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 - Add ALT and/or TITLE text to linked images in VB3 by BOP5 (https://vborg.vbsupport.ru/showthread.php?t=280080)

BirdOPrey5 03-14-2012 11:00 PM

Add ALT and/or TITLE text to linked images in VB3 by BOP5
 
1 Attachment(s)

The purpose of this mod is to add alt text and/or title text to to the <img> tags generated in VB3.x when an image is linked in a post.

This is the Standard Version. The GOLD Version is FREE but available only from:
Qapla.com - Add Alt Text GOLD by BOP5 Mod

The GOLD edition has 1 additional feature: Smart Tagging
Smart Tagging will check the filename of an image for useful information. If the mod believes the filename can be useful to describing the image it will use a cleaned and formatted version of the filename as the alt or title text. If the mod sees that the filename is all numeric, or a common digital camera format, or a vbulletin attachment filename it will instead use the thread title as the alt/title text for the image.

The Standard edition has only 3 options for alt or title text, each of which can be set independently. - Use Filename, Use Thread Title, or use both Filename AND Thread Title to create the tag.

THIS MOD REQUIRES 1 MANUAL FILE EDIT
Instructions included, the class_bbcode.php file must be edited. Detailed instructions are included on the ONE edit that must be made.

Since VB 3.8.7 is the last VB 3.x release a manual file edit isn't very annoying since you'll never have to worry about re-doing it unless you re-install your forum.

If you ever upgrade to VB4 there is a separate VB4 version that doesn't require any file edits.

Live Demo: A random image posted on JUOT Forums

------------------------------------------------------

Please "Mark as Installed" if you use this. :)
Donations always appreciated. :up:
Nominate MOTM if you LOVE it! ;)

BirdOPrey5 03-15-2012 02:26 PM

Reserved.

BirdOPrey5 03-16-2012 03:01 PM

I updated the zip file, I had included the wrong instructions for the manual file edit- my apologies.

The real edit, which has been fixed in the instructions now is:

Open file /includes/class_bbcode.php

Find in file: function handle_bbcode_img_match
or
Go to line #: 1993(in VB 3.8.7, may vary in other versions)

Change:
PHP Code:

    return '<img src="' .  $link '" border="0" alt="" />'

To:
PHP Code:

    //return '<img src="' .  $link . '" border="0" alt="" />';
        
($hook vBulletinHook::fetch_hook('bbcode_img_match_vb3')) ? eval($hook) : false;
    
$retval '<img src="' .  $link '" border="0" alt="'.$bop5alt.'" '.$bop5title.$bop5rscode.' />';    
    return 
$retval


Abu2 03-19-2012 05:10 PM

Quote:

//return '<img src="' . $link . '" border="0" alt="" />';
($hook = vBulletinHook::fetch_hook('bbcode_img_match_vb3')) ? eval($hook) : false;
$retval = '<img src="' . $link . '" border="0" alt="'.$bop5alt.'" '.$bop5title.$bop5rscode.' />';
return $retval;
It works perfect in FireFox, but not in IE9.
Image resizer not working in IE9 at all with this code. (I use ncode)
Why?

BirdOPrey5 03-19-2012 09:11 PM

It's working on my IE9...

Does it work for you on this page:
http://www.juot.net/forums/showthrea...13#post1286813

Please give me a link to a thread on your site with the problem.

htscpl 03-20-2012 10:01 PM

Just installed on my vb3.8 and it seems to be working just fine. Thanks! :D

weindians 03-21-2012 09:25 PM

Has this anything to do with [img] tag which normaly used while posting

BirdOPrey5 03-21-2012 11:07 PM

Yes, this works specifically with the regular [img] tag.

weindians 03-23-2012 05:30 PM

great BOP5... thanx for the mod.. also is there a option to add alt text to images exits... also "image linked in post" means <img src"link"/> ??? what if images inserted like [img]link[/img] or is it hotlinking images??

BirdOPrey5 03-23-2012 06:28 PM

This will work for all images added via the [IMG] BBCode- It works all existing posts as well, not just new ones.

If it isn't showing on an old post it may mean the post cache needs to be cleared. You can edit-and-resave the post to force the cache to update.


All times are GMT. The time now is 09:57 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.01085 seconds
  • Memory Usage 1,740KB
  • 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_php_printable
  • (1)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