Navigation

Pligg Support

Search Results for "widget"
The Statistics Widget was returning "UNKNOWN" for the MySql version. To fix it:
Open /widgets/statistics/templates/widget.tpl
On LINE 138, delete this bloc of code between the {php} and {/php}. It is returning an empty array:
function find_SQL_Version() {
$output = shell_exec('mysql -V');
preg_match('@[0-9]+.[0-9]+.[0-9]+@', $output, $version);
if ($version[0] != ''){
return $version[0];
}else{
return 'Unknown';
}
}
echo find_SQL_Version();

Replace it with the following block, between the {php} and {/php}
$link = mysqli_connect(localhost,EZSQL_DB_USER,EZSQL_DB_PASSWORD);
/* check connection */
if (mysqli_connect_errno()) {
printf("Connect failed: %sn", mysqli_connect_error());
exit();
}
$my_sql = mysqli_get_server_info($link);
//$my_sql returns will be something like the version and -log (5.5.24-log). we have to just grab the version number
$my_sql_version = substr($my_sql, 0, strpos($my_sql, "-"));
echo $my_sql_version;
mysqli_close($link);

https://github.com/redwinefireplace/pligg-cms/commit/f5093812849ef56bc7c3b8c34e97e63f06767a25
I was playing with widget, installing several and uninstalling several then I wanted to reinstall Statistics but somehow it refused to install and remained in the uninstall section.

And also what's that number "1" next to Widget for? a alert or notification?