Firefox PHP

Module: Embed Images

Posted by Maurice Makaay 
Re: Module: Embed Images
April 12, 2009 07:22AM
This was already reported in the SEF URL thread. Please report your issue in that thread too and not in this one. If SEF URL breaks Embed Images, then it's the SEF URL module that has a bug.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Module: Embed Images
May 16, 2009 03:16AM
*self-deleted*



Edited 1 time(s). Last edit at 06/24/2018 05:47PM by Voltius.
Re: Module: Embed Images
May 16, 2009 06:07AM
Above the text is not a big issue. It needs a bit of hacking in the module, but it's perfectly possible. Around line 229 in mods/embed_images/embed_images.php, you could try to replace the existing code with this:

Language: PHP
// Handle automatic displaying of image attachments as embedded // images in the message. $block = ';';; $has_images = FALSE; if (!empty($PHORUM[';mod_embed_images';][';embed_allatt';]) && !empty($data[$id][';attachments';])) {   foreach ($data[$id][';attachments';] as $aid => $attachment) { $attach = phorum_mod_embed_images_render_embedded_attachment( $attachment, $data[$id], TRUE ); if (isset($attach[';rendered_raw';])) { if (!$has_images) { $block = ';<div class="mod_embed_images_attachments">';; $has_images = TRUE; } $block .= $attach[';rendered_raw';]; unset($data[$id][';attachments';][$aid]); } } } if ($has_images) $data[$id][';body';] = $block .';</div><br style="clear:both"/>';;

I didn't test it, but this should be about it.

Floating to the left is what is in the CSS by default, but I'm not sure if that results in the effect that you desire.

Another option is to install the Embed Attachments module. Using that, you can place an attachment marker in the message body to point exactly where you want the image to appear. The images that are shown below the message will only be shown there, in case they are not already included in the body. I would prefer that option, since it gives me even more control and requires no hacking.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Module: Embed Images
May 16, 2009 11:38AM
*self-deleted*



Edited 1 time(s). Last edit at 06/24/2018 05:47PM by Voltius.
Re: Module: Embed Images
May 16, 2009 12:55PM
Oh yes, stupid me. Change the last two lines to the following:

Language: PHP
if ($has_images) $data[$id][';body';] = $block .';</div><br style="clear:both"/>'; . $data[$id][';body';];


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Module: Embed Images
May 16, 2009 06:53PM
*self-deleted*



Edited 1 time(s). Last edit at 06/24/2018 05:48PM by Voltius.
Re: Module: Embed Images
May 18, 2009 01:15AM
Thanks for your information
Re: Module: Embed Images
May 18, 2009 03:05AM
Sorry, I overlooked this response by you. In the current code, there is an explicit break to make sure that the text wraps below the image. Try removing <br style="clear:both"/> from the code in the module. Without that, the text should start to the right of the image. Things might get weird with multiple images, but it looks like you're only supporting one image per post.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Module: Embed Images
June 16, 2009 02:59PM
By default, if you use this mod with Embed Attachments, code is dropped in like this:

[attachment1.jpg]
[attachment2.jpg]

and the thumbnails are stacked on top of each other.

If the code were

[attachment1.jpg][attachment2.jpg]

then the images would be side by side. Is there a way to change this?

thanks
Re: Module: Embed Images
June 16, 2009 03:35PM
What exactly is it that you want to change? The way that the images are added to the post automatically or by a button click? Or do you want to prevent images from being show above each other if the embedding tags are above each other? I'm not fully sure what you are asking for.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Sorry, only registered users may post in this forum.

Click here to login