inherit
223470
0
Feb 27, 2019 17:05:53 GMT -8
₪» ⅀ ƪ Ƒ «₪
Original registration date: 2007. DeviantART: http://deviantart.com/ruanly. Discord: Ruanly#7946.
1,281
July 2015
fajita
|
Post by ₪» ⅀ ƪ Ƒ «₪ on May 29, 2016 22:10:03 GMT -8
There are either some errors in the word count in layout plugin or I'm inserting the class wrong, if you don't mind helping me out. =) I added the following into my "Post List" layout template: <span class="word-count-$[post.content_id]"></span>
However, it's showing very different numbers to what the "Word Count" plugin repots when you're looking at that post through the posting page. For example, when I hit edit for one post it reports "870 words" and if I look at that post through the post list, the new plugin tells me "1,093." I am using the wormopolis tabbed tables code and there is a hefty amount of code in these posts, so maybe there's something wrong with it in that sense? I can link you to my site if you need me to, it's in Maintenance Mode so I'd have to coordinate with you for a window you could look at it during. Obviously I can report any other info you need as well if I can further help somehow.
|
|
inherit
Official Code Helper
65613
0
1
Oct 22, 2024 1:56:19 GMT -8
Chris
"'Oops' is the sound we make when we improve"
9,018
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on May 29, 2016 23:04:41 GMT -8
I believe Wormo's plugin adds/modifies content in the post once the post displays as opposed to preview so that may account for the discrepancy. If you link me then I'll take a look
If you are thinking this will work in preview mode, it wont.
|
|
inherit
Official Code Helper
65613
0
1
Oct 22, 2024 1:56:19 GMT -8
Chris
"'Oops' is the sound we make when we improve"
9,018
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Jun 2, 2016 19:30:05 GMT -8
₪» ⅀ ƪ Ƒ «₪ , I just ran some tests with the following custom bbcodes placed in a post then compared preview count versus the count when the post was actually posted. [PTabbedContent]
[PTab=Tab 1 stuff] blah blah blah [/PTab]
[PTab=Tab 2 stuff] blah2 blah2 blah2 [/PTab]
[PTab=Tab 3 stuff] blah3 blah3 blah3 [/PTab] [/PTabbedContent] and found that it was counting the custom "[/PTabbedContent]" since it in turn contained nested custom bbcode tags. Ideally those tags should already be converted to their html counterparts in an html source such as this but I made a slight modification to the catch-all regular expression responsible for recognizing unconverted tags and not count them which should now disallow counting that closing tag. I also observed that attachments which are removed from preview (unless positioned) also get counted in-thread because they are obviously no longer removed but adding a new entry of attachment | .post_attachments, .attachment_preview to the ignore list in word count settings (advanced tab) would be the fix for that. It would help if I could take you up on that offer to study a larger sample than the one I've concocted here to ensure I haven't missed anything else .
|
|
inherit
223470
0
Feb 27, 2019 17:05:53 GMT -8
₪» ⅀ ƪ Ƒ «₪
Original registration date: 2007. DeviantART: http://deviantart.com/ruanly. Discord: Ruanly#7946.
1,281
July 2015
fajita
|
Post by ₪» ⅀ ƪ Ƒ «₪ on Aug 4, 2016 18:36:17 GMT -8
ChrisMy apologies, I've been on a semi-hiatus from PBS--most of what you said went way over my head, but I'm happy to send you a link to a much larger sample for the tabbed content posts. I'll send you a PM to such a thread now, since my site is not yet public so I can't post its URLs here yet. =)
|
|
inherit
Official Code Helper
65613
0
1
Oct 22, 2024 1:56:19 GMT -8
Chris
"'Oops' is the sound we make when we improve"
9,018
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Aug 4, 2016 19:20:51 GMT -8
To put it simply, if the code responsible for handling an unofficial bbcode such as the mentioned [PTabbedContent] doesn't bother to render said bbcode on the preview tab and only renders when viewing the actual post then there will most likely be a discrepancy between creating a post and the actual post. The word count plugin cannot easily deduce how a plugin wants its "unofficial" bbcode to be rendered so it can then be properly counted so it is up to the plugin responsible for that "unofficial" bbcode to render it before it can properly be counted. With that said however I noted a bug with unconverted nested custom bbcodes where the closing outer bbcode is counted as well as another bug regarding attachments which should not have been included in the count in the first place and posted a workaround to fix that.
|
|
inherit
218412
0
Oct 29, 2017 10:08:30 GMT -8
Kurt Redfield
...
30
February 2015
redfield
|
Post by Kurt Redfield on Aug 7, 2016 9:22:07 GMT -8
One question. I don't know how to do word-limits. I set limit on the board to be minimum 200 words, then I write 2 words for a test and still posts it regardless. I set maximum to 10 words for a test, write 20 words and still posts. Am I using plugin in a wrong way?
I want that when someone makes a thread on that specific board that they have to make 200 words minimum for their thread to be able to be posted in the first place.
|
|
inherit
Official Code Helper
65613
0
1
Oct 22, 2024 1:56:19 GMT -8
Chris
"'Oops' is the sound we make when we improve"
9,018
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Aug 7, 2016 18:00:33 GMT -8
One question. I don't know how to do word-limits. I set limit on the board to be minimum 200 words, then I write 2 words for a test and still posts it regardless. I set maximum to 10 words for a test, write 20 words and still posts. Am I using plugin in a wrong way? I want that when someone makes a thread on that specific board that they have to make 200 words minimum for their thread to be able to be posted in the first place. If you're testing this in a situation where plugins do not work such as on a mobile device or with javascript disabled then that would explain it. Also keep in mind that staff members are exempt from limits unless you specifically enable it in the plugin settings. If you believe that to not be the case then you'll probably need to provide the most important detail which would be a forum url where you are observing this behavior so it can be investigated a bit more in-depth.
|
|
inherit
223470
0
Feb 27, 2019 17:05:53 GMT -8
₪» ⅀ ƪ Ƒ «₪
Original registration date: 2007. DeviantART: http://deviantart.com/ruanly. Discord: Ruanly#7946.
1,281
July 2015
fajita
|
Post by ₪» ⅀ ƪ Ƒ «₪ on Aug 24, 2016 13:46:04 GMT -8
ChrisI was having a glitch in my coding and submitted a support ticket to try and fix it. The admins informed me that the source of the problem was coming from this plugin, and disabling it did seem to fix it. Since other people haven't reported the same issue despite how old this plugin is, I'm guessing it's something unique to my highly modified theme. Basically, my pagination is broken while this plugin is enabled, in both threads and the thread list (so basically any type of page change on the site). You can change from page 1 to page 2 just fine, but that switch breaks it and you cannot go to page 3 without refreshing. Then you'd have to refresh to go to page 4 again, and on and on that goes. Gotta refresh to reset the break that page-changing causes. My site like is alcryst.forums.net if you want to take a look. A good candidate for checking out the glitch in action is the Recent Threads page, which is at the top right-ish of the screen. Lots of pages in there to test with, since I don't have many threads with multiple pages to test in. I'll enable to the plugin now so you can see the glitch in action, but if you want me to disable it or do anything at all, please let me know!
|
|
inherit
Official Code Helper
65613
0
1
Oct 22, 2024 1:56:19 GMT -8
Chris
"'Oops' is the sound we make when we improve"
9,018
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Aug 24, 2016 15:41:27 GMT -8
Chris I was having a glitch in my coding and submitted a support ticket to try and fix it. The admins informed me that the source of the problem was coming from this plugin, and disabling it did seem to fix it. Since other people haven't reported the same issue despite how old this plugin is, I'm guessing it's something unique to my highly modified theme. Basically, my pagination is broken while this plugin is enabled, in both threads and the thread list (so basically any type of page change on the site). You can change from page 1 to page 2 just fine, but that switch breaks it and you cannot go to page 3 without refreshing. Then you'd have to refresh to go to page 4 again, and on and on that goes. Gotta refresh to reset the break that page-changing causes. My site like is alcryst.forums.net if you want to take a look. A good candidate for checking out the glitch in action is the Recent Threads page, which is at the top right-ish of the screen. Lots of pages in there to test with, since I don't have many threads with multiple pages to test in. I'll enable to the plugin now so you can see the glitch in action, but if you want me to disable it or do anything at all, please let me know! Within seconds of setting up your described test case at alcryst I got an error indicating "monetarysignupbonus" and also a function named "moneyonethousand" neither of which are part of this word count plugin. I am also seeing an error in the word count in layout plugin that is also not part of the word count plugin and was requested here and that error looks to be caused by something I cannot currently identify that is manually triggering a change event without passing an event object. Edit: I've identified the source of the incoming shrapnel and it appears to be friendly fire, I'll update the word count in layout plugin this weekend.
In the meantime... The error occurs in line 4 of that word count in layout plugin and can be addressed by testing if an event was passed first by modifying the line
Change
if(!evt.target.form || $(evt.target.form).hasClass('form_post_quick_reply')){
to
if(evt && (!evt.target.form || $(evt.target.form).hasClass('form_post_quick_reply'))){
It's also worth mentioning that the word count in layout plugin relies on the word count plugin in order to do its job so if it loads and sees no word count plugin then it shuts itself down which might lead one to believe that it might be the word count plugin ETA2: updated the Word Count in Layout that was written for ₪» ⅀ ƪ Ƒ «₪ to version 0.0.3
|
|
inherit
223470
0
Feb 27, 2019 17:05:53 GMT -8
₪» ⅀ ƪ Ƒ «₪
Original registration date: 2007. DeviantART: http://deviantart.com/ruanly. Discord: Ruanly#7946.
1,281
July 2015
fajita
|
Post by ₪» ⅀ ƪ Ƒ «₪ on Aug 25, 2016 13:10:22 GMT -8
Ah, ohkay, those are codes from the fantastic P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓ so I'll tag him so he sees the discussion. The monetary signup bonus is a plugin by him, I believe, and the moneyonethousand you're seeing is a customized little snippet code he gave me that's designed to see if someone has over a certain amount of money (from the monetary plugin by Peter) and display a certain badge/image if they do. However, I'm unsure if you're saying that those monetary codes are the ones causing this particular issue with pagination, or if you're just saying that they're causing some sort of error that isn't this one. (since the code you provided fixed the issue, clearly you aren't saying the monetary codes were the cause of this particular issue, but I'll keep the tag for Pastuleo in case he wants to see that errors are being thrown) Oops, I had the word count in layout plugin above the word counter plugin, I've swapped their order so the word count plugin should now load first. Not sure how I got those two screwed up. Thank you for informing me! I have swapped out the code line as requested. That does seem to fix it! Both plugins are enabled and yet I can switch pages again without the need to refresh. Oh, thank you so, so much! I'm excited to keep the plugin and also be able to browse through pages again. =D
|
|
inherit
223470
0
Feb 27, 2019 17:05:53 GMT -8
₪» ⅀ ƪ Ƒ «₪
Original registration date: 2007. DeviantART: http://deviantart.com/ruanly. Discord: Ruanly#7946.
1,281
July 2015
fajita
|
Post by ₪» ⅀ ƪ Ƒ «₪ on Aug 29, 2016 13:56:04 GMT -8
New plugin installed! Thank you so much!
|
|
inherit
Official Code Helper
65613
0
1
Oct 22, 2024 1:56:19 GMT -8
Chris
"'Oops' is the sound we make when we improve"
9,018
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Aug 29, 2016 18:41:08 GMT -8
To clarify, this is NOT AN UPDATE to the word count plugin that this thread was created to support, this was for another plugin requested by ₪» ⅀ ƪ Ƒ «₪
|
|
inherit
229600
0
Sept 7, 2022 11:09:51 GMT -8
Ben Goodman
96
February 2016
benhun
|
Post by Ben Goodman on Aug 23, 2017 5:38:32 GMT -8
Hello Chris ! I do not know how to use regexr, but I want to include áéíóö?úü? and their capital versions ÁÉÍÓÖ?ÚÜ? in your /\b[\w\-']+\b/g scheme. How can I do that?
|
|
inherit
Official Code Helper
65613
0
1
Oct 22, 2024 1:56:19 GMT -8
Chris
"'Oops' is the sound we make when we improve"
9,018
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Aug 23, 2017 21:56:49 GMT -8
Ben Goodman , those look to be from the Latin Extended A unicode block so on the advanced tab of the plugin configuration you should see an option which was added in version 0.0.5 in order to change the regex used for word pattern recognition. The tooltip help ( ) for that field recommends using kourge.net/projects/regexp-unicode-block to generate the metacharacter sequence needed for your new regex so in this case placing a checkmark by the Latin Extended A block in that generator would give you a class range of [\u0100-\u017F]. This however covers the entire unicode range in that block so if you want to allow only for the individual characters you posted then you can use the individual code points and separate them with commas instead of using the hyphen which covers the entire range (pretty much same principle when selecting specific pages instead of all pages in a print dialog). You can then incorporate that into the original regex: /\b[\w\-',\u0100-\u017F]+\b/g
- explanation:
- / : start a literal regular expression
- \b : start on a word boundary (not in the middle of a word)
- [ : start a character class (list of characters that should be included)
- \w : any alphanumeric character (a-z as well as A-Z and numbers 0-9 as well as the underscore character)
- \- : we also want to include and count hyphenated words as a single word (note leading slash to escape special hyphen character so it is interpreted as regular character)
- ' : words with apostrophes, such as "don't", should also be counted as a single word
- \u0100-\u017F: also include characters from the Latin Extended A unicode block
- ] : end character class
- + : process all characters in the word not just the first
- \b : end on a word boundary (not in the middle of a word)
- / : end literal regular expression
- g : make this expression global (process all occurrences not just the first word encountered)
|
|
inherit
229600
0
Sept 7, 2022 11:09:51 GMT -8
Ben Goodman
96
February 2016
benhun
|
Post by Ben Goodman on Aug 23, 2017 23:53:18 GMT -8
Chris , I am afraid they are not Latin extended. I typed áéíóö?úü? and ÁÉÍÓÖ?ÚÜ? here, but it wont work.
|
|