Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: bbMenu 1.2 released!

Adding new links will be supported in version 2, for now you will have to do it using phpMyAdmin or using a plugin :)

Excample plugin (not yet tested and the bbmenu plugin needs to be active/working):

<?php
/*
Plugin Name: add bbMenu tab
Plugin URI: http://www.bbportal.org/
Description: Adds a tab to the bbMenu list
Author: Maurice de Regt
Author URI: http://www.mauricederegt.nl/
Version: 1.0

NOTES:
- for xxxx use something normal like: "googletab" if you make a tab to the google.com page
- for 'YOUR-TITLE': This will be the text you can edit, make sure it is between the 'tags'
- for 'URL-OF-PAGE': This will be the page you'll go to when you click the menutab, make sure it's between the 'tags'
- These added tabs WILL NOT stay highlighted when you are on that page. This requires some more complex stuff
*/

// Check if the bbPortal menu tab exists
function xxxx_check_tab() {
global $bbdb;
$bbdb->hide_errors();
$bxxxx_tab = true;
if (!$bbdb->query("SELECT * FROM ~$bbdb->menu~ WHERE ~location~ = 'xxxx-page'")) {
return xxxx_add_tab();
}
$bbdb->show_errors();
return $xxxx_tab;
}

// If it doesn't, install the menu tab
function xxxx_add_tab() {
global $bbdb;
$query = "INSERT INTO ~$bbdb->menu~ VALUES
(DEFAULT, 'YOUR-TITLE', 'inactive', 'URL-OF-PAGE', 'xxxx-page', 0);";

$bbdb->query($query);
}

?>

NOTES:

– for xxxx use something normal like: “googletab” if you make a tab to the google.com page

– for ‘YOUR-TITLE’: This will be the text you can edit, make sure it is between the ‘tags’

– for ‘URL-OF-PAGE’: This will be the page you’ll go to when you click the menutab, make sure it’s between the ‘tags’

– These added tabs WILL NOT stay highlighted when you are on that page. This requires some more complex stuff

REPLACE ALL ~ with backticks, since this forum filters them out

Skip to toolbar