Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2020-08-06 05:28:04

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,007
Website GitHub Mastodon Twitter

Re: Comment with image attached?

SteveG wrote #325183:

Thanks a lot!

Edit:
I just tried. With the Allow more Textile markup in comments? enabled, I’m still not able to comment an image, Why?
Here is what it shows:
!https://i.imgur.com/cn0ibcy.png!

Confirming that I can replicate this behaviour in Pete’s demo site.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#14 2020-08-06 10:52:44

etc
Developer
Registered: 2010-11-11
Posts: 5,028
Website GitHub

Re: Comment with image attached?

SteveG wrote #325183:

With the Allow more Textile markup in comments? enabled, I’m still not able to comment an image, Why?
Here is what it shows:
!https://i.imgur.com/cn0ibcy.png!

Damn! Have we broken it or images never worked in comments? I’m confused..

Offline

#15 2020-08-06 11:25:49

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,007
Website GitHub Mastodon Twitter

Re: Comment with image attached?

etc wrote #325191:

Damn! Have we broken it or images never worked in comments? I’m confused..

Admittedly I did not use comments for aeons and when I did, it was always on restrictive mode, but I do not think you broke it as at the time comments were used, images where mostly out of the question.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#16 2020-08-06 11:36:07

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,250
Website GitHub

Re: Comment with image attached?

etc wrote #325191:

Damn! Have we broken it or images never worked in comments? I’m confused..

Must admit I’ve never tried it. I’m giving myself a headache trying to figure out the stupid negative logic in the variable naming conventions adopted over the years.

Textile’s RestrictedParser is instantiated:

$this
    ->setRestricted(true)
    ->setLite(!get_pref('comments_use_fat_textile', 1))
    ->setImages((bool) get_pref('comments_disallow_images', 1));

So:

  • Restricted: on. That’s fine.
  • Lite mode: the inverse of the ‘use_fat_textile’ pref. If use fat textile = 1, then lite mode = 0. Which is correct.
  • Allow images: The actual value of the negative pref “Disallow images” (argh… my brain!). So if you want to allow them, you set Disallow images to No(!). Which passes zero to Textile, which turns them… off?!

I think we’ve got that wrong in core. We should rebrand the pref label (and pophelp) to make this simpler and turn it to ‘Allow commenter images in comments’ rather than ‘Strip commenter images from comments’. That then makes the yes/no more logical. Although the actual pref name (behind the scenes) is still rubbish, at least it’ll do what people think.

In the meantime, SteveG, sorry. To get images in comments to work, visit your Admin>Preferences panel and turn Strip commenter images from comments? to “Yes”.

Urk. What a mess! Apologies for getting that backwards. Must have gone unnoticed for ages. We’ll fix it in the next version.

Last edited by Bloke (2020-08-06 12:00:41)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#17 2020-08-06 15:32:54

SteveG
Member
Registered: 2020-08-04
Posts: 24

Re: Comment with image attached?

Bloke wrote #325198:

In the meantime, SteveG, sorry. To get images in comments to work, visit your Admin>Preferences panel and turn Strip commenter images from comments? to “Yes”.

Urk. What a mess! Apologies for getting that backwards. Must have gone unnoticed for ages. We’ll fix it in the next version.

It works! Thanks for being so helpful!

Offline

#18 2020-08-06 23:12:46

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,058
Website

Re: Comment with image attached?

etc wrote #325191:

Damn! Have we broken it or images never worked in comments? I’m confused..

I don’t think you broke it, I even think it never worked for some reason hurried deep inside the commenting code. At least, I can‘t remember embedding images working in comments.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

Board footer

Powered by FluxBB