vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Display full list of referrers and referrals (https://vborg.vbsupport.ru/showthread.php?t=25173)

dwh 08-13-2001 08:00 AM

We should also make the referred members in the right column clickable but I'm going to bed. Maybe when I wake up someone will post the answer ;)

Admin 08-13-2001 08:56 AM

Thanks dwh, I appreciate your help. :)

unixman 08-15-2001 03:01 AM

Here you go, clickable usernames in the last column - enjoy. Great hack ... :)

PHP Code:

<?php
error_reporting
(7);
$templatesused='reflistbit,reflist';
require(
'./global.php');
$max=25//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
                   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]'");
  while (
$referred $DB_site->fetch_array($referreds)){
    
$enc_username urlencode($referred[username]);
    if (
$referrerlist) {
      
$referrerlist .= ", <A HREF=member.php?action=getinfo&username=$enc_username>$referred[username]</A>";
    } else {
      
$referrerlist .= "<A HREF=member.php?action=getinfo&username=$enc_username>$referred[username]</A>";
    }
  }
  eval(
"\$reflistbits .= \"".gettemplate("reflistbit")."\";");
  
$referrerlist="";
}
eval(
"dooutput(\"".gettemplate("reflist")."\");");
?>


Bane 08-15-2001 08:37 AM

I liked this hack so much I modified it a hair (as seen on http://www.talkloud.net/referrerlist.php ) and put an install script together for the templates.

The only real difference here is it adds the challenge to the top ( User XXX has the highest referrals with XX, can you do better? ) and has a fancy schmancy install file (ala-Kier). Should you want to give it a go feel free to DL the file here.

All credit goes to FireFly, and the others who modified his code :)

dwh 08-15-2001 05:00 PM

I haven't tried your code, but nice idea. One problem, on your site the top challenger you have listed is the second person w/ 2 referrals instead of the guy w/ 8 referrals.

Bane 08-15-2001 05:16 PM

There are three variables in the script now:

$max=?? - This number decides how many users to display
$userx=?? - Users to exclude from top referrer
$userl=?? - Users to exclude from top referrer list

On my board I have the admin [userid1] (me :) ) on the list but not on the top referrer for the board. It may look silly, but any admin worth his salt is going to have more referrals than his users I should think. If you dont like this you can set both userx and userl to 0 and it will list all.

Otherwise any userids you list will be excluded.

george_proost 08-23-2001 03:54 PM

Hi all,

My SQL is sooooooo bad.

Instead of the number of 'clean' referrals I would like to introduce the RIP. What is this RIP.

Well it is designed to give a workable indicator as to the effect of
a single member's referrals within a given timeframe.

How would it work ? Well ....
The RIP is calculated as follows :
-- you have a start date and an end date
-- one RIP point is added to the RIP period total for each directly referred new member.
-- add to this one half of the total RIP's for each directly referred new member.

The refererid becomes a sort of child and parent. And you probably have to work backwards somehow.

So no matter which time period you look at you get an accurate assessment of the members referal behaviour and referral effect.

I would like to award referal prizes based on something like this
instead of the 'one-on-one' hard referrals.

Can anyone help on this?

dwh 08-23-2001 07:13 PM

eh, are you trying to say that you want to pro-rate the referrals so that new members who referrred a lot of people in a short time get a better ranking than old timers who had more time to get referrals in? Like a referrals/day type deal but called RIP?

george_proost 08-24-2001 07:13 AM

Hi dwh,

Thanks for the reply... but no not really that way, and certainly not with that effect. Let me try expalin it in another way.

standard RIP logging - running totals in brackets

period1.
=====
Jack referes Jill and Simon -- Jack(2 RIP's)

period2.
======
Jill refers Pete -- Jill(1 RIP) and Jack(2,5 RIP's)

period3.
======
Pete referrs Paul --- Pete(1 RIP) Jill(1,5 RIP's) Jack(2,75 RIP's)

If the period to be measured is 'period 3' the actual standings would be :

Pete(1 RIP)
Jill(0,5)
Jack(0,75)

a member therefor ALWAYS for any given period WILL have a RIP value if a 'child' refereree at any level were to obtain a registration.

If Jack had refered 1 more member in period 3 in the current system of referals then would be a tie 1 RIP each. In the RIP system at the start of the period, depending on how large the referral tree is of a member and how deep there will ALWAYS be a RIP value ... albeit a very small one eg:

--1 direct referal in period
--0,5 referal once-revomed
--0,25 referal twice-removed
--0,125 ..
--0,0625 ..
--0,03125 and so on

This accurately measures the effect of refferals of a user over time within a given time period.

Hope this is clearer ..

eva2000 08-24-2001 07:21 AM

look the hack i installed the original version and works fine for my needs :)


All times are GMT. The time now is 08:24 PM.

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.01050 seconds
  • Memory Usage 1,749KB
  • 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)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete