MyBB Community Forums

Full Version: add to buddylist from memberlist
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4
I'm a new plugin creator and this seems nice, maybe I could do it as one of my first plugins for you? Smile
hope its made bro..thank for all.....it will be quite handy for all our users,better ajax if used it would be helpful to add many in a single chance
bump....anybody making this?????
(2011-02-10, 08:25 PM)envira Wrote: [ -> ]add to buddylist from memberlist

hello,
i want to have option of adding to buddylist,directly in memberlist for logged in users,can you please say th tutorial or is there any plugin for that?

please help me

Open your Member List Templates - memberlist_user
Replace whole code to this one:
<tr>
	<td class="{$alt_bg}" align="center">{$user['avatar']}</td>
	<td class="{$alt_bg}">{$user['profilelink']}<br />
<span class="smalltext">
	{$user['usertitle']}<br />
	{$usergroup['groupimage']}
	{$user['userstars']}<br>
<a href="usercp.php?action=do_editlists&add_username={$user['username']}&amp;my_post_key={$mybb->post_code}">add friend</a>
</span></td>
	<td class="{$alt_bg}" align="center">{$user['regdate']}</td>
	<td class="{$alt_bg}" align="center">{$user['lastvisit']}</td>
	<td class="{$alt_bg}" align="center">{$user['postnum']}</td>
	{$referral_bit}
</tr>

Should be works, but it will failed if your member username has a "space" character
Now, browse memberlist.php and enjoy. Wink
(2011-02-13, 06:52 PM)Aristotle Wrote: [ -> ]{$buddy_options} Is the code it think, but i have no clue where the memberlist templates are.

wait i have downs, give me a second


No idea why but it refuses to work for me when i insert buddy options in memberlist_user. Might be the wrong code.
I think that will only work on the users profile because it isn't declared
{$buddy_options} won't work because it isn't declared in that location.

You would have to have a plugin hook the memberlist and set the value for it.
@Connor and Revenger. Yea, thats been said before.
Envira,

I would like to share with you something I´ve been doing with my lack of experience writing a darn code for the last 2 days and 3 nights now. Darn because I´m still having headaches trying to figure how I can make the board to search, find, replace or add codes like "<br />".

The memberlist_user template looks like this:

<tr>
	<td class="{$alt_bg}" align="center">{$user['avatar']}</td>
	<td class="{$alt_bg}">{$user['profilelink']}<br />
<span class="smalltext">
        {$user['usertitle']}<br />
        {$usergroup['groupimage']}
	{$user['userstars']}
</span></td>
	<td class="{$alt_bg}" align="center">{$user['regdate']}</td>
	<td class="{$alt_bg}" align="center">{$user['lastvisit']}</td>
	<td class="{$alt_bg}" align="center">{$user['postnum']}</td>
	{$referral_bit}
</tr>

Mi intention is to insert my own stuff like this:

<tr>
	<td class="{$alt_bg}" align="center">{$user['avatar']}</td>
	<td class="{$alt_bg}">{$user['profilelink']}<br />
<span class="smalltext">
        {$buddy_options_ml}<br />       
        {$user['usertitle']}<br />
        {$usergroup['groupimage']}

But I can´t! Sad , the best I could do everytime I activate this sort of plugin I´m working on...I get this:

<tr>
	<td class="{$alt_bg}" align="center">{$user['avatar']}</td>
	<td class="{$alt_bg}">{$user['profilelink']}<br />
{$buddy_options_ml}<span class="smalltext">
               {$user['usertitle']}<br />
               {$usergroup['groupimage']}


I simply can´t add the "<br />" after the plugin code otherwise it would be shown below the span.

When I tried to replace and then add or whatever:

Quote:{$user['usertitle']}<br />

...nothing is going on. So that´s why it is inserted before the span code. So, If you want to try it. After you activate it, you just insert the code manually in your template wherever you want.

Of course, this is not a pro job. With some code taken from Ryan´s member.php file and edited a little bit. So don´t expect too much. Big Grin

And for the rest of the people, more experienced and interested on setting the functional way to add a buddy, remove a buddy, add to ignore list and remove to ignore list on memberlist page. Please...help! I´m not an expert, I could not have 5 or 6 mistakes, maybe there are hundreds of it, but I needed some sort of plugin like the one we are requesting, as at the moment 2 icons shows up. 1 works for adding and the other redirects to the buddy and ignore page. That´s it....but needs more than that.

Here is the code for public testing and review, at the meanwhile, some real plugin author would eventually to show up with something better.

Cheers

Edited: Thanks to RateU who make it work. My file attempt is removed.
well this is promising,,,,i m going to test right now,thanks samyed,for taking this a serious one and making it a plugin..well i too will look after the code,any changes wil be mentioned.thnkx bro
i get error while using this plugin,the members are not getting added into buddy list.....
Pages: 1 2 3 4