![]() |
Same Window For Local Links
Another really simple plugin from me.
I wanted local links (i.e. ones to other parts of the forum) to not open in a new tab. So, I wrote a little modifier to make that happen and decided to share the code. Tested on my forum, but let me know if you encounter any issues. :) How it works: It hooks in at the end of the BBCode parser, after the parser has transformed the BBCode into HTML. My plugin then removes the target="_blank" off of links that start with your forum base URL. Upgrading from version 1.0.1 or 1.0.0: Delete the plugin and then install the new product. It doesn't seem to be working on old posts! The output of the BBCode parser and such is cached by vB. Just rebuilt your post cache (it's under "Update Counters") and all will be good. ============================== DON'T FORGET TO CLICK INSTALL! https://vborg.vbsupport.ru/ ============================== |
CHANGELOG:
|
Thanks buddy! :)
|
/me clicks install!
Thanks! |
how this plugin know which links are local? Or this plugin use own bb-code? Also, can you do option like: not display local links for specific usergropus (for example: unregistering users) ?
|
Quote:
Nice and simple plugin ;) This really need to be a standard vbulletin option (local links not use "_blank" target; local links open in the same window) |
Finally, ... this works great just remember it does'nt take effect on posts before the installation unless you edit them. Sweet little plugin, thanks.
|
Quote:
This modifies the output of the BBCode parser (after the BBCode is applied) but that output gets cached by vB. |
<font color="Lime">*install*</font>
Thanks!! :laugh: |
good but its going to open the attachment images in the same window too so this is not good :/
|
Quote:
However, yeah, [ATT ACH]12345[/ATTACH] would be probably be affected. I'll exclude attachment.php links. |
if you can exclude them then im going to install this lovely simple mod,thanks.
|
Gah, man I suck at regex. :(
|
Alright, attachment.php is now excluded and will continue to open in a new tab/window. :)
|
Thank you Viper007Bond,
I requested something like this a long time ago because I hated new windows opening all the time on local links. I always had to use the html code <a href=""><span style="color: blue;"> Here </span></a> to open links in the same window :( But this great hack has now made me very happy:D And also should be default on all VB boards. Thanks again Install:) |
Quote:
Anyway, works great (on my new posts) - thanks. |
Quote:
|
Quote:
Also, can you add a feature to take into a count those "showthread" posts that include the syntax "showthread.php?p=22946#post22946" - these "normally" open in a new window and include a "Close Window" button on the bottom of the displayed page. Of course, when a user clicks it and with this add-on installed, it will prompt them to close it and in turn close down the whole browser, since it actually now opens in the same page. So can you make it so that these type of URL's continue to open in a new window. Thanks. |
Quote:
Quote:
|
Quote:
Yes, "showpost.php" is what I meant to say! |
Quote:
|
Quote:
Thanks. |
Small update. Cached versions of posts were still having their links open in new windows, this is now hopefully fixed.
|
Quote:
All is working well :D |
Oh, I also moved it from a plugin to a product to make things easier. Best to remove the old plugin (it won't hurt, but it'll just execute more code otherwise).
|
I've installed this mo; do you think there's anyway to make it work http://mydomain.com the same way it currently works for http://www.mydomain.com?
|
Im not sure what this does that you can't do with BBcode?
|
Quote:
|
Quote:
Code:
[url]http://yoursite.com/forum/showthread.php?t=123[/url] You cannot do that with vB fresh outta the box as far as I'm aware. |
Quote:
|
I like the idea of this hack. Doesn't work for me on 3.6.4 unfortunately.
|
Quote:
Did you read the part about how it doesn't affect posts posted before you installed the product unless you rebuild the post cache? |
Quote:
I rebuilt the post cache, and it does not work on new or old posts. It's too bad, cuz this would be great to have working on the forum. :) |
Quote:
|
Quote:
|
Quote:
|
Quote:
Still not opening up in same window. Thanks for the help. :) |
Quote:
Try this simpler version of my product and see if it works or not. |
Quote:
Still not working on my forum. Uninstalled the original product, and installed this lite one, and still not working. |
I'm outta ideas then. It should be working. :(
|
All times are GMT. The time now is 04:54 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|