vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Miscellaneous Hacks - Word Links (Turn words into links) by BOP5 (https://vborg.vbsupport.ru/showthread.php?t=263700)

adwade 06-16-2011 02:28 AM

THANXX again. This is working just M-a-r-v-e-l-o-u-s!

Artes_Marciales 06-16-2011 05:40 PM

Great Work!!!!
Thanks!!!

teach1st 06-25-2011 02:47 PM

I imagine not many people use the HTML "alt" image tag with vBulletin, but I do with my class newsletters, which go back for nine years. Word Links breaks the image if the alt tag one of the auto-linked words. For example, "homework" is automatically linked. If I have an image with "homework" in the alt tag (and I do, every week), here's what I get: X (broken image) homework3.gif" alt="homework"> (homework is a link)

Not a big deal, really. It's really a great product. Thanks!

BirdOPrey5 06-25-2011 03:28 PM

I know most people don't use alt in their images in vBulletin, but actually this mod should work even if they do. I just checked your site (the one in your profile) and found this example link in one of your posts (by viewing the HTML source)

HTML Code:

<img src="http://www.pb5th.com/pbkidz10/log/051611.jpg" alt="!!!">
The problem is that isn't a valid xhtml img element though it works on browsers just fine... the proper tag should look like:

HTML Code:

<img src="http://www.pb5th.com/pbkidz10/log/051611.jpg" alt="!!!" />
I assume you're using some type of Mod or BB Code to produce those images. If you edit it to put the proper xhtml closing (the "space, followed by the slash, followed by the closing square-bracket) or " />" this mod will recognize it as an xhtml <img> tag and ignore all keywords inside of it be it filename or alt code.

teach1st 06-25-2011 03:34 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2212661)
I assume you're using some type of Mod or BB Code to produce those images. If you edit it to put the proper xhtml closing (the "space, followed by the slash, followed by the closing square-bracket) or " />" this mod will recognize it as an xhtml <img> tag and ignore all keywords inside of it be it filename or alt code.

Thanks for the tip! The problem is I've been using that kind of sloppy coding for the past ten or eleven years, but I think I might be able to use the vB replacement variable manager to change them in bulk.

BirdOPrey5 06-25-2011 03:42 PM

Are you using a BBCode? If so it would be a simple fix and work on all past images as well. If it is a BB Code paste the replacement text into a post and I can update it for you.

teach1st 06-25-2011 03:48 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2212676)
Are you using a BBCode? If so it would be a simple fix and work on all past images as well. If it is a BB Code paste the replacement text into a post and I can update it for you.

I'm using straight HTML in the public forums (nobody else but me and a special kid account can post in public). Many of the tags were put in by my students, who help write the newsletter.

BirdOPrey5 06-25-2011 03:50 PM

Quote:

Originally Posted by teach1st (Post 2212679)
I'm using straight HTML in the public forums (nobody else but me and a special kid account can post in public). Many of the tags were put in by my students, who help write the newsletter.

OK gotcha...

teach1st 06-25-2011 03:52 PM

I am far, far from an expert, but I'm wondering if this would work:

Take: ">
Replace " />

BirdOPrey5 06-25-2011 04:06 PM

It might but it may cause other problems with other tags... also I think the replacement variable is run after all other mods so it wouldn't help in this case.

Ideally you'd need some type of search and replace on your database using a regular expression to find your old <img> tags and update them to xhtml <img> tags....

But I wouldn't get involved in something risking your database if things don't go well.

Another solution but not ideal would be a plugin that runs on postbit_display_complete with executon order 1 (so it runs before this mod) to change your html <img> tags to xhtml <img> on the fly. But it would really depend on how consistent your existing tags were entered. Is it always src="" before alt="" for example? if they were inconsistent this wouldn't work.


All times are GMT. The time now is 05:50 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
  • Page Generation 0.01146 seconds
  • Memory Usage 1,741KB
  • 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_html_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)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