In the management of the game server (Sourcebans ++ 1.6.3) there is such an error (more precisely in the logs of the subdomain on which it is located):
[Fri May 22 09: 29: 30.770872 2020] [PHP7: WARN] [PID 10749] [Client IP: Port] PHP Warning: Division by Zero In / Var / WWW / WWW-Userroot / Data / www / bans.mysite.ru / includes / smarty / plugins / function.math.php (94): eval () ‘D code on line 1, referer: iphost
Here is a string that he “complains”:
eval ("\ $ smarty_math_result =". $ equation. ";");
Here is the link full code
https://pastebin.com/d6wshcc1
Can I fix it?
Answer 1, Authority 100%
Error inside Smarty functions is caused by incorrect input data. In general, the use of such functions here is very redundantly and excessively complicates the code of the template (I can not imagine anything in SMARTI in principle such a functional).
Clean the desired values in the template.
{$ nc = $ smarty.now - $ ban_times [$ index] .c}
{$ EC = $ Ban_Times [$ index] .e - $ smarty.Now}
{$ w = $ EC? ($ NC / $ EC / 100): "Some value"}
& lt; DIV Class = "Progress-Bar BG-Warning Progress-Bar-Striped Progress-Bar-Animated"
ROLE = "PROGRESSBAR" ARIA-WIDTH = "{$ w}" & gt;
It is not particularly particularly similar that the error in this template, since the denominator compares $ smarty.now
, that is, the current timestamp. And the likelihood that it coincides is not great. So I would get rid of you at all from all inclusions {Math ...}
from templates.
and in case you have all this case is displayed in the form of
{foreach $ ban_times as $ index = & gt; $ V}
In the formulas, you can use {$ v.c}, {$ v.e}
and not {$ ban_times [$ index]}