Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by Admin (Coder) Admin is offline
Developer Last Online: Nov 2024 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 08-11-2001 Last Update: Never Installs: 8
 
No support by the author.

To see this in action go here.

Installation:
0. Download the attached zip file and extract it.
1. Create a new file named referrerlist.php and in it put the content of referrerlist.txt in it. Config $shownorefs.
2. Create a new template named reflist and put the content of reflist.txt in it.
3. Create a new template named reflistbit and put the content of reflistbit.txt in it.
4. Add an index to the field referredid in the table user.
5. Add a link to referrerlist.php?s=$session[sessionhash] anywhere you want.

Good luck, and feedback is welcomed!

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #32  
Old 09-02-2001, 04:41 AM
Joshs Joshs is offline
 
Join Date: Oct 2001
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What should my templates look like to make this work?
Reply With Quote
  #33  
Old 09-03-2001, 12:55 AM
Joshs Joshs is offline
 
Join Date: Oct 2001
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

bump
Reply With Quote
  #34  
Old 09-03-2001, 02:41 AM
hondastyle's Avatar
hondastyle hondastyle is offline
 
Join Date: Oct 2001
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great hack! Should generate some incentive for users to start doing some referring.

Thanks very much...It was an easy install and a very nice addition to my boards.
Reply With Quote
  #35  
Old 09-03-2001, 05:06 AM
dwh's Avatar
dwh dwh is offline
 
Join Date: Feb 2002
Posts: 278
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well, this is how I have it though I don't have that stuff on top about the top referrer, though it should be easy enough to add in the code.

First towards the top of the reflist template I took your javascript
PHP Code:
<script>
<!--
function 
jumpPage(newLoc) {
    
newPage newLoc.options[newLoc.selectedIndex].value
    
if (newPage != "") { window.location.href newPage }
}
// -->
</script
then you have your navbar etc then here's the table row

PHP Code:
<tr align="center">
  <
td bgcolor="#8080A6" align="center"><smallfont color="#EEEEFF"><b>Member</b></smallfont></td>
  <
td bgcolor="#8080A6" align="center"><smallfont color="#EEEEFF"><b>Referrals</b></smallfont></td>
  <
td bgcolor="#8080A6" align="center"><smallfont color="#EEEEFF"><b>Members Referred</b></smallfont></td>
</
tr>
$reflistbits 
Then in the reflistbits template I've got:

PHP Code:
<tr align="center">
    <
td bgcolor="#F1F1F1"><smallfont><b><a href="member.php?s=$session[sessionhash]&action=getinfo&userid=$referrer[userid]">$referrer[username]</a></b></smallfont></td>
    <
td bgcolor="#DFDFDF"><smallfont>$referrer[referrals]</smallfont></td>
    <
form><td bgcolor="#F1F1F1"><smallfont>$referrerlist</smallfont></td></form>
</
tr
hope that helps.
Reply With Quote
  #36  
Old 09-03-2001, 05:10 AM
dwh's Avatar
dwh dwh is offline
 
Join Date: Feb 2002
Posts: 278
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think I just found a bug in vb. Notice that my vbcode for php is correct (i think)
yet when you use 3 php's the /php code doesn't seem to work....and it indents and puts funny colors.
Reply With Quote
  #37  
Old 09-03-2001, 03:03 PM
Joshs Joshs is offline
 
Join Date: Oct 2001
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<a href="http://24.45.176.213:81/forums/referrerlist.php?s=" target="_blank">http://24.45.176.213:81/forums/referrerlist.php?s=</a>

Pretty perfect... but there is an extra row at the end... any ideas as how to fix that?
Reply With Quote
  #38  
Old 09-03-2001, 06:39 PM
dwh's Avatar
dwh dwh is offline
 
Join Date: Feb 2002
Posts: 278
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I guess you modified my code to get the top referrer, post your templates and code changes..I do not have that problem.
Reply With Quote
  #39  
Old 09-03-2001, 08:33 PM
Joshs Joshs is offline
 
