Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Beta Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
standard URL hyperlink opening in same window Details »»
standard URL hyperlink opening in same window
Version: 1.00, by Floris Floris is offline
Developer Last Online: Mar 2021 Show Printable Version Email this Page

Version: 3.0.7 Rating:
Released: 04-04-2005 Last Update: Never Installs: 2
Is in Beta Stage  
No support by the author.

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.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 04-05-2005, 09:00 AM
Lionel Lionel is offline
 
Join Date: Dec 2001
Location: Delray Beach, Florida
Posts: 3,277
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'd love to have that, but for links opening to my site only.
Reply With Quote
  #3  
Old 04-05-2005, 11:42 AM
wirewolf's Avatar
wirewolf wirewolf is offline
 
Join Date: Jun 2004
Location: New York City
Posts: 74
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #4  
Old 04-05-2005, 12:18 PM
Floris Floris is offline
 
Join Date: Jan 2002
Posts: 1,898
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #5  
Old 04-05-2005, 12:54 PM
wirewolf's Avatar
wirewolf wirewolf is offline
 
Join Date: Jun 2004
Location: New York City
Posts: 74
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #6  
Old 04-05-2005, 09:12 PM
Jenta Jenta is offline
 
Join Date: Dec 2004
Posts: 377
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #7  
Old 04-05-2005, 10:02 PM
Floris Floris is offline
 
Join Date: Jan 2002
Posts: 1,898
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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]...
Reply With Quote
  #8  
Old 04-05-2005, 11:38 PM
frankenberrie's Avatar
frankenberrie frankenberrie is offline
 
Join Date: Dec 2002
Location: N.Y.
Posts: 69
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ive already done this but didnt share... Im sorry!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:00 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.04415 seconds
  • Memory Usage 2,278KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (7)postbit
  • (8)postbit_onlinestatus
  • (8)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete