vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   How can I make link open in same window? (https://vborg.vbsupport.ru/showthread.php?t=125042)

JimLink 08-27-2006 05:04 AM

How can I make link open in same window?
 
Is there a way to make Links or URLs posted by registered members of my forum that are in my forum or domain open in the current window rather than opening a new one?

vBulletin THEN DAYLIGHT 08-27-2006 07:16 AM

You have to edit a PHP file: includes/class_bbcode.php

In this file, change

Code:

return "<a href=\"$rightlink\" target=\"_blank\">$text</a>";
to

Code:

return "<a href=\"$rightlink\">$text</a>";
And that should make the [url] tag open links in the same window.

JimLink 08-27-2006 07:39 AM

thank you

alanw 11-01-2006 08:54 PM

Actually that patch doesn't do what was asked and I have seen a number of people asking for a way to make links within the forum open in the same window but other (external) links open a new window.

I have done this successfully for my forum by making the patch conditional - eg, prefix the existing return statement with this where YOURURL is replaced by the URL prefix you require to match and XX is the length of the string to be matched (including the http://):

Code:

                if ( vbstrlen($rightlink) > XX AND substr($rightlink, 0, XX) == "http://YOURURL")
                { return "<a href=\"$rightlink\">$text</a>";                                             
                }else


ElfMage 01-15-2007 02:37 PM

This thread is 2 months old, but in case anybody else is looking for an alternate solution....

Edit the PHP file includes/class_bbcode.php, and in this file change:

PHP Code:

return "<a href=\"$rightlink\" target=\"_blank\">$text</a>"

to

PHP Code:

global $vbulletin;
if ((
strpos$rightlink$vbulletin->options['bburl'] ) === 0
    || (
strpos$rightlink$vbulletin->options['homeurl'] ) === 0))
    
$target '';
else 
    
$target 'target="_blank"';
return 
"<a href=\"$rightlink\" $target>$text</a>"



All times are GMT. The time now is 05:57 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.01055 seconds
  • Memory Usage 1,721KB
  • 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_code_printable
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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