Forum

You must be logged in to post Login Register

Search Forums:


 






Latest Sermon URL only on Homepage

RESOLVED
UserPost

12:40 pm
24 September, 2009


vagrantmonkey

Member

posts 7

Post edited 11:40 am – 24 September, 2009 by vagrantmonkey


In the design I am working on I need a way to call just the URL for the latest sermon on my homepage. I am already using the widget code elsewhere, but here I need just the URL to add as the href in my footer. A URL for the current series would also be great.

Thanks!

3:42 pm
24 September, 2009


Mark Barnes

Admin

posts 321

Unfortunately there's no way to do this at the moment. You can use a function to give you the name of the latest sermon, that is linked to the correct page, but you can't get just the URL, sorry.

4:14 pm
24 September, 2009


vagrantmonkey

Member

posts 7

Well, let's make that a feature request then. Laugh

3:06 am
2 October, 2009


Mark Barnes

Admin

posts 321

I've added a URL only function to 0.43.2 (see this FAQ). It will give you the most recent sermon, optionally filtered by series or preacher.

Current series is more problematic as many churches have multiple series running concurrently.

5:20 am
2 October, 2009


vagrantmonkey

Member

posts 7

Thanks for adding that in. I may have negated my ability to use it by mucking about with the widget, but I'll give it a shot. I see your point regarding the current series. I'll have to think about that one. Isolating a specific series would still be useful though.

You can check out the site at: http://thechurchonmelrose.org

3:48 am
5 October, 2009


journeyblair

Member

posts 3

Hey vagrantmonkey

I went to your site and i really like how you have the search area layed out. Would you be willing to post the code for that? It would be a great help if so. Thanks!

1:25 am
10 October, 2009


walkingcomplete

Orange County CA

Enthusiast

posts 13

That is a nice look vagrant monkey. I would love to know how you did it too.

2:48 am
10 October, 2009


vagrantmonkey

Member

posts 7

Hi Guys,

Sorry it took so long to get back to you on this. In order to set this up you need to directly edit the "frontend.php" file found inside the sermon browser plugin. Make sure you create a copy of both the original file AND your edited file. That way if you update the plugin you have away to recover these changes.

The code below should replace the "mainFilter" div that starts at line 941 in the original file. All I have really done is rearrange the table and take out some filters I didn't need at this time.

As last note before the code, if you are looking for the graphical look of the code as adjusted by the CSS I can post that separately, but this is the biggest change.

<div id="mainfilter">
<form method="post" id="sermon-filter" action="<?php echo sb_display_url(); ?>">
<div style="clear:both">
<table class="sermonbrowser">
<tr>
<td class="fieldname"><?php _e('Preacher', $sermon_domain) ?></td>
<td class="field"><select name="preacher" id="preacher">
<option value="0" <?php echo (isset($_REQUEST['preacher']) && $_REQUEST['preacher'] != 0) ? " : 'selected="selected"' ?>><?php _e('[All]', $sermon_domain) ?></option>
<?php foreach ($preachers as $preacher): ?>
<option value="<?php echo $preacher->id ?>" <?php echo isset($_REQUEST['preacher']) && $_REQUEST['preacher'] == $preacher->id ? 'selected="selected"' : " ?>><?php echo stripslashes($preacher->name).' ('.$preacher->count.')' ?></option>
<?php endforeach ?>
</select>
</td>
</tr>
<tr>
<td class="fieldname"><?php _e('Series', $sermon_domain) ?></td>
<td class="field"><select name="series" id="series">
<option value="0" <?php echo $_REQUEST['series'] != 0 ? " : 'selected="selected"' ?>><?php _e('[All]', $sermon_domain) ?></option>
<?php foreach ($series as $item): ?>
<option value="<?php echo $item->id ?>" <?php echo $_REQUEST['series'] == $item->id ? 'selected="selected"' : " ?>><?php echo stripslashes($item->name).' ('.$item->count.')' ?></option>
<?php endforeach ?>
</select>
</td>
</tr>
<tr>
<td class="fieldname"><?php _e('Book', $sermon_domain) ?></td>
<td class="field"><select name="book">
<option value=""><?php _e('[All]', $sermon_domain) ?></option>
<?php foreach ($book_count as $book): ?>
<option value="<?php echo $book->name ?>" <?php echo $_REQUEST['book'] == $book->name ? 'selected=selected' : " ?>><?php echo stripslashes($book->name). ' ('.$book->count.')' ?></option>
<?php endforeach ?>
</select>
</td>
</tr>
<tr>
<td class="fieldname"><?php _e('Start date', $sermon_domain) ?></td>
<td class="field"><input type="text" name="date" id="date" value="<?php echo mysql_real_escape_string($_REQUEST['date']) ?>" /></td>
</tr>
<tr>
<td class="fieldname"><?php _e('End date', $sermon_domain) ?></td>
<td class="field"><input type="text" name="enddate" id="enddate" value="<?php echo mysql_real_escape_string($_REQUEST['enddate']) ?>" /></td>
</tr>
<tr>
<td class="fieldname"><?php _e('Keywords', $sermon_domain) ?></td>
<td class="field" colspan="1"><input style="width: 98.5%" type="text" id="title" name="title" value="<?php echo mysql_real_escape_string($_REQUEST['title']) ?>" /></td>
</tr>
<tr>
<td class="fieldname"><?php _e('Sort by', $sermon_domain) ?></td>
<td class="field"><select name="sortby" id="sortby">
<?php foreach ($sb as $k => $v): ?>
<option value="<?php echo $v ?>" <?php echo $csb == $v ? 'selected="selected"' : " ?>><?php _e($k, $sermon_domain) ?></option>
<?php endforeach ?>
</select>
</td>
</tr>
<tr>
<td class="fieldname"><?php _e('Direction', $sermon_domain) ?></td>
<td class="field"><select name="dir" id="dir">
<?php foreach ($di as $k => $v): ?>
<option value="<?php echo $v ?>" <?php echo $cd == $v ? 'selected="selected"' : " ?>><?php _e($k, $sermon_domain) ?></option>
<?php endforeach ?>
</select>
</td>
</tr>
<tr>
<td colspan="1">&nbsp;</td>
<td class="field"><input type="submit" class="filter" value="<?php _e('Filter &raquo;', $sermon_domain) ?>"> </td>
</tr>
</table>
<input type="hidden" name="page" value="1">
</div>
</form>
</div>

2:53 am
10 October, 2009


vagrantmonkey

Member

posts 7

As for some of the CSS, I had to narrow the display of the fields a bit. I changed the CSS code in the Sermon Browser Template (via the admin page). the relevant code is below:

table.sermonbrowser td.fieldname {
font-weight:bold;
font-size: .65em;
padding-right: 10px;
vertical-align:bottom;
}

table.sermonbrowser td.field input, table.sermonbrowser td.field select{
width: 130px;
}

table.sermonbrowser td.field #date, table.sermonbrowser td.field #enddate {
width: 90px;
}


About the 4:14 evangelical christian theology blog forum

Most Users Ever Online:

19


Forum Stats:

Groups: 1

Forums: 6

Topics: 544

Posts: 2106




Popularity: 37% [?]