Forum

Please consider registering
guest

Log In Register

Register | Lost password?
Advanced Search:

— Forum Scope —



— Match —



— Forum Options —




Wildcard usage:
*  matches any number of characters    %  matches exactly one character

Minimum search word length is 3 characters - maximum search word length is 84 characters

Topic RSS
Enhancement: Sermons with Unknown Date
13 April, 2009
4:19 pm
cybersheep100
Enthusiast
Forum Posts: 13
Member Since:
6 April, 2009
Offline

I 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!

17 April, 2009
10:54 am
Mark Barnes
Admin
Forum Posts: 425
Member Since:
14 December, 2005
Offline

Thanks! I've added these fixes to 0.42.3. There's a minor bug in your code, so I recommend everyone else wait for the new version rather than apply the fix themselves. (It should be == not just = ).

Forum Timezone: Europe/London

Most Users Ever Online: 40

Currently Online:
14 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:

Guest Posters: 7

Members: 2062

Moderators: 1

Admins: 1

Forum Stats:

Groups: 1

Forums: 2

Topics: 1071

Posts: 4042

Newest Members: richdorm, Aaron Velasquez, aaronv, dave5884, tomduckering, ccwebb

Moderators: Ben Miller (386)

Administrators: Mark Barnes (425)

Comments are closed.