Friendscheck

Need help with an engine or coding not on the list? Need help with a game or the website and forums here? Direct all questions here.
Post Reply
Huezzer
Posts: 72
Joined: Mon Jan 31, 2011 7:47 pm

Friendscheck

Post by Huezzer »

Hey, I've got problem, I can't get it work as I want. I want a friendspage that shows the friends that you have added. And next to their names, I want it to show their onlinestatus, that means I have made some icons that I want to show up next to their names to show the status, if they are online, if they are offline etc.

Thanks, Huezzer
User avatar
SpiritWebb
Posts: 3107
Joined: Sun Jul 12, 2009 11:25 pm

Re: Friendscheck

Post by SpiritWebb »

Try looking at http://www.developphp.com and look under the PHP section...scroll to the bottom to the social network tutorial, he teaches how to do the add friends...
Image

Image
User avatar
vitinho444
Posts: 2819
Joined: Mon Mar 21, 2011 4:54 pm

Re: Friendscheck

Post by vitinho444 »

Not sure what to add to help you, but if you cant make it work with the previous replies then try to make:

//inside the while loop that catches all your friends or whatever you are using
if($friend_online)
{
echo $name . " <img src='online.png'>";
}
else
{
echo $name . " <img src='offline.png'>";
}

not sure if that's what you are asking :S
My Company Website: http://www.oryzhon.com

Skype: vpegas1234
User avatar
Torniquet
Posts: 869
Joined: Sun Aug 02, 2009 6:18 am

Re: Friendscheck

Post by Torniquet »

I agree with Spirit, definitely use that site as a starting point.

I have however produced a slightly cleaner method of retrieving the names of the users.

$query = "SELECT `user_id`, `username`, `username_clean` FROM `user_data` WHERE `user_id` IN ({$user->friends_list})";

If I remember rightly when he lists the names, he explodes the string and performs a query for every user id within the array. If you store your friends ids in a comma delimited list (which I believe is the way shown in those tutorials), the IN function will do the same thing in one query.

Just a small FYI for you and anyone who may need it :)
New Site Coming Soon! Stay tuned :D
Post Reply

Return to “Advanced Help and Support”