modify post.inc.php
Add new: newsfeed.php !! PLS UPDATE DB PROCEDURE

please add this procedure to your db before you use this:

delimiter //
CREATE PROCEDURE listDiaryByFriendsWithLikes(IN username VARCHAR(40))
BEGIN
select d.*, L.cnt from
(select Diary.*, nid, ncontent, iid, icontent, aid, acontent, vid,
vcontent
	from Diary
	left join Note on Diary.did=Note.did
	left join Image on Diary.did=Image.did
	left join Audio on Diary.did=Audio.did
	left join Video on Diary.did=Video.did
ORDER BY did DESC
) as d
left join
(select did, count(*) as cnt from Like_diary group by did) AS L
on d.did=L.did
where d.uname in
(select * from (
	(select funame from Friends where uname=username and accept="yes")
	union
	(select uname from Friends where funame=username and accept="yes")
) as f);
END
//
delimiter ;