Open Local links in same window, External in new window
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>"; Replace: Code:
return "<a href=\"$rightlink\" target=\"_blank\"" . ($is_external ? ' rel="nofollow"' : '') . ">$text</a>"; 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>"; } 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 Download No files for download. |
Similar Mods
Mini Mods Same Window For Local Links | vBulletin 3.6 Add-ons |