Join Date: Oct 2001
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

referrerlist.php:
PHP Code:
<?php
error_reporting
(7);
$templatesused='referrer_listbit,referrer_list,referrer_top';
require(
'./global.php');

// Top Referrer List Hack  ############################################
//    Hacked by: FireFly with help from dwh,unixman,Freddie,Bane
// Config  #######################################################

$max=100;        //This number decides how many users to display
$userx=0;        //Users to exclude from top referrer            Seperate with ,    (0 for none)
$userl=0;            //Users to exclude from top referrer list        Seperate with ,    (0 for none)

// Get Top List  ###################################################
$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.userid NOT IN (
$userl)
                   GROUP BY users.referrerid
                   ORDER BY referrals DESC
                   LIMIT 
$max");
while (
$referrer=$DB_site->fetch_array($referrers)) {
    
$referreds $DB_site->query("SELECT username,userid FROM user WHERE referrerid = '$referrer[userid]'");
    
$referrerlist "<SELECT NAME='newLoc' onChange='jumpPage(this.form.newLoc)' style='font-size: 7pt; background-color: #dfdfdf; font-family: Arial, Tahoma;' maxlength='25'><OPTION VALUE='#'>------------Select------------</OPTION>";
    while (
$referred $DB_site->fetch_array($referreds)){
        if (
$referrerlist) {
            
$referrerlist.="<OPTION VALUE='member.php?s=$session[sessionhash]&action=getinfo&userid=$referred[userid]'>$referred[username]</OPTION>";
        }
    }
    
$referrerlist.="</select>";
    eval(
"\$reflistbits .= "".gettemplate("referrer_listbit")."";");
    
$referrerlist="";
}

// Get Top referrer #################################################
if ($usereferrer) {
  
$ref $DB_site->query_first("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.userid NOT IN (
$userx)
                   GROUP BY users.referrerid
                   ORDER BY referrals DESC
                   LIMIT 1"
);

  eval(
"\$topreferrer = "".gettemplate('referrer_top')."";");
}
    
    eval(
"\$reflistbits .= "".gettemplate("referrer_listbit")."";");
    
$referrerlist="";

// ############################################################
makeforumjump();
eval(
"dooutput("".gettemplate("referrer_list")."");");
?>
referrer_list:
PHP Code:
{htmldoctype}
<
HTML>
<
HEAD><TITLE>$bbtitle Top Referrer List</title>
$headinclude
</head>
<
body>
$header
<!-- breadcrumb -->
<
table border="0" width="100%" cellpadding="0" cellspacing="0"><tr>
<
td width="100%"><img src="{imagesfolder}/vb_bullet.gif" align="absmiddle"> <normalfont><b><a href="index.php?s=$session[sessionhash]">$bbtitle</a> &gtTop Referrers</b></normalfont></TD></tr></table>
<!-- /
breadcrumb -->

<!--
Begin-->
<
br>

