wieso sind denn 4 Leerzeichen vor jeder Zeile? die sind im original nicht da...
however, 10000% funktionierende global.php:
Code: Alles auswählen
<?php
//error_reporting(E_ALL);
error_reporting(E_ERROR);
// Auslesen der ipc.cfg
// nur variablen in ' ' werden ausgelesen
$ipccfg=fopen("/var/emu/conf/ipc.cfg","r");
while($input = fgets($ipccfg, 1024)) {
preg_match('°(.*)\s{0,1}=\s{0,1}\'(.*)\'°',trim($input),$find);
if (isset($find[1])) {
if (empty($find[2])) { $find[2]='""'; }
$$find[1] = $find[2];
}
}
// Auslesen der functions.sh
// nur variablen in " " werden ausgelesen
$functions=fopen("/var/emu/script/functions.sh","r");
while($input = fgets($functions, 1024)) {
preg_match("°(.*)\s{0,1}=\s{0,1}\"(.*)\"°",trim($input),$find);
if (isset($find[1])) {
if (empty($find[2])) { $find[2]='""'; }
$$find[1] = $find[2];
}
}
$zeile=$zeile2='';
// Auslesen der CCcam.cfg
if (file_exists("/var/etc/CCcam.cfg")) {
$server = "SERVER LISTEN PORT";
$info = "WEBINFO LISTEN PORT";
$file = file("/var/etc/CCcam.cfg");
for($i=0; $i<count($file); $i++) {
preg_match("/$server/", trim($file[$i]), $find);
if (isset($find[0])) {
$zeile = "$file[$i]";
$CCPORT = trim(substr(strrchr($zeile, ":"), 1));
if (isset($zeile[0]) AND $zeile[0]=='#') { $CCPORT = "12000"; }
}
preg_match("/$info/", trim($file[$i]), $find);
if (isset($find[0])) {
$zeile2 = "$file[$i]";
$CCWEB = trim(substr(strrchr($zeile2, ":"), 1));
if (isset($zeile[0]) AND $zeile[0]=='#') { $CCWEB = "16001"; }
}
}
}
if(empty($CCPORT))
$CCPORT = "12000";
if(empty($CCWEB))
$CCWEB = "16001";
// Auslesen der oscam.conf
if (file_exists("/var/etc/oscam.conf")) {
$suche = "httpport";
$oscamconf = parse_ini_file("/var/etc/oscam.conf");
foreach ($oscamconf AS $set => $var) {
echo "<b>$set = $var</b><br/>";
}
if (isset($oscamconf["$suche"])) {
$OSWEB = $oscamconf["$suche"];
$OSPORT = $OSWEB;
} else {
$OSWEB = "inaktiv";
}
}
if(empty($OSWEB))
$OSWEB = "inaktiv";
////// defaults
//
$DEBUG=0;
if (!isset($WEBIF_CON)) { $WEBIF_CON = "hide"; }
if ($WEBIF_CON == "hid") { $WEBIF_CON = "hide"; }
if ($WEBIF_CON == "menu") { $WEBIF_CON = "menue"; }
if ($WEBIF_CON == "menü") { $WEBIF_CON = "menue"; }
if ($WEBIF_CON == "staz") { $WEBIF_CON = "stay"; }
// Home refresh in sec
$WEBIF_CON_Refresh="60";
// Control reload in millisec
$WEBIF_CON_Reload="7000";
// --------------------- f u n c t i o n s ---------------------
function showarray($array) {
echo "<pre>\n";
var_dump($array);
echo "</pre>\n";
flush();
}
function Get_consolenbefehle_html() {
global $LINES;
$handle = fopen("consolenbefehle.csv", "r");
$LINES='';
while($line = fgetcsv($handle, 1000, ";")) {
if (!isset($line[1])) { $line[1]=''; }
$LINES.="<tr><td><font color='#c8c8c8' face='Arial' size=2>".trim($line[0])."</font></td><td><font color=green face='Arial' size=2>".($line[1])."</font></td></tr>\n";
}
}
function dmesgTime($time) {
global $Uptime;
$now = time();
if (!isset($Uptime)) { $Uptime = shell_exec("cat /proc/uptime | cut -d'.' -f1"); }
$t_now = $now - $Uptime;
$t_time = $t_now + $time;
return $t_time;
}
function GetLogLines($File) {
global $LogLines;
$file = file("$File");
if ($File === "/var/log/dmesg") {
for($i=0; $i<count($file); $i++) {
$zeile = trim("$file[$i]");
$EndTpos1=(strpos($zeile,"]")-1);
$EndTpos2=(strpos($zeile,"]")+1);
$TIME=trim(substr("$zeile",1,$EndTpos1));
$TIME=date("H:i:s d.m.Y",dmesgTime($TIME));
$LINE=substr("$zeile",$EndTpos2);
$LogLines.="<font color='#800000'>[</font>".$TIME."<font color='#800000'>]</font> ".$LINE."<br/>\n";
}
} elseif ($_POST['Logs'] === "CCcam.log") {
for($i=0; $i<count($file); $i++) {
$zeile = trim("$file[$i]");
if (strstr($zeile,'CCcam:') != "") { $LogLines.="".$zeile."<br/>\n"; }
}
} else {
for($i=0; $i<count($file); $i++) {
$zeile = trim("$file[$i]");
$LogLines.="".$zeile."<br/>\n";
}
}
}
/**
* Get the human-readable size for an amount of bytes
* @param int $size : the number of bytes to be converted
* @param int $precision : number of decimal places to round to;
* optional - defaults to 2
* @param bool $long_name : whether or not the returned size tag should
* be unabbreviated (ie "Gigabytes" or "GB");
* optional - defaults to true
* @param bool $real_size : whether or not to use the real (base 1024)
* or commercial (base 1000) size;
* optional - defaults to true
* @return string : the converted size
*/
function get_size($size,$precision=2,$long_name=true,$real_size=true) {
$base=$real_size?1024:1000;
$pos=0;
while ($size>$base) {
$size/=$base;
$pos++;
}
$prefix=get_size_prefix($pos);
$size_name=$long_name?$prefix."bytes":$prefix[0].'B';
return round($size,$precision).' '.ucfirst($size_name);
}
/**
* @param int $pos : the distence along the metric scale relitive to 0
* @return string : the prefix
*/
function get_size_prefix($pos) {
switch ($pos) {
case 00: return "";
case 01: return "Kilo";
case 02: return "Mega";
case 03: return "Giga";
case 04: return "Tera";
case 05: return "Peta";
case 06: return "Exa";
case 07: return "Zetta";
case 08: return "Yotta";
case 09: return "Xenna";
case 10: return "W-";
case 11: return "Vendeka";
case 12: return "u-";
default: return "?-";
}
}
?>
wenn die auch nicht geht, dann machst DU auf jedenfall irgendwas falsch - zb kein Linux kompatibler Editor mit dem du die Datei bearbeitest? -> gewöhnt euch an LINUX zu benutzen und zwar -> nano