Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 04-25-2004, 11:17 PM
gspot's Avatar
gspot gspot is offline
 
Join Date: Mar 2003
Location: Nevada
Posts: 200
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default What is wrong here - templates??

No matter what I try, i cant get anyresults when going to this file:

PHP Code:
<?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:

PHP Code:
$stylevar[htmldoctype]
<
html dir="$stylevar[textdirection]lang="$stylevar[languagecode]">
<
head><title>$vboptions[bbtitle] - Refer $vboptions[bbtitleto a Friend</title>
$headinclude
</head>
<
body>
<
table cellpadding="{tableouterborderwidth}" cellspacing="0" border="0" bgcolor="{tablebordercolor}" {tableouterextrawidth="550" align="center">
  <
tr>
    <
td> <table cellpadding="4" cellspacing="{tableinnerborderwidth}" border="0" {tableinnerextrawidth="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....
Reply With Quote
  #2  
Old 04-26-2004, 10:09 AM
NTLDR's Avatar
NTLDR NTLDR is offline
Coder
 
Join Date: Apr 2002
Location: Bristol, UK
Posts: 3,644
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 04-27-2004, 03:45 AM
gspot's Avatar
gspot gspot is offline
 
Join Date: Mar 2003
Location: Nevada
Posts: 200
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by NTLDR
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.
Reply With Quote
  #4  
Old 04-27-2004, 04:11 AM
gspot's Avatar
gspot gspot is offline
 
Join Date: Mar 2003
Location: Nevada
Posts: 200
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Whats wrong with this coding??

PHP Code:
<?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') . '");');
?>
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:15 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03473 seconds
  • Memory Usage 2,257KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (4)post_thanks_box
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit_info
  • (4)postbit
  • (4)postbit_onlinestatus
  • (4)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete