MyBB Community Forums

Full Version: Missing Images appear in Post as [Image: xyz.jpg]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I have 1.6.8 installed

Missing Images appear in Post as [Image: xyz.jpg]

which becomes very ugly when there are 50 or 60 images in a post. It makes post look ugly. How do i make it so nothing appear for a missing image, like in vbulletin.

Please help Smile

Thankyou
Are you talking about attachment images or images that are like the "New Reply" button etc?
I have celebrity forum, I upload images to image hosting sites and get bbcode for thumbnails, and not all images show everytime and when such text appears for a missing image it makes the whole post look ugly and unordered, no matter how beautiful the thumbs are.

Ok, i figured it out go to inc/class_parser.php

then find

/**
* Parses IMG MyCode.
*
* @param string The URL to the image
* @param array Optional array of dimensions
*/

There below you can see a html code which have alt after border="0" , just remove it and the whole code will now look like this.

/**
	 * Parses IMG MyCode.
	 *
	 * @param string The URL to the image
	 * @param array Optional array of dimensions
	 */
	function mycode_parse_img($url, $dimensions=array(), $align='')
	{
		global $lang;
		$url = trim($url);
		$url = str_replace("\n", "", $url);
		$url = str_replace("\r", "", $url);
		if($align == "right")
		{
			$css_align = " style=\"float: right;\"";
		}
		else if($align == "left")
		{
			$css_align = " style=\"float: left;\"";
		}
		$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);
		if($dimensions[0] > 0 && $dimensions[1] > 0)
		{
			return "<img src=\"{$url}\" width=\"{$dimensions[0]}\" height=\"{$dimensions[1]}\" border=\"0\"{$css_align} />";
		}
		else
		{
			return "<img src=\"{$url}\" border=\"0\"{$css_align} />";			
		}
	}

Coders please state if it pose any security risk.

Thankyou
Mybb 1.6.8 installed
My Forum is under development
Advanced Editor WysiWyg is installed>>> http://mods.mybb.com/view/wysiwyg-editor
Browser : Firefox 16.0.2

==============
Hi all ... I am facing a similar problem.
Although i can directly post images within ordinary -plain- replies
(not enhanced by random bbcode tags i mean) when nesting them within a
("lets say") spoiler, i am having some issues

I just made the alteration provided above( http://community.mybb.com/thread-126331-...#pid914432 )
YET i am still getting a blank post when inserting images within
either Myfieldset code
or
Every spoiler plugin out there for download in MyBB bank of code-modifications

Meanwhile i have created a Contentbox Mycode
(more or less like the one vbulettin usualy offers, meaning a collapsible bar with optional title that reveals a text)
which strangely enough doesnt cause me any of the aforementioned issues
MyBB Created Code Contentbox is fully supporting images nesting

By images nesting i am both refering to either
implementing them via [img][/img](inserted manualy or via the button provided)
or directly copying the image from random urls(as an object or as url doesnt matter)

=================
If you need me to i can upload the code i made so to have a look.

=============================
edit
i just noticed that this is an issue of advanced wysiwyg editor
(not a bug actually)
switching into the source tab [Image: 14494-1295612571-wysiwyg-1.png]
enables you to insert those imgs within all tags.

I may though have to quit this editor...(*sigh "again!")
is there a tutorial to add commands and buttons in the default editor??
Much appreciated if i can get some help here....

thanks in advance
=============================