It’s now available for download here
.
If you upgraded Wordpress but didn’t upgrade the widget, please don’t post saying that the widget doesn’t work.
If you’re looking for instructions, check here.
Okay. You can ask support questions here.
|
Next post: KB Advanced RSS v1.5.4 »
|
9 comments »
Hi, Adam!
I almost hate to ask this, so feel free to hang me out to dry if you don’t want to be bothered with it!
I’m toying with using Sidebar Modules to replace the standard widgets interface in WordPress. When I loaded up KB Countdown, I got some weird stuff:
First, in the Add Module module list, it shows items for
KB Countdown 1
KB Countdown 2
KB Countdown 3
…
KB Countdown 9
When I add an instance of KB Countdown 1, I can configure the module options. An instance of any other module name (KB…2, etc.) appears to have no options.
Second, when I add an instance of KB Countdown 1 and configure the options, it begins with an error:
“Warning: Missing argument 1 for widget_kbcountdown_control() in /widget/path/kb_countdown.php on line 129″
The options all appear just fine, but don’t appear to save. (Even more puzzling, what actually appears on the blog page is an old countdown from a previous version of the plugin/widget. Where is that data stored?)
Again, I completely understand if you don’t want to support this mess; I started to take a look at the code myself, and just thought I’d ask before I started futilely thrashing around!
Jeff,
You’re welcome to fiddle around with it, but I don’t support use with anything other than the widgets setup. I suspect the problem you’re having is being caused by the widget registration. In the last couple of upgrades to WP, they’ve changed the way that programmers need to register their widgets with WP (at least for widgets with multiple instances, like this one).
Look through the kb_countdown.php file for where registration happens. You’ll see a bunch of lines using functions called “register_sidebar_widget,” “register_sidebar_widget_control,” and “wp_register_sidebar_widget.” You’ll notice that the countdown is doing version checks to decide how to register the widget. Try commenting out the version checks and manually telling the plugin to try one or the other registration functions. That might solve your problem.
If you don’t have a passing familiarity with PHP, then that will all sound like Greek to you. I suspect, though, that you’ll have the same problem with other widgets that have multiple instances (like php_exec, kb advanced rss, and a few others out there).
Good luck.
Thanks, Adam! I’ll look into that.
Ugh. Ok, I see. (I think.) This is the same issue people were having who mentioned that it didn’t work with the K2 theme (it uses Sidebar Modules instead of the standard widgets interface by default, I believe.)
SBM deals with widgets differently, it looks like. (I’m assuming that’s the ‘registration’ part, but not sure if I should be using that term.) With WordPress widgets, you can drag multiple instances into the sidebar, which would get numbered, right? So you could have KB Countdown 1, 2, etc.
Sidebar Modules provides a list of available widgets…you choose the one you want, and *assign it a name yourself*, and then add it to the sidebar. I have no idea how it accesses this information. :P
Anyway, I soloved the ‘multiple instances’ problem by commenting out the counting in widget_kb_countdown_register(), and changing the name to simply ‘KB Countdown’:
//$number = $options[’number’];
//if ( $number 9 ) $number = 9;
//for ($i = 1; $i
Whoops…sorry. Let me try that paragraph again with code tags this time:
Anyway, I solved the ‘multiple instances’ problem by commenting out the counting in widget_kb_countdown_register(), and changing the name to simply ‘KB Countdown’:
//$number = $options['number'];
//if ( $number 9 ) $number = 9;
//for ($i = 1; $i
…but then I realized where my widget_kbcountdown_control() error was coming from. (I’m guessing…I’m no PHP pro — I only know enough to break stuff well! :P) Is that function using the $number argument to identify which widget instance we’re supposed to be working with?
In that case, I’m guessing I’m screwed, because if I make an instance of KB Countdown in SBM and name it “Mabel” or something, I have no idea how the script will be able to identify it. :(
Ah well, I guess I’m in over my head. Thought I’d at least post this here for those having problems with K2 — that’s why!
Wow. That didn’t work, either…and made a mess, to boot. Sorry for spamming up your comments. Delete and/or tweak as you like! :(
The $number you have there is merely the part that tells WP how many instances are possible. If you want this to be a one-time-only widget, just change that first line you commented out to say
$number = 1;and that will do the trick. Beyond that, I don’t know anything about how modules work, so I hope you get it working.Thanks, I might mess with it a tad more and then give up.
One thing still puzzles me, though: I had a countdown already in progress under the WP widgets system. No matter WHAT I do in the modules system, the widget that appears on the front page is displaying the data from the old countdown. Where’s it pulling that from?? (Maybe if I could manually clear that out, it would work? But I’m doubting it…I’d just like to know where its stored.)
Thanks for all your help!
Does anyone know where I can find a v2.3 version of this? All the download links lead to 3.1 on WordPress. Thanks for any help!
Leave a comment