<
table cellpadding="{tableouterborderwidth}" cellspacing="0" border="0" bgcolor="{tablebordercolor}" {tableouterextrawidth="{contenttablewidth}" align="center"><tr><td>
<
table cellpadding="4" cellspacing="{tableinnerborderwidth}" border="0" {tableinnerextrawidth="100%">
<
tr align="center">
    <
td bgcolor="{secondaltcolor}"><smallfont><a href="memberlist.php?s=$session[sessionhash]&action=search"><b>Advanced Search</b></a></smallfont></td>
    <
td bgcolor="{secondaltcolor}"><smallfont><a href="memberlist.php?s=$session[sessionhash]&what=topposters&perpage=$memberlisttopposters"><b>Top $memberlisttopposters Posters</b></a></smallfont></td>
    <
td bgcolor="{secondaltcolor}"><smallfont><a href="memberlist.php?s=$session[sessionhash]"><b>List Alphabetically</b></a></smallfont></td>
    <
td bgcolor="{secondaltcolor}"><smallfont><a href="memberlist.php?s=$session[sessionhash]&what=datejoined"><b>List by Date Joined</b></a></smallfont></td>
<!-- 
Begin Referrals -->
<
td bgcolor="{firstaltcolor}"><smallfont><a href="referrerlist.php?s=$session[sessionhash]"><b>Referrals</b></a></smallfont></td>
<!-- 
End Referrals -->
<!-- 
Begin Forum Leaders -->
<
td bgcolor="{secondaltcolor}"><smallfont><a href="showmods.php?s=$session[sessionhash]"><b>Forum Leaders</b></a></smallfont></td>
<!-- 
End Forum Leaders -->
</
tr>
</
table>
</
td></tr></table>

<
br>
<!--
End-->

<!-- 
main -->
<!--
<
table cellpadding="{tableouterborderwidth}" cellspacing="0" border="0" {tableouterextrawidth="250" align="center"><tr>
    <
td><div align="center">$topreferrer</div></td>
</
tr></table>
-->
<
p align="center">$topreferrer</p>
<
table cellpadding="{tableouterborderwidth}" cellspacing="0" border="0" bgcolor="{tablebordercolor}" {tableouterextrawidth="275" align="center"><tr><td>
<
table cellpadding="4" cellspacing="{tableinnerborderwidth}" border="0" {tableinnerextrawidth="275">
<
tr align="center">
  <
td bgcolor="{tableheadbgcolor}" align="center" width="100"><smallfont color="{tableheadtextcolor}"><b>Member</b></smallfont></td>
  <
td bgcolor="{tableheadbgcolor}" align="center" width="50"><smallfont color="{tableheadtextcolor}"><b>Referrals</b></smallfont></td>
  <
td bgcolor="{tableheadbgcolor}" align="center" width="125"><smallfont color="{tableheadtextcolor}"><b>Members Referred</b></smallfont></td>
</
tr>
$reflistbits
</table>
</
td></tr></table>

<
p align="center">$forumjump</p>

<!-- /
main -->
$footer
</body></html
referrer_listbit:
PHP Code:
<tr align="center">
    <
td bgcolor="{firstaltcolor}"><smallfont><b><a href="member.php?s=$session[sessionhash]&action=getinfo&userid=$referrer[userid]">$referrer[username]</a></b></smallfont></td>
    <
td bgcolor="{firstaltcolor}"><smallfont>$referrer[referrals]</smallfont></td>
    <
form><td bgcolor="{firstaltcolor}">$referrerlist</td></form>
</
tr
Reply With Quote
  #40  
Old 09-03-2001, 09:46 PM
dwh's Avatar
dwh dwh is offline
 
Join Date: Feb 2002
Posts: 278
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Do you have phpMyAdmin? Or have any other way to do an sql command? It may be an issue with the data in the database. If you can do an sql call run this query:
PHP Code:
SELECT COUNT(*) AS referralsuser.usernameuser.userid FROM user AS users
                   LEFT JOIN user ON 
(users.referrerid user.userid)
                   
WHERE users.referrerid <> AND
                   
user.userid NOT IN (0)
                   
GROUP BY users.referrerid
                   ORDER BY referrals DESC
                   LIMIT 100 
I wouldn't be surprised if you get some weird result, but either way, post results here and we'll take it from there.

BTW, I really like your site design. You have a good eye for design.
Reply With Quote
  #41  
Old 09-03-2001, 09:50 PM
Joshs Joshs is offline
 
Join Date: Oct 2001
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
SELECT COUNT(*) AS referralsuser.usernameuser.userid FROM user AS users
                   LEFT JOIN user ON 
(users.referrerid user.userid)
                   
WHERE users.referrerid <> AND
                   
user.userid NOT IN (0)
                   
GROUP BY users.referrerid
                   ORDER BY referrals DESC 
Looked like it worked right...
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 10:37 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.08478 seconds
  • Memory Usage 2,408KB
  • Queries Executed 25 (?)
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
  • (8)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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_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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete