Does anyone know why my lines are working correctly? I've looked at them and don't see an error.
It says there is a parse error in lines 287.
I've pasted 287 -302
if ($name != "") echo '';
echo '
';
if ($name != "")
echo $name . ": ";
echo number_format($dup, 0) . "%";
echo '
';
}
function ping()
{
global $local_pfsense_ip;
global $ping_ip;
$clientIP = get_client_ip();
//$pingIP = '8.8.8.8';
if($clientIP != $local_pfsense_ip) {
$pingIP = $clientIP;
}
What version / repo are you using?
My lines 287 - 293 look like this but I'm using my own custom version:
echo $name . ": ";
echo number_format($dup, 0) . "%";
echo '';
echo '';
}
I will also post the entire functions for both the printDiskBar function and the ping function as that might also help:
printDiskBar (the one where your error is at):
function printDiskBar($dup, $name = "", $dsu, $dts)
{
// Using autoByteFormat() the amount of space will be formatted as GB or TB as needed.
if ($dup < 90)
{
$progress = "progress-bar";
}
else if (($dup >= 90) && ($dup < 95))
{
$progress = "progress-bar progress-bar-warning";
}
else
{
$progress = "progress-bar progress-bar-danger";
}
if ($name != "") echo '<!-- ' . $name . ' -->';
echo '<div class="exolight">';
if ($name != "")
echo $name . ": ";
echo number_format($dup, 0) . "%";
echo '<div rel="tooltip" data-toggle="tooltip" data-placement="bottom" title="' . byteFormat(autoByteFormat($dsu)[0], autoByteFormat($dsu)[1], autoByteFormat($dsu)[2]) . ' free out of ' . byteFormat(autoByteFormat($dts)[0], autoByteFormat($dts)[1], autoByteFormat($dts)[2]) . '" class="progress">';
echo '<div class="'. $progress .'" style="width: ' . $dup . '%"></div>';
echo '</div>';
echo '</div>';
}
ping function:
function ping()
{
global $local_pfsense_ip;
global $ping_ip;
$clientIP = get_client_ip();
//$pingIP = '8.8.8.8';
if($clientIP != $local_pfsense_ip) {
$pingIP = $clientIP;
}
$terminal_output = shell_exec('ping -c 5 -q '.$ping_ip);
// If using something besides OS X you might want to customize the following variables for proper output of average ping.
$findme_start = '= ';
$start = strpos($terminal_output, $findme_start);
$ping_return_value_str = substr($terminal_output, ($start +2), 100);
$findme_stop1 = '.';
$stop = strpos($ping_return_value_str, $findme_stop1);
$findme_avgPing_decimal = '.';
$avgPing_decimal = strpos($ping_return_value_str, $findme_avgPing_decimal, 6);
$findme_forward_slash = '/';
$avgPing_forward_slash = strpos($ping_return_value_str, $findme_forward_slash);
$avgPing = substr($ping_return_value_str, ($stop + 5), ($avgPing_decimal - $avgPing_forward_slash - 1));
return $avgPing;
}
Again, it really depends on what version / repo you are using.