PDA

View Full Version : Variables for thread title


Przemoo
12-10-2011, 06:21 PM
Hello, regarding to this thread - https://www.vbulletin.com/forum/showthread.php/392652-Where-to-find-alt-attribute i need to know what variable is use in .php files for thread title ? i've tried "$thread[title]" but not working . thanks in advance

LifesGreatestGift
12-10-2011, 06:51 PM
AdminCP>Plugins & Products>Add new plugin>

Product: vBulletin
Hook Location: postbit_display_complete
Title: add alt="" tags to images
PHP Plugin Code: $this->post['message'] = str_replace('<img', '<img alt="your alt tags here"', $this->post['message']);
Plugin is active: yes

You will just need to figure out how to echo the title variable in there somehow.

Przemoo
12-10-2011, 06:56 PM
that's the point, title variable. but i don't have any idea which variable i have2 use ;d

LifesGreatestGift
12-10-2011, 07:18 PM
have you tried $post['title'] seeing as this is a posbit edit? or {vb:raw post.title}

not really sure how to include those into your custom PHP

HMBeaty
12-10-2011, 07:22 PM
Maybe this?

$this->post['message'] = str_replace('<img', '<img alt="'.$post['title'].'"', $this->post['message']);

--------------- Added 1323548963 at 1323548963 ---------------

Ok, I just tested the above code and worked just fine for me :)

LifesGreatestGift
12-10-2011, 07:33 PM
it was the 2 . (periods) thanks HMBeaty :)

HMBeaty
12-10-2011, 07:35 PM
it was the 2 . (periods) thanks HMBeaty :)
Look closer ;)

Inside the 2 quotation marks, there are 2 single quotes as well :)

Przemoo
12-10-2011, 08:51 PM
thank you, working perfectly :)