Here is the query (and some sample results) I plan to use to build a new timeline page in the mockup vue.js
usercp I am working on.
When the postid
is the same as lastpostid
, this means the timeline entry will be - "{{Member}} Started Discussion {{Thread Title}} at {{date and time}}" and when they are different, it means "{{Member}} Posted a Reply in {{Thread Title}} at {{date and time}":
Seem like this will make a nice timeline in the new usercp I'm working on:
mysql> select post.userid, post.username, thread.title, thread.dateline,post.postid, thread.lastpostid from thread inner join post ON post.threadid = thread.threadid order by dateline desc limit 30;
+-----------+---------------+--------------------------------------------------------------------------------+------------+-----------+------------+
| userid | username | title | dateline | postid | lastpostid |
+-----------+---------------+--------------------------------------------------------------------------------+------------+-----------+------------+
| 302061468 | newbie_01 | Need help with how to search a file for a variable string and delete that line | 1550899316 | 303031186 | 303031189 |
| 302122047 | RudiC | Need help with how to search a file for a variable string and delete that line | 1550899316 | 303031189 | 303031189 |
| 302122727 | Don Cragun | Need help with how to search a file for a variable string and delete that line | 1550899316 | 303031187 | 303031189 |
| 1 | Neo | Vue.js UserCP Mockup Version 0.20 - Badge Notifications | 1550894775 | 303031184 | 303031188 |
| 1 | Neo | Vue.js UserCP Mockup Version 0.20 - Badge Notifications | 1550894775 | 303031185 | 303031188 |
| 1 | Neo | Vue.js UserCP Mockup Version 0.20 - Badge Notifications | 1550894775 | 303031188 | 303031188 |
| 302136317 | wisecracker | Apple looking to switch to using in-house ARM chips for their HW. | 1550864937 | 303031180 | 303031180 |
| 41441 | bakunin | Combining multiple greps | 1550845443 | 303031164 | 303031191 |
| 302052697 | Scrutinizer | Combining multiple greps | 1550845443 | 303031183 | 303031191 |
| 302116191 | MadeInGermany | Combining multiple greps | 1550845443 | 303031191 | 303031191 |
| 302170346 | stomp | Combining multiple greps | 1550845443 | 303031163 | 303031191 |
| 302181753 | Xubuntu56 | Combining multiple greps | 1550845443 | 303031161 | 303031191 |
| 302181753 | Xubuntu56 | Combining multiple greps | 1550845443 | 303031177 | 303031191 |
| 302181753 | Xubuntu56 | Combining multiple greps | 1550845443 | 303031190 | 303031191 |
| 21292 | milhan | Remove lines ending with a certain character | 1550836350 | 303031150 | 303031157 |
| 302122047 | RudiC | Remove lines ending with a certain character | 1550836350 | 303031151 | 303031157 |
| 302122047 | RudiC | Remove lines ending with a certain character | 1550836350 | 303031154 | 303031157 |
| 302122727 | Don Cragun | Remove lines ending with a certain character | 1550836350 | 303031152 | 303031157 |
| 302122727 | Don Cragun | Remove lines ending with a certain character | 1550836350 | 303031156 | 303031157 |
| 302180382 | maya3 | Remove lines ending with a certain character | 1550836350 | 303031145 | 303031157 |
| 302180382 | maya3 | Remove lines ending with a certain character | 1550836350 | 303031153 | 303031157 |
| 302180382 | maya3 | Remove lines ending with a certain character | 1550836350 | 303031157 | 303031157 |
| 1 | Neo | Mtime or the equivalent for HP-UX | 1550808466 | 303031143 | 303031165 |
| 302024200 | drl | Mtime or the equivalent for HP-UX | 1550808466 | 303031146 | 303031165 |
| 302122047 | RudiC | Mtime or the equivalent for HP-UX | 1550808466 | 303031144 | 303031165 |
| 302181968 | danielshell | Mtime or the equivalent for HP-UX | 1550808466 | 303031131 | 303031165 |
| 302181968 | danielshell | Mtime or the equivalent for HP-UX | 1550808466 | 303031165 | 303031165 |
| 1 | Neo | Help to remove malware | 1550784585 | 303031132 | 303031132 |
| 43551 | Corona688 | Help to remove malware | 1550784585 | 303031117 | 303031132 |
| 302182064 | asoh65 | Help to remove malware | 1550784585 | 303031113 | 303031132 |
+-----------+---------------+--------------------------------------------------------------------------------+------------+-----------+------------+
30 rows in set (0.00 sec)