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
Patches to add support for limit and dir shortcode attrs
7 October, 2009
2:00 am
liggitt
Cary, NC
New Member
Members
Forum Posts: 2
Member Since:
7 October, 2009
sp_UserOfflineSmall Offline

Hi Mark, I saw that adding the dir and limit shortcode attributes was on the list of future attributes. I needed those for a current project, so I went ahead and implemented them myself. In case you hadn't yet, here's the patch to add support for these:

Index: sermon.php
===================================================================
--- sermon.php (revision 161077)
+++ sermon.php (working copy)
@@ -452,6 +454,8 @@
global $wpdb, $record_count, $sermon_domain;
ob_start();
$atts = shortcode_atts(array(
+ 'limit' => '0',
+ 'dir' => isset($_REQUEST['dir']) ? $_REQUEST['dir'] : '',
'filter' => sb_get_option('filter_type'),
'filterhide' => sb_get_option('filter_hide'),
'id' => isset($_REQUEST['sermon_id']) ? $_REQUEST['sermon_id'] : '',
@@ -483,8 +487,8 @@
$sort_criteria = $_REQUEST['sortby'];
else
$sort_criteria = 'm.datetime';
- if (isset($_REQUEST['dir']))
- $dir = $_REQUEST['dir'];
+ if (!empty($atts['dir']))
+ $dir = $atts['dir'];
elseif ($sort_criteria == 'm.datetime')
$dir = 'desc';
else
@@ -495,7 +499,7 @@
else
$page = 1;
$hide_empty = sb_get_option('hide_no_attachments');
- $sermons = sb_get_sermons($atts, $sort_order, $page, 0, $hide_empty);
+ $sermons = sb_get_sermons($atts, $sort_order, $page, (int)$atts['limit'], $hide_empty);
$output = '?>'.sb_get_option('search_output');
eval($output);
}
7 October, 2009
2:06 am
liggitt
Cary, NC
New Member
Members
Forum Posts: 2
Member Since:
7 October, 2009
sp_UserOfflineSmall Offline

hmmm... the forum didn't like the svn patch at all. here's a link:

Add support for limit and dir shortcode attributes

Along with it, here's a couple other fixes I've made, in case you want them:
Include jQuery

Escape spaces in podcast urls as %20 (for iTunes)

13 April, 2011
2:34 pm
ChristChurchColumbia
New Member
Members
Forum Posts: 2
Member Since:
1 April, 2011
sp_UserOfflineSmall Offline

Where does this code go? I would like to limit posts also, but can't figure out where to add your code.

Thanks

27 April, 2011
11:35 pm
Mark Barnes
Admin
Forum Posts: 435
Member Since:
14 December, 2005
sp_UserOfflineSmall Offline

Liggitt,

Thanks for the patches. I'll add the shortcode and rawurlencode patches to the next version. jQuery should already be loaded where necessary by sb_add_headers though. Is there somewhere you noticed it wasn't being loaded?

Forum Timezone: Europe/London

Most Users Ever Online: 381

Currently Online:
11 Guest(s)

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