Comments (9)
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.
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.
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.
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.
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.
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.
or let the forum owners change it in settings.
That. Will try to get it done. Cheers
from advanced-sidebox.
Added the setting. Should be done huh?
from advanced-sidebox.
I guess. If I'll come with something better I'll open another issue.
from advanced-sidebox.
Related Issues (20)
- Script Definitions: Add Property To Toggle Display for Mobile
- Test On Popular MyBB Themes HOT 12
- Add/Edit Sidebox: Custom Title Not Displayed
- Add/Edit Sidebox: Scripts List Loaded Incorrectly
- Manage Scripts: Error On Update Width Redirects To Wrong Page
- Slideshow Module: In 3.x Error Caused By Deprecated jQuery
- Slideshow Module: JavaScript Update & Added Features Start
- Addons: Standardize Minimum Module Version
- Standardize capitalization in module descriptions.
- Manage Sideboxes: Show module description as title text on module `div`s.
- Filter Boxes Before Column Checks
- Expand sidebox HOT 4
- Creating non master scripts doesn't work HOT 1
- Dragging script seems to malfunction HOT 1
- Portal default "Replacing entire template?" setting HOT 5
- Getting module data or information HOT 1
- Getting xthread data for last threads. HOT 1
- Incorrect integer value: '' for column `mybb`.`_asb_script_info`.`mobile_disabled`
- Title of the custom boxes below their contents
- Left Sidebar breaks threads
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from advanced-sidebox.