Back to vBulletin 3.0 Add-Ons

Display time only if date is today or yesterday
Mod Version: 1.00, by coolegg

This modification is in the archives.
vB Version: 3.0.3 Rating: (0 vote - 0 average) Installs: 2
Released: 29 Jan 2005 Last Update: Never Downloads: 0
Not Supported Template Edits  

This is just the tiniest little mod, but some of you may find it useful.

I am big on keeping my sites as simple as possible for the surfer and not overloading them with useless information. So it has always bothered me to see the time displayed at various spots in my vB when it isn't important to do so. But the downside of disabling the time display site-wide is that it IS important sometimes.

So for example if a post was made today then I think the exact time it was made may be important to the surfers (was it 1 hour ago or 18 hours ago?). But if the post was made 4 months ago then who cares what the exact time was? - it's just brain clutter for the surfer.

So this little mini-mod will display the time in your template bits if the date is "Today" or "Yesterday", but disable the exact time for dates older than that.

It's VERY easy to do. The example below shows the mod for the forumhome_lastpostby template but it can also be done on the threadbit template and anywhere else where both the date and time are currently displayed by the template.

Template: forumhome_lastpostby
Find this:
Code:
$lastpostinfo[lastpostdate] 
<if condition="!$show['detailedtime']">
<span class="time">$lastpostinfo[lastposttime]</span>
</if>
Change it to:
Code:
$lastpostinfo[lastpostdate] 
<if condition="!$show['detailedtime']">
<if condition="(($lastpostinfo[lastpostdate]=='Today')||($lastpostinfo[lastpostdate]=='Yesterday'))">
<span class="time">$lastpostinfo[lastposttime]</span>
</if>
</if>
The attached image illustrates the effect of the change - time is only displayed if the date is Today or Yesterday.

Edit: This mod requires that you have the Yesterday/Today feature enabled under Date and Time Display Settings in Admin.

Download

No files for download.

Screenshots

 


vblts.ru supports vBulletin®, 2022-2024