MyBB Community Forums

Full Version: parse images in QUOTES ? change img to url
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
'When a person posts an image like

[Image: blow-pops.jpeg]

and another person QUOTES this post,
the QUOTED post  will show the message text and instead of the image, it will say something like

-[Click here to view the image from the post]-

'
example:

Quote:When a person posts an image like

-[Click here to view the image from the post]-

and another person QUOTES this post,
the QUOTED post  will show the message text and instead of the image, it will say something like

1: Convert the image to a link
2: Only QUOTED images are converted to LINK
3: Should affect both inline image, and attachment images. * (this one is optional if only inline image can be converted, that's fine)

Please only post the solution, or link to method that actually works.
I have read and tried every methods discussed on mybb.com before, none works as described above.

(2017-04-18, 12:33 AM)Vanz Wrote: [ -> ]'When a person posts an image like

[Image: blow-pops.jpeg]
[Image: impossibly-cute-puppy-2.jpg]
[Image: blow-pops.jpeg]

and another person QUOTES this post,
the QUOTED post  will show the message text and instead of the image, it will say something like

-[Click here to view the image from the post]-

'
example:

Quote:When a person posts an image like

-[Click here to view the image from the post]-
-[Click here to view the image from the post]-
-[Click here to view the image from the post]-

and another person QUOTES this post,
the QUOTED post  will show the message text and instead of the image, it will say something like

1: Convert the image to a link
2: Only QUOTED images are converted to LINK
3: Should affect both inline image, and attachment images. * (this one is optional if only inline image can be converted, that's fine)

Please only post the solution, or link to method that actually works.
I have read and tried every methods discussed on mybb.com before, none works as described above.
most probably jQuery can be used for such requirements [something like this]
(2017-04-18, 05:09 AM).m. Wrote: [ -> ] [something like this]

Thanks but,


1: That method does not tell the readers that there was any image-ATTACHMENTS in the  OP that was quoted.
2:  Does not LINK back to the image(s) as described here


Tested on MyBB 1.8.11
Added these attachment images for testing 

[attachment=38788]

MB 1 = attached
MB  2 = attachment - inserted in post

Quote this post /Quick reply to this post.
well, you can try using something like below in the showthread template (above </body>)
<script type="text/javascript">
$('blockquote img').each(function () {
var imgurl = $(this).attr("src");
var imgurl2 = '<a href='+imgurl+'>[image]</a>';
$(this).replaceWith(imgurl2);
});
</script> 
Thanks @.m.

We are part-way there Big Grin
This worked perfect for inserted linked images,
but it truncated all attachments in the quote, even attachments that are "insert in post"

(2017-04-21, 05:20 AM).m. Wrote: [ -> ]well, you can try using something like below in the showthread template (above </body>)
<script type="text/javascript">
$('blockquote img').each(function () {
var imgurl = $(this).attr("src");
var imgurl2 = '<a href='+imgurl+'>[image]</a>';
$(this).replaceWith(imgurl2);
});
</script> 
^ IIRC, image attachments are no longer displayed in the quoted messages. (eg. #)
(2017-04-21, 09:56 AM).m. Wrote: [ -> ]^ IIRC, image attachments are no longer displayed in the quoted messages. (eg. #)

Whats the LAST version of MyBB that attachments was still quotable ?
or
How do I reinstate that capability ?

T.I.A.
^ I tried searching through different versions of MyBB
and I understand that attachments never appear in the quoted messages.
so far could not trace where exactly that restriction is made.

attachments are tied to specific post (pid)

[attachment=18] <-- does not work here but it works at its specific post
Thanks for all your help @.m.

I have seen image attachments quoted on MyBB run forums in the past,
I just cant remember the forum(s) ATM.
maybe they had a MOD or they did some file alterations to get that accomplished.

I will keep searching still.
Pages: 1 2