Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 02-04-2013, 10:02 AM
dog-tag's Avatar
dog-tag dog-tag is offline
 
Join Date: Jan 2012
Posts: 84
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Changing Image Alt Text Using Replacement Variables

Hey all

Just been trying to change my pesky image alt text using replacements variables.
My current alt text is -

alt="Click image for larger version. 
(I think the lightbox feature creates this.)

Anyway I created a replacement variable like this -

REPLACE : alt="Click image for larger version
WITH : alt="$vboptions['bbtitle']

I also tried {options}, $vboptions['keywords'] and {title}

It will change the alt text but then the text is just {options} etc it won't pull the unique thread title or keywords into the alt text for me.

Can somebody tell me the correct code I need?
G
Reply With Quote
  #2  
Old 02-04-2013, 05:07 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try:
Code:
alt="{vb:raw vboptions.bbtitle}"
If your forum title has any special characters in it, you may need to do something a little different (It may be that " is the only character that would cause problems - I can't remember offhand).
Reply With Quote
  #3  
Old 02-04-2013, 06:22 PM
dog-tag's Avatar
dog-tag dog-tag is offline
 
Join Date: Jan 2012
Posts: 84
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No that doesn't work either...

The whole source of the images are like this -

Code:
alt="Click image for larger version. 

Name:	test 1.jpg 
Views:	0 
Size:	34.2 KB 
ID:	78672"/></a>
&nbsp;
Just tried -

Code:
alt="click image for larger version.
replace with
alt="{vb:raw vboptions.bbtitle}
Tried with and without the " with your code, thanks for the reply Kevin!

Is there any where I can find that piece of code I need?
Reply With Quote
  #4  
Old 02-04-2013, 08:47 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I probably should have asked, where are you doing this exactly? The curly brace replacements only work if you're putting that code in a template. Assuming you are and it didn't work, which template is it and what did you see?
Reply With Quote
  #5  
Old 02-05-2013, 05:46 AM
dog-tag's Avatar
dog-tag dog-tag is offline
 
Join Date: Jan 2012
Posts: 84
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Kevin,

I went into styles + termplates -> replacement variable manager -> add new replacement variable

I put the variable into my current custom theme (not the default vb one).

When I did the replace, I hovered the mouse over the image, alt text just reads {vb:raw vboptions.bbtitle}
When I view the source code in FF, it looks correct but the color of the text is now all red.

Before some of the text was blue, and this is what was the alt text I could read when hovering, but now the source code highlights it all as red.

So before I could read the lightbox alt text, filename, views and size
But now the alt (when hovering) just reads {vb:raw vboptions.bbtitle}
Reply With Quote
  #6  
Old 02-05-2013, 12:07 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm sorry, I misunderstood what you were trying to do. The answer is that when you set up a replacement variable, you can't use a variable in the replacement text. (That just sounds wrong, I know, but it's true).

But you could just put your forum title in there, since I don't imagine it would change very often.
Reply With Quote
  #7  
Old 02-05-2013, 01:52 PM
dog-tag's Avatar
dog-tag dog-tag is offline
 
Join Date: Jan 2012
Posts: 84
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

haha OK

Can I insert thread keywords? thread title? thread description?
Anything at all related to the thread...

I tried the alt plugin by BOP5 but it wouldn't work. I also checked to see if VBSEO offered this but they don't (which I found very weird).

How do vBulletin users get loving from Google images? I'm finding it very hard and I have alot of images on my site... thanks for all the words of wisdom Kevin
Reply With Quote
  #8  
Old 02-05-2013, 02:33 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I guess the way to do it is to have a plugin put together a string from whatever values you want, then register that to the template and use a curly brace thing in the template. But I know not everyone is in to that kind of programming, and I don't know if any mods exist already. Hopefully someone else will.
Reply With Quote
  #9  
Old 02-06-2013, 07:48 AM
dog-tag's Avatar
dog-tag dog-tag is offline
 
Join Date: Jan 2012
Posts: 84
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Damn it to hell, hmmm think I'll have to make a paid request and see what happens.

Thanks alot for the input, hopefully I can make something work and share it here on the forum.
Reply With Quote
  #10  
Old 02-06-2013, 01:34 PM
Digital Jedi's Avatar
Digital Jedi Digital Jedi is offline
 
Join Date: Oct 2006
Location: PopCulturalReferenceLand
Posts: 5,171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

One of the articles in the Articles Forum is a tutorial on how to do a simple string replace using plugins. It might need some tweaking for vB4, but it might be just what you needed.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:53 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.14084 seconds
  • Memory Usage 2,247KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete