Plugin: bbMenu 1.0
-
After a lot of trial and error, lots of frustration I give you:
bbMenu 1.0
What does it do?
It adds a menu to you bbPress site. You can edit the menu in the admin page (Content->Menu) by just drag & drop the menu items in the order you want.
Installation instructions and some documentation are included in the .zip
To do:
– Rename the menu items by doubble clicking them and then put in your desired name.
– Add an bbMenu_installed check so theme builders can make their theme’s compatible for bbMenu aswell as for non bbMenu users. (It will check if the bbMenu is installed.) Ideas about how to do this are more then welcome!!!
Download it here:
-
Where do I report bugs?
What bugs? Euuh well if you have a fix too, put it here for the time being
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/…/public_html/forums/my-plugins/bbmenu.php on line 325
Is the error I keep on getting. Running this on .80 with the 1.0 release.
Hi,
Did you use the beta aswell? Then delete the bb_menu first with phpmyadmin.
If not, then the table didn’t fill during installation of the plugin. Still don’t know why it doesn’t do that on certain servers.
Fill the table using this information:
mysql_query ("INSERT INTO
$bbdb->menu
VALUES ('active', 'Forums', 'index.php', 'front-page', 0)");
mysql_query ("INSERT INTO$bbdb->menu
VALUES ('active', 'Search', 'search.php', 'search-page', 1)");
mysql_query ("INSERT INTO$bbdb->menu
VALUES ('inactive', 'Statistics', 'statistics.php', 'stats-page', 0)");
I also found another bug. Somewhere I hardcoded bb_menu instead of using the prefix variable. As long as your prefix is bb_ (like most have) there is no problem. This will be fixed in the next release.
Also the ‘doubleclick-and-edit-the-menu-items’ function in the new release is getting along very well!
Greetz
the above sql throws an error:
#1064 – You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘mysql_query (“INSERT INTO
$bbdb->menu
VALUES (‘active’, ‘Forums’, ‘index.p’ at line 1
Dont put that in literlary, it said use the info, not the lines!
INSERT INTO bb_menu
VALUES (‘active’, ‘Forums’, ‘index.php’, ‘front-page’, 0)
Use something like this for each line, seperate submit…
How does your bb_menu table look like?
empty
empty as in not filled? Or empty at all so no set, item, page attributes?
Does anyone else has problems with this plugin? If you use(d) it plz let me know!
empty as in not filled.
Ah ok can you tell me what attributes it contains? (so how the table is build) Does it have: set, item, page etc etc?
Some suggested using set and item isn’t smart and could cause problems. But if these excist in your table, then it isn’t a problem. I think there is something “wrong” with the insert but to be sure. I am gonna make a version where I change the set and item into other values. Perhaps you can test that version for me when it’s done?
Still funny, it works on my own 2 test servers
suleiman, I would like you to test this version to see if this fixes the tabel install issues.
Follow these steps:
1- Go to your myplugins folder and delete bbmenu.php (you only need to remove this bbmenu-file, leave all others in). Now go to the admin menu and check if the Menu link in it is gone.
2- With phpmyadmin, remove the bb_menu table from your database.
3- Now upload the new bbmenu.php (test)version to your myplugins folder (see below for download)
4- Go to your admin page, press the menu link and refresh the page.
Let me know
The bbMenu testversion:
I’ve got bbMenu working fine and dandy on my site at http://brigantiimoot.co.uk/forums/ but I’m wondering is there an easy way to add extra items on the menu without doing it directly into the DB at the moment ?
Hi,
What kind of items would you like to add? Is it a plugin page like the memberlist plugin, or a link to another website, or a link to your homepage.
The last one is technically hard to do cause of the way bbPress id’s there pages. bbMenu uses this to highlight the menu item when you are on a certain page. Since your homepage proberbly doesn’t support/use this, you can add an item in the menu, but it proberbly wouldn’t highlight when you are on that page.
Hope you understand what I mean…
If you want to add an “off-link” (the link goes to wikipedia or something) you could add this into bbmenu.php (not tested):
At the bottom find:
echo '<li ' . $first . '><a ' . $current . ' href="' . $rw['page'] . '">' . $rw['item'] . '</a></li>';
Underneeth it add:
echo '<li><a href="link-to-your-thingy.com">Thingy-name</a></li>';
(Ignore the this forum adds them when editing this topic)
This should add a new link ad the end in your menu, but you will not see it in the admin, or be able to put it anywhere else… It will also not be highlighted when you are on that page (in case you use it to go to your homepage)
null, i tried the new plugin and i’m still getting an empty table and this error:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/…/public_html/forums/my-plugins/bbmenu.php on line 325
btw, I have set, item, page, location, and order in my table structure.
suleiman, I am still trying to figure out why the damn thing won’t install for you. I am kinda busy at the moment so it could take some time.
For template builders I have the following message:
If you build a template and want to make it compatible with bbMenu you can use the code below.
It shows the bbmenu if it is installed, if not it will show nothing (or your own hardcode menu).
……..Changing code…….. stay tuned……….
I’d suggest checking for function_exists on a bb_menu function or class_exists rather than file_exists, because you’re introducing an extra dependency on the site layout, which is subject to change.
How can you check if a function excist?
Lets take get_bbmenu as excample its in the bbmenu.php file….
Also for future versions, the plugins will be able to be disabled in the admin (like in wp) so bbmenu.php can be installed, but not used (inactive), how to fix that?
Use function_exists( string $function_name );
I don’t know how your plugin works, but if you made any calls to hooks then they simply won’t be called (as far as I understand it). Your code will probably also not be loaded. This plugin inactive shouldn’t be a problem?
Ah ok well I will experimend some with this function_excists then, should work the same (basicly)
Thx
Null, you might find http://php.net useful. It has descriptions of all methods and classes, as well as examples and suggestions of ways to do things.
I have made a new testversion for suleiman. Plz try this version.
1) Delete bbemenu.php from your plugin directory (and close browser)
2) Delete the bb_menu table from your database
3) Upload this test version, go to your admin and refresh the page if needed
4) Check if the bb_menu table is filled now.
ps. you only have to replace the bbmenu.php from your plugin directory.
Download testversion:
http://www.sourceskins.com/bbmenutest.zip
If this version isn’t working for you sul, I give up
- You must be logged in to reply to this topic.