Forum

This forum is now read-only. Support is provided at https://wordpress.org/support/plugin/sermon-browser/

Please consider registering
guest
sp_LogInOut Log In sp_Registration Register
Register | Lost password?
Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Feed Topic RSS sp_TopicIcon
Ok since Ben was so helpful... I will push my luck: Is there a way to get SB to detect and display the length of each sermon?
17 November, 2012
10:07 pm
Rich Brown
Parkville, MD
Guru
Members
Forum Posts: 358
Member Since:
13 July, 2009
sp_UserOfflineSmall Offline

I realize I could simply type the length of each MP3 in the comments section... Do you think this is possible?

Rich Brown
Aisquith Presbyterian Church
Parkville, Maryland, USA
sermons.aisquith.org

18 November, 2012
5:50 am
Ben Miller
Appleton, WI, USA
Moderator
Members

Moderators
Forum Posts: 1628
Member Since:
18 June, 2009
sp_UserOfflineSmall Offline

This one requires edits to two different files. Remember, always backup the files before you make any changes, so that you can go back if something goes wrong.

First, a new function needs to be added to the end of /wp-content/plugins/sermon-browser/sb-includes/frontend.php.  Add this function to the end of the file (right BEFORE the last "?>" line):

http://pastebin.com/GRNdnJyj

The function is called sb_mp3_duration2().

After you make this change, load your sermons page, just to make sure you don't see any errors.

Next, you need to add the template tag to both functions in /wp-content/plugins/sermon-browser/sb-includes/dictionary.php.  This time, the code is the same for both functions.  So at the end of each function in dictionary.php, add the following code:

http://pastebin.com/5TTW4bcm

After you make any changes to dictionary.php, you need to go to the Sermon Browser template screen and hit the Save button to load in the new definitions.

Now you are ready to change your templates to use the new tags.  The tag is file_duration, and it is only valid inside the files_loop tags.  So your template might have something like this:

Duration:(square-bracket)file_duration(square-bracket)

inside your files_loop tags.

It worked for me in both templates on my test site.  Let me know if it works on your site.

Ben Miller, Pathways Church, Appleton, Wisconsin, USA
Read the new FAQ, last updated 11/21/2013
Announcing version 0.45.12

18 November, 2012
8:54 pm
Rich Brown
Parkville, MD
Guru
Members
Forum Posts: 358
Member Since:
13 July, 2009
sp_UserOfflineSmall Offline

Ben - my new nickname for you will be Santa Claus, ha ha.  Thanks!!!!!  works great!

Rich Brown
Aisquith Presbyterian Church
Parkville, Maryland, USA
sermons.aisquith.org

Forum Timezone: Europe/London
Most Users Ever Online: 381
Currently Online:
Guest(s) 8
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Rich Brown: 358
Matt Schlueter: 93
Mindy: 72
Don Johnson: 65
anointed: 57
0be1: 55
Member Stats:
Guest Posters: 7
Members: 3188
Moderators: 1
Admins: 1
Forum Stats:
Groups: 1
Forums: 2
Topics: 1713
Posts: 7499
Newest Members:
marktest, deatles50, ValeriaGoodriz, dapedPup, oapedPup, Margarettoimb
Moderators: Ben Miller: 1628
Administrators: Mark Barnes: 435