inherit
169267
0
Nov 22, 2024 11:02:13 GMT -8
Mike
Praise God Almighty!
1,534
July 2011
riccetts
|
Post by Mike on May 22, 2022 7:39:36 GMT -8
I want to use "user.posts in my plugin is this permissible? trying to divide user posts by 10. and having it appear in miniprofile as coins:value
|
|
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 May 23, 2022 11:52:46 GMT -8
If what you are asking is whether you can use the template variable $[user.posts] in your plugin then that's not possible, that particular variable is extra problematic since it is contextual so changes based on what is being done and would not translate at all to the global context in which plugins run. There are some variables that do get processed server-side in your plugin such as $[plugin] and $[current_user] provided they appear in an HTML component (e.g. global header). I don't have an exhaustive list of those that do work since they've changed behind the scenes without any fanfare over the years. I recall $[theme] being processed at one time (to navigate the themes obstacle course) and other globals such as $[route], $[forum], etc. but they no longer seem to be (or it could just be my wishful/faulty memory) Most plugins that utilize the post count for some sort of calculation (monetary, posting activity, etc.) harvest that number by walking the mini-profile DOM or using pattern recognition to extract it. Both methods are however prone to failure if the mini-profile has been altered enough to make generic identification impossible or produce a false positive. The plugin would need to know every single theme and all variations used in those themes (not very feasible) in order to correct its search algorithm and work unaided across a myriad of themes.
|
|
inherit
169267
0
Nov 22, 2024 11:02:13 GMT -8
Mike
Praise God Almighty!
1,534
July 2011
riccetts
|
Post by Mike on May 23, 2022 12:13:07 GMT -8
Thanks for the explanation Chris
|
|