bh-widgets
This is an OO library of widgets built on top of the widget system provided natively in wordpress.
Instead of widgets this system provides a set of widget classes. You can create as many instances of each class as you like. And if you have an inclination toward PHP you can extend any one of these classes or write your own classes easily as extending ANY PHP class.
REQUIREMENTS
- wordpress 2.3.3
- PHP5 (that’s right I abandoned php4 all together)
INSTALLATION
-
- Here
- svn checkout http://bh-widgets.googlecode.com/svn/tags/latest/ bh-widgets
- unzip (if necessary) and place plugin in wp-content/plugins of you wordpress directory
- Activate
USING BH WIDGETS
- Browse to Design >> Widgets
- select the class you wish to instantiate from the drop down
- Give your instance a unique name
- select Add
- Drag-n-Drop the new widget instance to the Sidebar of your choice.
- Configure the control to your liking
- Save Changes











January 27th, 2008 at 7:51 pm
I get an error when I try to activate:
Warning: array_push() [function.array-push]: First argument should be an array in C:\xampplite\htdocs\wordpress\wp-content\plugins\bh-widgets\BH_Widget_Data.php on line 31
Fatal error: Call to undefined method wpdb::set_prefix() in C:\xampplite\htdocs\wordpress\wp-content\plugins\bh-widgets\BH_Widget_Data.php on line 32
Any suggestions?
January 28th, 2008 at 4:52 pm
gus,
This is the line in the plugin it is choking on:
$wpdb->set_prefix($wpdb->prefix);
It doesn’t believe you when you say there is a n attribute called prefix in object wpdb.
It also doesn’t believe you when you say the same object has a method called set_prefix.
What version on WP do you have? If it is less than 2.3.2 try upgrading.
January 29th, 2008 at 11:39 pm
Very eager to give this a try. Thanks for all your efforts. Unfortunately, it’s causing a fatal error so won’t activate.
Parse error: syntax error, unexpected T_CLASS in /home/ebiz1/public_html/testsite/wp-content/plugins/bh-widgets/BH_Widget_Base.php on line 25
I’m using wp 2.3.2 Suggestions?
Christy
January 30th, 2008 at 11:54 am
Christy,
What version of PHP do you have. You have to use php5. PHP5’s OO implementation is very different than that of php4. Some apps written for 4 won’t work in 5 and vice versa.
January 30th, 2008 at 12:23 pm
Oh, darn, that’s right. I did read that it uses php5. Unfortunately (for a lot of users since it’s so popular) my HostGator account is at 4.4.4.
Guess I’ll bookmark your site for future when everyone else catches up to you :).
Thanks, again.
Christy
January 30th, 2008 at 6:00 pm
Guess I’ll bookmark your site for future when everyone else catches up to you :).
February 10th, 2008 at 11:13 am
BH: I am running WP 2.3.2 and PHP 5. And I still get the error. I don’t fully understand your explanation of the error. What should those values be, and how could I change them? What should I do next?
I’ve been using the BH Category Dropdown plugin, so this is an “upgrade.” Could that make a difference?
February 11th, 2008 at 4:47 pm
gus,
It looks like I’m using a 2.4 feature, which has not been release yet. Give me a day or so and I will have this working in 2.3 proper.
BH
February 11th, 2008 at 5:45 pm
Thanks. I’m looking forward to it!
February 12th, 2008 at 10:41 pm
gus,
Get the latest version here. I hope this does it for you.
BH
February 13th, 2008 at 1:16 am
It does . . . great!
February 13th, 2008 at 1:45 am
Okay, I’m really liking this, and I think I’ve got most of the classes figured out.
But I do have a small feature request: I’d like the ability to specify the first option for each instance of the category dropdown. For now, I’ve changed the text in the code from “select option” to “Browse by category:”. But I’d like to use more than one of these on a page (each with a different subset of categories), and have each one be named differently. So I’d prefer the first option to be one of the parameters of each instance.
Also, a request for a tag dropdown that operates similarly to the category dropdown. With the new tag architecture, would that be simple to do?
Even without these, this is a great plugin. Thank you very much!
February 14th, 2008 at 1:41 am
Gus,
Look for this new feature in the next release, in a couple of days. As for a tag is actually pretty easy with the new architecture. Tags, categories, link categories, and any other type are all handled the same way. I could copy category drop down code, and trek it for tags, but I want to try to handle it more generically , so I don’t create a new widget for every arbitrary taxonomy, one could create. Give me a while to think about that one and I’ll come up with something.
February 14th, 2008 at 9:39 am
Hey, that would be great! I did try to see if I could create my own tag dropdown — by copying your category dropdown code and attacking it with a sledgehammer (converted all “categories” or “cat” mentions to “tag”). It did actually run, but the tags wouldn’t load into the popup. I presume a more gentle (and intelligent) approach is needed.
February 16th, 2008 at 3:06 am
Gus,
You probably where not far from the correct solution. Anyway version 0.5 is up.
February 16th, 2008 at 6:54 pm
Thanks! The category dropdown works great now, and there are now two of them running, targeting different subsections of categories, which is amazing.
But the tag dropdown isn’t working for me. I can choose the tags I want to appear, and name the dropdown, but when I save changes it doesn’t appear on the site, and when I go back to the widgets page all the tag selections have been lost. I tried it both with and without the other dropdowns running, to see if there might be some kind of interference. But it didn’t work either way.
February 18th, 2008 at 8:28 am
Gus,
Your turning out to be my QA dept. Version 0.6
February 19th, 2008 at 6:15 pm
Hey, it works! Thanks! But I’ll be resigning my QA job . . . until I need more features or there’s an upgrade.
February 20th, 2008 at 12:40 am
not a problem thanks for the feedback gus
February 26th, 2008 at 8:32 am
Oops. I may have quit too soon. I don’t know if this just happened, or if it stopped working with the last revision: I have three dropdowns — two category dropdowns featuring different subsets of the categories, and one tag dropdown. The first dropdown, for categories, works. So does the tag dropdown. But the second category dropdown doesn’t. It shows all the right choices, but selecting one of them just brings up the same page.
I’ll fiddle with this to see if I can get it to work by reselecting them, but I thought I’d mention it in the meantime.
February 26th, 2008 at 6:43 pm
working on it gus.
February 27th, 2008 at 6:30 am
gus,
The problem is that they forms for the drop downs where being named exactly the same. I don’t think the browser liked that. The forms now will render with unique names each behaving like it should. Tags drop down had the same bug. Version 0.7 should do the trick.
March 3rd, 2008 at 12:05 am
It works! And I didn’t even have to recreate the dropdowns. Thanks again!
And now a question: I’m not sure if this is a function of your plugin, but I’ll ask anyway. I’ve got some pretty long category names. The category names are longer than the width of the column in which I’ve placed the dropdown menus. In Firefox, this works out okay: although the absolutely longest names are clipped a bit by the scrollbar, most of most of the names are visible, because when you click on the dropdown, the dropdown becomes wider than the column.
On IE6, though, the dropdown doesn’t get any wider than the column itself, so most of many of the category names are truncated. I haven’t been able to test this on IE7.
Is there a setting I can change in the plugin that will make long categories display their full width? Or is this more a CSS(link) (Cascading Style Sheets) thing?
March 3rd, 2008 at 10:25 am
This is actually more of a CSS(link) (Cascading Style Sheets) thing. While it could be handled with the code. the MORE correct and flexible way would be to handle it with in your theme’s style sheet.