vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   New Posting Features - Add Alt Text to Linked Images by BOP5 (VB 4.1.10+) (https://vborg.vbsupport.ru/showthread.php?t=277033)

BirdOPrey5 01-14-2012 11:00 PM

Add Alt Text to Linked Images by BOP5 (VB 4.1.10+)
 
1 Attachment(s)


Current Version: 1.5

This is the Standard Version. The GOLD Version is FREE but available only from:
Qapla.com - Add Alt Text GOLD VB4 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.

The purpose of this mod is to automatically add "alt" and / or "title" tags to linked images in vBulletin forums.

By default vBulletin leaves the alt tag blank on all linked images. However image searches like Google scan for alt and/or title tags to determine what the image is and having these tags can increase your SEO in regards to images and perhaps regular SEO as well.

It can also benefit visually impaired users who may be using a screen reader.

Demo: http://www.qapla.com/mods/showthread...?p=325#post325

VB 4.1.10+ Preferred. No manual file edits necessary.
VB 4.0.0 - VB 4.1.9 - 1 manual file edit required. Directions in .zip.

Please Mark as Installed if you use this. :)
Donations always appreciated. :up:

BirdOPrey5 01-15-2012 09:49 PM

Reserved.

Merjawy 01-15-2012 11:52 PM

Nice,...

Will check it out. Thanks

fizzow 01-16-2012 12:51 AM

Will this mod work if members upload images via 3rd party image hosting like Photobucket?

datoneer 01-16-2012 01:08 AM

Why only 4.1.10 i want this mod, can you make it work for 4.1.8 please. Thanks

OldSchoolDSL 01-16-2012 03:22 AM

Quote:

Originally Posted by datoneer (Post 2288365)
Why only 4.1.10 i want this mod, can you make it work for 4.1.8 please. Thanks

4.1.8 was very troublesome for many modifications (buggy as all hell).

4.1.10 re-does alot of the style vars.

You're best to upgrade (my option)

BirdOPrey5 01-16-2012 11:59 AM

Quote:

Originally Posted by fizzow (Post 2288358)
Will this mod work if members upload images via 3rd party image hosting like Photobucket?

Looking at this example URL from Photobucket:
Code:

http://i170.photobucket.com/albums/u267/bcblondie05/Bunny.jpg
It appears Photobucket does keep the original file name *Bunny" in this case, so yes it should work with Photobucket uploaded images.

Quote:

Originally Posted by datoneer (Post 2288365)
Why only 4.1.10 i want this mod, can you make it work for 4.1.8 please. Thanks

Because the hook used by this mod was introduced in version 4.1.10, the only way it would work on older versions is with a manual file edit.

If you want to try in 4.1.8 you will need to edit your file /includes/class_bbcode.php

Find the function:

PHP Code:

    function handle_bbcode_img_match($link$fullsize false)
    {
        
$link $this->strip_smilies(str_replace('\\"''"'$link));

        
// remove double spaces -- fixes issues with wordwrap
        
$link str_replace(array('  ''"'), ''$link);

        
$retval = ($fullsize '<div class="size_fullsize">' '')  . '<img src="' .  $link '" border="0" alt="" />' . ($fullsize '</div>' '');

        return 
$retval;
    } 

and add the hook manually so it becomes:

PHP Code:

    function handle_bbcode_img_match($link$fullsize false)
    {
        
$link $this->strip_smilies(str_replace('\\"''"'$link));

        
// remove double spaces -- fixes issues with wordwrap
        
$link str_replace(array('  ''"'), ''$link);

        
$retval = ($fullsize '<div class="size_fullsize">' '')  . '<img src="' .  $link '" border="0" alt="" />' . ($fullsize '</div>' '');

        (
$hook vBulletinHook::fetch_hook('bbcode_img_match')) ? eval($hook) : false;

        return 
$retval;
    } 

You would also need to edit the xml file in the zip and change the min version near the top to 4.1.0 or any number less than or equal to your version.

Be warned though there were over 30 new hooks added to 4.1.10- there will be a lot of new mods coming that will only work with 4.1.10 and above- you should upgrade.

dacho 01-16-2012 05:05 PM

nice mate... I will check it on my forum

datoneer 01-16-2012 06:40 PM

Thanks man i'm waitin response from ry215 to ugrade my style...

puertoblack2003 01-17-2012 03:28 AM

Quote:

Originally Posted by BirdOPrey5 (Post 2288511)
Looking at this example URL from Photobucket:
Code:

