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

Reply
 
Thread Tools
Automatically Add a New User to Their Referrer's Buddy List Details »»
Automatically Add a New User to Their Referrer's Buddy List
Version: 1.00, by amykhar amykhar is offline
Developer Last Online: Nov 2013 Show Printable Version Email this Page

Version: 3.0.7 Rating:
Released: 03-20-2005 Last Update: 03-20-2005 Installs: 9
 
No support by the author.

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

Show Your Support

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

Comments
  #22  
Old 04-09-2005, 05:45 PM
T3MEDIA T3MEDIA is offline
 
Join Date: Dec 2004
Posts: 944
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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)
Reply With Quote
  #23  
Old 04-13-2005, 06:24 PM
T3MEDIA T3MEDIA is offline
 
Join Date: Dec 2004
Posts: 944
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

bump
Reply With Quote
  #24  
Old 04-18-2005, 12:09 PM
Colin F's Avatar
Colin F Colin F is offline
 
Join Date: Jul 2004
Location: Switzerland
Posts: 1,551
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

T3MEDIA, amykhar didn't check the supported field, so please don't keep bumping the thread.

Thanks.
Reply With Quote
  #25  
Old 04-25-2005, 09:43 AM
T3MEDIA T3MEDIA is offline
 
Join Date: Dec 2004
Posts: 944
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #26  
Old 06-10-2005, 10:14 PM
amykhar's Avatar
amykhar amykhar is offline
 
Join Date: Oct 2001
Location: PA
Posts: 4,438
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Announcement: I will not be porting this hack to 3.5. It did not have enough interest to warrant the effort.
Reply With Quote
  #27  
Old 08-01-2005, 08:36 PM
akanevsky akanevsky is offline
 
Join Date: Apr 2005
Posts: 3,972
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

PHP Code:
 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

PHP Code:
    else
 {
    
$DB_site->query("
        UPDATE " 
TABLE_PREFIX "usertextfield
        SET buddylist = TRIM(CONCAT(buddylist, ' ', '
$testreferrerid[userid]'))
        WHERE username = '" 
addslashes(htmlspecialchars_uni($_POST['referrername'])) . "'
    "
);
 } 
And this
PHP Code:
 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

PHP Code:
    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
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 11:55 AM.


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.04362 seconds
  • Memory Usage 2,271KB
  • Queries Executed 21 (?)
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
  • (4)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
  • (2)pagenav_pagelink
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (6)postbit
  • (7)postbit_onlinestatus
  • (7)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