Automatic Image Embedding

Looking for an Extension? Have an Extension request? Post your request here for help. (Note: This forum is community supported; while there is an Extensions Development Team, said team does not dedicate itself to handling requests in this forum)
Suggested Hosts
Brighto
Registered User
Posts: 32
Joined: Tue Jun 27, 2017 9:01 am

Automatic Image Embedding

Post by Brighto »

I'm looking for an extension that will do this for images. The creator said it was possible, but that he didn't want to enable it for whatever reason.

I've searched quite extensively for an alternative, but all I found was this (I'm unsure how to use it, however).

It's surprising that there isn't an extension for this as it'd be very useful.

Cheers.
User avatar
ViolaF
I've Been Banned!
Posts: 1609
Joined: Tue Aug 14, 2012 11:52 pm

Re: Automatic Image Embedding

Post by ViolaF »

The Code in the 2nd-Link works a treat :idea:
User avatar
ViolaF
I've Been Banned!
Posts: 1609
Joined: Tue Aug 14, 2012 11:52 pm

Re: Automatic Image Embedding

Post by ViolaF »

English Instruction here..
http://bit.ly/2twJz4E

....(cant edit - sorry)
User avatar
Theriddler1
Registered User
Posts: 451
Joined: Sat Aug 27, 2011 11:00 pm
Location: NL
Name: Theriddler❶
Contact:

Re: Automatic Image Embedding

Post by Theriddler1 »

there is a event that can be used for this

Code: Select all

core.modify_format_display_text_after
so a simple extension can be made
Theriddler - Former Moderator @ phpBB.nl | phpBBservice.nl Team-member
Image My Extensions | buy me a beer Image
User avatar
ViolaF
I've Been Banned!
Posts: 1609
Joined: Tue Aug 14, 2012 11:52 pm

Re: Automatic Image Embedding

Post by ViolaF »

theoretical, yes ... but works also...
User avatar
JoshyPHP
Code Contributor
Posts: 1288
Joined: Mon Jul 11, 2011 12:28 am

Re: Automatic Image Embedding

Post by JoshyPHP »

Theriddler1 wrote: Sun Jul 02, 2017 4:22 pm there is a event that can be used for this
That event is only triggered on preview. The simplest way to do it in 3.2 is by enabling the Autoimage plugin in core.text_formatter_s9e_configure_after. It will only apply to messages posted or edited while the extension is enabled.
I wrote the library that handles markup in phpBB 3.2+.
User avatar
ViolaF
I've Been Banned!
Posts: 1609
Joined: Tue Aug 14, 2012 11:52 pm

Re: Automatic Image Embedding

Post by ViolaF »

ViolaF wrote: Sun Jul 02, 2017 4:37 pm... but works also...
...the named code works also on images posted before and in future...
Brighto
Registered User
Posts: 32
Joined: Tue Jun 27, 2017 9:01 am

Re: Automatic Image Embedding

Post by Brighto »

ViolaF wrote: Sat Jul 01, 2017 10:38 am English Instruction here..
http://bit.ly/2twJz4E

....(cant edit - sorry)
Thanks for the translation. I can't get it to work, though. I think I've put it in the posting.php file fine, but in viewtopic.php, I can't find

// Parse the message and subject
$message = censor_text($row['post_text']);

Only

