vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Mini Mods - Open Local links in same window, External in new window (https://vborg.vbsupport.ru/showthread.php?t=256195)

SweCastel 12-29-2010 10:00 PM

Open Local links in same window, External in new window
 
1 Attachment(s)
I did search for a easy solution to simply open a local link in the same window, and external links in a new window.

Did not find it, so I did make this. My first PHP script.

In the file:
includes/class_bbcode.php

Search for: standard URL hyperlink

3.1.5 (maybe 3.1.6?) And before:
Replace:
Code:

return "<a href=\"$rightlink\" target=\"_top\"" . ($is_external ? ' rel="nofollow"' : '') . ">$text</a>";
3.1.7 ->
Replace:
Code:

return "<a href=\"$rightlink\" target=\"_blank\"" . ($is_external ? ' rel="nofollow"' : '') . ">$text</a>";
With:

Code:

       
        if( is_int(  strpos(  strtolower( $rightlink ), "InsertYourDomainHere") ) )

        {
                return "<a href=\"$rightlink\" target=\"_top\"" . ($is_external ? ' rel="nofollow"' : '') . ">$text</a>";
        } else {
                return "<a href=\"$rightlink\" target=\"_blank\"" . ($is_external ? ' rel="nofollow"' : '') . ">$text</a>";
        }

InsertYourDomainHere = Should be replaced with your domain eg: vbulletin (exclude the last part of your domain eg .com / .org)
It didn?t work for me anyway.
Maybe because of vbulletin cutting down long texts? I dont really now.

And then update the CMS Cache.
AdminCP - vBulletin CMS - Clean CMS-Cache

However this works perfect for me.

// Daniel

dacho 12-30-2010 06:13 PM

It didnĀ“t work for me

utahraves 12-30-2010 06:24 PM

I have several parked domains. I would like this if I could use multiple domains.
Ex: utahraves.com and utrave.org = same site, I would need to be able to put both domains in that for my site to work.

Dr.osamA 12-31-2010 04:28 PM

ander test

thank you bro

dormopoco 01-15-2011 07:20 AM

work whit attachments? i have on my site Bug Whit attacment. i need open in new windows

SweCastel 02-05-2011 11:34 AM

Some update is done. Maybe it works now.

nacaruncr 02-08-2011 07:15 AM

It doesn't work in 4.0.x...

SweCastel 02-08-2011 07:21 AM

Quote:

Originally Posted by nacaruncr (Post 2160099)
It doesn't work in 4.0.x...

Sorry if it does not.
I works just fine in 4.1.1 so I guess thats what you need.
If you don?t want to customize it.

// D

angeljs 05-14-2011 08:19 PM

Doesn't work for me, either :(

kmfrei 09-13-2011 07:22 AM

Works out perfect with version 4.1.5. Thanx for having resolved this issue!


All times are GMT. The time now is 09:14 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.01174 seconds
  • Memory Usage 1,728KB
  • 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
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete