Page 1 of 1

Editing [img] bbcode help - adding alt tag

Posted: Mon Aug 23, 2010 2:57 am
by cgworld
Hello guys
I would like to edit the [img] bbcode so i can add the alt and title tags. Also alt and title tag will be generated from the topic title automatically + some other word which i will place, i don't want to be like this i know how to do this one :
[img alt="something"][/img]

i tried to edit the "bbcode.php" but coudlnt understand how it works :(
any help will be appreciated !

Thanks

Re: Editing [img] bbcode help - adding alt tag

Posted: Mon Aug 23, 2010 9:38 am
by tbackoff
This is going to be more then a simple few edits. If you are generating the alt tag from the topic title, you would have to run SQL queries on the topics table to get the name of the topic your in. Then passing that information to the img BBCode.

Like you said, it's much easier to have users type in their own alt tags (by making a new custom BBCode).

Re: Editing [img] bbcode help - adding alt tag

Posted: Mon Aug 23, 2010 9:42 am
by AmigoJack
To define your own tag in go to ACP > Posting > BBCodes:

BBCode usage:

Code: Select all

[pic={URL}]{INTTEXT}[/pic]
HTML replacement:

Code: Select all

<img src="{URL}" alt="{INTTEXT} title="{INTTEXT}" />