// Parse the message and subject
$parse_flags = ($row['bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0) | OPTION_FLAG_SMILIES;
$message = generate_text_for_display($row['post_text'], $row['bbcode_uid'], $row['bbcode_bitfield'], $parse_flags, true);


I've tried just pasting it anyway, but it doesn't seem to work.

re: the other suggestion in the thread, sounds good, but how do I make use of that in layman's terms?
User avatar
Ger
Registered User
Posts: 2107
Joined: Wed Jan 02, 2008 7:35 pm
Location: 192.168.1.100
Contact:

Re: Automatic Image Embedding

Post by Ger »

ViolaF wrote: Sat Jul 01, 2017 10:38 am English Instruction here..
http://bit.ly/2twJz4E

....(cant edit - sorry)
That's for 3.0 and it's a MOD not an extension. You shouldn't try to "help" people by posting MOD instructions that don't work for 3.2. It will do more harm than it solves.
Brighto wrote: Wed Jul 05, 2017 9:20 am
ViolaF wrote: Sat Jul 01, 2017 10:38 am English Instruction here..
http://bit.ly/2twJz4E

....(cant edit - sorry)
Thanks for the translation. I can't get it to work, though. I think I've put it in the posting.php file fine, but in viewtopic.php, I can't find

// Parse the message and subject
$message = censor_text($row['post_text']);

Only

// Parse the message and subject
$parse_flags = ($row['bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0) | OPTION_FLAG_SMILIES;
$message = generate_text_for_display($row['post_text'], $row['bbcode_uid'], $row['bbcode_bitfield'], $parse_flags, true);


I've tried just pasting it anyway, but it doesn't seem to work.
You should revert your modifications.
My extensions:
Simple CMS, Feed post bot, Avatar Resize, Modbreak, Magic OGP, Live topic update, Modern Quote, Quoted Where (GDPR) and Autoresponder.
Newest: FAQ manager for 3.2

Like my work? Buy me a coffee to keep it coming. :ugeek:

-Don't PM me for support-
Brighto
Registered User
Posts: 32
Joined: Tue Jun 27, 2017 9:01 am

Re: Automatic Image Embedding

Post by Brighto »

Ah, so that's why. Thanks for pointing it out.
Brighto
Registered User
Posts: 32
Joined: Tue Jun 27, 2017 9:01 am

Re: Automatic Image Embedding

Post by Brighto »

JoshyPHP wrote: Sun Jul 02, 2017 4:51 pm
Theriddler1 wrote: Sun Jul 02, 2017 4:22 pm there is a event that can be used for this
That event is only triggered on preview. The simplest way to do it in 3.2 is by enabling the Autoimage plugin in core.text_formatter_s9e_configure_after. It will only apply to messages posted or edited while the extension is enabled.
Anyone interested in doing this?
Brighto
Registered User
Posts: 32
Joined: Tue Jun 27, 2017 9:01 am

Re: Automatic Image Embedding

Post by Brighto »

No interest at all?
User avatar
Theriddler1
Registered User
Posts: 451
Joined: Sat Aug 27, 2011 11:00 pm
Location: NL
Name: Theriddler❶
Contact:

Re: Automatic Image Embedding

Post by Theriddler1 »

maybe this will work

Code: Select all

$(function () {
    $(".post").each(function () {
        id = this.id;
        $("a.colorbox", this).colorbox({
            rel: id,
            transition: "none",
            photo: true,
            maxWidth: "95%",
            maxHeight: "95%",
            scalePhotos: true
       });
    });
    checkLink();
});

function checkLink() {
    $("a.postlink, a.postlink-local, a.img_link").filter(function () {
        return $(this).attr("href").match(/\.(gif|jpe?g|png|bmp)$/i)
    }).colorbox({
        photo: !0,
        maxWidth: "800px",
        maxHeight: "800px"
    });
};
it works with colorbox.
Last edited by Theriddler1 on Sat Jul 22, 2017 9:44 am, edited 6 times in total.
Theriddler - Former Moderator @ phpBB.nl | phpBBservice.nl Team-member
Image My Extensions | buy me a beer Image
Brighto
Registered User
Posts: 32
Joined: Tue Jun 27, 2017 9:01 am

Re: Automatic Image Embedding

Post by Brighto »

Thank you!
Brighto
Registered User
Posts: 32
Joined: Tue Jun 27, 2017 9:01 am

Re: Automatic Image Embedding

Post by Brighto »

Theriddler1 wrote: Mon Jul 17, 2017 7:58 am maybe this will work

Code: Select all

$(function () {
    $(".post").each(function () {
        id = this.id;
        $("a.colorbox", this).colorbox({
            rel: id,
            transition: "none",
            photo: true,
            maxWidth: "95%",
            maxHeight: "95%",
            scalePhotos: true
       });
    });
    checkLink();
});

function checkLink() {
    $("a.postlink, a.postlink-local, a.img_link").filter(function () {
        return $(this).attr("href").match(/\.(gif|jpe?g|png|bmp)$/i)
    }).colorbox({
        photo: !0,
        maxWidth: "800px",
        maxHeight: "800px"
    });
};
it works with colorbox.
Can you explain how I go about adding this? I've read the guide and faq, but I'm none the wiser. Thanks.
Post Reply

Return to “Extension Requests”