PDA


View Full Version : Public Favorites


absolutepunknet
12-05-2005, 06:13 AM
I'm looking to duplicate the "my favorites" link in a unique way -- I want to add the link in user's profiles to show THEIR favorites.

http://www.absolutepunk.net/artists/browselinks.php?do=favorites&userid=####

Would be ideal. Can anyone think of any easy way to do this? I was looking at the code, but I'm just not good enough to do it.

Any ideas would be amazingly helpfull.

Brian
12-05-2005, 03:27 PM
Here's the PHP code.

require_once('./includes/functions_links.php');

$getlinks = $db->query("
SELECT links.linkid, name, links.description, url, links.catid, views, posts, username, links.userid, dateline, sticky, open, votenum, votetotal
FROM " . TABLE_PREFIX . "links_favorites AS favorites
INNER JOIN " . TABLE_PREFIX . "links AS links USING (linkid)
WHERE suspended = 0 AND valid = 1 AND favorites.userid = '" . $vbulletin->userinfo['userid'] . "'
ORDER BY name ASC
LIMIT 20
");
while ($links = $db->fetch_array($getlinks))
{
$linkbits .= construct_linkbits($links);
}



Add that as a plugin for your one of your memberinfo hook locations, then add a table and the variable $linkbits somewhere in your MEMBERINFO template.

phoenixdown
12-05-2005, 05:55 PM
Nice idea

absolutepunknet
04-10-2006, 06:22 AM
How would I do the opposite of this and show the users who are favorites on the details page?