Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.7 > vBulletin 3.7 Add-ons

Reply
 
Thread Tools
Automatically Add Friend Details »»
Automatically Add Friend
Version: 1.0.1, by King Kovifor King Kovifor is offline
Developer Last Online: Aug 2015 Show Printable Version Email this Page

Category: Profile Enhancements - Version: 3.7.x Rating:
Released: 04-26-2008 Last Update: 04-27-2008 Installs: 202
Uses Plugins
Translations  
No support by the author.

Introduction
This modification acts somewhat like Myspace. When you register on Myspace, the creator of Myspace (Tom) is automatically added as a friend (mutually). This acts the same way on your forum by adding any number of users (user IDs required) to the new users friend list. This is completely mutual, but now has the option to be a non-mutual friendship.

This was coded by request in this thread.

Requirements
  • vBulletin 3.7.x (This should work on ALL betas & RCs!)
Installation
  1. Upload the attached product file by following this path:
    ACP -> Plugins & Products -> Manage Products -> [Add/Import Product]
  2. Head over to the vBulletin options, open up the "User Registration Options", and set a list of users under the "Automatically Add Friends" option.
  3. Enjoy!

Show Your Support

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

Comments
  #162  
Old 11-15-2008, 02:51 PM
iNRoC iNRoC is offline
 
Join Date: Jul 2008
Location: Clifton, New Jersey
Posts: 151
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks. Installed.
Reply With Quote
  #163  
Old 12-03-2008, 10:26 PM
kalleklorin kalleklorin is offline
 
Join Date: Nov 2008
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

interesting
Reply With Quote
  #164  
Old 12-06-2008, 03:12 PM
joh's Avatar
joh joh is offline
 
Join Date: Mar 2006
Location: NY
Posts: 79
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

is it safe to reinstall this mod.
has the bug been fix seen that we are now in December.
Reply With Quote
  #165  
Old 12-06-2008, 05:57 PM
King Kovifor's Avatar
King Kovifor King Kovifor is offline
 
Join Date: Nov 2004
Location: PA
Posts: 3,872
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by joh View Post
is it safe to reinstall this mod.
has the bug been fix seen that we are now in December.
no update has been released yet.
Reply With Quote
  #166  
Old 12-13-2008, 02:48 AM
TigerC10's Avatar
TigerC10 TigerC10 is offline
 
Join Date: Apr 2006
Location: Austin, TX
Posts: 616
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by King Kovifor View Post
Sorry, known bug. I really really really need to finish this. * I need to get a life in coding again *.
Yeah... Well, since people want the fix here's the only problem...

Code:
$userid
I'm sure you used that for good reason, and later on in the plugin code you also (correctly) use

Code:
$userinfo[userid]
That's the same thing... So swapping them out resulted in the fix (I tested it, works great). In order to make this compatable with the e-mail activation here's the plugin code:





Plugin: Add Friend After Validation
Hook: register_activate_process
Code:
if(!empty($vbulletin->options['kk_auto_friends']))
{
	$friends = explode(',', $vbulletin->options['kk_auto_friends']);
	
	foreach($friends AS $friendid)
	{
		$db->query("INSERT INTO " . TABLE_PREFIX . "userlist (userid, relationid, type, friend) VALUES ({$userinfo['userid']}, {$friendid}, 'buddy', 'yes')");
		if($vbulletin->options['kk_auto_friends_mutual'])
		{
			$db->query("INSERT INTO " . TABLE_PREFIX . "userlist (userid, relationid, type, friend) VALUES ({$friendid}, {$userinfo['userid']}, 'buddy', 'yes')");
		}
		$db->query_write("UPDATE " . TABLE_PREFIX . "user SET friendcount = friendcount + 1	WHERE userid IN ($userinfo[userid], " . $vbulletin->userinfo['userid'] . ")");
		$db->query_write("UPDATE " . TABLE_PREFIX . "user SET friendcount = friendcount + 1	WHERE userid={$friendid}");
	}
}



