Jump to content

Filter before saving a comment


J1897

Recommended Posts

Posted

[edited]

Hi all,

many thanks for this supercool service!

 

This is the behavior that I'd want to have:

  • Someone posts a Comment, that contains a reference to an external image (url)
  • BEFORE to save the comment, i want to check the url through a php function (in order to check the image compliance)
  • IF the check is ok, then save the comment as is on the DB
  • IF not, change the url with a marker

What i am asking you, is to know if and where in the invision src code I can find the place in which i can put my control?

 

sorry for my not deep knowledge in the ipb src

 

 

 

Posted

Answering the title: Lazy Loading should be a stock feature of the upcoming 4.4 release later this year. Just wait for that. 

Not sure what describe in the post itself. Check an image call with PHP? Check for what?

Posted
32 minutes ago, opentype said:

Answering the title: Lazy Loading should be a stock feature of the upcoming 4.4 release later this year. Just wait for that. 

Not sure what describe in the post itself. Check an image call with PHP? Check for what?

Sorry, i will try to explain better.

 

This is the behavior that I'd want to have:

  1. Someone posts a Comment, that contains a reference to an external image (url)
  2. BEFORE to save the comment, i want to check the url through a php function (in order to check the image compliance)
  3. IF the check is ok, then save the comment as is on the DB
  4. IF not, change the url with a marker

 

Sorry for changing the concept, but it should be more clear now.

Thx!

 

 

Posted

Https? Something else? Can you give a high level overview of what your defining as image compliance for your community? 

There is imageproxy that serves images via https through your board URL in case someone posts a non https link. Keeps your pages from breaking with mixed content. If this is what you're after, it's a simple setting. 

Posted
24 minutes ago, Aiwa said:

Https? Something else? Can you give a high level overview of what your defining as image compliance for your community? 

There is imageproxy that serves images via https through your board URL in case someone posts a non https link. Keeps your pages from breaking with mixed content. If this is what you're after, it's a simple setting. 

non porno images 😄

Posted

Yeah, no setting for that... You can hook into the content before it is saved to the DB and remove questionable content or flag the content for moderation, it's more difficult to do on the fly while the content is being generated by the user.

Posted
2 hours ago, A Zayed said:

I think he is referring to the image host (url)

Yes, basically in that way.

just before the save, if the post contains an url, then i can call a service, then save the content if compliant 

 

what i need is to know where to override the “save” method

4 hours ago, Aiwa said:

Yeah, no setting for that... You can hook into the content before it is saved to the DB and remove questionable content or flag the content for moderation, it's more difficult to do on the fly while the content is being generated by the user.

This is what Iwant to do,just before the save...any hint in how can I hook into the content?

 

many thx guys!

 

 

Posted
17 hours ago, J1897 said:

This is what Iwant to do,just before the save...any hint in how can I hook into the content?

 

20 hours ago, bfarber said:

Your best option would be to create a hook on \IPS\Text\Parser to overwrite _parseImgElement(). This will allow you to manipulate the entire <img> element.

 

Posted
On 10/19/2018 at 2:27 PM, Nathan Explosion said:

Are you looking to determine if the image itself is 'porno' or whether the source of the image is a porn site?

the first one

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...