http://i170.photobucket.com/albums/u267/bcblondie05/Bunny.jpg
It appears Photobucket does keep the original file name *Bunny" in this case, so yes it should work with Photobucket uploaded images.



Because the hook used by this mod was introduced in version 4.1.10, the only way it would work on older versions is with a manual file edit.

If you want to try in 4.1.8 you will need to edit your file /includes/class_bbcode.php

Find the function:

PHP Code:

    function handle_bbcode_img_match($link$fullsize false)
    {
        
$link $this->strip_smilies(str_replace('\\"''"'$link));

        
// remove double spaces -- fixes issues with wordwrap
        
$link str_replace(array('  ''"'), ''$link);

        
$retval = ($fullsize '<div class="size_fullsize">' '')  . '<img src="' .  $link '" border="0" alt="" />' . ($fullsize '</div>' '');

        return 
$retval;
    } 

and add the hook manually so it becomes:

PHP Code:

    function handle_bbcode_img_match($link$fullsize false)
    {
        
$link $this->strip_smilies(str_replace('\\"''"'$link));

        
// remove double spaces -- fixes issues with wordwrap
        
$link str_replace(array('  ''"'), ''$link);

        
$retval = ($fullsize '<div class="size_fullsize">' '')  . '<img src="' .  $link '" border="0" alt="" />' . ($fullsize '</div>' '');

        (
$hook vBulletinHook::fetch_hook('bbcode_img_match')) ? eval($hook) : false;

        return 
$retval;
    } 

You would also need to edit the xml file in the zip and change the min version near the top to 4.1.0 or any number less than or equal to your version.

Be warned though there were over 30 new hooks added to 4.1.10- there will be a lot of new mods coming that will only work with 4.1.10 and above- you should upgrade.

in 4.1.9 is different

from this

Code:

function handle_bbcode_img_match($link, $fullsize = false)
        {
                $link = $this->strip_smilies(str_replace('\\"', '"', $link));

                // remove double spaces -- fixes issues with wordwrap
                $link = str_replace(array('  ', '"'), '', $link);

                return  ($fullsize ? '<div class="size_fullsize">' : '')  . '<img src="' .  $link . '" border="0" alt="" />'
                        . ($fullsize ? '</div>' : '');
        }

to this

Code:

function handle_bbcode_img_match($link, $fullsize = false)
        {
                $link = $this->strip_smilies(str_replace('\\"', '"', $link));

                // remove double spaces -- fixes issues with wordwrap
                $link = str_replace(array('  ', '"'), '', $link);

                return  ($fullsize ? '<div class="size_fullsize">' : '')  . '<img src="' .  $link . '" border="0" alt="" />'
                        . ($fullsize ? '</div>' : '');
        ($hook = vBulletinHook::fetch_hook('bbcode_img_match')) ? eval($hook) : false;
        }

and it worked thanks buddy:up:

BirdOPrey5 01-17-2012 12:23 PM

Cool... The actual code of the function may vary from version to version, the important thing is to find the function:

function handle_bbcode_img_match

And then add the hook right before the return line...

Code:

($hook = vBulletinHook::fetch_hook('bbcode_img_match')) ? eval($hook) : false;
So actually I don't think the code you posted is right, the hook needs to be above the return line.

puertoblack2003 01-17-2012 03:35 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2288966)
Cool... The actual code of the function may vary from version to version, the important thing is to find the function:

function handle_bbcode_img_match

And then add the hook right before the return line...

Code:

($hook = vBulletinHook::fetch_hook('bbcode_img_match')) ? eval($hook) : false;
So actually I don't think the code you posted is right, the hook needs to be above the return line.

thanks :up: i made the adjustment....

strudinox 01-17-2012 09:43 PM

Does this also work with linked images on the CMS?

BirdOPrey5 01-18-2012 12:07 PM

Actually it seems like it does work on linked images in the CMS as well. Just tried it...

14DH01 01-23-2012 04:12 PM

Hello,
Thank you for this mod 5 stars
it also aids to find our images as attachments (I needed to find broken images) ;)

Dennis Kaczor 01-24-2012 06:27 PM

I have been looking for something like this for months and months and always came up blank with my searching. Yesterday I seen this plug-in and downloaded and installed this today and liked what I see with all the images on my site. It has potential with my users images now.

Adding an image from my server worked like a charm, PhotoBucket still shows the file name so that is a plus. I use Flickr for my images and it is a shame that they don't use the File Name when you upload your images on there site, you end up with their file name.

