MyBB Community Forums

Full Version: [Release]MyFriends (vers 1.0)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
works great a nice add on would be to choose top friends
Why that?
Do you make differences between your friends? Wink
Here are some tips for you from one plugin author to another.

You should imho have simply hooked into the buddy list feature of mybb. No sense in creating what's already there. Most of the difference is that you have a page for the "friends" and a section in profiles. This same effect could be achived by hooks and template changes.


$db->query("DROP TABLE IF EXISTS ".TABLE_PREFIX."friends");
Could be:
$db->drop_table("friends");

This seems like it could be improved:
	$query = $db->query("SELECT away, friend_id AS id, ".TABLE_PREFIX."users.uid, username, reputation, postnum, avatar, namestyle
FROM ".TABLE_PREFIX."friends, ".TABLE_PREFIX."users, ".TABLE_PREFIX."usergroups
WHERE ((
".TABLE_PREFIX."friends.uid =".$uid."
AND ".TABLE_PREFIX."friends.friend_id = ".TABLE_PREFIX."users.uid
AND ".TABLE_PREFIX."usergroups.gid = ".TABLE_PREFIX."users.usergroup
)

OR (
".TABLE_PREFIX."friends.friend_id =".$uid."
AND ".TABLE_PREFIX."friends.uid = ".TABLE_PREFIX."users.uid
AND ".TABLE_PREFIX."usergroups.gid = ".TABLE_PREFIX."users.usergroup
))
AND ".TABLE_PREFIX."friends.check = '1'
ORDER BY username");

Why have 2 lang files?
$lang->load("friends");
$lang->load("friends2");

And part of the reason I think using the buddy list would be nicer is because it would add more functionality to an existing mybb feature versus recreating that same feature.

I looked for any obvious exploits and didn't find any. It's good code overall and it's a nice plugin. I would have just liked a few things different. Great job and congrats on release.
(2009-06-26, 03:20 PM)Lennart Sauter Wrote: [ -> ]Why that?
Do you make differences between your friends? Wink

ROFLOL! Maybe having the following "friends types" may be sufficient:

Best Friends
Good Friends
Friends
Acquaintances
Profile Decorations

Sorry, couldn't resist... Big Grin
Gene
(2009-06-26, 04:58 PM)Gene53 Wrote: [ -> ]Profile Decorations

Awesome one Big Grin
labrocca Wrote:You should imho have simply hooked into the buddy list feature of mybb. No sense in creating what's already there

I agree with Jesse, why re-invent the wheel? Your plugin would be great if it worked with the existing buddy system.

Cheers,
Gene
What to do Appropriate box / Removing space?

[Image: 1246381299.jpg]
(2009-06-30, 06:22 AM)Pars Wrote: [ -> ]What to do Appropriate box / Removing space?

[Image: 1246381299.jpg]

Simple!! just go to global templates, edit templates friends_all and friends_rand
in CSS edit the width in "li.mybbfriends" and decrease it as you like(the best to fit all screen is 48% i think Wink)...
this will allow friends box to display correctly for all screens!!


(2009-06-26, 04:22 PM)labrocca Wrote: [ -> ]Here are some tips for you from one plugin author to another.

You should imho have simply hooked into the buddy list feature of mybb. No sense in creating what's already there. Most of the difference is that you have a page for the "friends" and a section in profiles. This same effect could be achived by hooks and template changes.
Thanks, in next version i will modify the plugin and i will use the buddylist Wink
But at the moment i'm quite busy and i won't release this very soon...

(2009-06-26, 04:22 PM)labrocca Wrote: [ -> ]$db->query("DROP TABLE IF EXISTS ".TABLE_PREFIX."friends");
Could be:
$db->drop_table("friends");

This seems like it could be improved:
	$query = $db->query("SELECT away, friend_id AS id, ".TABLE_PREFIX."users.uid, username, reputation, postnum, avatar, namestyle
FROM ".TABLE_PREFIX."friends, ".TABLE_PREFIX."users, ".TABLE_PREFIX."usergroups
WHERE ((
".TABLE_PREFIX."friends.uid =".$uid."
AND ".TABLE_PREFIX."friends.friend_id = ".TABLE_PREFIX."users.uid
AND ".TABLE_PREFIX."usergroups.gid = ".TABLE_PREFIX."users.usergroup
)

OR (
".TABLE_PREFIX."friends.friend_id =".$uid."
AND ".TABLE_PREFIX."friends.uid = ".TABLE_PREFIX."users.uid
AND ".TABLE_PREFIX."usergroups.gid = ".TABLE_PREFIX."users.usergroup
))
AND ".TABLE_PREFIX."friends.check = '1'
ORDER BY username");
When i'll integrate this with the buddy system there will be no more need for this Wink

(2009-06-26, 04:22 PM)labrocca Wrote: [ -> ]Why have 2 lang files?
$lang->load("friends");
$lang->load("friends2");
Because friends.php uses some lang var used also in member.php and if i would have used a unique lang file there would have been conflicts Wink

Thanks all for the comments!!

I hope what i wrote is understandable Wink

MapoGio
what do the middle of the text & avatar?
<center .... <center/>

[Image: 1246468932.jpg]
Pages: 1 2 3