gtv22
Junior Member
Still learning ...
Posts: 260
inherit
203486
0
Mar 1, 2014 9:50:41 GMT -8
gtv22
Still learning ...
260
December 2013
gtv22
|
Post by gtv22 on Oct 10, 2015 3:53:41 GMT -8
It worked, perfectly! Thank you very much.
|
|
inherit
222412
0
Jan 29, 2019 16:48:39 GMT -8
tules
76
June 2015
tulululu
|
Post by tules on Oct 17, 2015 23:10:05 GMT -8
is it possible to either set a minimum word count that must be reached in order for a post to be counted towards post count (so you can still post under a certain minimum, it just won't show up in the post count section of the mini profile) or make it so that every post shows the word count at the bottom with out the user manually having to put "word Count: %wc#" somewhere in their post? also can this plugin take into account coding that comes from the style tags plugin? right now, it counts things like [ attr=" class"," classname"] and [newclass=.classname] css css css[/newclass]
|
|
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,017
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Oct 18, 2015 15:01:26 GMT -8
Plugins have no access to the behind-the-scenes workings of Proboards so would have no influence over when a post counts toward a user's post count or not, a staff member would have to manually adjust that number in the user's profile. As for an always-on count, that would not be something everyone would want which is why you add it yourself if you want it filled in. If you want it on for everybody on your forum then a separate code could easily be made to automatically add the required text pattern to each post so it gets filled in but it will not be set as default in this plugin.
The plugin technically only supports bbcodes that are officially supported by Proboards, but in practice it will consider anything that starts with a "[" followed by an alphanumeric string and eventually closed with an "]" as a bbcode tag. This however is not the behavior on the preview tab, it is up to the handler of that bbcode to turn that tag into its HTML representation when switching from bbcode to preview and vice versa (just like any other tag). If the custom tags you mentioned are properly handled in this manner then you can specify that their content not be counted by checking the advanced tab when configuring the plugin, from there you can add tags that contain content that you do not want counted
Edit: As further clarification, to prevent the content (i.e "css css css" in [newclass=.classname]css css css[/newclass] ) from being counted you would add "newclass" to the list of ignoreables on the advanced tab for the bbcode side and whatever HTML it turns into whenever you switch to the preview tab. If it doesn't actually perform a "preview" (changes into HTML) when switching to preview tab then it is fair game and counted as text.
For the [attr="class","classname"] the word counter won't recognize that as a bbcode tag simply because the tag name contains non-alphanumeric characters (tag name ends at first space or "]"). Basically since Proboards V5 automatically converts all those old form tags (e.g. [img=URL] into their discrete attribute counterparts [img src="URL]) there was no need to recognize them but I'll look into into adding recognition for that generic form of tag style. For the time being, if the plugin still recognizes the tag with a space inserted before the equal sign then that would work.
|
|
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,017
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Oct 23, 2015 0:09:25 GMT -8
Added recognition for ancient format bbcode (e.g. [attr="class","classname"] ) in version 1.0.7 as discussed
|
|
inherit
215396
0
Aug 14, 2019 11:01:05 GMT -8
Mixed
And the new sun rises. With it comes restored hopes and renewed dreams.
1,168
October 2014
mixedinterests
|
Post by Mixed on Nov 18, 2015 13:11:29 GMT -8
Hi Chris! I feel a bit stupid because I KNOW I asked this question before. Unfortunately, I cannot remember the answer, find the Q&A posted here on Support, nor can I backtrack it on the forum I had already fixed it on. First I'll refer to the forum I had it fixed on: redhorizon.freeforums.net/On this forum, I had made it so that the "xx Words" was on one line in the Word Count box at the bottom right-handed corner of the posting area, with your help I believe. I would like to do this again at avatarascent.boards.net/ (it's in maintenance mode). However, as I already said, I'm having a hard time figuring out what to repeat. As far as I know, both forums are using the same sort of template so I'm hoping that if I can figure out how I did it on the first, I can also repeat it on the second. Thank you for your help.
|
|
inherit
217348
0
Jul 27, 2022 7:26:44 GMT -8
Lynx
5,846
January 2015
msg
|
Post by Lynx on Nov 18, 2015 13:51:06 GMT -8
Hi Chris! I feel a bit stupid because I KNOW I asked this question before. Unfortunately, I cannot remember the answer, find the Q&A posted here on Support, nor can I backtrack it on the forum I had already fixed it on. First I'll refer to the forum I had it fixed on: redhorizon.freeforums.net/On this forum, I had made it so that the "xx Words" was on one line in the Word Count box at the bottom right-handed corner of the posting area, with your help I believe. I would like to do this again at avatarascent.boards.net/ (it's in maintenance mode). However, as I already said, I'm having a hard time figuring out what to repeat. As far as I know, both forums are using the same sort of template so I'm hoping that if I can figure out how I did it on the first, I can also repeat it on the second. Thank you for your help. Mixed, I did an Inspect Element on the site you linked and found the answer. I've already adjusted our Stylesheet for it. For those who may want this: .word-count.mode-word .status::after { content: " Words"; } .word-count.mode-word .icon::after { display: none; }
|
|
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,017
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Nov 18, 2015 18:15:36 GMT -8
If you do not ever switch between word and character modes then what Lynx said should be fine, but for those who do occasionally switch see Brian's post in this thread
|
|
inherit
217348
0
Jul 27, 2022 7:26:44 GMT -8
Lynx
5,846
January 2015
msg
|
Post by Lynx on Nov 18, 2015 19:56:37 GMT -8
Dang. I thought I had done good on that. Forgot about if switched to characters.
|
|
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,017
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Nov 18, 2015 20:24:20 GMT -8
I originally coded it that way so as to not to be too greedy with the real estate and leave room for other plugins that might want to be roommates down there with me. I can't however recall any other plugin over the years that has used that space except for Wormo's Chess FEN Editor tab which is why the v1.0.7 linked around 5 posts back does everything inline. If it works for you Lynx then it "works like a charm", it's the person that uses it in a way that you don't that will always discover the bug. The more people who use something the more chance we have of a bug being discovered so it can be corrected.
|
|
inherit
215396
0
Aug 14, 2019 11:01:05 GMT -8
Mixed
And the new sun rises. With it comes restored hopes and renewed dreams.
1,168
October 2014
mixedinterests
|
Post by Mixed on Nov 20, 2015 10:34:55 GMT -8
Thank you to both Lynx and Chris. Now I should go check out the site-in-progress and talk to the co-captain of that ship about how we'll do it.
|
|
inherit
217348
0
Jul 27, 2022 7:26:44 GMT -8
Lynx
5,846
January 2015
msg
|
Post by Lynx on Dec 3, 2015 9:50:44 GMT -8
Hi, Chris. This is probably something you may not have thought of, but to insure our RP'ers don't miss any aspect of "Word Count: %wc#" in their post to have it placed (the option is enabled), I tried using a Censored Word to do that for them. At first, I tried [wc] but then noticed it had that as part of the posting code. So then I tried [count] and it didn't work. I came here and noticed your post above about the [ and ], so I tried a third option of just having the censored word as mywc. Still no luck. The Replacement Word for it is (exactly): "Word Count: %wc#" with the quotes and everything. Unfortunately, in every occurrence, it expands out to: "Word Count: %wc#" Is there any way to have this work to where it will actually put in the count number instead of the %wc#? I can just seeing someone forgetting a quote or the % sign when posting. Thanks!
|
|
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,017
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Dec 3, 2015 22:36:40 GMT -8
Hi, Chris . This is probably something you may not have thought of, but to insure our RP'ers don't miss any aspect of "Word Count: %wc#" in their post to have it placed (the option is enabled), I tried using a Censored Word to do that for them. At first, I tried [wc] but then noticed it had that as part of the posting code. So then I tried [count] and it didn't work. I came here and noticed your post above about the [ and ], so I tried a third option of just having the censored word as mywc. Still no luck. The Replacement Word for it is (exactly): "Word Count: %wc#" with the quotes and everything. Unfortunately, in every occurrence, it expands out to: "Word Count: %wc#" Is there any way to have this work to where it will actually put in the count number instead of the %wc#? I can just seeing someone forgetting a quote or the % sign when posting. Thanks! Hi Lynx , the idea of using censored words would not work here since the censored words are activated after a post has been created while the word count plugin deals exclusively with the time period during the creation of a post so would be unaffected by any kind of content censorship that occurs after creation. If the post contains the pattern defined in the "post pattern" setting of the advanced tab at the time of submission then a hard copy of the word count is inserted wherever that pattern occurs. Advanced Tabthe settings on this tab normally do not need to be modified, they are there for the rare cases. - ignore content
in this section we list tags that have content that should not be counted, by default the QUOTE, CODE and IMG tags are in this list. The V5 version of the image tag need not be in this list but the V4 format places the image url between the opening and closing tags thus appearing as countable content
- Word Pattern
this is the pattern used to distinguish one word from another for counting purposes. It is a regular expression so you would need to know regular expressions in order to construct an alternate pattern.
- Post Pattern (default: /(%[wc]c#[-+\d]*)/gi)
this is also a regular expression that is used to identify whether the person making the post also wants the count to be included in the post. By default it will look for the pattern %wc# (for wordcount) or %cc# (for character count) and replace that pattern with a number. Additionally you can add or subtract from the count with modifiers, for example, if you placed "word count: %wc#" in the post but did not want the words "word count" to be included in the count you would use "word count: %wc#-2" to subtract 2 from the count.
in the above example, by adding up the number of words that should not be counted in that template then placing that offset number in the "word count" tab with the pattern described above (e.g. %wc#-19), it will automatically be replaced upon posting with the accurate number of words actually considered content. Words such as "Template by Jawn.." would not be included in the total. The template could then be saved with that pattern so it can be reused
- BBCode Max (default:300)
this is the maximum number of tags the counter will process in any given counting session. This setting exists because the plugin makes use of a function provided by Proboards that identifies and grabs tags, this function however is coded to give up after encountering 100 tags but the plugin needed a bit more headroom to work consistently on posts one may encounter on RPG forums. Set this value too high and it may appear that your browser has frozen or perhaps get a "script is busy" warning message from your browser
- Debugging
this is for troubleshooting purposes only. It will log behind-the-scenes messages to the console to aid in identifying problems
As I said in this reply, it would require an actual code to add the pattern so it is there at submission time to be filled in. Such a code would optionally need to recognize any preexisting word counts during post edits and overwrite that with the necessary pattern. The use of the words "Word Count:" placed before the number would make that task easier as well as lend context to the number following it but as you can see from the post pattern setting on the advanced tab of the plugin, the use of the text "Word Count:" or any quotes are not necessary, just the occurrence of the pattern %wc# or %cc# is all that is needed
|
|
inherit
217348
0
Jul 27, 2022 7:26:44 GMT -8
Lynx
5,846
January 2015
msg
|
Post by Lynx on Dec 4, 2015 9:01:31 GMT -8
Thanks, Chris! Much appreciated! Just curious: Would noparse tags keep it from filling in with the actual count on posting? Curious so I know if I can make a post that shows that pattern for the Members. Thanks again!
|
|
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,017
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Dec 4, 2015 15:15:18 GMT -8
If you do not want it to parse but instead show as an example then a simple but effective trick is to place an empty bbcode tag somewhere in the mix to break up the pattern, so something like %[u][/u]wc# would end up looking exactly the same as the pattern (%wc#) but with the code or even the bbcode parser not recognizing it as a valid pattern. This was how some bbcode tags were demonstrated back in the days when [noubbc][/noubbc] was the only game in town and it had a bug that didn't affect certain tags such as [br]
|
|
inherit
217348
0
Jul 27, 2022 7:26:44 GMT -8
Lynx
5,846
January 2015
msg
|
Post by Lynx on Dec 4, 2015 15:21:39 GMT -8
Ah, okay. Thank you very much, Chris!
|
|