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.

TigerC10 12-17-2008 03:49 AM

Quote:

Originally Posted by King Kovifor (Post 1687083)
Thanks for replying.

What about the bug fix? I mean, it does fix it for me and I know a bunch of people uninstalled this because of that bug.

King Kovifor 12-17-2008 06:43 PM

Like I said, I will have time in the coming weeks to release the fixed version.

TigerC10 12-18-2008 03:00 AM

Quote:

Originally Posted by King Kovifor (Post 1687540)
Like I said, I will have time in the coming weeks to release the fixed version.

But... I... Gave you the fix. How would it take you weeks to get to?

King Kovifor 12-18-2008 07:37 PM

Quote:

Originally Posted by TigerC10 (Post 1687762)
But... I... Gave you the fix. How would it take you weeks to get to?

It won't take me weeks. I am done with school on Tuesday. That will be my planned upgrade week. Next week. This product, and at least 2 others.

TheInsaneManiac 12-22-2008 04:11 AM

What was in the update that just came out?

King Kovifor 12-22-2008 09:45 PM

Quote:

Originally Posted by TheInsaneManiac (Post 1690833)
What was in the update that just came out?

The link in the update email fixes the problems with email activation.

buyinflatables 12-30-2008 01:50 AM

I installed it... and new members sign on.. and neither they or I have them listed as friends?

What's up with it?

Checked the settings and all seems to be okay

King Kovifor 12-30-2008 03:33 AM

If you followed the instructions, it should work just fine...

TandyServices 12-30-2008 08:24 PM

Re-installed.. Thanks works great now.. Will be looking for more patches.. Again good work..

Jasmin 01-01-2009 10:44 PM

Quote:

Originally Posted by King Kovifor (Post 1691490)
The link in the update email fixes the problems with email activation.

I think this is a great mod! :) Can you share the link here?

I just installed this the other day, so I don't have the benefit of the update email that was sent. I see that the version in this thread is still very old, not the December version.

I followed instructions w/the current version posted in this thread the other day, but, sadly it doesn't work. I get the same database error everyone else used to get.

TigerC10 01-02-2009 02:25 AM

@Jasmin - I posted the fix on page 17. I included the plugin code at the bottom, just edit the plugins and change the code to what I put at the bottom of my post.

Jasmin 01-02-2009 05:13 PM

Quote:

Originally Posted by TigerC10 (Post 1698969)
@Jasmin - I posted the fix on page 17. I included the plugin code at the bottom, just edit the plugins and change the code to what I put at the bottom of my post.

Oh, ok. I thought they implied up there that he issued a new .xml with all that stuff included so I didn't have to mess w/it.

Thanks, though. I'll try this. :)

TigerC10 01-02-2009 05:25 PM

Yeah, I'm not sure why he didn't change the XML file - perhaps he did and it's being reviewed for approval right now.

buyinflatables 01-02-2009 09:08 PM

Thank you TigerC10... Followed your instructions and examples and it now works!

Thank you again!!

King Kovifor 01-02-2009 09:41 PM

Quote:

Originally Posted by TigerC10 (Post 1699483)
Yeah, I'm not sure why he didn't change the XML file - perhaps he did and it's being reviewed for approval right now.

I just haven't gotten around to installing it on a dev server and adding the patch.

Stubbed 01-11-2009 11:05 PM

How is getting around to installing it on a Dev server King Kovifor?

I'll be keen to run this on 3.8, but require the option to add all current members as friends..

King Kovifor 01-13-2009 08:53 PM

Quote:

Originally Posted by Stubbed (Post 1709089)
How is getting around to installing it on a Dev server King Kovifor?

I'll be keen to run this on 3.8, but require the option to add all current members as friends..

It's been installed, but a package is not ready.

Shaliza 01-15-2009 02:03 AM

Nice mod! Thanks. =)

Nadavy 01-18-2009 07:08 PM

