Knowledge Base

Add an "Author" column to Prosilver
Article ID: 1035
Written By: Christian 2.0
Written On: Sun Apr 18, 2010 1:59 pm
Description: Add a Subsilver2-inspired "Author" column to Prosilver's viewforum page.
link to this article on phpbb.com: Select All
[kb=add-an+quotauthor+quot-column-to-prosilver]Add an "Author" column to Prosilver[/kb]
link to this article on your own board: Select All
[url=http://www.phpbb.com/kb/article/add-an+quotauthor+quot-column-to-prosilver/]Knowledge Base - Add an "Author" column to Prosilver[/url]

Introduction
One of the noticeable differences between Prosilver and Subsilver2 is the lack of "Author" column in viewforum. With a few simple edits it's possible to add this column whilst still maintaining a consistent structure across the rest of your board.

What we'll achieve in this guide:
Image

CSS Edits
Firstly, we will reduce the width of the "last post" column to accommodate the new "Author" column. Then we'll add a new CSS class for the Author column so that it displays correctly.

Open: /styles/prosilver/theme/content.css

Find:
Code: Select all
dd.lastpost {
   width: 25%;
   font-size: 1.1em;
}

Replace with:
Code: Select all
dd.lastpost {
   width: 15%;
   font-size: 1.1em;
}

Find:
Code: Select all
dd.posts, dd.topics, dd.views {
   width: 8%;
   text-align: center;
   line-height: 2.2em;
   font-size: 1.2em;
}

Below, Add:
Code: Select all
dd.author {
   width: 10%;
   text-align: center;
   line-height: 2.2em;
   font-size: 1.2em;
}


HTML Edits
Now we're going to physically add the new column to viewforum. We'll also remove the post author from below the Topic Title as there's no need to have it twice - and it'll look a lot cleaner.

Open: /styles/prosilver/template/viewforum_body.html

Find:
Code: Select all
<dd class="posts">{L_REPLIES}</dd>

Before, Add:
Code: Select all
<dd class="author">{L_AUTHOR}</dd>

Find:
Code: Select all
<dd class="posts">{topicrow.REPLIES} <dfn>{L_REPLIES}</dfn></dd>

Before, Add:
Code: Select all
<dd class="author">{topicrow.TOPIC_AUTHOR_FULL}</dd>

Find:
Code: Select all
<!-- IF topicrow.ATTACH_ICON_IMG -->{topicrow.ATTACH_ICON_IMG} <!-- ENDIF -->{L_POST_BY_AUTHOR} {topicrow.TOPIC_AUTHOR_FULL} &raquo; {topicrow.FIRST_POST_TIME}

Replace with:
Code: Select all
<!-- IF topicrow.ATTACH_ICON_IMG -->{topicrow.ATTACH_ICON_IMG} <!-- ENDIF -->{L_POSTED} &raquo; {topicrow.FIRST_POST_TIME}


Finishing off
Save and Upload the modified files.

To see the changes take effect, you need to refresh your theme and template cache:
Admin Panel -> Styles Tab -> Style Components -> Themes -> Prosilver -> Refresh
Admin Panel -> Styles Tab -> Style Components -> Templates -> Prosilver -> Refresh
.

Assuming you followed the instructions correctly you'll now have a nice clean Author column, just like Subsilver2. These edits should work on Prosilver based styles.

Enjoy :)