inherit
266343
0
Apr 28, 2024 15:01:26 GMT -8
giovanni79
260
May 2022
giovanni79
|
Post by giovanni79 on Nov 15, 2023 15:18:04 GMT -8
considering that exist a plugin for the quick reply that display the number of characters and the words that a post will have i was wondering if it was possible create a plugin that display these things in a post after it was written i mean inside the post itself it would be nice if that informations are displayed in the right upper corner of a post i hope that someone is interested i think that would be a very useful thing for our forums
|
|
inherit
266343
0
Apr 28, 2024 15:01:26 GMT -8
giovanni79
260
May 2022
giovanni79
|
Post by giovanni79 on Nov 18, 2023 18:25:44 GMT -8
no one is interested?
|
|
inherit
Official Code Helper
65613
0
1
Apr 15, 2024 17:01:41 GMT -8
Chris
"'Oops' is the sound we make when we improve"
8,858
December 2005
horace
|
Post by Chris on Nov 18, 2023 19:47:26 GMT -8
Basically, the word count plugin has this built-in but requires the person creating or editing the post to provide a pattern that the word count plugin will then replace with the final count. By default, the pattern is %wc# for word count and %cc# for character count. If you're referring to a count embedded within the post itself then that is one of the reason it is left up to the user to provide the pattern necessary to embed the count. There would be no way to distinguish between a number embedded into a post meant to show a count and a number left there by someone who decided to come clean and post their bank card PIN. The user is therefore REQUIRED to provide the pattern necessary to record a word count and embed it within the post evenl when editing a post snce that pattern would obviously overwrite any previous count thus removing the uncertainty. If you are wanting a static count somewhere in the layout instead of the content then a request was made for a secondary companion plugin to accomplish that... Hey, Chris ! My request is a way to insert a post's word count into my template layout, maybe as a div class so I can fully customize where it goes and how it looks, so it shows up in the post list for each post recording how many words that post encompasses. If that's not clear what I'm requesting, please ask me to clarify, I'm unsure if I made any sense just now lol. I know they can add their word count into their posts of their own volition currently, but this would be a forum-wide addition so the word count shows up in every post where I want it to, as decided in the layout templates. Thank you for at the very least reading my request! =D The plugin exposes a rudimentary api which can be used to capture the word count of a particular post to use as you will. I believe I wrote a companion plugin once that utilized that api to keep a running tab of a user's accumulated word count and also to award monetary points based on word count multiplied by an assigned group factor. I'm unfortunately without a computer at the moment so unable to fill any requests on this kindle fire but I'm sure P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓ would be more than willing. EDIT: ₪» ⅀ ƪ Ƒ «₪ : I now have a passable laptop to replace the one I lost in the fire so are you still interested in getting the above request filled? I'm also working on an update to the plugin that includes additional statistics, here is a download link if interested in helping me test it. I'm anticipating some free time this weekend (finally!) ₪» ⅀ ƪ Ƒ «₪ so plan on getting to this and thanks for your patience. edit Word Count in LayoutThis plugin makes use of the interface provided by the word count plugin so cannot operate without it (e.g no quick reply then no counter exists). It looks for an element with a class of word-count-$[post.content_id] or word-count-$[message.content_id] in which to place the count but in the absence of such an element it defaults to the area around where edited by usually appears. The default type of count is "words" but that can be overridden by adding an additional class of mode-TYPE where TYPE can be on of the following: words : word count, characters : character count, sentences : sentence count, paragraphs : paragraph count, unique : unique words count, nscharacters : character count (no spaces), average_word_length : average word length, reading_level : reading level, syllables : syllable count, complex : complex word count Updated the plugin Word Count in Layout to version 0.0.2 now with the ability to activate in situations where the word count plugin is not active such as a thread where no quick reply exists or on returned search results. Note: this still requires the word count plugin since it uses methods and settings provided by that plugin and should be ABOVE that word count plugin in the managed list of plugins. Chris 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. 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 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 ₪» ⅀ ƪ Ƒ «₪
|
|