MyBB Community Forums

Full Version: I'm install - ProStat plugin , but wrong
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I downloaded and installed this mybb plugin, but a lot of bugs came out -- https://prostats.wordpress.com/2016/06/0...-released/

can someone help me fix the error?


[Image: P86vBsI.png]
I think your problem is PHP 7.1.33
Please see Bugtracker:
One, twothree ...

I guess you can take this as an example and try to fix it.
I have PHP 5.2 on my server, so can't test it Smile
It's worth mentioning that using old plugins will frequently get you in harms way.  I know it says 1.8.x, but take that with a grain of salt.  Lot of changes in both MyBB and back-end software since 2016.  I'd be looking for a plan b. Toungue
I made (i think Huh ) required adjustment to this plugin and installed it on my forum. It seems to work as expected (with default theme Big Grin ) without breaking things around.
Can not test on PHP 7.1+ as I have 5.2 on "my" server Big Grin
I have gotten the list of errors to seven with one change in syntax. But now I am dealing with eval() errors in the remaining ones. Example is line 1940:
eval("\$prostats = \"".$templates->get("prostats")."\";");
return $prostats;

The Error:
Warning [2] Use of undefined constant tablespace - assumed 'tablespace' (this will throw an Error in a future version of PHP) - Line: 113 - File: inc/plugins/prostats.php(1940) : eval()'d code PHP 7.4.33 (Linux)

All of the remaining errors are line2, line 110, and line 113 in the error codes.

The question I am pondering is do I need to define the "prostats" as an array or is there something that is missing in these lines of code?
In the templates, the wrong syntax is being used to reference some array entries. To fix it, within function prostats_activate(), change:

$theme[borderwidth] to $theme['borderwidth'] (one occurrence).

and change:

$theme[tablespace] to $theme['tablespace'] (multiple occurrences).

i.e., add enclosing single quotes to the array key, which is the correct syntax.

Then (or first) deactivate and reactivate the plugin. Hopefully, that'll fix the "undefined constant" error.
(2023-03-18, 09:28 PM)Laird Wrote: [ -> ]In the templates, the wrong syntax is being used to reference some array entries. To fix it, within function prostats_activate(), change:

$theme[borderwidth] to $theme['borderwidth'] (one occurrence).

and change:

$theme[tablespace] to $theme['tablespace'] (multiple occurrences).

i.e., add enclosing single quotes to the array key, which is the correct syntax.

Then (or first) deactivate and reactivate the plugin. Hopefully, that'll fix the "undefined constant" error.

Thanks...  Now I am down to no errors, but it will not populate in the forum....  OY!

(2023-03-18, 09:28 PM)Laird Wrote: [ -> ]In the templates, the wrong syntax is being used to reference some array entries. To fix it, within function prostats_activate(), change:

$theme[borderwidth] to $theme['borderwidth'] (one occurrence).

and change:

$theme[tablespace] to $theme['tablespace'] (multiple occurrences).

i.e., add enclosing single quotes to the array key, which is the correct syntax.

Then (or first) deactivate and reactivate the plugin. Hopefully, that'll fix the "undefined constant" error.

Changes made to each of the templates.  

Changes made to eliminate conflicts with PHP7.4.33

Protstats up and running....  

Thanks for your help.  Will be more than happy to down load the files for others.
Huh. That's a nuisance. Are you getting any output from it at all?
(2023-03-19, 12:37 AM)Laird Wrote: [ -> ]Huh. That's a nuisance. Are you getting any output from it at all?

Patriot Action

Here is the active site...
Oh, I see I missed your later (auto-merged) post in which you said you had it up and running. Good stuff. I see it on your live site. It all looks fine to me, not that I've used the plugin myself, so am not sure what it's meant to look like.

Maybe try contacting the authors of the plugin to see if they'll accept your fixes? It's up to you though.
Pages: 1 2