vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Beta Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=34)
-   -   standard URL hyperlink opening in same window (https://vborg.vbsupport.ru/showthread.php?t=79398)

Floris 04-04-2005 10:00 PM

standard URL hyperlink opening in same window
 
As requested here: standard URL hyperlink opening in same window
http://www.vbulletin.com/forum/showthread.php?t=135315

Just doing a quick browse through includes/functions_bbcodeparse.php makes me think this might just be what that user is looking for: (line 1510)

Download & backup the includes/functions_bbcodeparse.php file and open the file (not the backup of course) and find ..

PHP Code:

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

The target is set to blank which will make the link open a new window. Remove that and they should open in the same window:

PHP Code:

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

Save the file when you're done and upload it, replacing the file already there (so overwrite it, don't resume or skip it during upload).

If you're using postcache you might need to rebuild post cache first.

Lionel 04-05-2005 09:00 AM

I'd love to have that, but for links opening to my site only.

wirewolf 04-05-2005 11:42 AM

floris, could a conditional statement be added so that any forum internal link (other forum pages) would open in the same window, but that any external link (anyother sites) would open in a new one?
John

Floris 04-05-2005 12:18 PM

Quote:

Originally Posted by wirewolf
floris, could a conditional statement be added so that any forum internal link (other forum pages) would open in the same window, but that any external link (anyother sites) would open in a new one?
John

What you want is how it works by default with vBulletin 3.0.7

wirewolf 04-05-2005 12:54 PM

I know by default in Vbull, any standard link (url) in a post will open in a new window. I see by the code you showed that it can be changed to open in the same window.

What I want to know, is there a way to add a conditional statement ( ie in affect, <if "start of url == http://yoursite.com/forum/">then open same window><else />open new window) to the code you showed above, so that any url that links to a forums' internal page will open in the same window as the post is in, but any url in a post that points to an external (non forum page, outside source) would open in a new window?

Examples, these two urls' are in the same post:
This internal forum url (or any other) would open in the same window;
http://shipmodeling.net/vb_forum/art...ticle&artid=38

This external (non forum page) url would open in a new window;
http://www.google.com/

John

Jenta 04-05-2005 09:12 PM

Quote:

Originally Posted by wirewolf
What I want to know, is there a way to add a conditional statement ( ie in affect, <if "start of url == http://yoursite.com/forum/">then open same window><else />open new window) to the code you showed above, so that any url that links to a forums' internal page will open in the same window as the post is in, but any url in a post that points to an external (non forum page, outside source) would open in a new window?

good idea, probably need to regular expression?

Floris 04-05-2005 10:02 PM

Quote:

Originally Posted by wirewolf
I know by default in Vbull, any standard link (url) in a post will open in a new window. I see by the code you showed that it can be changed to open in the same window.

What I want to know, is there a way to add a conditional statement ( ie in affect, <if "start of url == http://yoursite.com/forum/">then open same window><else />open new window) to the code you showed above, so that any url that links to a forums' internal page will open in the same window as the post is in, but any url in a post that points to an external (non forum page, outside source) would open in a new window?

Examples, these two urls' are in the same post:
This internal forum url (or any other) would open in the same window;
http://shipmodeling.net/vb_forum/art...ticle&artid=38

This external (non forum page) url would open in a new window;
http://www.google.com/

John

If you know the post or thread id, use those bbcodes? [thread] ... & [post]...

frankenberrie 04-05-2005 11:38 PM

Ive already done this but didnt share... Im sorry!


All times are GMT. The time now is 03:25 PM.

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.01206 seconds
  • Memory Usage 1,734KB
  • 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
  • (2)bbcode_php_printable
  • (3)bbcode_quote_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