Favorites Plug-in: Count listings

6 posts by 2 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: July 25, 2011   (RSS)

By gversion - June 28, 2011

Hello,

I've just bought the Favorites Plug-in and I'd like to display the total number of Favorites that a user has.

I'd be really grateful if someone could someone please tell me how to achieve this.

Thanks,
Greg

Re: [robin] Favorites Plug-in: Count listings

By gversion - June 29, 2011

Hi Robin,

Many thanks for the help. I seem to have got this to work! :)

Thanks again for all your help.

Regards,
Greg

Re: [gversion] Favorites Plug-in: Count listings

By gversion - July 22, 2011

Hi Robin,

Could you please tell me how to update the code you provided so that it displays the total number of listings for the currently logged in user?

The example you provided was just for a user with UserNum='1'

Thank you,
Greg

Re: [gversion] Favorites Plug-in: Count listings

By gversion - July 22, 2011

Hi Robin,

I seem to have got this working by changing the code to be as follows:

<?php
// load favorites records
list($_website_favoritesRecords, $_website_favoritesMetaData) = getRecords(array(
'tableName' => '_website_favorites',
'where' => "createdByUserNum= '".mysql_escape($CURRENT_USER['num'])."'"
));

?>



Unsure if that's the way you would have suggested, but it appears to work! :)

Thanks,
Greg

Re: [gversion] Favorites Plug-in: Count listings

By robin - July 25, 2011

Hey Greg,

That looks good to me. $CURRENT_USER['num'] is exactly what I would use.

Robin
Robin
Programmer
interactivetools.com