-->
julis

Sharetronix - Sort Group Post by Last Comment date

In this time i get a job to research a microblogging platform - Sharetronix.
Basically, Sharetronix is a multimedia microblogging - powered by Blogtronix and is opensource.
The source code is distributed under GNU GPL Affero License.

The first requirement in my work is how to sort group post by last comment in the post.

so here the change i've made :
NOTE : this change is for sharetronix 1.4.2


Open file \system\controllers\group.php with your favorite editor.
change line 174, 
from
$q2 = 'SELECT *, "public" AS `type` FROM posts WHERE group_id="'.$g->id.'" ORDER BY id DESC ';
to
$q2 = 'SELECT *, "public" AS `type` FROM posts WHERE group_id="'.$g->id.'" ORDER BY date_lastcomment DESC ';

change line 178, 
from
$q2 = 'SELECT p.*, "public" AS `type` FROM posts p, posts_attachments a WHERE p.id=a.post_id AND p.group_id="'.$g->id.'" AND a.type="'.$tmp[$D->filter].'" ORDER BY p.id DESC ';
to
$q2 = 'SELECT p.*, "public" AS `type` FROM posts p, posts_attachments a WHERE p.id=a.post_id AND p.group_id="'.$g->id.'" AND a.type="'.$tmp[$D->filter].'" ORDER BY p.date_lastcomment DESC ';

Save.
julis
julis
Load comments