vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.7 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=228)
-   -   Profile Enhancements - Automatically Add Friend (https://vborg.vbsupport.ru/showthread.php?t=177269)

iNRoC 11-15-2008 02:51 PM

Thanks. Installed.

kalleklorin 12-03-2008 10:26 PM

interesting

joh 12-06-2008 03:12 PM

is it safe to reinstall this mod.
has the bug been fix seen that we are now in December.

King Kovifor 12-06-2008 05:57 PM

Quote:

Originally Posted by joh (Post 1679646)
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.

TigerC10 12-13-2008 02:48 AM

Quote:

Originally Posted by King Kovifor (Post 1654167)
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. :)

nightbloom 12-14-2008 03:24 AM

Quote:

Originally Posted by TigerC10 (Post 1684273)
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.

TigerC10 12-14-2008 04:39 PM

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.

nightbloom 12-15-2008 03:05 PM

FOr some reason, when I add this, i get no ACP settings... =.= I installed, uninstalled, etc... Nothing. Grrrrrrr.... I really want this to work.

TigerC10 12-15-2008 04:41 PM

Are you sure? The admin options are under "User Registration Options", it's not separated out to its own section...

King Kovifor 12-17-2008 12:32 AM

Quote:

Originally Posted by nightbloom (Post 1685924)
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 (Post 1685975)
Are you sure? The admin options are under "User Registration Options", it's not separated out to its own section...

Thanks for replying.


All times are GMT. The time now is 06:47 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.01201 seconds
  • Memory Usage 1,749KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (8)bbcode_code_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete