Notice

The forum is in read only mode.

Support Forum

Welcome! Support Forums have been reactivated
Welcome the Technical Support section. Help us in assisting you by providing us with a concise and descriptive elaboration of your issues. Be specific and if possible, provide us with a step-by-step instruction in replicating your problem.

integration with jom classifieds

11 years 3 weeks ago
  • April's Avatar
    Topic Author
  • April
  • Offline
  • Fresh Boarder
  • Posts: 53
  • Thank you received: 1
Licenses:
JomSocial Expired

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>

11 years 3 weeks ago
Licenses:

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

I need to know where the $this from. Could you please provide me the FTP access detail (Put at Site Info).

Regards,
Albert

11 years 3 weeks ago
  • April's Avatar
    Topic Author
  • April
  • Offline
  • Fresh Boarder
  • Posts: 53
  • Thank you received: 1
Licenses:
JomSocial Expired

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.

11 years 3 weeks ago
Licenses:

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 />';
        }
    }
?>

or if you want display single information. e.g: gender
<?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'];
            }
        }
    }
?>

'fieldcode' you can find it at Jomsocial backend - customize profile

Regards,
Albert

11 years 3 weeks ago
  • April's Avatar
    Topic Author
  • April
  • Offline
  • Fresh Boarder
  • Posts: 53
  • Thank you received: 1
Licenses:
JomSocial Expired

HI Albertus,

Thanks for the code. But I am getting the following error:

Fatal error: Class 'CFactory' not found in /home/............

11 years 3 weeks ago
Licenses:

April,

please provide me your FTP details, and tell me where do you put that code?

FYI: for FTP details you can edit your 1st post on this topic. put it at Site Info section.

Regards,
Albert

11 years 3 weeks ago
  • April's Avatar
    Topic Author
  • April
  • Offline
  • Fresh Boarder
  • Posts: 53
  • Thank you received: 1
Licenses:
JomSocial Expired

Hi Albertus,

I have entered the ftp information and the file source in my first post.

Thank you.

11 years 3 weeks ago
Licenses:

Hi April,

which file do you put that code? (location and file name)

Regards,
Albert

11 years 3 weeks ago
  • April's Avatar
    Topic Author
  • April
  • Offline
  • Fresh Boarder
  • Posts: 53
  • Thank you received: 1
Licenses:
JomSocial Expired

Hi Albert

I have entered the information in my first post. The place where I keyed in the ftp info

Thank you.

11 years 3 weeks ago
Licenses:

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 />';
    }
}

Because this is not jomsocial component, I will not touch the code.

Regards,
Albert

11 years 3 weeks ago
  • April's Avatar
    Topic Author
  • April
  • Offline
  • Fresh Boarder
  • Posts: 53
  • Thank you received: 1
Licenses:
JomSocial Expired

Hi Albert,

Am getting this now

Call to undefined method JFactory::getModel() in .........../components/com_jomclassifieds/views/advert/tmpl/default.php on line 64

11 years 3 weeks ago
Licenses:

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

11 years 3 weeks ago
  • April's Avatar
    Topic Author
  • April
  • Offline
  • Fresh Boarder
  • Posts: 53
  • Thank you received: 1
Licenses:
JomSocial Expired

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 :)

11 years 3 weeks ago
Licenses:

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

put customize code at jom-classifieds its to complocated
Sorry for this.

Regards,
Albert

The following user(s) said Thank You: April
Moderators: Piotr Garasiński
Powered by Kunena Forum

Join 180,000 websites creating Amazing communities

JomSocial is the most complete, easy-to-use addon that turns Joomla CMS into a
full -fledged, social networking site

TRY NOW BUY NOW