vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Mini Mods - Same Window For Local Links (https://vborg.vbsupport.ru/showthread.php?t=130966)

Viper007Bond 11-06-2006 10:00 PM

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/
==============================

Viper007Bond 11-07-2006 06:22 AM

CHANGELOG:
  • v1.0.3: if your base URL contains "www.", it's now optional and this plugin will affect both www.yoursite.com as well as yoursite.com
  • v1.0.2: cached versions of posts were still having their links open in new windows, this is now hopefully fixed
  • v1.0.1: attachment.php links now continue to open in a new window
  • v1.0.0: initial release

Snake 11-07-2006 09:14 AM

Thanks buddy! :)

Cheertobi 11-07-2006 02:20 PM

/me clicks install!

Thanks!

4yBak 11-07-2006 05:01 PM

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) ?

TCattitude 11-07-2006 05:39 PM

Quote:

Originally Posted by 4yBak
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) ?

If the linked url have your vbulletin['bburl'] in that url, so the plugin re-write the "a href" code to change the "target" of the link, and left the link intact.

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)

w1z4rd 11-07-2006 05:56 PM

Finally, ... this works great just remember it does'nt take effect on posts before the installation unless you edit them. Sweet little plugin, thanks.

Viper007Bond 11-07-2006 06:33 PM

Quote:

Originally Posted by w1z4rd
Finally, ... this works great just remember it does'nt take effect on posts before the installation unless you edit them. Sweet little plugin, thanks.

No, it does, just flush your post cache. ;)

This modifies the output of the BBCode parser (after the BBCode is applied) but that output gets cached by vB.

PsicoByte 11-07-2006 10:32 PM

<font color="Lime">*install*</font>

Thanks!! :laugh:

abramelin 11-08-2006 12:09 AM

good but its going to open the attachment images in the same window too so this is not good :/


All times are GMT. The time now is 09:43 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.01136 seconds
  • Memory Usage 1,734KB
  • 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
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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