PDA

View Full Version : What is wrong here - templates??


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">&nbsp;</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....

NTLDR
04-26-2004, 10:09 AM
Firstly the GENERIC_SHELL template does all the <head>/<html> etc tags for you so you don't need them in your other template. Secondly, unless you have added all the vB2 style replacements to vB3 you should get rid of them all as <smallfont> for example no longer exists.

gspot
04-27-2004, 03:45 AM
Firstly the GENERIC_SHELL template does all the <head>/<html> etc tags for you so you don't need them in your other template. Secondly, unless you have added all the vB2 style replacements to vB3 you should get rid of them all as <smallfont> for example no longer exists.
I appreciate the help, besides the smallfont quotations, what else is the older version 2 of vbulletin?? Sorry, I'm a newbie still at this.

Thanks in advance.

gspot
04-27-2004, 04:11 AM
Whats wrong with this coding??


<?php
// GO TO FORUM DIR
chdir('/home/kyle/public_html/forums/');

// STANDARD VBULLETIN STUFF
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'Referrals');
require('./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') . '");');
?>