Quote:
Originally Posted by Adrian Schneider
Typically you'd use a "Manage Contests" link, rather than having dynamic navigation (vBulletin wasn't really built for that).
Updating the phrase works (ideally as a translation*) as well.
If you want to do it dynamically, create a new plugin at the admin_index_navigation hook with something like this:
PHP Code:
$newnavigation = array();
foreach ($navigation as $grouporder => $groups) { foreach ($groups as $groupname => $contents) { $newnavigation[$grouporder][$groupname] = array( 'group' => $contents['group'], 'options' => array() ); foreach ($contents['options'] as $linkorder => $linkinfo) { list($text, $link) = each($linkinfo); if ($groupname == 'Group Name' and $text == 'Old Text') { $text = 'New Title'; $link['text'] = $text; } $newnavigation[$grouporder][$groupname]['options'][$linkorder][$text] = $link; } } }
$navigation = $newnavigation;
I've used "Your Group", "Old Text" and "New Title" as placeholders... you should edit them accordingly. You could also use this method to dynamically add to the navigation depending on what exists in the database.
|
Thanks for your replies everyone. I was successful now changing it from the php that nhawk gave ; the only reason it was not working before was because it needed to update the translated field not the actual text ( as suggested by Adrian ).
I created that plug-in although all the subnav options disappear. This is the plugin I used:
PHP Code:
$newnavigation = array();
foreach ($navigation as $grouporder => $groups)
{
foreach ($groups as $groupname => $contents)
{
$newnavigation[$grouporder][$groupname] = array(
'group' => $contents['group'],
'options' => array()
);
foreach ($contents['options'] as $linkorder => $linkinfo)
{
list($text, $link) = each($linkinfo);
if ($groupname == 'Contests Of The Week' and $text == 'Contest 2')
{
$text = 'Avatar Of The Week';
$link['text'] = $text;
}
$newnavigation[$grouporder][$groupname]['options'][$linkorder][$text] = $link;
}
}
}
$navigation = $newnavigation
Also Adrian I am very much interested in this navigation , I would much rather have a link to manage contests for example than what I have now, just now quite sure how to go about it just yet. Would you happen to have any source of documentation for this by any chance?
Any help will be appreciated.