hello,
on my website's homepage/login page im after a newsfeed like facebooks.
If its your first time to the site you will view a random few post's from people,
But if your a member and have signed up it will just show your friends.
currently i have a function
function friends_streams ($uid)
{
$res = mysql_query("SELECT * FROM friends WHERE uid='$uid'");
while ($row = mysql_fetch_array($res))
{
$fids[] = $row['fid'];
}
if (is_array($fids))
{
array_push($fids, $uid);
foreach ($fids as $value)
{
$my_in = mysql_query("SELECT * FROM accounts where id = '$value' ORDER BY id DESC");
$my_info = mysql_fetch_array($my_in);
// output the users comments here
}
}
}
but the trouble is it orders the post not by the newest but by the friend's id going in order e.g
people | ID numbers
you | 1
friend 1 | 2
friend 2 | 3
friend 3 | 4
friend 3 writes a post - it will show at the top.
friend 2 then writes a post after f3 - still at the top.
friend 3 writes a new post and it shows up in the middle,
hope you understand whaat i mean because its very hard to explian whats happening