Looking at seeing if one can add an Alt and Title to the end of their code, means a bit of extra work but more of a curious thing for me.

As you mentioned this is better than nothing and I agree. Voted 5 STARS

BirdOPrey5 01-25-2012 01:31 AM

If you want users to enter their own "title" for images you could create a custom BB Code...

Admin CP -> BB Code Manager -> Add New BB Code

Call it: img
Make sure USE OPTION is set to YES
Make the replacement code:
Code:

<img src="{param}" alt="{option}" title="{option}" border="0" />
Save it...

now people can include images like:


14DH01 01-27-2012 01:52 PM

hello,
Add Alt Text to Linked Images
no longer operate this mod:
https://vborg.vbsupport.ru/showthread.php?t=237650

resize image no longer works with your plugin

Thank you

BirdOPrey5 01-27-2012 03:08 PM

Quote:

Originally Posted by 14DH01 (Post 2293043)
hello,
Add Alt Text to Linked Images
no longer operate this mod:
https://vborg.vbsupport.ru/showthread.php?t=237650

resize image no longer works with your plugin

Thank you

Sorry to hear that. I don't think I can do anything about it though.

OldSchoolDSL 01-31-2012 05:23 AM

Installed and working

4.1.10 :)

ayam 02-14-2012 06:54 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2293073)
Sorry to hear that. I don't think I can do anything about it though.

hope it will be fixed later. this is a great mod

BirdOPrey5 03-16-2012 12:03 AM

Updated this to version 1.5

Completely upgraded the code, logic, and options. Introduced a GOLD version which is still FREE with "Smart Tagging" option.

Disregard the "VB3" in the settings screenshots, the settings are identical between the two versions now.

Manual file edit instructions for VB 4.0.0 - 4.1.9 now in info txt file.

It also has new settings to allow it to work with Image Resizers (like ncode image resizer.)

Actually the ncode image resizer is in the info txt file on how to set this mod up to work with it.

For ncode image resizer enter this code in the resizer code setting for this mod:
Code:

onload="NcodeImageResizer.createOn(this);"

Hareth 03-16-2012 09:02 AM

GREAT MOD BOP.

Installed + Nom.

Thank you

BANDiT600 03-16-2012 12:39 PM

Alt is not right tag, right is Titile.

BirdOPrey5 03-16-2012 12:47 PM

Quote:

Originally Posted by BANDiT600 (Post 2310014)
Alt is not right tag, right is Titile.

Please explain... ? :confused:

BANDiT600 03-16-2012 12:58 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2310017)
Please explain... ? :confused:

According to the W3C's HTML 4 specification, the ALT (Alternate Text) attribute is used with the IMG (Image) element to display text when users are viewing the page with a non-graphical browser or other device.

The TITLE attribute is used with the IMG element to provide a tooltip that is displayed when a user mouses over the image. Microsoft IE has been doing this wrong for years and years.

BirdOPrey5 03-16-2012 01:03 PM

This mod allows you to set both the alt tag and title tag separately.

You can set the alt tag to the file name and the title tag to something else. (Or no alt tag at all)

It's not just IE, Chrome also displays the "tool tip" if only an alt tag is present. I haven't checked other browsers.

I'm sure search engines consider both tags for SEO purposes because they base their results on the reality of how things are used, not strict specifications.

BANDiT600 03-16-2012 01:09 PM

But remember that Alt tag will not shown in Firefox.

dog-tag 01-08-2013 08:19 PM

Hi BOP,

I'm using the Marco image resizer, this doesn't work with it, is it because your plugin needs this - "Image Resizer Code"

Do you know what image resizers are currently working with your plugin? This plugin is bloody great for image SEO and I'd love to see it running :)

G

**edit** I've disabled the Marco Image Resizer, but this still doesn't work. Tried re-installing but nothing. I'm using vbulletin 2 pl3 is there any known conflicts or anything I could bug check?

BirdOPrey5 01-12-2013 02:28 PM

I assume you mean 4.2.0 PL3, no conflicts I know of. If you "view source" of your page are you getting anything different in the image tags?

dog-tag 01-12-2013 10:20 PM

Hey Bop :)

This is my source code around the alt text ->>>

Quote:

<img class="thumbnail" src="attachment.php?attachmentid=75410&amp;stc=1&a mp;thumb=1&amp;d=1358021059" alt="Click image for larger version.&nbsp;

