Changing Display Order in Category View |
Description: Want to change the order of topics, authors, replies, views, and last post information? Here's how. |
Author: prince_of_oreon |
Date: Tue Mar 16, 2004 9:59 pm |
Type: HowTo |
Keywords: topics,authors,replies,views,last post, header, order, category view |
Category: Styles |
|
Changing Display Order in Category View
To change the order of topics, replies, posts, view, and last post in category view, you need to edit viewforum_body.tpl
There is code in viewforum_body.tpl which affects the header, and the corresponding section of code which affects display. Hence if you change the display order in the one without changing the other you will change the header order, but not the information display order, which could leave you with last post information under topics, or worse. Lets look at the two sections of code.
The first section of code we encounter is lines 16-22 of the vanilla package, and it reads thus:
Code: |
<tr>
<th colspan="2" align="center" height="25" class="thCornerL" nowrap="nowrap"> {L_TOPICS} </th>
<th width="50" align="center" class="thTop" nowrap="nowrap"> {L_REPLIES} </th>
<th width="100" align="center" class="thTop" nowrap="nowrap"> {L_AUTHOR} </th>
<th width="50" align="center" class="thTop" nowrap="nowrap"> {L_VIEWS} </th>
<th align="center" class="thCornerR" nowrap="nowrap"> {L_LASTPOST} </th>
</tr> |
The above section of code forms the 'header' area, which is the area which displays Topics, Author, Replies, Views, and Last Post. By rearranging the structure of any line of code between the <th> tags and placing them above or below others you can re-arrange the header display. But too have the information display with their corresponding headers you will need to grab lines 24-32 of viewforum_body.tpl in subSilver. It reads:
Code: | <tr>
<td class="row1" align="center" valign="middle" width="20"><img src="{topicrow.TOPIC_FOLDER_IMG}" width="19" height="18" alt="{topicrow.L_TOPIC_FOLDER_ALT}" title="{topicrow.L_TOPIC_FOLDER_ALT}" /></td>
<td class="row1" width="100%" onMouseOver="this.style.backgroundColor='{T_TD_COLOR1}'; this.style.cursor='hand';" onMouseOut=this.style.backgroundColor="{T_TR_COLOR1}" onclick="window.location.href='{topicrow.U_VIEW_TOPIC}'"><span class="topictitle">{topicrow.NEWEST_POST_IMG}{topicrow.TOPIC_TYPE}<a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a></span><span class="gensmall"><br />
{topicrow.GOTO_PAGE}</span></td>
<td class="row2" align="center" valign="middle"><span class="postdetails">{topicrow.REPLIES}</span></td>
<td class="row3" align="center" valign="middle"><span class="name">{topicrow.TOPIC_AUTHOR}</span></td>
<td class="row2" align="center" valign="middle"><span class="postdetails">{topicrow.VIEWS}</span></td>
<td class="row3Right" align="center" valign="middle" nowrap="nowrap"><span class="postdetails">{topicrow.LAST_POST_TIME}<br />{topicrow.LAST_POST_AUTHOR} {topicrow.LAST_POST_IMG}</span></td>
</tr> |
To effectively change both the table header, and the display information the corresponding groups of code must be ordered similarly. To invert the order of line 18 & 19, without inverting the order of lines 28 & 29 would leave you with your replies count under your author information, and your author information under your replies table header.
So here are the corresponding lines of code:
Lines 17 & Line 26-27.
Lines 18 & 28.
Lines 19 & 29.
Lines 20 & 30.
Lines 21 & 31.
Note: that line 25 does not have a correponding line of code, and affects the folder icon to the right of the topic. |
|
|