Shoutbox and Imgcode - Printable Version +- Makestation (https://makestation.net) +-- Forum: Technical Arts (https://makestation.net/forumdisplay.php?fid=45) +--- Forum: Web Design & Internet (https://makestation.net/forumdisplay.php?fid=62) +---- Forum: MyBB Related (https://makestation.net/forumdisplay.php?fid=120) +---- Thread: Shoutbox and Imgcode (/showthread.php?tid=2982) |
Shoutbox and Imgcode - tc4me - May 5th, 2020 Hy forum professionals, I installed the same Shoutbox, runs great, I changed the 'allow_imgcode' => 0 to 1 in the dvz_shoutbox.php, that pictures can also be displayed via bbcode, works, but unfortunately I fail at the css to reduce the pictures, could you help me? lg Tc4me RE: Shoutbox and Imgcode - Lain - May 5th, 2020 Note: You're better off asking DVZ himself on his support thread over at the MyBB Community Forums. All this is unofficial. Not as simple as that. The shoutbox uses the regular MyBB MyCode/BBCode parser. The default parser parses images normally, as you would see in a thread. That's why your images look really big in the shoutbox. The problem is that if you were to make a change to it to make all images look small, then all images that people upload to their threads with [img] tags would also look small. Another point is that CSS doesn't really apply to <img> tags. If you want to resize an image on a page, you need to do so with width/height properties of the element, not the style property. E.g. This works: <img width="30px" height="30px" src="x" /> This doesn't work: <img style="width: 30px; height: 30px;" src="x" /> I think max-width/max-height might work for CSS, but I don't think the image scales down and it might overflow. The fix is relatively simple, but it involves a lot of steps. I can outline generally what you'd need to do. Code: 1. Create a copy of the file 'inc/class_parser.php' and name it something like 'class_parser_shoutbox.php' RE: Shoutbox and Imgcode - tc4me - May 5th, 2020 Thank you very much Lain. I create my own shoutclass_parser.php or x-name for the shoutbox so that only the pictures in the shoutbox and not the whole forum are reduced! Try that is perfect. Big thanks Lain RE: Shoutbox and Imgcode - tc4me - May 5th, 2020 Hy Lain, so after I try the easy way, it works with the CSS Code: #shoutbox .entry img { max-width: 200px; height: auto; } RE: Shoutbox and Imgcode - Lain - May 5th, 2020 (May 5th, 2020 at 9:02 AM)tc4me Wrote: Hy Lain, so after I try the easy way, it works with the CSS Oh cool, it does scale. Yeah figured the main difference lied in max-width/max-height instead of just width/height properties. RE: Shoutbox and Imgcode - tc4me - May 5th, 2020 (May 5th, 2020 at 9:14 AM)Lain Wrote:(May 5th, 2020 at 9:02 AM)tc4me Wrote: Hy Lain, so after I try the easy way, it works with the CSS But thanks for your instructions anyway, I'll try that too, my brain won't let me rest until I have it as I imagine it. I am concerned with parse.php, I really have to try that :-) |