I'm busy on a basic spec. It is not too difficult.
This is NOT a program but a way of specing a program.
Ideally it would become php and integrate passively with
vBulletin.
I am not a programmer so it could take yonks to do this.
A pro-programmer could probably do this in 3-4 hours.
It is NOT a hack as NO vBulletin code would be changed,
no new or altered tables nor new columns in tables.
Code:
// userrips.php
//
// the intention of this program is to calculate the number
// of Referral Index Points or RIPs for short.
// =====================
//
// A RIP allows for the correct allocation of credit when even an n'th
// generation registration occurs. If the referrer is an ancestor of yours you
// still get credit for registration between date ranges
//
// This task needs to run periodically to keep track of things. (cronjob)
// it will probably be too greedy to run 'real-time'.
//
// the process described trickles RIP credits to all members
// for new member registrations within any given period of time
input parameters from_date, to_date
delete table userrips if it exists
create table userrips columns userid referrerid dateregistered rips
select userid, referrerid, dateregistered from user descending
// user table is no longer used in this program
// it will be queried again when the display needs to be shown
// the display can be a modified clone the current refertally program
insert userid, referrerid, dateregistered rips=0 into userrips
// table userrips will now be acted upon by two separate loops
// loop_1 just keeps the current user being analysed and is looped through
// processing only those users with a referrerid. This is a simple step_process loop.
foreach ( referrerid <> 0 AND dateregistered falls within date rangeparms ) //loop1
// set up start variables for each itteration of user
points = 1
luckyuserid = reffererid
// now trickle deminishing credit down the table
do while luckyuserid <> 0
udpate userrips rips with rips+points where userid = luckyuserid
select referrerid as luckyuserid from userrips userid = luckyuserid
points = points / 2
enddo
endfor
// end spec