Topic RSS
4:19 pm
6 April, 2009
OfflineI have a lot of sermon mp3 files where I don't know the date they were preached.
If I leave date field on the Add New Sermon Page blank, sermon-browser (because of a PHP function line 1626 of sermon.php and the need to store dates in an SQL DATE format) converts this to '1970-01-01'.
I have tweaked the files to display "Unknown" if the date is stored as '1970-01-01' which for most of my files is correct. The only downside is if you actually had a file of a sermon preached on that one day (probably less likely than having sermons with unknown dates) – it would display as 'Unknown' Date!
Here are the tweaks:
sermon.php line 1563 change from:
<td><?php echo $sermon->date ?></td>
to:
<td><?php if ($sermon->date='1970-01-01') {echo 'Unknown';} else {echo $sermon->date;} ?></td>
frontend.php[function sb_formatted_date] change end line (480) from:
return date_i18n(get_option("date_format"), strtotime($sermon->date.' '.$sermon_time));
to:
if ($sermon->date='1970-01-01') {return 'Unknown Date';} else {
return date_i18n(get_option("date_format"), strtotime($sermon->date.' '.$sermon_time));
}
That's it! Hope that helps someone else!
Most Users Ever Online: 40
Currently Online: 0be1
13 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
malpan - 2453
jogen - 2440
VanWatterson - 652
GeraldSebring - 364
LucasWoltman - 362
RandellFeenstra - 362
Member Stats:
There have been 7 guest posters
There are 1936 members
There are 1 moderators
There are 1 admins
Forum Stats:
Groups: 1
Forums: 2
Topics: 971
Posts: 3747
Newest Members: twinton, ellison13579, Daigh, mchunful, jesua, LGRG Design
Moderators: Ben Miller (383 )
Administrators: Mark Barnes (425)
Log In
Register
Home



