vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Referring hack addon - please help (https://vborg.vbsupport.ru/showthread.php?t=59155)

gspot 12-13-2003 10:37 PM

Referring hack addon - please help
 
Ok, I'm trying to use a hack that was posted on this site and the only problem that I have ran into is the order in which the referrals are being shown on the main template page. Here is my code right now:

PHP Code:

error_reporting(7);
$templatesused='reflistbit,reflist';
require(
'./global.php');
$max=4//This number decides how many users to display
//show total number pending activation referrals
$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
                     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=2");
//  AND user.usergroupid=2
    
while ($referred $DB_site->fetch_array($referreds)){
        if (
$referrerlist) {
            
$referrerlist.=", $referred[username] ";
        } else {
            
$referrerlist "$referred[username]";
        }
}
//end show actual numbers of pending activation referals
//show actual number of verified members
$referredstest $DB_site->query("SELECT COUNT('username') AS username FROM user WHERE referrerid = '$referrer[userid]' AND user.usergroupid=2
ORDER BY username DESC"
);
//  AND user.usergroupid=2
    
while ($referred11 $DB_site->fetch_array($referredstest)){
        if (
$referreractual) {
            
$referreractual.=", $referred11[username] ";
        } else {
            
$referreractual "$referred11[username]";
        }
//end actual # show
    
}
    eval(
"\$reflistbits .= \"".gettemplate("reflistbit")."\";");
    
$referrerlist="";
    
$referreractual="";
}
eval(
"dooutput(\"".gettemplate("reflist")."\");"); 


*All the referrals are being listed in decending order by the complete number of referrals pending and not by the actual number of referrals activated... What can I do here?? Any help is greatly appreciated...

MindTrix 12-26-2003 05:15 PM

Wouldnt you just change all the instances of DESC too ASC ?

gspot 12-27-2003 10:29 PM

Ya, I tried that with no luck, but I finally got it to work.

Thanks for the reply though. Hopefully I will be adding it to the hack as an addon.


All times are GMT. The time now is 11:22 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.01068 seconds
  • Memory Usage 1,730KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete