View Full Version : Automatically Add a New User to Their Referrer's Buddy List
amykhar
03-20-2005, 10:00 PM
This one was done by request. It's a simple, easy to install hack that will take you less than 5 minutes to install. No screenshots because there's nothing to shoot.
If a new person registers at your board and lists an existing member as a referrer, this will automatically add the new user to the referrer's buddy list. And, the honor will be automatically reciprocated.
This is a great hack for beginners to try because it involves only one file edit and no templates, phrases, or database changes.
Enjoy
Tekton
03-21-2005, 04:13 AM
Was a good idea for a request too~ :)
sabret00the
03-21-2005, 07:45 AM
simple but great idea, installed :)
Very nice...I like this.
Thanks....
T3MEDIA
03-22-2005, 03:32 PM
Wow... I cant belive someone did me a favour on this site.
Acutally almost everyone that posted above me has helped me on this site also Kentarous (spelling) and one or two others... besides the admin...
Thank you! the site I am working on is almost 90% done now.
T3MEDIA
03-22-2005, 03:43 PM
ok here is the deal. two guys added a girl on my site as friends. she does not know one and HATES the other. I guess they saw her profile as a guest.
>sigh<
Sooooo now she is asking that NOT to happen anymore.
I told her to simply just remove them as friends. I have also that vbfriends hack.
ok is there a hack (I think this has to be moded if there is) that pm's a user that so and so just added you as a friend. do you want to do the same kind of thing.
that way girls dont have a mob of guys as friends they dont even know.
Same for guys... dont want the wife saying who the hell is that.
and he says I dont know her.
But you have her as a friend!!!!!
:bored: (I'll pack my things....)
Let me know. Thanks.
noppid
03-22-2005, 05:11 PM
Well a referer and a buddy may not be the same to some folks.
I didn't read the code, but put a checkbox there, if you have not already, asking if they want the referer added to the buddy list. :smoke:
amykhar
03-22-2005, 05:22 PM
Noppid, personally I agree that they're not the same thing, which is why I didn't install this hack. I just write em. Don't always use em. :D
noppid
03-22-2005, 06:04 PM
Noppid, personally I agree that they're not the same thing, which is why I didn't install this hack. I just write em. Don't always use em. :D
and a fine job I might add!
sabret00the
03-22-2005, 06:06 PM
best bed would be to add an option in their profile and enclose all of amy's work in a condtional dependant on that option ;)
amykhar
03-22-2005, 06:21 PM
The problem is that it needs to be two options. The existing members need to be able to decide if they want the newbies to be on their buddy list and the new members need to decide if they want the existing member added to theirs. All easy enough to code, but I have enough trouble getting new registrants to read the registration screen without adding a new option.
sabret00the
03-23-2005, 12:09 AM
couldn't you just have the user option in the existing buddies page? "add your new referrals to your buddy list"? and that be enough? alternatively you can do that and then send the new members a pm with a link to add the existing member to their buddylist?
* sabret00the is just tossing around ideas :)
T3MEDIA
03-23-2005, 12:51 AM
couldn't you just have the user option in the existing buddies page? "add your new referrals to your buddy list"? and that be enough? alternatively you can do that and then send the new members a pm with a link to add the existing member to their buddylist?
* sabret00the is just tossing around ideas :)I was thinking a very simple idea.
you add me as a referral.
You add me as a buddy. I get a pm saying you added me.
If I want to add you click here kind of thing and that is the end of it.
amykhar
03-23-2005, 02:10 AM
I was thinking a very simple idea.
you add me as a referral.
You add me as a buddy. I get a pm saying you added me.
If I want to add you click here kind of thing and that is the end of it.
Straight forward no interface needed. Can some one put that together for me?
In other words if I get a referral they become my buddy and I become theirs.
instantly when the new guy joins up.
of course it should work with the referer link as well.
PLEASE guys its small if you can that would be nice.
Your original request said automatically and with no interface. So, that's what you've got. Feel free to tweak it to meet your specific needs if those needs have changed.
T3MEDIA
03-26-2005, 10:51 AM
Your original request said automatically and with no interface. So, that's what you've got. Feel free to tweak it to meet your specific needs if those needs have changed.why would you put a response like that?
What would that do.
I did ask for the hack and you responded and I am gratefull. Never said I wasnt.
I asked the second question simply becuase (should I retype all of it or use quotes?) A girl found from using the hack a ton of people was instantly (well in a day) added to her friends where she didnt want that to be the case.
SOOOOO from testing you could say I realized ok... you do need to inform a user. That isnt a interface. I dont see how you see that to be a interface.
AND I was only having a conversation. For me to tweak response I mean... I am asking here because I do not know how to tweak as you put it.
Look I am thankfull you did it really.
Thanks.
tnguy3n
03-26-2005, 12:31 PM
To make adding referrer as an option at registration page.
Open register template,
FIND:
<input type="text" class="bginput" name="referrername" value="$referrername" size="50" maxlength="250" />
BELOW, ADD:
<br><input type="checkbox" name="addreferrer" value=""> Add $referrername to your buddylist?
Then from amykhar's hack,
REPLACE:
if($referrer)
{
// Put it in the database.
$DB_site->query("
UPDATE " . TABLE_PREFIX . "usertextfield
SET buddylist = '" . addslashes($testreferrerid[userid]) . "'
WHERE userid = $userid
");
}
WITH:
if ($referrer AND $_POST['addreferrer'])
{
// Put it in the database.
$DB_site->query("
UPDATE " . TABLE_PREFIX . "usertextfield
SET buddylist = '" . addslashes($testreferrerid[userid]) . "'
WHERE userid = $userid
");
}
Did not tested
if i refered someone using my referal form (
https://vborg.vbsupport.ru/showthread.php?t=59708) would they also be added to my buddy list ?? and would i be added to theres ??
T3MEDIA
03-29-2005, 11:30 AM
if i refered someone using my referal form (
https://vborg.vbsupport.ru/showthread.php?t=59708) would they also be added to my buddy list ?? and would i be added to theres ??yes they would.
T3MEDIA
04-08-2005, 12:05 PM
To make adding referrer as an option at registration page.Thanks but I dont think anyone would do that. Keeping in mind they are new.
Is there a hack (because I did not see it) that simply PM's a user (regardless if they have ignore pms on or not) that x user would like to add them as a friend? if they say yes the both are added if they say no JUST the x person gets them on the buddy list.
thats all and the hack would be flawless.
Anyone with out getting upset or offended could huck that up?
T3MEDIA
04-08-2005, 12:45 PM
>>>amykhar (member.php?u=87)
How about this?
How would I go about having it done only one way then?
If I am adding a referrer it goes to my buddy list and thats that?
(Half of what this hack does) Thanks again.
T3MEDIA
04-09-2005, 05:45 PM
any idea on how to change this to just the new user addes the referrer as a buddy only? (instead of doing both the new user and the referrer)
T3MEDIA
04-13-2005, 06:24 PM
bump
Colin F
04-18-2005, 12:09 PM
T3MEDIA, amykhar didn't check the supported field, so please don't keep bumping the thread.
Thanks.
T3MEDIA
04-25-2005, 09:43 AM
Any idea on how to change this to just the new user addes the referrer as a buddy only? (instead of doing both the new user and the referrer)
Colin F (please.) I can ask others. chilax.
amykhar
06-10-2005, 10:14 PM
Announcement: I will not be porting this hack to 3.5. It did not have enough interest to warrant the effort.
akanevsky
08-01-2005, 08:36 PM
Okay, you got some excess queries and code here...
There is no reason behind veryfind referrer's id, because it is already verified by vBulletin... All you need to do is this:
After
if (!$testreferrerid = $DB_site->query_first("SELECT userid FROM " . TABLE_PREFIX . "user WHERE username = '" . addslashes(htmlspecialchars_uni($_POST['referrername'])) . "'"))
{
eval('$errors[130] = "' . fetch_phrase('badreferrer', PHRASETYPEID_ERROR) . '";');
}
Add
else
{
$DB_site->query("
UPDATE " . TABLE_PREFIX . "usertextfield
SET buddylist = TRIM(CONCAT(buddylist, ' ', '$testreferrerid[userid]'))
WHERE username = '" . addslashes(htmlspecialchars_uni($_POST['referrername'])) . "'
");
}
And this
if ($referrer)
{
// Put it in the database.
$DB_site->query("
UPDATE " . TABLE_PREFIX . "usertextfield
SET buddylist = '" . addslashes($testreferrerid[userid]) . "'
WHERE userid = $userid
");
}
Should be replaced by
if ($referrer)
{
// Put it in the database.
$DB_site->query("
UPDATE " . TABLE_PREFIX . "usertextfield
SET buddylist = '$testreferrerid[userid]'
WHERE userid = '$userid';
");
}
Oops, looks like I have rewritten your hack. Oh well.. :P
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.