Topic RSS
1:21 pm
13 July, 2009
OfflineNic, that would be a good feature request — maybe a drop down "Part of a series — yes/no" which would then remove it for that sermon.
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
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.
Thanks for the time!
12:30 am
16 October, 2009
OfflineI'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.)"
1:47 am
13 July, 2009
Offlinegjertsen said:
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:
'[series_link_new]' => '<?php if(!empty($sermon->series)) { ?>(Part of the <?php echo stripslashes($sermon->series) ?> series.)<?php } ?>'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.
3:59 am
16 October, 2009
Offline@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.
Thanks again for the help!
7:31 pm
20 January, 2010
OfflineWhile 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? 
12:11 am
21 January, 2010
OfflineHi 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:
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:
to this:
I then clicked Save, and that worked as expected!
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:
and just as a test (needs work to tidy it up), I changed it to this:
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.)
Thanks.
3:32 am
21 January, 2010
OfflineHi 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:
'[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:
'[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 } ?>',
Sermon Template — Search results page:
Change this:
to this:
And change this:
to this:
Sermon Template — Sermon page:
Change this:
to this:
[service_phrase2]
No Verses issue
dictionary.php: function sb_sermon_page_dictionary()
Change this:
'[/passages_loop]' => ",
to this:
'[/passages_loop]' => 'start) > 0) { ?>)',
Or slightly more concisely, this:
'[passages_loop]' => 'start) > 0) { echo "(" }; for ($i = 0; $i start); $i++): ?>',
'[/passages_loop]' => 'start) > 0) { echo ")" }; ?>',
Sermon Template — Sermon page:
Change this:
to this:
I guess could have just used [...phrase] instead of [...phrase1] & [...phrase2], but the latter may be clearer for some.
No Tags issue
dictionary.php: function sb_sermon_page_dictionary()
Insert this (untested) code:
Sermon Template — Sermon page:
Change this:
to this (also untested):
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.
Hope this helps someone. Any questions?
Terry
6:51 pm
18 June, 2009
OfflineTel7, thanks for the patches. Mvejvoda just recently came up with a bug fix for the Tags not displaying bug, which you can read about here.
2:42 am
13 July, 2009
OfflineTel7, 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:
',
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?
3:52 am
18 June, 2009
OfflineRich, 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?
4:09 am
13 July, 2009
OfflineBen, not silly at all. Yes, that tag is present in the template. That's why I am stumped as to why it doesn't appear as "Presented".
4:17 am
18 June, 2009
OfflineRich, 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"?
4:28 am
13 July, 2009
OfflineBen,
It's not in my templates, and it's not in dictionary.php. Here, see for yourself:
function sb_search_results_dictionary() {
return array(
'[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 } ?>',
'[filters_form]' => '<?php sb_print_filters($atts) ?>',
'[most_popular]' => '<?php sb_print_most_popular() ?>',
'[tag_cloud]' => '<?php sb_print_tag_clouds() ?>',
'[sermons_count]' => '<?php echo $record_count ?>',
'[sermons_loop]' => '<?php foreach ($sermons as $sermon){ $media = sb_get_stuff($sermon); ?>',
'[/sermons_loop]' => '<?php } ?>',
'[sermon_title]' => '<a href="<?php sb_print_sermon_link($sermon) ?>"><?php echo stripslashes($sermon->title) ?></a>',
'[preacher_link]' => '<a href="<?php sb_print_preacher_link($sermon) ?>"><?php echo stripslashes($sermon->preacher) ?></a>',
'[series_link]' => '<a href="<?php sb_print_series_link($sermon) ?>"><?php echo stripslashes($sermon->series) ?></a>',
'[service_link]' => '<a href="<?php sb_print_service_link($sermon) ?>"><?php echo stripslashes($sermon->service) ?></a>',
'[date]' => '<?php echo sb_formatted_date ($sermon) ?>',
'[first_passage]' => '<?php $foo = unserialize($sermon->start); $bar = unserialize($sermon->end); if (isset($foo[0]) && isset($bar[0])) echo sb_get_books($foo[0], $bar[0]) ?>',
'[files_loop]' => '<?php foreach ((array) $media as $media_type => $media_names) { if (is_array($media_names) && $media_type != "Code") { foreach ((array)$media_names as $media_name) { ?>',
'[/files_loop]' => '<?php } } } ?>',
'[file]' => '<?php sb_print_url($media_name) ?>',
'[file_with_download]' => '<?php sb_print_url_link($media_name) ?>',
'[embed_loop]' => '<?php foreach ((array) $media as $media_type => $media_names) { if (is_array($media_names) && $media_type == "Code") { foreach ((array)$media_names as $media_name) { ?>',
'[/embed_loop]' => '<?php } } } ?>',
'' => '<?php sb_print_code($media_name) ?>',
'[next_page]' => '<?php sb_print_next_page_link() ?>',
'[previous_page]' => '<?php sb_print_prev_page_link() ?>',
'[podcast_for_search]' => '<?php echo sb_podcast_url() ?>',
'[podcast]' => '<?php echo sb_get_option("podcast_url") ?>',
'[itunes_podcast]' => '<?php echo str_replace("http://", "itpc://", sb_get_option("podcast_url")) ?>',
'[itunes_podcast_for_search]' => '<?php echo str_replace("http://", "itpc://", sb_podcast_url()) ?>',
'[podcasticon]' => '<img alt="Subscribe to full podcast" title="Subscribe to full podcast" class="podcasticon" src="<?php echo SB_PLUGIN_URL ?>/sb-includes/icons/podcast.png"/>',
'[podcasticon_for_search]' => '<img alt="Subscribe to custom podcast" title="Subscribe to custom podcast" class="podcasticon" src="<?php echo SB_PLUGIN_URL ?>/sb-includes/icons/podcast_custom.png"/>',
'[editlink]' => '<?php sb_edit_link($sermon->id) ?>',
'[creditlink]' => '<div id="poweredbysermonbrowser">Powered by <a href="http://www.4-14.org.uk/sermon-browser">Sermon Browser</a></div>',
);
}
function sb_sermon_page_dictionary() {
return array(
'[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 != "-") { ?>Presented at a <a href="<?php sb_print_service_link($sermon["Sermon"]) ?>"><?php echo stripslashes($sermon["Sermon"]->service) ?></a> service.<br /><?php } ?>',
'[sermon_title]' => '<?php echo stripslashes($sermon["Sermon"]->title) ?>',
'[sermon_description]' => '<?php echo wpautop(stripslashes($sermon["Sermon"]->description)) ?>',
'[preacher_link]' => '<a href="<?php sb_print_preacher_link($sermon["Sermon"]) ?>"><?php echo stripslashes($sermon["Sermon"]->preacher) ?></a>',
'[preacher_description]' => '<?php sb_print_preacher_description($sermon["Sermon"]) ?>',
'[preacher_image]' => '<?php sb_print_preacher_image($sermon["Sermon"]) ?>',
'[series_link]' => '<a href="<?php sb_print_series_link($sermon["Sermon"]) ?>"><?php echo stripslashes($sermon["Sermon"]->series) ?></a>',
'[service_link]' => '<a href="<?php sb_print_service_link($sermon["Sermon"]) ?>"><?php echo stripslashes($sermon["Sermon"]->service) ?></a>',
'[date]' => '<?php echo sb_formatted_date ($sermon["Sermon"]) ?>',
'[passages_loop]' => '<?php $ref_output = array(); for ($i = 0; $i < count($sermon["Sermon"]->start); $i++): ?>',
'[/passages_loop]' => '<?php endfor; echo implode($ref_output, ", "); ?>',
'[passage]' => '<?php $ref_output[] = sb_get_books($sermon["Sermon"]->start[$i], $sermon["Sermon"]->end[$i]) ?>',
'[files_loop]' => '<?php $media = sb_get_stuff($sermon["Sermon"]); foreach ((array) $media as $media_type => $media_names) { if (is_array($media_names) && $media_type != "Code") { foreach ((array)$media_names as $media_name) { ?>',
'[/files_loop]' => '<?php } } } ?>',
'[file]' => '<?php sb_print_url($media_name) ?>',
'[file_with_download]' => '<?php sb_print_url_link($media_name) ?>',
'[embed_loop]' => '<?php $media = sb_get_stuff($sermon["Sermon"]); foreach ((array) $media as $media_type => $media_names) { if (is_array($media_names) && $media_type == "Code") { foreach ((array)$media_names as $media_name) { ?>',
'[/embed_loop]' => '<?php } } } ?>',
'' => '<?php sb_print_code($media_name) ?>',
'[next_sermon]' => '<?php sb_print_next_sermon_link($sermon["Sermon"]) ?>',
'[prev_sermon]' => '<?php sb_print_prev_sermon_link($sermon["Sermon"]) ?>',
'[sameday_sermon]' => '<?php sb_print_sameday_sermon_link($sermon["Sermon"]) ?>',
'[tags]' => '<?php sb_print_tags($sermon["Tags"]) ?>',
'[esvtext]' => '<?php for ($i = 0; $i < count($sermon["Sermon"]->start); $i++): echo sb_add_bible_text ($sermon["Sermon"]->start[$i], $sermon["Sermon"]->end[$i], "esv"); endfor ?>',
'[kjvtext]' => '<?php for ($i = 0; $i < count($sermon["Sermon"]->start); $i++): echo sb_add_bible_text ($sermon["Sermon"]->start[$i], $sermon["Sermon"]->end[$i], "kjv"); endfor ?>',
'[asvtext]' => '<?php for ($i = 0; $i < count($sermon["Sermon"]->start); $i++): echo sb_add_bible_text ($sermon["Sermon"]->start[$i], $sermon["Sermon"]->end[$i], "asv"); endfor ?>',
'[nettext]' => '<?php for ($i = 0; $i < count($sermon["Sermon"]->start); $i++): echo sb_add_bible_text ($sermon["Sermon"]->start[$i], $sermon["Sermon"]->end[$i], "net"); endfor ?>',
'[ylttext]' => '<?php for ($i = 0; $i < count($sermon["Sermon"]->start); $i++): echo sb_add_bible_text ($sermon["Sermon"]->start[$i], $sermon["Sermon"]->end[$i], "ylt"); endfor ?>',
'[webtext]' => '<?php for ($i = 0; $i < count($sermon["Sermon"]->start); $i++): echo sb_add_bible_text ($sermon["Sermon"]->start[$i], $sermon["Sermon"]->end[$i], "web"); endfor ?>',
'[akjvtext]' => '<?php for ($i = 0; $i < count($sermon["Sermon"]->start); $i++): echo sb_add_bible_text ($sermon["Sermon"]->start[$i], $sermon["Sermon"]->end[$i], "akjv"); endfor ?>',
'[hnvtext]' => '<?php for ($i = 0; $i < count($sermon["Sermon"]->start); $i++): echo sb_add_bible_text ($sermon["Sermon"]->start[$i], $sermon["Sermon"]->end[$i], "hnv"); endfor ?>',
'[lbrvtext]' => '<?php for ($i = 0; $i < count($sermon["Sermon"]->start); $i++): echo sb_add_bible_text ($sermon["Sermon"]->start[$i], $sermon["Sermon"]->end[$i], "rv1909"); endfor ?>',
'[cornilescutext]' => '<?php for ($i = 0; $i < count($sermon["Sermon"]->start); $i++): echo sb_add_bible_text ($sermon["Sermon"]->start[$i], $sermon["Sermon"]->end[$i], "cornilescu"); endfor ?>',
'[synodaltext]' => '<?php for ($i = 0; $i < count($sermon["Sermon"]->start); $i++): echo sb_add_bible_text ($sermon["Sermon"]->start[$i], $sermon["Sermon"]->end[$i], "synodal"); endfor ?>',
'[biblepassage]' => '<?php for ($i = 0; $i < count($sermon["Sermon"]->start); $i++): sb_print_bible_passage ($sermon["Sermon"]->start[$i], $sermon["Sermon"]->end[$i]); endfor ?>',
'[editlink]' => '<?php sb_edit_link($_GET["sermon_id"]) ?>',
'[creditlink]' => '<div id="poweredbysermonbrowser">Powered by <a href="http://www.4-14.org.uk/sermon-browser">Sermon Browser</a></div>',
);
}
?>
4:40 am
18 June, 2009
OfflineWell, 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.
5:12 am
13 July, 2009
OfflineBen Miller said:
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…
Most Users Ever Online: 40
Currently Online:
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:
Guest Posters: 7
Members: 2062
Moderators: 1
Admins: 1
Forum Stats:
Groups: 1
Forums: 2
Topics: 1071
Posts: 4042
Newest Members: richdorm, Aaron Velasquez, aaronv, dave5884, tomduckering, ccwebb
Moderators: Ben Miller (386)
Administrators: Mark Barnes (425)
Log In
Register
Home