Name: image.jpg&nbsp;
Views: 0&nbsp;
Size: 94.0 KB&nbsp;
ID: 75410" title="Click image for larger version.&nbsp;

Name: image.jpg&nbsp;
Views: 0&nbsp;
Size: 94.0 KB&nbsp;
ID: 75410">
Makes image SEO impossible. I was wondering if this was a conflict with lightbox? I think that inserts this certain alt text.

I'd happily pay you to look at this in private also. I've disabled any image related mod, so I find it odd that it doesn't work.

If I ran this through the debugger what should I see? What should look normal?

Edgespeeder06 03-07-2013 01:16 AM

Hey I need some help. I have Vb 4.2. I installed the gold version and i'm using the smart tags but not sure if its working well. My images have an enlarge option and I'm not seeing the alt text:

http://www.njstangers.org/forum/show...ord-Mustang-NJ

Thank you. :)

Edgespeeder06 03-07-2013 01:55 AM

Quote:

Originally Posted by Edgespeeder06 (Post 2408427)
Hey I need some help. I have Vb 4.2. I installed the gold version and i'm using the smart tags but not sure if its working well. My images have an enlarge option and I'm not seeing the alt text:

http://www.njstangers.org/forum/show...ord-Mustang-NJ

Thank you. :)

I disabled the macro resizer and used the quick resizer and it works but how do I adjust the alt text to remove "name:...." from it?

example:

Code:

<img style="max-width: 610px; cursor: pointer;" onclick="window.open(this.src)" src="http://www.njstangers.org/forum/attachment.php?attachmentid=6727&amp;d=1358738794" border="0" alt="Name:  2015-Ford-Mustang-Concept-2015-Mustang-NJ.jpg
Views: 55
Size:  66.7 KB" title="Name:  2015-Ford-Mustang-Concept-2015-Mustang-NJ.jpg
Views: 55
Size:  66.7 KB">


Spangle 03-07-2013 02:49 AM

Installed Works on 4.2 patch 3

BirdOPrey5 03-09-2013 10:08 AM

Quote:

Originally Posted by Edgespeeder06 (Post 2408434)
I disabled the macro resizer and used the quick resizer and it works but how do I adjust the alt text to remove "name:...." from it?

example:

Code:

<img style="max-width: 610px; cursor: pointer;" onclick="window.open(this.src)" src="http://www.njstangers.org/forum/attachment.php?attachmentid=6727&amp;d=1358738794" border="0" alt="Name:  2015-Ford-Mustang-Concept-2015-Mustang-NJ.jpg
Views: 55
Size:  66.7 KB" title="Name:  2015-Ford-Mustang-Concept-2015-Mustang-NJ.jpg
Views: 55
Size:  66.7 KB">


Those are Attachments, not linked images. That text would be the same whether or not this mod was installed because it is generated by vBulletin.

This mod only works on images embedded using [img] BBCode (external images usually)

Please "Mark as installed" if using this. :)

The_____KinG 03-12-2013 11:22 AM

Installed and working perfectly.

Has any one seen any bump in traffic from image search after installing this mod?.

datoneer 10-28-2013 03:01 AM

It doesn't work with ncode imageresizer, and i don't know where is the problem

dizzynation 10-28-2013 03:59 AM

Installed on 4.2 PL3 Works great:

Code:

<br />
<img src="http://www.digipress.us/pics/vomit-img.jpg" border="0" alt="Projectile vomit"  /><br /><br />
                                                </blockquote>
                                        </div>


CAG CheechDogg 10-30-2013 11:16 AM

Quote:

Originally Posted by BirdOPrey5 (Post 2292018)
If you want users to enter their own "title" for images you could create a custom BB Code...

Admin CP -> BB Code Manager -> Add New BB Code

Call it: img
Make sure USE OPTION is set to YES
Make the replacement code:
Code:

<img src="{param}" alt="{option}" title="{option}" border="0" />
Save it...

now people can include images like:

Code:

[IMG="This is a custom title"]http://www.example.com/demo.jpg[/IMG]

How does this work BOP5 once you create the custom bb code? I created the bb code but when I wrap the image with this bb code the image wont show up , only the custom bb code's tag...

mradlin 03-09-2014 07:06 PM

Installed and working great in 4.2.2!
Thanks!


All times are GMT. The time now is 07:28 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.02641 seconds
  • Memory Usage 1,884KB
  • 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
  • (14)bbcode_code_printable
  • (4)bbcode_php_printable
  • (13)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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