Log in

View Full Version : [Someone Please Help] Referrals on Custom Template


evenmonkeys
04-03-2006, 05:51 PM
Can't seem to find out how to do this. How would I get the correct referral count to show up? It says the total number of users registered on the site, and I can't get it to show how many referrals the person viewing has. Basically, I want it to have the same effect as $bbuserinfo so that whoever is looking at it, it'll tell you how many referrals you have.

I have this as a plugin for it, but it's only giving me the total number of users on the site. What could I do to make it show for the person viewing how many they have?// REFERRALS
if ($vbulletin->options['usereferrer'])
{
$refcount = $db->query_first("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "user WHERE referrerid = '$vbulletin->userinfo[userid]'");
$referrals = vb_number_format($refcount['count']);
}

Plugins / products only if possible. Please help. >_<;

evenmonkeys
04-06-2006, 09:16 PM
Okay... I think I've found the problem, but I can't seem to fix it...

This is showing 72 referrals:// ****************************************
// REFERRALS - NOT WORKING
$yarubrefcount = $db->query_first("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . " user WHERE referrerid = '$vbulletin->userinfo[userid]'");
$yarubreferrals = vb_number_format($yarubrefcount['count']);This is showing 5 referrals (correct):// ****************************************
// REFERRALS - WORKING
$yarubrefcount = $db->query_first("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . " user WHERE referrerid = '1'");
$yarubreferrals = vb_number_format($yarubrefcount['count']);However, I can't put in a number as that wouldn't do me any good for other members. =\ The problem's obviously the "where" part... Any ideas?

evenmonkeys
04-07-2006, 10:12 PM
Please help.

evenmonkeys
04-08-2006, 10:25 PM
This can't be that hard. It's a problem with the $vbulletin->userinfo[userid] part in the query. No one can help me?

Princeton
04-09-2006, 01:17 PM
try " . $vbulletin->userinfo['userid'] . "