MyBB Community Forums

Full Version: Remove Hard Coded Images
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
A personal pet hate of mine and i am sure others is that some images such as the collapse images are hard coded into the core and as such require either a core modification or to change the way those images are used within the templates or the system via plugins etc.

An example being;

in the functions_forumlist.php 

			// Check if this category is either expanded or collapsed and hide it as necessary.
			$expdisplay = '';
			$collapsed_name = "cat_{$forum['fid']}_c";
			if(isset($collapsed[$collapsed_name]) && $collapsed[$collapsed_name] == "display: show;")
			{
				//$expcolimage = "collapse_collapsed.png";   Removed to allow for svg images
				$expcolimage = "collapse_collapsed.svg";
				$expdisplay = "display: none;";
				$expthead = " thead_collapsed";
				$expaltext = "[+]";
			}
			else
			{
				// $expcolimage = "collapse.png";   Removed to allow for svg images
				$expcolimage = "collapse.svg";
				$expthead = "";
				$expaltext = "[-]";
			}
 
note here that to use svg images with the default expander var you need to edit the above as shown for this to work.
it would be nice to see this made a variable within a template or setting.
I know there are other ways to achieve this but for the average user or themer it would be nicer to have greater control over images than to have to add more code or have to rely on a png in todays designs.
Just my opinion but a bit of a pain from my view.
Quote:I know there are other ways to achieve this

like a single rewrite rule that serves svg instead of png, if it exists...

how good is svg support these days? last time I tested, it was great for zooming in, less great if the image was tinsy. also possibly huge filesize and slow to render.

but I guess it's a thing with 4K, 8K displays and whatnot.
Using svg is a more norm thing in todays environment for a number of reason using raster images is not so good due to limitations with those images but vectors open up a a lot more scope.

It is kind of like the change from gif to png years ago now with html 5 svg has become the option of choice in reality that is what nearly every icon font is.

Coming forward in today's designs having scale-able images is nearly a must.

That aside the choice is still up to the designer and the user of a system and having a choice to simply use another image format or maybe even a css class and whilst with a bit of work you can still achieve this within mybb is it time to do away with stuff that is hard coded in this way to me that is not good.

Google can explain more about the versus theories and i do not think it is ideal to go into that here maybe the question about who thinks images should be hard codded into the core or made a more open part of the theme i know as we move to twig more things like this will be looked at so hence the request