PDA

View Full Version : Who Am I A Buddy Of? 2.1


Gamingforce
03-20-2006, 10:00 PM
[ Feature Description ]
This feature allows users to easily see who they are buddies of along with an easy way to add/remove buddies right from the page! This modification is a big upgrade from the one I made for vBulletin 2. It has proved to be a very useful tool for my members. As of this version, there are noother known performance optimization techniques, nobugs and no security problems.

[ Screenshot ]
http://www.gamingforce.com/vbmods/whobuddy.gif

Enjoy!

The Chief
03-21-2006, 07:47 PM
hey looking good, love your forums :)

projectego
03-21-2006, 07:56 PM
Nice hack, I actually used it when you first released it for the 3.0.x series. Cheers for the port. :)

hiiped
03-22-2006, 01:59 AM
very useful

thanks

< clicking install >

shadowdancer36
03-22-2006, 02:30 PM
Just wondering if I can make a link and have the list to come up as a pop up window?

Alien
03-22-2006, 04:44 PM
Awesome port! I'll be using this one...

briansol
04-24-2006, 07:17 AM
anychance of adding the + or - to each post under the user name like their post count?

briansol
04-24-2006, 08:31 AM
I figured my own post out. :)

open showthread.php

find:

'editor_jsoptions_size',


add after:

'whobuddy',


find:

else
{
$fetchtype = 'post';
}


add after:


//************************************************** ************************************************** **
//------ buddy mod
//************************************************** ************************************************** **

$bbuserinfo['userid'] = $vbulletin->userinfo['userid'];
$bbuserinfo['buddylist'] = $vbulletin->userinfo['buddylist'];

$buddyarray = explode(" ", $bbuserinfo['buddylist']);

//$post['whobuddybit']= "";

foreach($buddyarray as $buddyid)
{
if(strstr(" $buddyid "," $post[userid] "))
{
//$post['whobuddybit'].= "Buddy ID: ". $buddyid ." matches";
$currentpostbuddyid = $buddyid;
}
}



if ($currentpostbuddyid == $post[userid]) {
$mutualbuddybit = "<a href=\"profile.php?$session[sessionurl]do=removelist&amp;userlist=buddy&amp;u=$post[userid]\">[Remove from Buddy List]</a>";

} else {
$mutualbuddybit = "<a href=\"profile.php?$session[sessionurl]do=addlist&amp;userlist=buddy&amp;u=$post[userid]\">[Add to Buddy List]</a>";
}
$post['whobuddybit'] .= $mutualbuddybit;
//$post['whobuddybit'] .= "bbuserinfo[userid]= " . $bbuserinfo['userid'] ." bbuserinfo[buddylist]= ". $bbuserinfo['buddylist'];




//************************************************** ************************************************** **
//------ end buddy mod
//************************************************** ************************************************** **



find:

unset($post);


add after:


unset($whobuddybit);
unset($mutualbuddybit);




TEMPLATES:

go to edit templates, postbit_legacy (this is the one i use... you may use the new postbit, and i don't know exaclty where you want to add this horizontally... i'm sure you can find a spot on your own. it's the same paste code.

find:

<div>$post[icqicon] $post[aimicon] $post[msnicon] $post[yahooicon] $post[skypeicon]</div>


add after:

<if condition="$post['userid']">
<div>$post[whobuddybit]</div>
</if>


and i think thats it. let me know if anyone has trouble with it.

briansol
04-24-2006, 08:32 AM
also note, this DOESNT add an extra query. All info needed is already pulled from the main query for the posts!

Boofo
04-24-2006, 08:35 AM
Isn't there a way to do a string replace for the file edit?

briansol
04-24-2006, 01:13 PM
i'm sure you could, but you aren't replacing anything.... you're adding to it.

Boofo
04-24-2006, 05:45 PM
i'm sure you could, but you aren't replacing anything.... you're adding to it.

Basically, you are replaciong... find one line and add another line underneath it. So find "this" and replace it with "this, that". ;)

KevNJ
04-25-2006, 02:16 AM
* clicks install *

flawless install - great addition... thanks!

moonclamp
04-30-2006, 11:19 PM
For some reason it is only telling me about the first three buddies who added me ... Nothing else is registering

EDIT ... Actually it isn't showing any at all now. I got the buddies to remove me from their list. They then added me again and now they're not showing.

It only seems to show buddies that were added before the hack was installed.

dt~
05-06-2006, 04:59 AM
Thanks, installed. (aka)

EDIT : Not working at all. Like what moonclamp wrote, the list shows 0 users.

moonclamp
05-06-2006, 01:55 PM
Thanks, installed. (aka)

EDIT : Not working at all. Like what moonclamp wrote, the list shows 0 users.
Yeah, mine seems to be erratic. I'm using a couple of test accounts to play with it.

If I remove a user and the add them again they sometimes show up, at other times they don't. Can't quite figure why that should be.