Hi,
I have purchased jom classifieds and would like to grab jom social's profile information instead of having my users to enter multiple times. The code currently only grabs username from joomla. Possible for jomsocial to advice How it can be done? I tried checking with jom classifieds but they replied that they are unfamiliar with jom social.
Thank you.
<div class="user"><?php echo $username.' ('.$this->getuseradsCount($item->userid).')'; ?></div>
<div><a href="<?php echo JRoute::_('index.php?option=com_jomclassifieds&view=userads&id='.$item->userid.':'.$username.'&Itemid='.JRequest::getInt('Itemid'));?>">
<?php echo JText::_('SHOW_USER_ADS'); ?> </a> </div>
</div>
Hi April,
do mean want put that code at any Jomsocial page?
it can, but I need see full code for jom classifieds module.
The problem only at this code.
$this->getuseradsCount
Hi Albert,
I mean I want to display joomla profile, such as address, on jom classifieds ad. Currently all ads need users to key in contact details. It would be ideal if jom classifieds can grab the data from jom social instead.
How do I send you the access details?
Thank you in advance.
Hi April,
please try this code:
this code will display all users information (about me)
<?php
$my = CFactory::getUser();
$model = CFactory::getModel('Profile');
$profile = $model->getProfile($my->id);
foreach ($profile['fields'] as $groupName => $items) {
foreach ($items as $item) {
echo $item['name'].': '.$item['value'].'<br />';
}
}
?>
<?php
$my = CFactory::getUser();
$model = CFactory::getModel('Profile');
$profile = $model->getProfile($my->id);
foreach ($profile['fields'] as $groupName => $items) {
foreach ($items as $item) {
if ($item['fieldcode'] == 'FIELD_GENDER') {
echo $item['value'];
}
}
}
?>
Hi April,
Try to put this code after line 62: components/com_jomclassifieds/views/advert/tmpl/default.php
$model = JFactory::getModel('Profile');
$profile = $model->getProfile($item->userid);
foreach ($profile['fields'] as $groupName => $items) {
foreach ($items as $item) {
echo $item['name'].': '.$item['value'].'<br />';
}
}
Hi April,
how to produce that error? I logged in using admin user, and I went to my advert and adverts. Can't find it.
or can you give me other login for that user?
I decided to help you with "com_jomclassifieds" code to get this topic immediately done.
Regards,
Albert
Hi Albert,
Million of thanks for the help.
You may go to the main page, on the right module (directory search), you may select furniture then click search. You may click on any of the result to produce the error.
Thank you :)
Hi April,
I can't help you. because after spend 2 hours I still got errors. jom-classifieds component still can't load profile model properly
got error
Fatal error: Class 'CAppPlugins' not found in /home/renospir/public_html/components/com_community/models/profile.php on line 293