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
Suggestion (if it's not terribly difficult)
16 November, 2012
12:39 am
Rich Brown
Parkville, MD
Guru
Members
Forum Posts: 358
Member Since:
13 July, 2009
sp_UserOfflineSmall Offline

Any possibility of getting a short-code which would show the number of times a sermon has been listened to/clicked on?

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

16 November, 2012
7:30 pm
Ben Miller
Appleton, WI, USA
Moderator
Members

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

Rich, I assume you are talking about a template tag that you would use in your Sermon Browser template, right?  Would you want the count to appear on the list of sermons page (Search Results template) or the single sermon page (Sermon Page template), or both?

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

17 November, 2012
12:02 am
Rich Brown
Parkville, MD
Guru
Members
Forum Posts: 358
Member Since:
13 July, 2009
sp_UserOfflineSmall Offline

Ben Miller said
Rich, I assume you are talking about a template tag that you would use in your Sermon Browser template, right?  Would you want the count to appear on the list of sermons page (Search Results template) or the single sermon page (Sermon Page template), or both?

On the single-sermon page would be good, and not all of them... just some of them.

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

17 November, 2012
4:56 am
Ben Miller
Appleton, WI, USA
Moderator
Members

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

Rich, I think I've got a solution for you, and it's not too hard.  It's a couple of small edits to dictionary.php, which is in the /wp-content/plugins/sermon-browser/sb-includes/ folder.  It seemed to work for me on my test site, so if you decide to try it out on your site, let me know if it works or not.

Before editing, make sure you backup the file, just in case you make a mistake (or I made a mistake).

dictionary.php is a relatively short file, and it has two functions in it.  The first one, sb_search_results_dictionary(), defines all of the template tags that you can use in the Search Results template.  The second one, sb_sermon_page_dictionary(), defines the Single Sermon Page template tags.  We can add this template tag to both lists.

At the end of the sb_search_results_dictionary() function, after the last template tag line that you have, add the following line:

http://pastebin.com/SBt3Lr6D

(Note: When you visit the link, it might look like there are two lines there, but it is just wrapped.  Put it all on one line.)

At the end of the sb_sermon_page_dictionary() function, add this line:

http://pastebin.com/GpbBWh8q

The two lines are slightly different for the different templates, so don't get them mixed up.

After you make any changes to dictionary.php, you need to go to the Sermon Browser Templates (Sermons, Templates) and click the Save button.  This loads the new definitions from dictionary.php into Sermon Browser.

Now you can start using the template tag.  It is:

(square-bracket)sermon_stats(square-bracket)

(Square bracket characters are bad for the forum, so I had to spell it out here.)

So in your template, you can put something like this:

Listened to (square-bracket)sermon_stats(square-bracket) times.

Let me know if you have any trouble.  One other note: These stats are only as good as the ones that show up in the control panel Sermons list.  I think they only increment when someone listens or downloads from your WordPress site.  If someone grabs it via RSS feed or podcast, I don't think it increments.

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

17 November, 2012
5:02 am
Ben Miller
Appleton, WI, USA
Moderator
Members

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

One other note I forgot to mention: If you use this template tag in the Search Results template, make sure you put it inside the (square-bracket)sermons_loop(square-bracket) tags.  Otherwise it won't work.

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

17 November, 2012
6:50 am
Rich Brown
Parkville, MD
Guru
Members
Forum Posts: 358
Member Since:
13 July, 2009
sp_UserOfflineSmall Offline

Ben Miller said
One other note I forgot to mention: If you use this template tag in the Search Results template, make sure you put it inside the (square-bracket)sermons_loop(square-bracket) tags.  Otherwise it won't work.

Works like a charm.  Thanks Ben.

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

17 November, 2012
9:43 pm
Rich Brown
Parkville, MD
Guru
Members
Forum Posts: 358
Member Since:
13 July, 2009
sp_UserOfflineSmall Offline

Ben Miller said
One other note I forgot to mention: If you use this template tag in the Search Results template, make sure you put it inside the (square-bracket)sermons_loop(square-bracket) tags.  Otherwise it won't work.

The only problem I had was on the Search page.  No matter where I put the tag in the "sermon_loop" tag, all the verbiage and all the counts appeared at the top of the Search page, instead of under each individual sermon.  Like this (but at the very top):

 

"This sermon has been downloaded 2 times. This sermon has been downloaded 9 times. This sermon has been downloaded 18 times. This sermon has been downloaded 35 times. This sermon has been downloaded 36 times. This sermon has been downloaded 31 times. This sermon has been downloaded 56 times. This sermon has been downloaded 52 times. This sermon has been downloaded 67 times. This sermon has been downloaded 56 times."

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

18 November, 2012
4:19 am
Ben Miller
Appleton, WI, USA
Moderator
Members

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

Rich Brown said

The only problem I had was on the Search page.  No matter where I put the tag in the "sermon_loop" tag, all the verbiage and all the counts appeared at the top of the Search page, instead of under each individual sermon.  Like this (but at the very top):

That's strange.  It worked great for me on my test site.  If you want to troubleshoot it, post your Search results template at http://pastebin.com and I'll take a look.  I know you said that you don't really want it on your Search results page anyway, so if you don't feel like troubleshooting, then don't worry about it.

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

Forum Timezone: Europe/London
Most Users Ever Online: 381
Currently Online:
Guest(s) 5
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