gspot
04-25-2004, 11:17 PM
No matter what I try, i cant get anyresults when going to this file:
<?php
// GO TO FORUM DIR
chdir('/home/kyle/public_html/forums/');
// STANDARD VBULLETIN STUFF
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'Referrals');
require_once('./global.php');
//start referrals system
$max=3; //This number decides how many users to display
$referrers = $DB_site->query("SELECT COUNT(*) AS referrals, user.username, user.userid FROM user AS users LEFT JOIN user ON (users.referrerid = user.userid)
WHERE users.referrerid <> 0
AND user.usergroupid=6
GROUP BY users.referrerid
ORDER BY referrals DESC
LIMIT $max");
while ($referrer=$DB_site->fetch_array($referrers)) {
$referreds = $DB_site->query("SELECT username FROM user WHERE referrerid = '$referrer[userid]' AND user.usergroupid=6
GROUP BY username
ORDER BY username ASC");
while ($referred = $DB_site->fetch_array($referreds)){
$enc_username = urlencode($referred[username]);//get username for href link info below
if ($referrerlist) {
$referrerlist.=", <A HREF=member.php?action=getinfo&username=$enc_username>$referred[username]</A>";//make referred members clickable to user info.
} else {
$referrerlist ="<A HREF=member.php?action=getinfo&username=$enc_username>$referred[username]</A>"; //make referred members clickable to user info.
}
}
//show actual number of verified/registered members script
$referredstest = $DB_site->query("SELECT COUNT(*) AS username FROM user WHERE referrerid = '$referrer[userid]' AND user.usergroupid=6
GROUP BY user.usergroupid
ORDER BY referrerid DESC");
while ($referred11 = $DB_site->fetch_array($referredstest)){
if ($referreractual) {
$referreractual.=", $referred11[username] ";
} else {
$referreractual = "$referred11[username]";
}
//end actual # script
}
}
//end referrals system
// GENERIC_SHELL VARS
$pagetitle = "Referrals Points";
$HTML = ""; // PIECED TOGETHER IN SCRIPT
$navbits[lastelement] = "Referrals Points";
eval('$HTML = "' . fetch_template('reflist') . '";');
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('GENERIC_SHELL') . '");');
?>
The Template being called is:
$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head><title>$vboptions[bbtitle] - Refer $vboptions[bbtitle] to a Friend</title>
$headinclude
</head>
<body>
<table cellpadding="{tableouterborderwidth}" cellspacing="0" border="0" bgcolor="{tablebordercolor}" {tableouterextra} width="550" align="center">
<tr>
<td> <table cellpadding="4" cellspacing="{tableinnerborderwidth}" border="0" {tableinnerextra} width="550">
<tr align="center">
<td class="alt1" align="center" width="160"><smallfont"><b>Members</b></smallfont></td>
<td class="alt2" align="center" width="100"><smallfont><b>Actual
# of referrals verified</b></smallfont></td>
<td class="alt1" align="center" width="310"><smallfont><b>Members
Referred<br>
And Successfully Registered/Activated $referreractual</b></smallfont></td>
</tr>
$reflistbits </table> </td></tr>
</table>
<td align="center"> </td>
<tr align="center">
<td class="alt2"><smallfont><b><a href="member.php?s=$session[sessionhash]&action=getinfo&userid=$referrer[userid]">$referrer[username]</a></b></smallfont></td>
<td class="alt1"><smallfont>$referreractual</smallfont></td>
<td class="alt2"><smallfont>$referrerlist</smallfont></td>
</tr>
</body>
</html>
PLEASE ANY HELP WOULD BE APPRECIATED....
<?php
// GO TO FORUM DIR
chdir('/home/kyle/public_html/forums/');
// STANDARD VBULLETIN STUFF
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'Referrals');
require_once('./global.php');
//start referrals system
$max=3; //This number decides how many users to display
$referrers = $DB_site->query("SELECT COUNT(*) AS referrals, user.username, user.userid FROM user AS users LEFT JOIN user ON (users.referrerid = user.userid)
WHERE users.referrerid <> 0
AND user.usergroupid=6
GROUP BY users.referrerid
ORDER BY referrals DESC
LIMIT $max");
while ($referrer=$DB_site->fetch_array($referrers)) {
$referreds = $DB_site->query("SELECT username FROM user WHERE referrerid = '$referrer[userid]' AND user.usergroupid=6
GROUP BY username
ORDER BY username ASC");
while ($referred = $DB_site->fetch_array($referreds)){
$enc_username = urlencode($referred[username]);//get username for href link info below
if ($referrerlist) {
$referrerlist.=", <A HREF=member.php?action=getinfo&username=$enc_username>$referred[username]</A>";//make referred members clickable to user info.
} else {
$referrerlist ="<A HREF=member.php?action=getinfo&username=$enc_username>$referred[username]</A>"; //make referred members clickable to user info.
}
}
//show actual number of verified/registered members script
$referredstest = $DB_site->query("SELECT COUNT(*) AS username FROM user WHERE referrerid = '$referrer[userid]' AND user.usergroupid=6
GROUP BY user.usergroupid
ORDER BY referrerid DESC");
while ($referred11 = $DB_site->fetch_array($referredstest)){
if ($referreractual) {
$referreractual.=", $referred11[username] ";
} else {
$referreractual = "$referred11[username]";
}
//end actual # script
}
}
//end referrals system
// GENERIC_SHELL VARS
$pagetitle = "Referrals Points";
$HTML = ""; // PIECED TOGETHER IN SCRIPT
$navbits[lastelement] = "Referrals Points";
eval('$HTML = "' . fetch_template('reflist') . '";');
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('GENERIC_SHELL') . '");');
?>
The Template being called is:
$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head><title>$vboptions[bbtitle] - Refer $vboptions[bbtitle] to a Friend</title>
$headinclude
</head>
<body>
<table cellpadding="{tableouterborderwidth}" cellspacing="0" border="0" bgcolor="{tablebordercolor}" {tableouterextra} width="550" align="center">
<tr>
<td> <table cellpadding="4" cellspacing="{tableinnerborderwidth}" border="0" {tableinnerextra} width="550">
<tr align="center">
<td class="alt1" align="center" width="160"><smallfont"><b>Members</b></smallfont></td>
<td class="alt2" align="center" width="100"><smallfont><b>Actual
# of referrals verified</b></smallfont></td>
<td class="alt1" align="center" width="310"><smallfont><b>Members
Referred<br>
And Successfully Registered/Activated $referreractual</b></smallfont></td>
</tr>
$reflistbits </table> </td></tr>
</table>
<td align="center"> </td>
<tr align="center">
<td class="alt2"><smallfont><b><a href="member.php?s=$session[sessionhash]&action=getinfo&userid=$referrer[userid]">$referrer[username]</a></b></smallfont></td>
<td class="alt1"><smallfont>$referreractual</smallfont></td>
<td class="alt2"><smallfont>$referrerlist</smallfont></td>
</tr>
</body>
</html>
PLEASE ANY HELP WOULD BE APPRECIATED....