Quote:
Originally Posted by shyguy82
Does anyone know how to include currently logged in UserId when using an external link?
I want to setup a link to an external site but I also want to include a UserId (affiliate).
Thanks
|
In Plugin Insertando Tabs
find:
PHP Code:
$tree = array();
while( $tabs = $vbulletin->db->fetch_array( $result ))
{
if (is_null($tabs['tipo']))
{
$tree[$tabs['tabid']] = $tabs;
}
else
{
if ($tabs['tipo']=='menuitem' or $tabs['tipo']=='submenu')
{
$tree[$tabs['tabid']][] = $tabs;
}
}
}
Replace with:
PHP Code:
$tree = array();
/*to use another variable, use $to_find[1], after $to_find[2], etc */
$to_find[0]="{userid}";
$to_change[0]=$vbulletin->userinfo['userid'];
/**/
while( $tabs = $vbulletin->db->fetch_array( $result ))
{
$tabs['url']=str_replace($to_find,$to_change,$tabs['url']);
$tabs['curl']=str_replace($to_find,$to_change,$tabs['curl']);
if (is_null($tabs['tipo']))
{
$tree[$tabs['tabid']] = $tabs;
}
else
{
if ($tabs['tipo']=='menuitem' or $tabs['tipo']=='submenu')
{
$tree[$tabs['tabid']][] = $tabs;
}
}
}
after that, you can use
{userid} in your URLs