Archive

Author Archive

BP Profile Search 2.1

December 13th, 2010 No comments

BP Profile Search 2.1 fixes a nasty bug, where in some installations no results were found. Thanks to Elliott who allowed me to debug the issue on his site!

Additionally I’ve added an option to hide/show the search form, as requested by many users. Thanks to Marcy, CEO of Polymathic Media, who provided this useful patch!

I also wish to thank you all for sending your suggestions and bug reports. BP Profile Search is available in the WordPress Plugin Directory and in the BuddyPress Plugin Directory.

Categories: BP Profile Search

Menubar 4.10

November 15th, 2010 No comments

Menubar 4.10 is a bug fixing release that removes some compatibility problems with the qTranslate plugin.

As usual, this new version is available on the WordPress Plugin Directory. Enjoy!

Categories: WordPress Menubar

BP Profile Search 2.0

November 15th, 2010 No comments

A new version of BP Profile Search, the WordPress / BuddyPress plugin which enables advanced search on the extended member profiles, is ready.

Version 2.0 brings you the following enhancements:

1) Support for multiselectbox and checkbox field types.

Users can select one or more values to search for, and the results are the ones matching any of the values selected.

E.g. if there is a checkbox type field named Preferred Colors with possible values Red, Blue and Green, and users select Red and Green in the search form, they will get all the members with preferred color Red OR preferred color Green.

2) Support for wildcard characters in text searching.

The wildcard characters supported are % (percent sign), matching zero or more characters, and _ (underscore), matching exactly one character.

E.g. read% matches read, reader, readiness and so on, while %read% matches read, bread, reader and so on, and b_each matches breach and bleach, but not beach.

BP Profile Search 2.0 is available for download in the WordPress Plugin Directory and in the BuddyPress Plugin Directory.

Categories: BP Profile Search

Meta links with Menubar 4.9

October 15th, 2010 18 comments

Do you need to add an item like Log in, Log out, Register, Site Admin to your Menubar menu? Now, with the new PHP item type in Menubar 4.9, you can!

A) Let’s say you wish to add a menu item that lets you logout when you are logged in, and login when you are logged out.

That’s simple. Add to your Menubar menu a new item with type PHP, and enter in the PHP code field the following PHP snippet:

if (is_user_logged_in ())
return array ('Log out', wp_logout_url ());
else
return array ('Log in', wp_login_url ());

That means that, if you are logged in, you’ll get a menu item labeled Log out and pointing to your site logout URL, otherwise you’ll get a menu item labeled Log in and pointing to your site login URL.

B) What if you need a menu item to allow visitors to register to your site? Of course that item should be present only if the visitor is not already logged in.

That’s the content to write into the PHP code field:

if (!is_user_logged_in () && get_option ('users_can_register'))
return array ('Register', site_url ('wp-login.php?action=register', 'login'));
else
return false;

That means that, if the visitor is not logged in and user registration is enabled, you’ll get a menu item labeled Register and pointing to your site signup URL, otherwise you’ll get no menu item at all.

C) Now let’s make a menu item which brings you to the admin dashboard, if you are already logged in.

The code you need to put in the PHP code field is:

if (is_user_logged_in ())
return array ('Site Admin', admin_url ());
else
return false;

That means that, if you are logged in, you’ll get a menu item labeled Site Admin and pointing to your dashboard URL, otherwise you’ll get no menu item at all.

I hope you find these examples useful, and I think they help to show the potential of the PHP item type available in Menubar 4.9. If you find other interesting applications, please share them in the comments!

Categories: WordPress Menubar

Menubar 4.9 is available

October 12th, 2010 No comments

Menubar 4.9 enhances the PHP item type, allowing you to create a menu item and dynamically generate both the link label and the link destination URL.

The PHP item type was introduced in Menubar 4.8, but you could dinamically generate only the link destination, while the link label was specified statically in the Name field.

Now you can enter in the PHP code field any PHP code returning an array with your dynamically generated label and URL; you may also return an empty value, and in this case Menubar will generate no menu item at all.

A sample of the PHP code you can insert in the PHP code field is as follows:

// content of the PHP code field

$someurl = some expression;
$otherurl = other expression;

if (some-condition)
return array ('somelabel', $someurl);
else if (other-condition)
return array ('otherlabel', $otherurl);
else
return false;

This PHP snippet generates:

a) a menu item labeled ‘somelabel’ and pointing to $someurl if (some-condition) is met;
b) a menu item labeled ‘otherlabel’ and pointing to $otherurl if (other-condition) is met;
c) no menu item otherwise.

Menubar 4.9 also fixes a bug that prevented highlighting in an External or PHP menu item type, when the page URL contained a querystring.

Thank you for your support of Menubar!

Categories: WordPress Menubar