PDA

View Full Version : New Window


G0F0RBR0KE
12-05-2010, 06:01 PM
I need help with this.

https://vborg.vbsupport.ru/showthread.php?t=235265&highlight=navbar+tabs

It seem unsupported and hopefully someone can help me with this.

Objective: Make it open a new window.

if ($vbulletin->options['ctab_enable'] && $vbulletin->options['new_window'])
{
$template_hook['navtab_end'] .= '
<li><a href="'. $vbulletin->options['ctab_redirect_url'] .'" class="navtab">'. $vbulletin->options['ctab_name'] .'</a></li>
<li><a href="'. $vbulletin->options['ctab_redirect_url1'] .'" class="navtab">'. $vbulletin->options['ctab_name1'] .'</a></li>';
}else{
$template_hook['navtab_end'] .= '
<li><a href="'. $vbulletin->options['ctab_redirect_url'] .'" class="navtab">'. $vbulletin->options['ctab_name'] .'</a></li>
<li><a href="'. $vbulletin->options['ctab_redirect_url1'] .'" class="navtab">'. $vbulletin->options['ctab_name1'] .'</a></li>';
}

how do I accomplish it?

BirdOPrey5
12-05-2010, 06:21 PM
just add target="_blank" to the <a> tags, like:

<a href="'. $vbulletin->options['ctab_redirect_url'] .'" class="navtab" target="_blank">'. $vbulletin->options['ctab_name'] .'</a>

G0F0RBR0KE
12-05-2010, 06:24 PM
Imma try that. I kept adding a target"_blank after the $vbulletin->options['ctab_name']

This is how the code is suppose to be written just to get it working or else..it creates duplicate or it doesn't work at all.

if ($vbulletin->options['ctab_enable'] && $vbulletin->options['new_window'])
{
$template_hook['navtab_end'] .= '
<li><a href="'. $vbulletin->options['ctab_redirect_url'] .'" class="navtab" target="_blank">'. $vbulletin->options['ctab_name'] .'</a></li>
<li><a href="'. $vbulletin->options['ctab_redirect_url1'] .'" class="navtab" target="_blank">'. $vbulletin->options['ctab_name1'] .'</a></li>';
}else{
$template_hook['navtab_end'] .= '
<li><a href="'. $vbulletin->options['ctab_redirect_url'] .'" class="navtab" target="_blank">'. $vbulletin->options['ctab_name'] .'</a></li>
<li><a href="'. $vbulletin->options['ctab_redirect_url1'] .'" class="navtab">'. $vbulletin->options['ctab_name1'] .'</a></li>';
}

BirdOPrey5
12-05-2010, 06:50 PM
They can be anywhere in the opening <a> tag but they MUST be within it, not outside the tag:

<a href="'. $vbulletin->options['ctab_redirect_url'] .'" class="navtab" target="_blank">

<a href="'. $vbulletin->options['ctab_redirect_url'] .'" target="_blank" class="navtab">

<a target="_blank" href="'. $vbulletin->options['ctab_redirect_url'] .'" class="navtab">

any of these would work.

G0F0RBR0KE
12-05-2010, 07:00 PM
Ah, understandable. I thought it can be placed before the </a>
Thanks.