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: 0be1
17 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:
There have been 7 guest posters
There are 1937 members
There are 1 moderators
There are 1 admins
Forum Stats:
Groups: 1
Forums: 2
Topics: 973
Posts: 3782
Newest Members: damianv, twinton, ellison13579, Daigh, mchunful, jesua
Moderators: Ben Miller (383 )
Administrators: Mark Barnes (425)
Log In
Register
Home



