I want to hack vBulletin so that the link target in the CMS and Blog entries do not open a new window when linking to the rest of my site.
I tried to edit includes/class_bbcode.php and includes/class_bbcode_blog.php but my changes seem to get overwritten by functionality elsewhere in vbulletin.
Here's the original bb url code in class_bbcode.php:
PHP Code:
return "<a href=\"$rightlink\" target=\"_blank\"" . ($is_external ? ' rel="nofollow"' : '') . ">$text</a>";
I changed it to this:
PHP Code:
return "<a href=\"$rightlink\" target=\"" . ($is_external ? '_blank' : '_self') . "\"" . ($is_external ? ' rel="nofollow"' : '') . ">$text</a>";
Links in my test article still point to "_blank". I even hard coded the target to _self and they still show up as _blank. Do I need to make a change else where?
--------------- Added [DATE]1306342871[/DATE] at [TIME]1306342871[/TIME] ---------------
Nevermind... got it to work! I neglected to resave my test posts after making the code changes (doh!).
I ended up changing the original code in class_bbcode.php from this:
PHP Code:
return "<a href=\"$rightlink\" target=\"_blank\"" . ($is_external ? ' rel="nofollow"' : '') . ">$text</a>";
To this:
PHP Code:
return "<a href=\"$rightlink\" target=\"" . iif(strstr($rightlink,"chromebookuser.com"),"_self","_blank") . "\"" . ($is_external ? ' rel="nofollow"' : '') . ">$text</a>";
You have to resave your articles after making this change!