Topic: how can i add a coloum of "poster作者" in forum table ?

how can i add a coloum of "poster??" in forum table instead of the following:

original:

Topic+poster,                replies,     view,    last poster+time

Now i want to change to:

Topic                           replies,      view,   last poster+time,    original poster+time.

How can i do?>?

Thanks in advance for all your support!!

Re: how can i add a coloum of "poster作者" in forum table ?

Moved to PunBB discussions.

Open viewforum.php, find:

                                        <th class="tcl" scope="col"><?php echo $lang_common['Topic'] ?></th>
                                        <th class="tc2" scope="col"><?php echo $lang_common['Replies'] ?></th>
                                        <th class="tc3" scope="col"><?php echo $lang_forum['Views'] ?></th>
                                        <th class="tcr" scope="col"><?php echo $lang_common['Last post'] ?></th>

After, add:

                    <th class="tcr" scope="col"><?php echo 'First post' ?></th>

Find:

                if ($cur_topic['moved_to'] == null)
                        $last_post = '<a href="viewtopic.php?pid='.$cur_topic['last_post_id'].'#p'.$cur_topic['last_post_id'].'">'.format_time($cur_topic['last_post']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['last_poster']).'</span>';
        else
            $last_post = ' ';

Change to:

                if ($cur_topic['moved_to'] == null)
        {
                        $last_post = '<a href="viewtopic.php?pid='.$cur_topic['last_post_id'].'#p'.$cur_topic['last_post_id'].'">'.format_time($cur_topic['last_post']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['last_poster']).'</span>';
            $original_post = '<a href="viewtopic.php?id='.$cur_topic['id'].'">'.format_time($cur_topic['posted']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>';
        }
        else
                {
            $last_post = ' ';
            $original_post = ' ';
        }

Find:

                if ($cur_topic['moved_to'] != 0)
                        $subject = $lang_forum['Moved'].': <a href="viewtopic.php?id='.$cur_topic['moved_to'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>';
                else if ($cur_topic['closed'] == '0')
                        $subject = '<a href="viewtopic.php?id='.$cur_topic['id'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>';
                else
                {
                        $subject = '<a href="viewtopic.php?id='.$cur_topic['id'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>';
                        $icon_text = $lang_common['Closed icon'];
                        $item_status = 'iclosed';
                }

Change to:

                if ($cur_topic['moved_to'] != 0)
                        $subject = $lang_forum['Moved'].': <a href="viewtopic.php?id='.$cur_topic['moved_to'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a>';
                else if ($cur_topic['closed'] == '0')
                        $subject = '<a href="viewtopic.php?id='.$cur_topic['id'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a>';
                else
                {
                        $subject = '<a href="viewtopic.php?id='.$cur_topic['id'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a>';
                        $icon_text = $lang_common['Closed icon'];
                        $item_status = 'iclosed';
                }

Find:

                                        <td class="tc2"><?php echo ($cur_topic['moved_to'] == null) ? $cur_topic['num_replies'] : ' ' ?></td>
                                        <td class="tc3"><?php echo ($cur_topic['moved_to'] == null) ? $cur_topic['num_views'] : ' ' ?></td>
                                        <td class="tcr"><?php echo $last_post ?></td>

After, add:

                    <td class="tcr"><?php echo $original_post ?></td>

Note that a lot of the spacing in the code is messed up, but it will still work, even though it doesn't look pretty.

Looking for a certain modification for your forum? Please take a look here before posting.

3

Re: how can i add a coloum of "poster作者" in forum table ?

pogenwurst: I guest there was nothing good on TV tonight then.

4 (edited by angeljhouse 2006-07-24 10:15)

Re: how can i add a coloum of "poster作者" in forum table ?

O....i have changed my viewforum.php according to the above maunal....

The original poster after topic is disappeared . .. it's suit for me...

However, I can't see the original poster after last poster.....

please refer to http://angeljhouse.awardspace.com/forum … m.php?id=9

after ???? last poster, i want to add a coloum of 'original poster ??'...but it doesn't work....how can i do now??

and the table after code changed becomes too height!  it just have one line words, but it have about five lines space.....how can i do to adjust the height??

Re: how can i add a coloum of "poster作者" in forum table ?

Paul wrote:

pogenwurst: I guest there was nothing good on TV tonight then.

Haha. tongue It was mostly for practice - I'm very slowly learning PHP (I try but I don't tend to be very patient with tutorials, and although learning as I go might not be efficient, I don't have a pressing deadline to learn PHP or anything), and although the code I actually wrote myself isn't too complicated, it's still very helpful to me to practice reading code and figuring out what it's doing. And yeah, not much of anything better to do (actually, that's not true, I've got some schoolwork I need to do -  a pattern, maybe? -, but the procrastinator in me says otherwise).

angeljhouse wrote:

O....i have changed my viewforum.php according to the above maunal....

The original poster after topic is disappeared . .. it's suit for me...

However, I can't see the original poster after last poster.....

please refer to http://angeljhouse.awardspace.com/forum ? m.php?id=9

after ???? last poster, i want to add a coloum of 'original poster ??'...but it doesn't work....how can i do now??

and the table after code changed becomes too height!  it just have one line words, but it have about five lines space.....how can i do to adjust the height??

Last edited by angeljhouse (Today 05:15:21)

Sorry, but I'm not quite sure what problem you're having.

Looking for a certain modification for your forum? Please take a look here before posting.

Re: how can i add a coloum of "poster作者" in forum table ?

Actually, original punbb's forums format (not categories format) is shown below:

http://angeljhouse.awardspace.com/forums/Book1.xls


However, I want to add a individual coloum of author (original poster), same as below format:

http://angeljhouse.awardspace.com/forums/Book2.xls

hope can assist me to change to format, thanks a lot!

and also, how to amend the size of forums' cell (including cell width and height)

Thanks again!

Re: how can i add a coloum of "poster作者" in forum table ?

Sorry, but your link seems to be broken.

Looking for a certain modification for your forum? Please take a look here before posting.