|
|
Joined: Sep 2004
Posts: 8
Lurker
|
Lurker
Joined: Sep 2004
Posts: 8 |
Mod Name / Version: Today and Yesterday Description: You know how some forums list posts with the date showing "Today" or "Yesterday" as the post date (instead of or in addition to the actual dates)? This mod makes a simple change to ubbt.inc.php to add this functionality. Working Under: UBB.Threads 6.4 Mod Status: Beta Any pre-requisites: Author(s): bostongio Date: 06/20/05 Credits: Other forum software Files Altered: ubbt.inc.php New Files: Database Altered: No Info/Instructions: In ubbt.inc.php Find (under Convert the time): <br /> if ($timeformat == "short1") {<br /> $time = @date("m/d/y h:i a", $time);<br /> }<br /> elseif ($timeformat == "short2") {<br /> $time = @date("d/m/y h:i a", $time);<br /> }<br /> elseif ($timeformat == "short3") {<br /> $time = @date("y/m/d h:i a", $time);<br /> }<br /> elseif ($timeformat == "short4") {<br /> $time = @date("d/m/Y H:i", $time);<br /> }<br /> elseif ($timeformat == "short5") {<br /> $time = @date("H:i d/m/Y", $time);<br /> }<br /> elseif ($timeformat == "long") {<br /> $time = @date("D M d Y h:i a", $time);<br /> }<br /> Replace with:<br />// Still show the date in addition to the words "Today" and "Yesterday"? 1 = Yes, 0 = No<br /><br />$j_show_moddate = 1;<br /><br /><br /> $j_today = date("m/d/y");<br /> $j_yesterday = date("m/d/y", strtotime("-1 day"));<br /> $j_tdate = @date("m/d/y", $time);<br /> $j_time = @date("h:i a", $time);<br /><br /> if ($j_show_moddate) {<br /> $j_showdate = "($j_today)";<br /> $j_showyester = "($j_yesterday)";<br /> }<br /><br /> if ($j_tdate == $j_today) {<br /> $time = "Today $j_showdate at ".$j_time;<br /> }<br /> elseif ($j_tdate == $j_yesterday) {<br /> $time = "Yesterday $j_showyester at ".$j_time;<br /> }<br /> else {<br /><br /> if ($timeformat == "short1") {<br /> $time = @date("m/d/y h:i a", $time);<br /> }<br /> elseif ($timeformat == "short2") {<br /> $time = @date("d/m/y h:i a", $time);<br /> }<br /> elseif ($timeformat == "short3") {<br /> $time = @date("y/m/d h:i a", $time);<br /> }<br /> elseif ($timeformat == "short4") {<br /> $time = @date("d/m/Y H:i", $time);<br /> }<br /> elseif ($timeformat == "short5") {<br /> $time = @date("H:i d/m/Y", $time);<br /> }<br /> elseif ($timeformat == "long") {<br /> $time = @date("D M d Y h:i a", $time);<br /> }<br /> }<br /><br /> Disclaimer: Please backup every file that you intend to modify. If the modification modifies the database, it's a good idea to backup your database before doing so.
Note: If you modify your UBB.Threads code, you may be giving up your right for "official" support from Infopop.If you need official support, you'll need to restore unmodified files.
|
|
|
|
Joined: Mar 2000
Posts: 21,079 Likes: 3
I type Like navaho
|
I type Like navaho
Joined: Mar 2000
Posts: 21,079 Likes: 3 |
|
|
|
|
Joined: Jan 2005
Posts: 39
User
|
User
Joined: Jan 2005
Posts: 39 |
Any suggestion for v6.5? 
|
|
|
|
Joined: Sep 2004
Posts: 8
Lurker
|
Lurker
Joined: Sep 2004
Posts: 8 |
I don't have copies of the other versions, so I can't check out and see if the code is similar or the same. Does such a subroutine exist in ubbt.inc.php in 6.5? If so, the mod should work just fine.
|
|
|
|
Joined: Jan 2005
Posts: 39
User
|
User
Joined: Jan 2005
Posts: 39 |
[] bostongio said:I don't have copies of the other versions, so I can't check out and see if the code is similar or the same. Does such a subroutine exist in ubbt.inc.php in 6.5? If so, the mod should work just fine. [/] Unfortunately it doesn't 
|
|
|
|
Joined: Sep 2004
Posts: 8
Lurker
|
Lurker
Joined: Sep 2004
Posts: 8 |
Hmmm, how does 6.5 handle time conversion? I suspect the function is still in the code, but perhaps they just moved it or renamed it... Because there has to be a function to handle formatting the time and date to the board preferences....
You could do a grep on timeformat or convert_time and see if it appears in some other file elsewhere. Sorry, if I get a chance I'll download a copy of 6.5 and look for it myself...
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 417
Joined: November 2001
|
|
Forums63
Topics37,575
Posts293,930
Members13,823
|
Most Online6,139 Sep 21st, 2024
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|
|