Quote:
Originally Posted by Andreas
... a unique ID or you will run into problems sooner or later 
|
chances are very less, because all the
links inside menu generated through navigation manager has id in range of (20 - 50 +), so one can use any id between 1-20
for links inside menu. (per menu).
A higher number will be much better (ex: 1001)
OR
Get the last navid of link in menu.
PHP Code:
$lastnavid = array_pop(array_keys($result['vbtab_forum']['links']['vbmenu_qlinks']['links']));
$lastnavid = $result['vbtab_forum']['links']['vbmenu_qlinks']['links'][$lastnavid]['navid'];
So, last code which i gave to one of the user will be like this
PHP Code:
if (vB::$vbulletin->userinfo['userid'])
{
$userid = vB::$vbulletin->userinfo['userid'];
$lastnavid = array_pop(array_keys($result['vbtab_forum']['links']['vbmenu_qlinks']['links']));
$lastnavid = $result['vbtab_forum']['links']['vbmenu_qlinks']['links'][$lastnavid]['navid'];
$lien_messujets = array(
'name' => 'rescue_messujets',
'navtype' => 'link',
'url' => '{options.toppath}search.php?do=finduser&userid='.$userid.'&starteronly=1&contenttype=vBForum_Thread',
'active' => 1,
'text' => 'Mes sujets',
'productid' => 'vbulletin',
'navid' => $lastnavid++
);
$lien_mesmessages = array(
'name' => 'rescue_mesmessages',
'navtype' => 'link',
'url' => '{options.toppath}search.php?do=finduser&userid='.$userid.'&starteronly=1&contenttype=vBForum_Post&showposts=1',
'active' => 1,
'productid' => 'vbulletin',
'text' => 'Mes messages',
'navid' => $lastnavid++
);
$lien_mesannonces = array(
'name' => 'rescue_commu_annonces',
'navtype' => 'link',
'url' => '{options.toppath}member.php?u='.$userid.'&tab=afficher_annonces',
'active' => 1,
'productid' => 'vbulletin',
'text' => 'Mes annonces',
'navid' => $lastnavid++
);
$result['vbtab_forum']['links']['vbmenu_qlinks']['links']['rescue_messujets'] = $lien_messujets;
$result['vbtab_forum']['links']['vbmenu_qlinks']['links']['rescue_commu_annonces'] = $lien_mesannonces;
$result['vbtab_forum']['links']['vbmenu_qlinks']['links']['rescue_mesmessages'] = $lien_mesmessages;
unset($userid);
}