1

Topic: reverse order post and replies

I have a PunBB 1.4.2
Is there a way to have newest posts and replies build from the top down and not placed on the bottom of the topic ?


Thanks in advanced

Re: reverse order post and replies

Hi,
you can achieve that by replacing two lines of code in viewtopic.php

line 285:
    'ORDER BY'    => 'p.id',
change it to:
    'ORDER BY'    => 'p.id DESC',

line 320:
    'ORDER BY'    => 'p.id'
change it to:
    'ORDER BY'    => 'p.id DESC'

If you want to contact me quickly - send e-mail, not PM.
<?php $t='<?php $t=%c%s%c; printf($t,39,$t,39,10);%c'; printf($t,39,$t,39,10);

Re: reverse order post and replies

keeshii wrote:

Hi,
you can achieve that by replacing two lines of code in viewtopic.php

line 285:
    'ORDER BY'    => 'p.id',
change it to:
    'ORDER BY'    => 'p.id DESC',

line 320:
    'ORDER BY'    => 'p.id'
change it to:
    'ORDER BY'    => 'p.id DESC'

how about if first post keep on first page and second post is latest post?

sorry my BAD english T___T
Have a nice day >.<
(^____^)v

Re: reverse order post and replies

just don't change line 285, and you will keep the order of pages, but it in my opinion it looks weird.

If you want to contact me quickly - send e-mail, not PM.
<?php $t='<?php $t=%c%s%c; printf($t,39,$t,39,10);%c'; printf($t,39,$t,39,10);

5

Re: reverse order post and replies

thank you very much!

Re: reverse order post and replies

keeshii wrote:

just don't change line 285, and you will keep the order of pages, but it in my opinion it looks weird.

yes i try dont change line 285, but the first post being 10th post not in 1st post :?

sorry my BAD english T___T
Have a nice day >.<
(^____^)v

7 (edited by luca 2014-12-23 14:11)

Re: reverse order post and replies

changing order the link of every post dont work so you have to change also
    // Determine on what page the post is located (depending on $forum_user['disp_posts'])
    $query = array(
        'SELECT'    => 'COUNT(p.id)',
        'FROM'        => 'posts AS p',
        'WHERE'        => 'p.topic_id='.$topic_info['topic_id'].' AND p.posted<'.$topic_info['posted']
    );

in
    // Determine on what page the post is located (depending on $forum_user['disp_posts'])
    $query = array(
        'SELECT'    => 'COUNT(p.id)',
        'FROM'        => 'posts AS p',
        'WHERE'        => 'p.topic_id='.$topic_info['topic_id'].' AND p.posted>'.$topic_info['posted']
    );

8 (edited by kudataz 2014-12-26 06:25)

Re: reverse order post and replies

luca wrote:

changing order the link of every post dont work so you have to change also
    // Determine on what page the post is located (depending on $forum_user['disp_posts'])
    $query = array(
        'SELECT'    => 'COUNT(p.id)',
        'FROM'        => 'posts AS p',
        'WHERE'        => 'p.topic_id='.$topic_info['topic_id'].' AND p.posted<'.$topic_info['posted']
    );

in
    // Determine on what page the post is located (depending on $forum_user['disp_posts'])
    $query = array(
        'SELECT'    => 'COUNT(p.id)',
        'FROM'        => 'posts AS p',
        'WHERE'        => 'p.topic_id='.$topic_info['topic_id'].' AND p.posted>'.$topic_info['posted']
    );

I try change < to > like ur post with dont cahnge on line 285
but the result still same first post to be 10th post sad

sorry my BAD english T___T
Have a nice day >.<
(^____^)v