Hi, love the plugin, it has made my job a whole lot easier.
regarding the 'part of the series' text that displays below the sermon title, is there an easy way to stop it from displaying if the sermon is not part of a series? I am hoping i have just missed something obvious.
Love the plugin. Just starting a site where it will be used but the pastors in the church don't really do "series" sermons much so want to wrap the following code
(Part of the [series_link] series).
in a conditional statement where if there isn't a series, then that text doesn't print.
A wordaround like this should suffice until other code enhancements to the plugin are made. However, I'm pretty new to WP and just now diving into the code. Can someone help me out with a snippet that will work? I've tried a couple of if structures but with no joy. I can't seem to test what is in [series_link] when it is evaluated.
Post edited 11:30 pm – 15 October, 2009 by gjertsen Post edited 11:31 pm – 15 October, 2009 by gjertsen Post edited 11:31 pm – 15 October, 2009 by gjertsen
I'm sure there are more elaborate or sophisticated solutions, but what I did was essentially hack the plugin's dictionary.php file. Inside the function sb_search_results_dictionary(), add a new tag like this:
I'm sure there are more elaborate or sophisticated solutions, but what I did was essentially hack the plugin's dictionary.php file. Inside the function sb_search_results_dictionary(), add a new tag like this:
This tag will either return nothing, or else return the string "(Part of the SERIES series.)"
That doesn't work for me. It does, indeed, remove the "series" info but when I click on the sermon title to read the scripture it tells me that the sermons cannot be found.
Rich Brown Webmaster, Aisquith Presbyterian Church Parkville, Maryland, USA sermons.aisquith.org
Post edited 4:46 pm – 20 October, 2009 by tyhilltx
@gjertsen, I appreciate the posts and time. I did get this to work. One thing that might slip someone up though is you using [series_link_new] above, you would then need to change the template to use that same shortcode. This might save someone a few minutes of head scratching.
While I believe the plugin is solid and I am happy to use it and donate to it for every site I use sermon browser on, it is not a good assumption that every sermon is part of a series. I would like to see this "workaround" be incorporated into the code so that if no series is selected when adding a sermon that code would not be output from the script. I think there is a features request forum that I will add this to.
Ok…I have swapped out the code, adjusted the template but still no cigar. I have tried adding the new code and then replacing old code with new but nada. What am i missing??
While the hack might work for some, I think this is a basic feature that should be included in this plugin. I'm not complaining – this is a fantastic plugin; however, there are quite a few preachers out there that don't do a lot of series. It would be nice to be able to keep the option in there (not remove the series from the templates), but also not have it displayed if not part of a series.
Anybody got any other workarounds? I created a series called "General" which would encompass anything that doesn't really belong to any other series. Now what would I need to do (that wouldn't get broken with a plugin update) that would allow me to hide the "part of series" when the series is "General"? Anybody?
Post edited 12:13 am – 22 January, 2010 by Tel7 Post edited 12:17 am – 22 January, 2010 by Tel7 Post edited 12:19 am – 22 January, 2010 by Tel7 Post edited 12:21 am – 22 January, 2010 by Tel7 Post edited 12:21 am – 22 January, 2010 by Tel7 Post edited 1:28 am – 4 February, 2010 by Tel7
Hi guys.
I have an improvement on the above, and a problem.
I'm very new to WordPress (this is my first modification), and I'm using WordPress 2.9.1 with SermonBrowser 0.42.4. I've also been trying to remove the series phrase from:
- The Search results page (which has worked).
– The Sermon page (which isn't working).
To do this, I've taken gjertsen's code above (thanks), and modified it as follows:
– Rename the variable from [series_link_new] to [series_phrase], since it is more than a link.
– Include the original hyperlink in the variable.
– Add a "-" item to the list of series (my alternative to mwbarker's "General" item), which is what I will select if the sermon is not part of a series, which will prevent the series phrase from appearing.
Here's the code I added:
'[series_phrase]' => '<?php if ($sermon->series != "-") { ?> (Part of the <a href="<?php sb_print_series_link($sermon) ?>"><?php echo stripslashes($sermon->series) ?></a> series)<?php } ?>',
I'm not sure if this is the best way to do it, but I used the WordPress admin webpage to add this code, via Plugins > Editor > Sermon Browser > Select plugin to edit: Sermon Browser > Select > sermon-browser/sb-includes/dictionary.php, then I inserted the code after the line which defined "[series_link]". I then clicked Update File.
Then I went into Sermons > Templates (below Add Sermon, etc), and changed the Search results page, from this:
<td class="sermon-passage">[first_passage] (Part of the [series_link] series).</td>
But then I did the same kind of thing for the Sermon page (which I found the next pane down on that Templates window), and I found the code which said this:
Part of the [series_link] series, preached at a [service_link] service<br />
and just as a test (needs work to tidy it up), I changed it to this:
[series_phrase], preached at a [service_link] service<br />
But after saving, when I visited the Sermon webpage I got this kind of thing:
"[series_phrase], preached at a Sunday Morning service"
where I was hoping for the CONTENTS of the [series_phrase] variable to display (as it did for the Search results page), not the variable name itself!
Note: I didn't have to deactivate SermonBrowser during any of the above changes.
Questions:
a) Any ideas why the [series_phrase] variable is being displayed correctly for the Search results page, but the variable name itself is displaying for the Sermon page?
b) Is my general method of editing, the best/easiest way to achieve the above (i.e. am I editing the correct files via appropriate means)?
(BTW mwbarker, hopefully the above helps you (just change my "-" to "General"), but I have no idea how to make such changes plugin-update proof.)
Post edited 4:21 am – 12 February, 2010 by Tel7 Post edited 4:55 am – 12 February, 2010 by Tel7 Post edited 5:02 am – 12 February, 2010 by Tel7
Hi again guys,
Sorry for the delay in responding (to my post above). I worked out the answer to my question a) some weeks ago (still not sure on b)). Having further studied the dictionary.php code, I found that there are 2 functions:
sb_search_results_dictionary()
and
sb_sermon_page_dictionary().
The 1st is for the Search results page only, and the 2nd is for the Sermon (detail) page only. I was previously putting my Sermon page code in the sb_search_results_dictionary() function, where I should have put it in the sb_sermon_page_dictionary() function.
I also upgraded from SermonBrowser 0.42.4 to 0.43.5 (not that that seemed to help with these issues).
I've now written code to make the following changes:
To print nothing when:
- There is no series
- There is no service
- There are no verses (Sermon page issue only, which usually prints "()" when there are none)
- There are no tags (Sermon page issue only).
No Series / Service issues
First I added these records:
- A series called '-' (I select this when there is no series).
- A service called '-' with a time of say '00:00′ (I select this when there is no service).
Then I changed the code as follows:
dictionary.php: function sb_search_results_dictionary():
Insert this:
'[series_phrase1]' => '<?php if ($sermon->series != "-") { ?> (Part of the <a href="<?php sb_print_series_link($sermon) ?>"><?php echo stripslashes($sermon->series) ?></a> series)<?php } ?>',
'[service_phrase1]' => '<?php if ($sermon->service != "-") { ?> (<a href="<?php sb_print_service_link($sermon) ?>"><?php echo stripslashes($sermon->service) ?></a>)<?php } ?>',
dictionary.php: function sb_sermon_page_dictionary():
Insert this:
'[series_phrase2]' => '<?php if ($sermon["Sermon"]->series != "-") { ?>Part of the <a href="<?php sb_print_series_link($sermon) ?>"><?php echo stripslashes($sermon["Sermon"]->series) ?></a> series.<br /><?php } ?>',
'[service_phrase2]' => '<?php if ($sermon["Sermon"]->service != "-") { ?>Preached at a <a href="<?php sb_print_service_link($sermon["Sermon"]) ?>"><?php echo stripslashes($sermon["Sermon"]->service) ?></a> service.<br /><?php } ?>',
However, I can't actually get tags to appear even when I've entered tags (I just get the "Tags:" label), so I ended up not doing any of the above tags changes, and just commented out the tags template code like this:
<!—
Tags don't seem to display, so commenting this out for now. 2010-02-03
<p class="sermon-tags">Tags: [tags]</p>
—>
Best to put comments with all your changes. If you don't know how, just ask.
Post edited 2:42 am – 14 February, 2010 by webservant
Tel7, Mvejvoda, and Ben – I am in the presence of Geeky Greatness. Thank you all so much for the valuable contributions you have made here.
Tel7, the fix you gave for No Series worked, but I am having one minor issue. In the following code:
'[service_phrase2]' => 'service != "-") { ?>Preached at a <a href="">service) ?></a> service.
',
I changed the word "Preached" to "Presented". On the Sermon page, the word "Preached" still appears. I have triple checked, and I pasted the code the right way. What do you think I did wrong?
Rich Brown Webmaster, Aisquith Presbyterian Church Parkville, Maryland, USA sermons.aisquith.org
Rich, this might be a silly question, but do you still have the word "Preached" in your Sermon page template? Did add the [service_phrase2] tag to your Sermon page template?
Post edited 4:18 am – 14 February, 2010 by Ben Miller
Rich, from what I can tell, the word "Preached" is in either your Sermon page template or your dictionary.php file. If that word is not in your Sermon page template, could you search your dictionary.php file for the word "Preached"?
Well, you've got me stumped. One more silly question, before I give up: After you changed "Preached" to "Presented" in dictionary.php, are you sure you uploaded the file to the right spot on the server? Another way of asking the same question: Are you sure that the dictionary.php file you just posted matches the one that is currently running on your server?
Sorry for asking these annoying questions, but it is the only thing I can think of right now.
Well, you've got me stumped. One more silly question, before I give up: After you changed "Preached" to "Presented" in dictionary.php, are you sure you uploaded the file to the right spot on the server? Another way of asking the same question: Are you sure that the dictionary.php file you just posted matches the one that is currently running on your server?
Sorry for asking these annoying questions, but it is the only thing I can think of right now.
Ben, I edited the template and dictionary.php directly through the WP interface. Let me upload it and see what happens…
Rich Brown Webmaster, Aisquith Presbyterian Church Parkville, Maryland, USA sermons.aisquith.org