MyBB Community Forums

Full Version: SEO Images in Posts
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm looking to edit the alt/title tag for images in a post. Currently this shows as alt="[Image: imagename.jpg]" I am looking to change this to the post title, alt="SEO Images in Posts"

Any help would be great as I have looked in all pages, code which I thought would need to be edited with no luck. Thanks.
1. Open the ./inc/class_parser.php file in a text editor.

2. Find: (line 889)

global $lang;

3. Change to:

global $lang, $thread;

4. Find: (lines 901-906)

$alt = htmlspecialchars_uni(basename($url));
if(my_strlen($alt) > 55)
{
	$alt = my_substr($alt, 0, 40)."...".my_substr($alt, -10);
}
$alt = $lang->sprintf($lang->posted_image, $alt);

5. Change to:

$alt = $thread['subject'];

6. Save the ./inc/class_parser.php file and re-upload it.
Thank you