Forum Moderators: coopster
<?php
$wrt54g_data[" v2.0"] = file("http://10.0.0.1/");
$wrt54g_data_addi[" v2.0"] = " (router)";
// $wrt54g_data[" v5.0"] = file("http://EEE.FFF.GGG.HHH/");
// $wrt54g_data_addi[" v5.0"] = " (WDS node)";
$maxlen = 40;
foreach ($wrt54g_data as $version => $data) {
foreach ($wrt54g_data[$version] as $zeile) {
if (eregi("share.about",$zeile)) {
$splitted = split('"',strip_tags($zeile));
$splitted = split('"',$splitted[1]);
$line = "Linksys WRT54GS".$version.": Running ".$splitted[0];
};
if (eregi(" up ",$zeile)) {
$splitted = split(' up ',ereg_replace(" +"," ",strip_tags($zeile)));
$splitted = split(', load',$splitted[1]);
#$line2 = " Current uptime: ".$splitted[0].$wrt54g_data_addi[$version];
$line2 = " Uptime: ".$splitted[0];
$line3 = " Load".$splitted[1];
$splitted = split(',',$line3,3);
#$line3 = $splitted[0].", ".$splitted[1].", ".$splitted[2];
$line3 = $splitted[0];
if (strlen($line) > $maxlen) $maxlen = strlen($line);
$output[0] = $line;
$output[1] = $line2;
$output[2] = $line3;
//$output[4] = " Using 2x6mbit Cable Connections in Dual WAN mode";
};
if (eregi("MemFree:",$zeile)) {
$splitted = split('MemFree:\'\,\'',strip_tags($zeile));
$splitted = split('\'',$splitted[1]);
$line4 = " Total Memory: 32768kB, Total Free: ".$splitted[0]."kB";
$output[3] = $line4;
};
};
};
$font = 2;
// $width = ImageFontWidth($font) * $maxlen;
//$height = (ImageFontHeight($font)+1) * sizeof($output);
//$im = imagecreate ($width,$height);
$im = imagecreatefrompng("1.png");
// $background_color = imagecolorallocate ($im, 0, 0, 0);
//imagecolortransparent($im,$background_color);
$text_color = imagecolorallocate ($im, 205, 227, 238);
$text_color2 = imagecolorallocate ($im, 255, 153, 0);//black text
$text_color3 = imagecolorallocate ($im, 255, 153, 0);
$text_color4 = imagecolorallocate ($im, 255, 153, 0);
$text_color5 = imagecolorallocate ($im, 255, 153, 0);
#foreach ($output as $zeile) {
# imagestring ($im, $font, 0, $y, $zeile, $text_color);
# $y = $y + ImageFontHeight($font) + 1;
#};
$y=0;
imagestring ($im, $font, 0, $y, $output[0], $text_color);
$y = $y + ImageFontHeight($font) + 1;
imagestring ($im, $font, 0, $y, $output[1], $text_color2);
$y = $y + ImageFontHeight($font) + 1;
imagestring ($im, $font, 0, $y, $output[2], $text_color3);
$y = $y + ImageFontHeight($font) + 1;
imagestring ($im, $font, 0, $y, $output[3], $text_color4);
$y = $y + ImageFontHeight($font) + 1;
imagestring ($im, $font, 0, $y, $output[4], $text_color5);
header("Content-type: image/png");
imagepng ($im);
imagedestroy($im)
?>
this used to work fine now it doesnt even render the page