vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Forum link - target="_blank" (https://vborg.vbsupport.ru/showthread.php?t=98851)

albibak 10-20-2005 11:56 AM

Forum link - target="_blank"
 
Hello,

I created a forum, with the option forum link. It's a link for another website.
When I click on this link, the other website opens in the current window. However I would like to know how I can get it to open in a new window (i.e. target="_blank")

Thanks for your answer.

HiDeo 10-21-2005 10:42 AM

Same problem on my test forum, no idea !!

Marco van Herwaarden 10-21-2005 07:28 PM

It is done by a piece in global.php:
PHP Code:

// #############################################################################
// Redirect if this forum has a link
// check if this forum is a link to an outside site
if (trim($foruminfo['link']) != '')
{
    
// get permission to view forum
    
$_permsgetter_ 'forumdisplay';
    
$forumperms fetch_permissions($forumid);
    if (!(
$forumperms $vbulletin->bf_ugp_forumpermissions['canview']))
    {
        
print_no_permission();
    }
    
exec_header_redirect($foruminfo['link'], true);


I don't have time to look for a solution now, but this should get you going.

1 Thing is strange though (a bug??), it is passing a second parameter to exec_header_redirect (true), but this function don't take a second parameter i think.

Paul M 10-21-2005 08:48 PM

You would need to completely change the way it works, at the moment it sends an http 301 response back to re-direct the browser to the new location, hence it will not (and cannot) open a new page.

albibak 10-29-2005 08:40 AM

I don't understand :s

harmor19 10-29-2005 09:06 AM

I guess you can make your own function if that is an internal function.

just change it to
PHP Code:

 link_redirect($foruminfo['link']); 

then add this in global
PHP Code:

function link_redirect($link)
{
   global 
$foruminfo;

  echo 
"<a href='$link' target='_blank'>".$foruminfo['name']."</a>";


I'm not sure "$foruminfo['name']" is correct.
I'm also not sure if that will work.

mhackl 02-02-2009 07:29 PM

This would appear to do it for all of the links, but what if you wanted to select the link target per forum?

ragtek 02-02-2009 07:40 PM

As Marco said, this is a piece of code in global.php and not a function;)

And, target="_blank" is no valid attribut in xhtml ;) it's working, but not valid!


All times are GMT. The time now is 10:25 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00956 seconds
  • Memory Usage 1,726KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete