![]() |
Yip, I agree eva2000.
I am looking for an exciting new alternative which is 'perpetually inclusive', I believe a member should get some credit for even great-great-..-grand-referals. I would like to offer prizes every 3 months. At the start of a given period all RIP totals are 0. If a referer joins from a related referred member ALL those in the chain of referral benefit. The referral tree will eventually also be displayed for the period. So even 1 referal starts it off and puts all members that have residual RIP's on the prize list already. |
I seee...hmm. This isn't too easy in my view and may add significant load on the server. I won't do it for you but I'll give you some direction as to how I'd do it if I was really set on it.
I don't believe you can do this with one sql statement based on the current table layout. But if you add some fields perhaps it can be done. Very complicated though. There may be some code somewhere to handle this. Look in the IPAddress code of vb. The problem is you need to do recursive searching. Or try I think it's php.net for some code. Personally I think it's way more trouble than it's worth....if you can accept .5 instead of .5 then .25 etc it will be a little bit easier with a new field, but still a royal pain. |
I have been trying to play around with this referrer stuff myself, and was wondering:
How difficult would it be to add a user field to the table that keeps track of a user's # of referrals, in addition to keeping track of "who referred who" like it does now? I would like to be able to add a "Referrals" column to, for example, the Member Listing, without having to loop through the list for each user to see who referred who. Also, I would like to be able to sort the Member Listing based on # of referrals, which I have not been able to do so far (without an absolutely ludicrous amount of database queries). My goal in this regard is strictly numeric; the system already keeps track of who referred who, so all I am looking for a single numeric field that is incremented, say, when somebody registers. I know you can add fields using the ALTER command though I know very little about it and don't want to screw anything up. It does seem that once a field like that was added, putting the rest together would be very easy. Am I wrong, or would this be a relatively easy hack? |
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:
|
Check this out: http://24.45.176.213:81/forums/referrerlist.php?s=
I have a question, what variable would I use to have it actually display the referred in the drop down menu? I can't figure it out... Right now I am trying the referrer value to make sure that it works and it does. I just cant seem to figure out what variable to use to display the correct information. Any ideas? My referrer list bit: PHP Code:
PHP Code:
|
Nice work. But the answer to your question is a bit involved and you'll have to play with it to get it right. You need to get the option statement out of the template and into the code. You need the option statement in a repeated loop or else you will only be able to get one username. I'm amazed that it isn't messing you up more.
|
I think I have to make a new variable in the php file, but I dont know what to do. It is just the variable I need to figure out...
|
Nope that's not the case. You aren't looking for a variable, you need to move the html for the drop down box into the code.
Why? When the reflistbit is called it runs one line, 3 <TD>'s. But you need to loop through the last <TD> containing the list of referrers as many times as there are referrers. So your <option> html HAS to be in the code not in the template. You don't need a new variable name. The same one will do but you need the html inside the code. |
Okay I know that this code (below) will contain the $referrerlist I dont know what I have to incorporate into the php file, but I have no clue how to do it.
PHP Code:
|
I'm not using the topreferrer code and I looked at the code most of you are using but it was taking too long to adjust. So I'll post my code which is working great and hopefully you can figure it out.
BTW, looking at the code that was written for the top referrer, there was an unneeded template and an unneeded sql call. The top referrer is the first userid that comes out in the loop. Simply set a variable the first time it is run then pull out all the sql code and extra template. So something like if (!$topdone) { $ref[userid]=$referred[userid]; $topdone=1; } placed right after the first fetch array should enable you to get rid of a bunch of code... Anyways here's the code I'm using: Code:
<?php |
All times are GMT. The time now is 06:54 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|