This mod was actually restricting users from being able to confirm their emails on my forums :(

King Kovifor 01-18-2009 11:44 PM

Quote:

Originally Posted by Nadavy (Post 1717159)
This mod was actually restricting users from being able to confirm their emails on my forums :(

Odd. I wouldn't know why as I only do so on email verification (after it's been verified) and on the add member process.

TigerC10 01-19-2009 10:30 PM

Quote:

Originally Posted by Nadavy (Post 1717159)
This mod was actually restricting users from being able to confirm their emails on my forums :(

Quote:

Originally Posted by King Kovifor (Post 1717311)
Odd. I wouldn't know why as I only do so on email verification (after it's been verified) and on the add member process.

Isn't that the widely known bug? It seems obvious to me that Nadavy didn't apply the fixes that I supplied to you, King Kovifor (since you still haven't put the patches in the XML file, I'm sure a lot of people are downloading that without reading through the posts for the fix).

King Kovifor 01-19-2009 11:16 PM

Quote:

Originally Posted by TigerC10 (Post 1718345)
Isn't that the widely known bug? It seems obvious to me that Nadavy didn't apply the fixes that I supplied to you, King Kovifor (since you still haven't put the patches in the XML file, I'm sure a lot of people are downloading that without reading through the posts for the fix).

The bug was email validation not adding friends correctly (or whatever), but it wasn't as he said. I've never had a report of that.

GCC LLC 01-20-2009 12:51 AM

Installed but its not sending a notification to the user when its not mutual...or mutual for that matter. any ideas?

sensimilla 01-20-2009 10:08 AM

Its not working for me on vb 3.8 , any ideas ? TIA

King Kovifor 01-20-2009 08:06 PM

I will try to check this out later.

TigerC10 01-22-2009 04:26 AM

Quote:

Originally Posted by King Kovifor (Post 1718374)
The bug was email validation not adding friends correctly (or whatever), but it wasn't as he said. I've never had a report of that.

Well consider this your second report of that, then. When I had e-mail activation enabled with your original version, I encountered a database error which would not allow someone to validate the e-mail link. Every time the link was clicked, database error. No move from the "awaiting activation" group. When I was coming up with the fix, I encountered this a lot of times. I would click the link again, and it would complain that the activation link wasn't valid. I would have to re-send the activation link and eventually when I finished the fix it worked fine.

Maybe something changed in the error handling code for vB between the version that you developed this on and 3.7.5, but when people were complaining about how this plugin didn't work and when some people complained that it broke their board - I thought you knew about it.


Quote:

Originally Posted by sensimilla (Post 1718831)
Its not working for me on vb 3.8 , any ideas ? TIA

It works for me on 3.8, apply the fixes mentioned on page 17 of this thread and it should work for you too.

MrBig 02-08-2009 01:35 AM

how do i delete friends if its a large amount , i have over 4,000+ since i installed it and i would like to delete them and start fresh , and ideas besides doing it manually?

King Kovifor 02-08-2009 02:10 AM

Not a clue. I don't think you can prune friends. Sadly, that's a disadvantage of this modification.

MrBig 02-09-2009 01:51 AM

Quote:

Originally Posted by King Kovifor (Post 1737469)
Not a clue. I don't think you can prune friends. Sadly, that's a disadvantage of this modification.

thanks for the quick reply , hopefully someone finds this that can help :(

TigerC10 02-09-2009 05:53 AM

MrBig, you can query the database yourself. If you've set your permissions properly (in the config.php file, look for $config['SpecialUsers']['canrunqueries'] and make sure your userID is allowed), then in the AdminCP at the bottom under the "Maintenance" section, go to "Execute Database Query".

It goes without saying that you should make a database back up before doing this, just in case something goes wrong. This code is untested, but should work. Be 100% sure that you get a database backup before trying this.

Reset your friend count
Code:

UPDATE vb_user SET friendcount="0" WHERE userid="1"
Delete all friends from your list
Code:

DELETE FROM vb_userlist WHERE userid="1" AND type="buddy" AND friend="yes"
---------------------------------------------------------------------------

Reduce friend counts from everyone else that lists you as a friend
Code:

UPDATE vb_user LEFT JOIN vb_userlist ON vb_user.userid = vb_userlist.userid SET vb_user.friendcount = vb_user.friendcount-1 WHERE vb_userlist.relationid="1"
Delete yourself from everyone else's friend lists
Code:

DELETE FROM vb_userlist WHERE relationid="1" AND type="buddy" and friend="yes"
Of course, replace "vb_" with your table prefix, or delete it if you don't have a table prefix. And replace the 1 with your userid, assuming you're not userid 1 (don't forget to change the "relationid" variables away from 1). The first two and the last two must be done together as pairs, but you do not have to do all 4 of them. If you just want to clear YOUR friend list, and still let other people list you as a friend, just do the first two.


Then go to your trusty Maintenance section, and open the "Update Counters" page, and "Fix Broken Profiles" (this is just in case - it shouldn't have an effect, I don't think it even resets the friend counts properly).




@King Kovifor - Maybe adding in a friend establisher/resetter feature would be good. I know some people complained when it didn't retroactively make friendships for existing users. And here you see MrBig wants to be able to start fresh on his friend list. You need to update the .xml file because of the e-mail activation bug anyway - might as well just throw in some shiny new features. Using the code I just provided above (assuming it's fully correct - the only query I worry about is the left join one... which I guess is the important one) it shouldn't be too difficult to implement a friendlist resetter, and going backwards to make a friendlist establisher shouldn't be too difficult.


All times are GMT. The time now is 08:57 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.01496 seconds
  • Memory Usage 1,848KB
  • 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
  • (12)bbcode_code_printable
  • (20)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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