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
Automatic Series image on Sermon page
9 January, 2013
6:59 pm
Jared
Enthusiast
Members
Forum Posts: 11
Member Since:
9 January, 2013
sp_UserOfflineSmall Offline

 This tutorial will put your Sermon series image on the top of every Sermon associated with the Series.

Example:  http://calvaryeast.com/message.....mon_id=174

 

Creating the [series_id] tag --->

head to   /wp-content/plugins/sermon-browser/sb-includes/dictionary.php

or if in wordpress admin navigate to

Plugins>editor   choose Sermon Browser

open       sermon-browser/sb-includes/dictionary.php

scroll to the bottom

paste this code before the closing brackets.

It should look like this.

'[series_id]' => ' series); echo str_replace(" ", "-", $temp_series_id); ?>',

         );

     }

?>

 

Calling up the right Image--->

 sermons>templates>sermon page


On the left navigation bar you should see the Sermons tab.

Open it and click on "Templates"

 

In the "Sermon Page" window
 just below the first line enter this code

 

it should look like this

     

<div class="sermon-browser-results">
     <div class="series-banner"><img src="http://[your-domain]/wp-content/uploads/[series_id].jpg"/>
     </div>

 

(you can change the "series-banner" class to whatever you want but I'll be using that for styling later.)

Naming your Images -->


There are two things you will need to do to make sure that you actually get an image.

 

First: Use your series title to name your images when you upload them into wordpress.

for example: If the series is titled Life of Jesus. name your image "Life of Jesus.jpg"

DO NOT add anything to the end. "Life of Jesus banner.jpg" will get you nothing.

 

Second: Wordpress does two things to the file names when you upload them.

First it replaces all empty space with hyphens. So "Life of Jesus.jpg" becomes "Life-of-Jesus.jpg"

Don't worry about it that's taken care of. Just be sure to use "space" or "hyphens" to separate words in your file names. underscores won't work. (it needs to be the same as the series title.)

 

Second it automatically places all of the files into folders by month and year... we need to turn this off or our code won't find the image.

In the wordpress admin screen, open up

'settings>media'

Right above the "Save Changes" button you will see the option to organize by month and year.

Make sure this is UNCHECKED.

 

And BOOM! your series images show at the top of the sermon page.

 

Big Thanks to Ben for helping me figure this out, and trouble shooting that php code.

18 January, 2013
8:24 pm
Matt Schlueter
Dodgeville, WI USA
Guru
Members
Forum Posts: 93
Member Since:
19 November, 2009
sp_UserOfflineSmall Offline

Very nice!  Thanks for sharing this!

Matt Schlueter, Multimedia Coordinator
Dodgeville United Methodist Church -- Dodgeville, WI

5 February, 2013
4:25 am
krunnels
New Member
Members
Forum Posts: 1
Member Since:
5 February, 2013
sp_UserOfflineSmall Offline

i could really use this on our church site. I followed everything you mention above, but no success. Can you offer any assistance. Thank you in advance.

5 February, 2013
7:20 pm
Ben Miller
Appleton, WI, USA
Moderator
Members

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

krunnels,

Can you post a link to your site, so we can take a look?

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

5 February, 2013
7:25 pm
Jared
Enthusiast
Members
Forum Posts: 11
Member Since:
9 January, 2013
sp_UserOfflineSmall Offline

What is it doing?

Not calling up the image? not calling up the right image?

8 July, 2013
7:53 am
Dan Godde
Member
Members
Forum Posts: 3
Member Since:
8 July, 2013
sp_UserOfflineSmall Offline

I am having the same problem as krunnels.  I don't get any image come up at all. I followed the exact instructions in Jared's first post.  I think I need to do something with "series-banner" maybe?  (I'm pretty newb at this).

Website is http://floodingcreek.com/sermo.....ermon_id=8

Thanks.

 

8 July, 2013
7:57 am
Dan Godde
Member
Members
Forum Posts: 3
Member Since:
8 July, 2013
sp_UserOfflineSmall Offline

Solved it myself.  Didn't substitute floodingcreek.com for [yourdomain] in template addition.  Awesome.  Thanks Jared for a great tutorial.

8 July, 2013
6:40 pm
Jared
Enthusiast
Members
Forum Posts: 11
Member Since:
9 January, 2013
sp_UserOfflineSmall Offline

Hey Dan, 

 

I'm glad it worked out. If you have any other problems let me know. :-)

 

Jared

15 July, 2013
4:09 am
Dan Godde
Member
Members
Forum Posts: 3
Member Since:
8 July, 2013
sp_UserOfflineSmall Offline

Important note for updates: when the plugin is updated you must re-add the line to dictionary.php and you must press the button to save your templates again, otherwise the links won't work.  (Well that's what happened to me for 0.45.9)

15 July, 2013
10:52 pm
Ashley Hsu
New Member
Members
Forum Posts: 2
Member Since:
15 July, 2013
sp_UserOfflineSmall Offline

Hi,

Thanks for this tutorial! I was able to add a series image for the individual page for each sermon.

 

Is there a way to extend this functionality so that it works for the search pages as well? I tried adding the [series_id] php code to the part of /wp-content/plugins/sermon-browser/sb-includes/dictionary.php that works for sb_search_results_dictionary instead of just sb_sermon_page_dictionary, but when I try to add these lines inside of [sermon_loop]

 

<tr> 

<td class = "series_banner"> <img src = "http://livingwaterberkeley.org/wp-content/uploads/[series_id].jpg"/> </td></tr>

 

the sermons disappear on the actual page. 

 

Any help or suggestions would be appreciated! Thanks!

16 July, 2013
1:28 am
Jared
Enthusiast
Members
Forum Posts: 11
Member Since:
9 January, 2013
sp_UserOfflineSmall Offline

Hi Ashley, 

 

I'll take a look and see what I can come up with.

 

Jared.

 

16 July, 2013
5:00 am
Ben Miller
Appleton, WI, USA
Moderator
Members

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

Ashley,

I haven't looked at your site yet, but here are some thoughts to get you started.  In dictionary.php, there are two functions.  The first, sb_search_results_dictionary, defines template tags that can be used in the search results template.  The second, sb_sermon_page_dictionary, defines the template tags for the sermon page template.  Jared's tutorial only shows the code for the [series_id] tag in the sermon page template, so if you didn't add any code into the sb_search_results_dictionary function, you won't be able to use the template tag in the search results template.

You can add the template tag to the sb_search_results_dictionary function.  The code will need to be slightly different to work in that function.  Try adding this code to the end of the sb_search_results_dictionary function:

http://pastebin.com/xFtgR1ua

After you've added that code into dictionary.php, go to your Sermons, Templates admin page and hit the Save button to load in the new template tag definitions.  Then you should be able to use [series_id] in the search results template.

Note: I haven't tried out the code yet, so let us know if it works for you.  :)

Let us know if you have any questions.

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

18 July, 2013
7:58 am
Ashley Hsu
New Member
Members
Forum Posts: 2
Member Since:
15 July, 2013
sp_UserOfflineSmall Offline

Ben and Jared -

 

It works! Thank you so much!

 

The sermon site is http://www.livingwaterberkeley.....ia/sermons if you'd like to see how it looks. After I added in the dictionary php code, I added html code to call up the image right after it says [sermons_loop] in the template for search result page.

 

For future reference, what made this php definition from the previous one? Is it because the search result page uses a different variable for $sermon than the regular sermon page?

 

-Ashley

18 July, 2013
3:20 pm
Ben Miller
Appleton, WI, USA
Moderator
Members

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

Ashley,

The search results template tags are used in a different part of the software than the sermon page template tags.  (See sermon.php, function sb_shortcode to see this.  The "eval" statement with 'single_output' in it is the sermon page template, and the "eval" statement with 'search_output' is the search results template.) 

As a result, the $sermon variable is defined differently in the two contexts.  In the search results template, $sermon contains an object with the current sermon data.  ($sermon actually gets defined in the [sermons_loop] template tag.)  In the sermon page template, this same sermon object is contained in $sermon["Sermon"].

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