View Single Post
Distortion
Member
Join Date: Feb 2017
Old 11-13-2018 , 02:46   Re: SourceBans Star Theme (v1.6.3)
Reply With Quote #28

Quote:
Originally Posted by bmsmod View Post
PHP is not my thing. Getting these errors. I imagine its something on my end but have no idea.


[256] mysqli error: [1048: Column 'aid' cannot be null] in EXECUTE("INSERT INTO sb_log(type,title,message, function, query, aid, host, created)
VALUES ('w','PHP Warning','[512] math: parameter \'e\' is empty
\nError on line 65 in file /var/www/sites/prgaming/public/sourcebans/includes/smarty/plugins/function.math.php','/var/www/sites/prgaming/public/sourcebans/includes/smarty/plugins/function.math.php - 65
/var/www/sites/prgaming/public/sourcebans/themes_c/star^%%42^420^420ABB47%%page_dashboard.tpl.ph p - 186
/var/www/sites/prgaming/public/sourcebans/includes/smarty/Smarty.class.php - 1263
/var/www/sites/prgaming/public/sourcebans/includes/smarty/Smarty.class.php - 1113
','N/A',NULL,'xx.xx.xx.xxx',1542076819)")


Fatal error on line 79 in file /var/www/sites/prgaming/public/sourcebans/includes/adodb/adodb-errorhandler.inc.php
Parent Function /var/www/sites/prgaming/public/sourcebans/includes/adodb/adodb-errorhandler.inc.php - 79
/var/www/sites/prgaming/public/sourcebans/includes/adodb/adodb.inc.php - 1250
/var/www/sites/prgaming/public/sourcebans/includes/adodb/adodb.inc.php - 1190
/var/www/sites/prgaming/public/sourcebans/includes/CSystemLog.php - 91
Query String N/A
IP

Thanks!

Note replaced the IP with X
On page_dashboard.tpl at line 164 there is a math function to calculate percentage of time between end and created.
PHP Code:
{math equation="( n - c ) / ( ( e - c ) / 100 )" e=$player.e_secs c=$player.c_secs n=$smarty.now
Currently I'm working on a solution.

I don't want you to add some lines to page.home.php file because it's not in theme folder. Also I believe that it's not the purpose of themes.

As you can see at #L125, sourcebans gets ends and created columns from database but it's not including them to array that we can use in dashboard.tpl file.

In my case, I've added these lines after #L150
PHP Code:
$info['e_secs'] = $res->fields['ends'];
$info['c_secs'] = $res->fields['created']; 
If you don't want to edit php file, you can replace #L164 with a simple change

This is a fake solution. It'll generate random number between 10-90 (both included)

Old Code
PHP Code:
<div class="progress-bar bg-warning progress-bar-striped" role="progressbar" style="width: {math equation=") / ( ( ) / 100 )" e=$player.e_secs c=$player.c_secs n=$smarty.now}%"
New Code
PHP Code:
<div class="progress-bar bg-warning progress-bar-striped" role="progressbar" style="width: {10|rand:90}%"
It will stop warnings, but I'll make it as soon as possible.

Cheerz.
__________________
Distortion is offline