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: 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)

 

Comments are closed.