Order a profile wall (publications and activity feeds) on Facebook

I make a curious social site. I noticed that profiles of poster publications are published on my pages, as well as an activity feed (likes, becoming friends, etc.) - publications are in the first place, and the activity feed is in the other. This is not a problem, but here comes what I cannot understand. The activity feed and publications are not only divided by type, but also by date. Here is what I mean.

 **Today** 
publication -> Windom is very tired. 
publication -> DAMN! I'm so angry!!! 
act.feed -> Windom became friends with John and Steve. 
act. feed -> Windom likes AC/DC, Guitars and Rock.

**Yesterday** 
publication -> Bla bla bla 
act.feed -> Windom likes PHP, Table tennis and Vermeer. 
act. feed-> Windom and Lisa are now friends. 

and etc.

There may also be days in which there is only an activity feed or only publications. How to do this on my website with php and mysql ?: (

+3
source share
1 answer

, , (, , , dtae ..), , aray go , act.feed - , . ... , , (pub1, pub2, feed1, feed2). ... , . , . , , , .

json1 json2 ( ). , , , , ... :

$ = 0;

do {

$tmp_message_feed [$ fi] = $json1 ['message'];

$tmp_message_feed [$ fi] = json1 ['created_time'];

$ ++;

} while ($ total_feed_messages > $fi)

- . json 2 .

.

multisort:

array_multisort($tmp_created_time, SORT_DESC, SORT_STRING, $tmp_message);

, , , , !

, !

+1

Source: https://habr.com/ru/post/1784158/


All Articles