View Full Version : Navigation Manager
kapii
06-10-2012, 10:41 PM
For some unknow reason, in 4.2 with the Navigation Manager if you delete a item, it leaves behind the record in the navigation table and in the phrase table.
I have found a way to delete the record in the navigation table by adding this code via a plugin to the navigation_admin_dodelete hook.
if ($_REQUEST['do'] == 'dodelete')
{
$vbulletin->input->clean_array_gpc('r', array(
'navid' => TYPE_UINT,
'tabid' => TYPE_UINT
));
$db->query_write("
DELETE FROM " . TABLE_PREFIX . "navigation
WHERE navid = " . $navelement['navid'] . "
");
}
But I have not been able to come up with a way to delete the phrase record, if anybody can help me out it would be greatly appreciated.
Thanks
Lynne
06-10-2012, 11:31 PM
Did you put in a bug report about this?
kapii
06-10-2012, 11:35 PM
Hi Lynne their is already something in JIRA http://tracker.vbulletin.com/browse/VBIV-15177
But that don't help me at the moment.
Thanks
nhawk
06-11-2012, 10:30 AM
I'm the one that filed that report and just about fell out of my chair when I saw it marked "As designed" and "Resolved".
I would have to double check it, but the reason you can't delete the phrase is there isn't any id that links them to the navigation item. You need to know the full name of the phrase and delete it using that phrase.
The standard phrases for navigation items are...
FOR MENUS: vb_navigation_menu_' . $name . '_text'
FOR TABS: vb_navigation_tab_' . $name . '_text'
FOR LINKS: vb_navigation_link_' . $name . '_text'
Simon Lloyd
06-11-2012, 10:48 AM
I'm soooo glad i haven't moved to vb4 beta :) wonder if vb5 will still be in constant beta mode?
kapii
06-11-2012, 11:41 AM
I'm the one that filed that report and just about fell out of my chair when I saw it marked "As designed" and "Resolved".
I would have to double check it, but the reason you can't delete the phrase is there isn't any id that links them to the navigation item. You need to know the full name of the phrase and delete it using that phrase.
The standard phrases for navigation items are...
FOR MENUS: vb_navigation_menu_' . $name . '_text'
FOR TABS: vb_navigation_tab_' . $name . '_text'
FOR LINKS: vb_navigation_link_' . $name . '_text'
Right, but how would I add that to my delete code to remove the phrase when it removes the item from the navigation table, if it is even possible?
Thanks :)
nhawk
06-11-2012, 02:58 PM
Right, but how would I add that to my delete code to remove the phrase when it removes the item from the navigation table, if it is even possible?
Thanks :)
Get the name from the navigation table prior to deleting it. Then use the name (varname) to delete the phrase from the phrase table.
kapii
06-11-2012, 03:02 PM
I tried something like that but I don't think I write it correctly, when I would delete a item via the navigation manager, it would delete the item in the db just fine but not the phrase, so I don't know how to code it to do that.
Lynne
06-11-2012, 03:10 PM
I tried something like that but I don't think I write it correctly, when I would delete a item via the navigation manager, it would delete the item in the db just fine but not the phrase, so I don't know how to code it to do that.
Post your code so we can try to see what was wrong.
kapii
06-11-2012, 03:13 PM
Hi Lynne, actually I tried so many different things I deleted the whole thing and then just wrote the part to remove the item from the navigation table. I know that don't help you but I tried looking back on my text files and don't have what I wrote anymore. :(
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.