Topic RSS
12:51 pm
6 April, 2009
OfflineHi Mark,
Because I have a fairly custom website I found that the new version introduced a new bug causing the plugin to show an unsightly SQL error on some of my custom pages! (because on my custom pages $post->ID is null)
The solution was to edit frontend.php – adding some simple error checking in the function sb_add_headers()
i.e. change line (around) 443 from:
$pageid = $wpdb->get_var("SELECT ID FROM {$wpdb->posts} WHERE post_content LIKE '%[sermons%' AND (post_status = 'publish' OR post_status = 'private') AND ID={$post->ID} AND post_date < NOW();");
TO:
$pageid = NULL;
if ($post->ID != '') $pageid = $wpdb->get_var("SELECT ID FROM {$wpdb->posts} WHERE post_content LIKE '%[sermons%' AND (post_status = 'publish' OR post_status = 'private') AND ID={$post->ID} AND post_date < NOW();");
This change doesn't seem to affect any of the other operation and is similar to how you error-checked sb_display_url around line 40.
Most Users Ever Online: 40
Currently Online:
14 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



