Monday, April 6, 2009

Digitalpoint Style "days old" phpBB3 MOD

One of the things I like about the Digitalpoint forum listings is that little gray indicator to the right of thread titles that lets you know how old a topic is in days. I don't think I've seen this handy little notice anywhere other than Digitalpoint (at least before now) and it kinda boggles my mind as to why.

Especially for phpBB3 forums, where adding it is as simple as adding a single line in three files.
Here's a screenshot of the prosilver theme with the MOD applied.

phpBB3 days old mod

And here's what needs to be done, and the order to do it so you don't get any errors during the change.

First open /language/en/viewforum.php and find the following line,
 'VIEW_FORUM_TOPICS'  => '%d topics',


After that line add this line and then save/upload the file.
 'OLD'     => 'old',


Next open /viewforum.php and find the following line,
   'TOPIC_TITLE'  => censor_text($row['topic_title']),


After that line add the following line then save/upload the file.
   'TOPIC_AGE_DAYS' => round((time() - $row['topic_time']) / 86400),


Next open /styles/prosilver/template/viewforum_body.html and find the following piece of code which will be at the end of the line it is on.
<a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a>


After that line add the following line then save/upload the file.
<!-- IF topicrow.TOPIC_AGE_DAYS > 0 --><small style="color:#999;"> - {topicrow.TOPIC_AGE_DAYS} <!-- IF topicrow.TOPIC_AGE_DAYS > 1 -->{L_DAYS}<!-- ELSE -->{L_DAY}<!-- ENDIF --> {L_OLD}</small><!-- ENDIF -->


Once those changes are made, clear the cache from the ACP and you should be up and running.

No comments: