Forum

Please consider registering
guest

Log In Register

Register | Lost password?
Advanced Search:

— Forum Scope —



— Match —



— Forum Options —




Wildcard usage:
*  matches any number of characters    %  matches exactly one character

Minimum search word length is 3 characters - maximum search word length is 84 characters

Topic RSS
Patches to add support for limit and dir shortcode attrs
7 October, 2009
2:00 am
liggitt
Cary, NC
New Member
Forum Posts: 2
Member Since:
7 October, 2009
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
Forum Posts: 2
Member Since:
7 October, 2009
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
Forum Posts: 2
Member Since:
1 April, 2011
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
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: 125

Currently Online: Ben Meredith
11 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Rich Brown: 336

Matt Schlueter: 91

Don Johnson: 58

anointed: 57

0be1: 55

Mindy: 54

Member Stats:

Guest Posters: 7

Members: 2401

Moderators: 1

Admins: 1

Forum Stats:

Groups: 1

Forums: 2

Topics: 1348

Posts: 5500

Newest Members: kclagge, Ben Meredith, jasegbert, Rebecca Moehring, Sam Mathews, Oliver Redmond

Moderators: Ben Miller (903)

Administrators: Mark Barnes (435)