Display time only if date is today or yesterday
This modification is in the archives.
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> Code:
$lastpostinfo[lastpostdate] <if condition="!$show['detailedtime']"> <if condition="(($lastpostinfo[lastpostdate]=='Today')||($lastpostinfo[lastpostdate]=='Yesterday'))"> <span class="time">$lastpostinfo[lastposttime]</span> </if> </if> 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
|