Plugin: Automatically Add Friend
Hook: register_addmember_complete
Code:
if(!empty($vbulletin->options['kk_auto_friends']) && !$vbulletin->options['verifyemail'])
{
	$friends = explode(',', $vbulletin->options['kk_auto_friends']);
	foreach($friends AS $friendid)
	{
		$db->query("INSERT INTO " . TABLE_PREFIX . "userlist (userid, relationid, type, friend) VALUES ({$userinfo['userid']}, {$friendid}, 'buddy', 'yes')");
		if($vbulletin->options['kk_auto_friends_mutual'])
		{
			$db->query("INSERT INTO " . TABLE_PREFIX . "userlist (userid, relationid, type, friend) VALUES ({$friendid}, {$userinfo['userid']}, 'buddy', 'yes')");
		}
		$db->query_write("UPDATE " . TABLE_PREFIX . "user SET friendcount = friendcount + 1	WHERE userid IN ($userinfo[userid], " . $vbulletin->userinfo['userid'] . ")");
		$db->query_write("UPDATE " . TABLE_PREFIX . "user SET friendcount = friendcount + 1	WHERE userid={$friendid}");
	}
}



Cheers on the great mod, King Kovifor.
Reply With Quote
  #167  
Old 12-14-2008, 03:24 AM
nightbloom's Avatar
nightbloom nightbloom is offline
 
Join Date: Mar 2008
Location: Whidbey Island, WA
Posts: 145
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by TigerC10 View Post
Yeah... Well, since people want the fix here's the only problem...

Code:
$userid
I'm sure you used that for good reason, but later on in the plugin code you also use

Code:
$userinfo[userid]
That's the same thing... So swapping them out resulted in the fix (I tested it, works great).
So you just find all the instances of
Code:
$userinfo[userid]
and replace with
Code:
$userid
or the other way around in the product xml?. >< I'm a little newbish at this and I wanna make this mod work. I have had this thread tagged since it was opened.
Reply With Quote
  #168  
Old 12-14-2008, 04:39 PM
TigerC10's Avatar
TigerC10 TigerC10 is offline
 
Join Date: Apr 2006
Location: Austin, TX
Posts: 616
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The other way around (find all instances of $userid and replace with $userinfo[userid]), I put the code brackets in my post containing the exact code I used to get it working with e-mail activation. If you go to your plugin manager you can find them and just copy/paste the code from my example.
Reply With Quote
  #169  
Old 12-15-2008, 03:05 PM
nightbloom's Avatar
nightbloom nightbloom is offline
 
Join Date: Mar 2008
Location: Whidbey Island, WA
Posts: 145
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

FOr some reason, when I add this, i get no ACP settings... =.= I installed, uninstalled, etc... Nothing. Grrrrrrr.... I really want this to work.
Reply With Quote
  #170  
Old 12-15-2008, 04:41 PM
TigerC10's Avatar
TigerC10 TigerC10 is offline
 
Join Date: Apr 2006
Location: Austin, TX
Posts: 616
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Are you sure? The admin options are under "User Registration Options", it's not separated out to its own section...
Reply With Quote
  #171  
Old 12-17-2008, 12:32 AM
King Kovifor's Avatar
King Kovifor King Kovifor is offline
 
Join Date: Nov 2004
Location: PA
Posts: 3,872
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by nightbloom View Post
FOr some reason, when I add this, i get no ACP settings... =.= I installed, uninstalled, etc... Nothing. Grrrrrrr.... I really want this to work.
I added them to a previous category as it is an add-on to specific features. They should appear in "User Registration Options" as TigerC10 has already noted.

Quote:
Originally Posted by TigerC10 View Post
Are you sure? The admin options are under "User Registration Options", it's not separated out to its own section...
Thanks for replying.
Reply With Quote
Reply

Thread Tools

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 01:50 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.05070 seconds
  • Memory Usage 2,317KB
  • Queries Executed 27 (?)
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
  • (8)bbcode_code
  • (5)bbcode_quote
  • (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
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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_postinfo_query
  • fetch_postinfo
  • 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