Code Monkey home page Code Monkey logo

Comments (9)

WildcardSearch avatar WildcardSearch commented on July 20, 2024

I was wondering how long it would take someone to notice. 😉

The reason I added that fail-safe is because once we strip all the BB code and quotes from the text we may be left with some unusable garbage . . . in testing anything less than 20 chars was generally worthless and I wouldn't want these short snips on the forum.

Maybe I can just add a setting?

Oh and also I snuck in your hide/show cookie toggle for 1.5 😄

from advanced-sidebox.

Destroy666x avatar Destroy666x commented on July 20, 2024

Well, I'd suggest to put something like that to query: strlen($parser->text_parse_message($new_message)) < $mybb->settings['quote_min_chars']) so it filters them completely instead of changing words of the person - they may get annoyed if they see it wrote what they didn't.

Thanks for adding the hide/show.

from advanced-sidebox.

WildcardSearch avatar WildcardSearch commented on July 20, 2024

Thanks for adding the hide/show.

Thanks for suggesting it 😉

The problem is this: If I make the routine have a set amount of characters after the filter then I am forced to use a loop and keep fetching query results until I get enough chars to reach the limit.

I realize that replacing short posts with 'I Love ' - bbname - '!!!' is not very professional but without that fallback the module could cause forums to time out looking for posts if the admin sets the forum ids to a a forum like games with one words posts.

Given all of those thoughts, do you have a suggestion?

from advanced-sidebox.

Destroy666x avatar Destroy666x commented on July 20, 2024

I don't really understand what you were trying to say as I'm green at PHP and my English isn't perfect either.

You mean if you put that conditional to WHERE in query it would use to many resources looking for parsed post with less than x chars?

from advanced-sidebox.

WildcardSearch avatar WildcardSearch commented on July 20, 2024

No I am saying that I already put a conditional to WHERE in the SQL query looking for posts over 40 chars (so that we have a chance) but that is BEFORE the post is stripped of all quotes, mycodes, video tags, etc.

So after all that even a 40 char post can be < 20 chars easily. When that happens I would be forced to fetch another post and start the (rather intensive) parsing and stripping routines over . . .

I am just not convinced that is for the best.

from advanced-sidebox.

Destroy666x avatar Destroy666x commented on July 20, 2024

I have no idea of another solution then. Will try to think more about it but I don't think I'll come with anything well-working with my PHP knowledge and experience.

For now I suggest changing the text to something more suitable like "This post is too short or contains too many BB codes to be quoted." or let the forum owners change it in settings.

from advanced-sidebox.

WildcardSearch avatar WildcardSearch commented on July 20, 2024

or let the forum owners change it in settings.

That. Will try to get it done. Cheers

from advanced-sidebox.

WildcardSearch avatar WildcardSearch commented on July 20, 2024

Added the setting. Should be done huh?

from advanced-sidebox.

Destroy666x avatar Destroy666x commented on July 20, 2024

I guess. If I'll come with something better I'll open another issue.

from advanced-sidebox.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.