und es wird keine log datei erstellt
Beiträge von tomcrafter
-
-
ehrlich gesagt bin ich nicht selbst in der lage den fehler auszulesen oder anders gesagt weiss ich nicht wie du das meinnst wo ich dalesen soll... ich schau aber aufjedenfall grade in den logs
-
ich habe deinen tip befolgt aber allem anschein nach ist der server nichtmal gestartet
-
standardmaessig bekomme ich ja die ausgangsmeldung das der server online ist wenn ich auf straten klicke....
aber connecten kann ich nicht!
und wennni ch danna uf stoppen klicke dann kommt die meldunge rst die ich oben angegeben habe oder verstehe ich deinen satz nicht ?? ich weiss echt nicht mehr weiter... schonwieder alles neu machen kommt fuer mich nicht in frage weil ich im auftrage eines kunden handel und der mich nur gefragt hatte ob ich das kenne :(( -
Hallo zusammen wieder einmal habe ich eine Fehlermeldung im Script wo ich mir nicht weiterhelfen kann
der code:Warning: fsockopen() [function.fsockopen]: unable to connect to streamhosting.radio-kraftwerk.com:8000 (Connection refused) in /var/www/vhosts/****************/subdomains/streamhosting/httpdocs/content/servers.php on line 336
Server ist nicht OnlineGenutztes script
PHP
Alles anzeigen<?PHP // // // WallCityServer // Shoutcast Admin Panel // // Copyright 2008 // //////////////////////////////// if (!eregi("index.php", $_SERVER['PHP_SELF'])) { die ("You can't access this file directly..."); } if (!isset($user_level)) { table("Access Denied"); echo "You must be logged in to access this file"; closetable(); exit; } if (!isset($_GET['manage']) && !isset($_GET['view'])) { table("Server - Überblick"); echo " <table border='0' align='center' width='530'> "; $limit = $setting['display_limit']; if (!isset($_POST['p'])) $p = 0; else $p = $_POST['p'] * $limit; $l = $p + $limit; $listq = mysql_query("SELECT * FROM servers WHERE owner='$loginun' order by id ASC limit $p,$limit"); while($data = mysql_fetch_array($listq)) { if ($data['suspended']=="") { echo "<table width='95%' border='0' cellpadding='0' cellspacing='0'> <tr> <td width='137' align='left'>".$data['owner']."</td> <td width='157' align='center'>".$data['portbase']."</td> <td width='218' align='right'>[ <a href='index.php?page=servers&view='.$data['id']."'>Anzeigen</a> ] - [ <a href='index.php?page=servers&manage='.$data['id']."'>Einstellen</a> ] <br> [ <a href='index.php?page=servers&view='.$data['id']."&action=start'>Starten</a> ] - [ <a href='index.php?page=servers&view='.$data['id']."&action=stop'>Beenden</a> ]</td> </tr> <tr> <td height='2' align='left'> </td> <td align='center'> </td> <td align='right'> </td> </tr> </table> "; }else{ echo " <tr> <td align='left'>".$data['owner']."</td> <td align='center'>".$data['portbase']."</td> <td align='center'><font color='red'>Suspendiert</font> - <a href='?page=reason&id=".$data['id']."'>Begründung</a></td> </tr> "; } } if (mysql_num_rows($listq)==0) { echo " <tr> <td align='center' colspan='3'>Es sind keine Server auf dich registriert.</td> </tr> "; } echo " </table></br> "; $page = mysql_num_rows(mysql_query("SELECT * FROM servers")); echo "</br> <form method='POST' action='index.php?page=servers'> <center>Seite: <select name='p'>"; $i = 0; while($page > "0") { echo " <option "; if (($p / $limit) == $i){echo "selected ";} echo ">$i</option> "; $i++; $page -= $limit; } echo " </select> <input type='submit' name='submit' id='button' value='Anzeigen' style='background-image: url(images/bbg1.gif); color:#FFFFFF; font-weight: bold; font-family: trebuchet ms, helvetica, sans-serif; font-size:11px; border:0;'/> <br><br><a href='".$setting['newlink']."'>Einen Server beantragen</a> </center> "; closetable(); } if (isset($_GET['view'])) { $serverq = mysql_query("SELECT * FROM servers WHERE id='".$_GET['view']."'"); $serverdata = mysql_fetch_array($serverq); if ($serverdata['suspended']!="") { table("Achtung !"); echo "Der Server der angefragt wurde ist suspendiert.<br>Klicke <a href='?page=reason&id=".$_GET['view']."'>hier</a> um Details anzuzeigen"; closetable(); exit; } if (mysql_num_rows($serverq)==0 || $serverdata['owner']!=$loginun && ($userdata['user_level']!="Super Administrator")) { table("Achtung"); echo "Server existiert nicht, oder ist nicht auf dich registriert.<br>Bitte gehe <a href='index.php?page=servers'>zurück</a>"; closetable(); exit; } if (!isset($_GET['action'])) { table("Server - Überblick"); echo "<center>"; $scip = $setting['host_add']; $scpt = $serverdata['portbase']; function quiry_scserv($scservurl, $scservprt) { $scservfip = gethostbyname($scservurl); $getscserv = @fsockopen($scservfip, $scservprt, &$errno, &$errstr, 1) or $php_err .= "server doa"; $servquiry = ""; if (!$getscserv) { return "offline"; } else { fputs($getscserv, "GET /7.html HTTP/1.1\r\nAccept: */*\r\nAccept-Encoding: gzip, deflate\r\nUser-Agent: RaveTrax SC_Serv Stats Getter v1.1 (Mozilla Compatible)\r\nConnection: Keep-Alive\r\n\r\n"); while (!feof($getscserv)) { $servquiry .= fread($getscserv, 500); } fclose($getscserv); $quiryb = substr($servquiry, strpos($servquiry, "\r\n\r\n") + 4); return $quiryb; } } echo "<!-- "; $scserv_quiry = quiry_scserv($scip, $scpt); echo " -->"; if ($scserv_quiry == "offline") { $link = "[ <a href='?page=servers&view='.$_GET['view']."&action=start'>Starten</a> ]"; $csc_status = "Offline"; ?> Server ist gerade: <? echo $csc_status; ?> <? //--[ time to exit... see ya! } //--[ retuned quiry is online! let continue here else { //--[ lets explode the quiry data into an array... $quirydat = explode(',', $scserv_quiry); //--[ ok, now lets double check to see if server is actually broadcasting if ($quirydat[1] == "1") { //--[ double check says server is online, lets continue here. //--[ what verbage should be used? $csc_status = 'Dein Server ist Online<br>'; //--[ now lets turn the pretty array into some variables for output. $listener_c = $quirydat[0]; $listener_p = $quirydat[2]; $listener_m = $quirydat[3]; $listener_r = $quirydat[4]; $sc_bitrate = $quirydat[5]; $sc_playing = $quirydat[6]; //--[ let get the online template and show user the stats what we found. ?> <b>Aktueller Titel: <? echo $sc_playing; ?></b><br> ------------------------------------------ <br> Aktuelle Zuhörer: <? echo $listener_c; ?> <br> Zuhörer Record: <? echo $listener_p; ?> <br> Gesamte Zuhörer: <? echo $listener_r; ?> <br> Max Zuhörer: <? echo $listener_m; ?> <br> Bitrate: <? echo $sc_bitrate; ?> <br> <? $link = '[ <a href='?page=servers&view='.$_GET['view']."&action=stop'>Stoppen</a> ]"; } else { //--[ double check says server is offline, lets bail! //--[ what verbage should be used? $csc_status = 'Dein Server ist Online, aber kein DJ verbunden<br>'; $link = '[ <a href='?page=servers&view='.$_GET['view']."&action=stop'>Server stoppen</a> ]"; //--[ let get the offline template and show user what we found. echo $csc_status; //--[ time to exit... see ya! } } //_____________________________________________________________________________ //============================================================================= //--[ ok stop reading now, time to say goodbye! developed by rava@ravetrax.com // end stats script // echo '<br> '.$link.' - [ <a href='?page=servers&manage='.$_GET['view']."'>Einstellungen</a> ]"; closetable(); } if (isset($_GET['action']) && $_GET['action']=="start") { if ($user_level == "Super Administrator") $radioport = mysql_query("SELECT portbase FROM servers WHERE id='".$_GET['view']."'"); else $radioport = mysql_query("SELECT portbase FROM servers WHERE id='".$_GET['view']."' AND owner='".$loginun."'"); if (mysql_num_rows($radioport)==0) { table("Achtung"); echo "Server existiert nicht<br>Bitte gehe <a href='index.php?page=servers'>zurück</a>"; closetable(); exit; } $connection = @fsockopen($setting['host_add'], mysql_result($radioport,0), &$errno, &$errstr, 1) or $php_err .= "server doa"; if ($connection) { table("Achtung"); echo "Server ist Online<br>Bitte gehe <a href='index.php?page=servers'>zurück</a>"; closetable(); exit; } table("Server - Überblick"); echo "<center>"; $serverdata = mysql_query("SELECT * FROM servers WHERE id='".$_GET['view']."' AND portbase='".mysql_result($radioport,0)."'"); $ini_content = ""; foreach(mysql_fetch_array($serverdata) as $field => $value) { if (!is_numeric($field) && $field != "id" && $value !="" && $field != "owner" && $field!="pid" && $field!="sitepublic" && $field!="suspended" && $field!="abuse") { $ini_content .= $field."=".$value." "; } } if ($setting['os'] == 'windows') { $filename = $setting['dir_to_cpanel']."temp\\".mysql_result($radioport,0)."_".time().".ini"; } if ($setting['os'] == 'linux') { $filename = "temp/".mysql_result($radioport,0)."_".time().".conf"; } if (!$handle = fopen($filename, 'a')) { echo "Cannot open file ($filename)"; exit; } if (fwrite($handle, $ini_content) === FALSE) { echo "Cannot write to file ($filename)"; exit; } fclose($handle); if ($setting['os']=='windows') { //this starts the server then checks for the latest pid $WshShell = new COM("WScript.Shell"); $oExec = $WshShell->Run($setting['dir_to_cpanel']."files/windows/sc_serv.exe $filename", 3, false); $output = array(); exec('tasklist /fi "Imagename eq sc_serv.exe" /NH', $output); foreach($output as $a => $b) $pid = $b; if (strstr($pid,"INFO:") || !$pid || mysql_num_rows(mysql_query("SELECT * FROM servers WHERE pid='$pid'"))==1) { mysql_query("INSERT INTO notices (username,reason,message,ip) VALUES('".$loginun."','Server failure','The server with id".$_GET['view']." cannot start on port ".$serverdata['portbase']."','".$_SERVER['REMOTE_ADDR']."')"); echo "Could not start server, please contact administration using the contact form on your left"; closetable(); exit; } $pid = explode(" ",$pid); $i=0; foreach($pid as $a) { if (is_numeric($a) && !isset($set)) { $pid = trim($a); $set = 1; } } } if ($setting['os'] == 'linux') { $pid = shell_exec("nohup ".$setting['dir_to_cpanel']."files/linux/sc_serv ".$setting['dir_to_cpanel'].$filename." > /dev/null & echo $!"); if (!$pid || $pid == "") { mysql_query("INSERT INTO notices (username,reason,message,ip) VALUES('".$loginun."','Server failure','The server with id ".$_GET['view']." cannot start on port ".$serverdata['portbase']."','".$_SERVER['REMOTE_ADDR']."')"); echo "Could not start server, please contact administration using the contact form on your left"; closetable(); exit; } } //unlink($filename); mysql_query("UPDATE servers SET pid='$pid' WHERE id='".$_GET['view']."'"); echo "Dein Server sollte jetzt Online sein.<br>Bei einem Problem bitte an den Administrator wenden.<br>"; closetable(); } if (isset($_GET['action']) && $_GET['action']=="stop") { table("Servers - Überblick - Stoppen"); $radioport = mysql_query("SELECT portbase FROM servers WHERE id='".$_GET['view']."'"); $connection = fsockopen($setting['host_add'], mysql_result($radioport,0), $errno, $errstr, 1); if (!$connection) { echo "Server ist nicht Online<br>"; }else{ $pid = mysql_query("SELECT pid FROM servers WHERE id='".$_GET['view']."'"); if (mysql_result($pid,0)=="") { echo "Fortschritts ID nicht gefunden.<br>Bitte kontaktiere den Administrator."; closetable(); exit; } if ($setting['os']=="windows") { $WshShell = new COM("WScript.Shell"); $oExec = $WshShell->Run("taskkill /pid ".mysql_result($pid,0)." /f", 3, false); } if ($setting['os']=="linux") { $output = shell_exec("kill ".mysql_result($pid,0)); } echo "Server sollte jetzt Offline sein."; } closetable(); } } if (isset($_GET['manage'])) { $serverq = mysql_query("SELECT * FROM servers WHERE id='".$_GET['manage']."'"); $serverdata = mysql_fetch_array($serverq); if ($serverdata['suspended']!="") { table("Achtung !"); echo "Der Server ist suspendiert.<br>Klicke <a href='?page=reason&id=".$_GET['manage']."'>hier</a> um Details aufzurufen."; closetable(); exit; } if (mysql_num_rows($serverq)==0 || $serverdata['owner']!=$loginun && ($userdata['user_level']!="Super Administrator" || $userdata['user_level']!="Administrator") ) { table("Achtung"); echo "Server existiert nicht, oder ist nicht auf die registriert.<br>Bitte gehe <a href='index.php?page=servers'>zurück</a>"; closetable(); exit; } if (!isset($_POST['submit'])) { table(" Server - Einstellungen"); echo "<center> <form method='POST' action='index.php?page=servers&manage=".$_GET['manage']."'> <table border='0' align='center' width='100%'> "; $server= mysql_query("SELECT * FROM servers WHERE id='".$_GET['manage']."'"); foreach (mysql_fetch_array($server) as $field => $value) { $typeq = mysql_query("SELECT type FROM ini_sets WHERE field='c_".$field."'"); $ue = mysql_query("SELECT user_editable FROM ini_sets WHERE field='c_".$field."'"); $q = mysql_fetch_array(mysql_query("SELECT * FROM ini_sets WHERE field='c_".$field."'")); $type=0; $skip=0; if (mysql_num_rows($typeq)==0 || mysql_num_rows($ue)==0) $skip = 1; else if (mysql_result($ue,0)==1 && $skip==0) $type = 1; else if (mysql_result($typeq,0)==1 && $skip==0) $type = 0; if (!is_numeric($field) && $field == "sitepublic" && $type==1 && $skip==0) { echo " <tr> <td align='center'><b>".$q['title']."</b><bR><font size=2><i>".$q['description']."</i></font></td> <td width='55%' align='center'> <select name='".$field."'> <option value='1'"; if ($value == 1) echo " Selected"; echo ">Ja</option> <option value='0'"; if ($value == 0) echo " Selected"; echo ">Nein</option> </select> </td> </tr> "; $skip = 1; } if (!is_numeric($field) && $type==1 && $skip==0) { echo " <tr> <td align='center'><b>".$q['title']."</b><bR><font size=2><i>".$q['description']."</i></font></td> <td width='55%' align='center'><input type='text' name='".$field."' value='".$value."' size=8 maxlength='50'></td> </tr> "; }else if (!is_numeric($field) && $skip==0){ echo " <tr> <td align='center'><b>".$q['title']."</b><bR><font size=2><i>".$q['description']."</i></font></td> <td width='55%' align='center'>".$value."</td> </tr> "; } } echo " </table> <center><input type='submit' name='submit' id='button' value='Aktualisieren' style='background-image: url(images/bbg1.gif); color:#FFFFFF; font-weight: bold; font-family: trebuchet ms, helvetica, sans-serif; font-size:11px; border:0;'/></center></form> "; }else{ $fields = ""; $values = ""; foreach($_POST as $key => $value) { if ($key != "submit" && $value!="" && $key!="id") { $fields .= $key."='".$value."', "; $lastfield = $key; $lastvalue = $value; } } $fields = explode($lastfield,$fields); $fields = $fields['0'].$lastfield."='".$lastvalue."'"; if (mysql_query("UPDATE servers SET $fields WHERE id='".$_GET['manage']."'")) { table(" Servers - Aktualisierung"); echo "Server wurde erfolgreich aktualisiert.<br>Änderungen werden nach dem nächsten Neustart übernommen.<br>Klicke <a href='index.php?page=servers'>hier</a> um zurück zu kommen"; }else{ table(" Servers - Aktualisierung - FEHLER"); echo "Es ist ein Fehler aufgetreten<br>MYSQL ERROR:<br><font color=red>".mysql_error()."</font><br>Klicke <a href='index.php?page=servers&manage=".$_GET['manage']."'>hier</a> um zurück zu kommen"; echo "<br>".$fields; } closetable(); } } echo "</table>";
ueber hilfe und evtl Korrektur waere ich sehr dankbar da das script schonmal funktioniert hat und seit ich lenny 4.0 nutze eben nic htmehr
-
hat sich geklaert danke euch
-
Ich habe eben grade eine aktuelle Updayate funktion geutzt und es hat sich somit erledigt keinerlei fehler mehr auf Der Page
Danke allen Lesern des Threads und auch den Antwortendenfuer ihre anregungenMFG Chris
-
dort heisst es wenn ich das script richtig installiere also auch mit der setup.php alles mache dann funktioniert es ... was es ja leider aber nicht tut :((
ich habs norml installiert und es war von anfang an immer mysql fehlermeldungenals "notice" drinn :((
installiert habe ich es auf dem aktuellen xampp paket fuer windows um meine homepage bei mir zuhause zu testen bevor ich diese dann online stelle
-
Hallo wiedermal zusammen!
Ich hoffe ich kann bei euch auch diesesmal wieder mit netten hilfebeitraegen Rechnen ;-)!Ich habe folgendes problem
Fatal error: Can't use function return value in write context in C:\xampp\xampp\htdocs\maincore.php on line 35Der Code dazu ist hier zu bekommen http://fly-wow.de:8080/User%20ups/maincore.php und vorher habe ich issets eingebaut und wenn ich da aber nicht drinn habe bekomme ich immer eregi fehler angezeigt :(( kann mir jemand sagen ob das an der php version liegt ?
oder mir generell helfen ?
Diese maincore.php kommt direkt aus einem FUSION KitMFG
Christian
-
Hallo Leute ich bekomme wiedermal fehlermeldungen wo mir selbst mein Lehrer schon nicht weiterhelfen konnte folgende Meldung bekomme ich :
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in C:\Inetpub\vhosts\fly-wow.de\subdomains\msi\httpdocs\include\db.inc.php on line 49
Der coed dazu lautet
PHP
Alles anzeigen<? //////////////////////////////////////////////////////////////////////// /*SMI - SHOUTcast Management Interface A web based shoutcast server management program Founding Author: Scott D. Harvanek <scotth@sourcemirrors.org> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.*/ //////////////////////////////////////////////////////////////////////// //================================================================== // // Based on "A Simple MySQL Class" // By: Matthew Saragusa <polyhedron@gmail.com> // // Modified for SMI to match MDB2 class functions // for easier MySQL database operations and cleaner code // By: Kristian Resset <resset@users.sourceforge.net> // //=================================================================== require_once('config.php'); // DEFINE VARIABLES define('localhost', $dbhost); define('msi', $dbname); define('msi', $dbuser); define('mikelo89', $dbpass); // DEFINE MYSQL DATABASE CLASS class MySQLDB { var $db, $conn; public function __construct($server, $database, $username, $password) { $this->conn = mysql_connect($server, $username, $password); $this->db = mysql_select_db($database,$this->conn); } ////////////////////////////////////////////////////////////////////////////// // // MySQLDB->insert(<table>, <insert values array>) // or // MySQLDB->insert(<query>) // // Insert a record with columns and values from <insert values array>. // A full regular SQL INSERT query can be passed if desired. // Returns the value of insert_id if applicable. // // Example usage: // $db->insert('users', array('username' => 'admin', 'password' => 'changeme')); // // Equals to this call of the insert function if full query is preferred: // $db->insert("INSERT INTO users (username, password) VALUES ('admin', 'changeme')"); ////////////////////////////////////////////////////////////////////////////// public function insert($table, $insert_values='') { if (strtoupper(substr(trim($table), 0, 6)) == "INSERT") { $sql = $table; } else { foreach($insert_values as $key=>$value) { $keys[] = $key; $insertvalues[] = '\''.$value.'\''; } $keys = implode(',', $keys); $insertvalues = implode(',', $insertvalues); $sql = "INSERT INTO $table ($keys) VALUES ($insertvalues)"; } $this->sqlordie($sql); return mysql_insert_id($this->conn); } ////////////////////////////////////////////////////////////////////////////// // // MySQLDB->delete(<table> [, <condition array>]) // or // MySQLDB->delete(<query>) // // Deletes records from <table> based on <condition array>, if passed. // A full regular SQL DELETE query can be passed if desired. // CAUTION! If <condition array> is omitted, all recods in <table> is deleted. // // Example usage: // $db->delete('users', array('username' => 'admin')); // // Equals to this call of the delete function if full query is preferred: // $db->update("DELETE FROM users WHERE username = 'admin'"); ////////////////////////////////////////////////////////////////////////////// public function delete($table, $cond_array = '') { if (strtoupper(substr(trim($table), 0, 6)) == "DELETE") { $sql = $table; } else { $sql = "DELETE FROM $table"; if (is_array($cond_array)) { $sql .= " WHERE ".$this->conditions($cond_array); } } return $this->sqlordie($sql); } ////////////////////////////////////////////////////////////////////////////// // // MySQLDB->update(<table>, <update set array> [, <condition array>]) // or // MySQLDB->update(<query>) // // Updates records with <update set array> based on <condition array> if set. // A full regular SQL SELECT query can be passed if desired. // CAUTION! If <condition array> is omitted, all records in <table> is updated. // // Example usage: // $db->update('users', array('level' => 'admin'), array('username' => 'john')); // // Equals to this call of the update function if full query is preferred: // $db->update("UPDATE users SET level = 'admin' WHERE username = 'john'"); ////////////////////////////////////////////////////////////////////////////// public function update($table, $update_array, $cond_array = '') { if (strtoupper(substr(trim($table), 0, 6)) == "UPDATE") { $sql = $table; } else { foreach($update_array as $key => $value) { $sets[] = $key."='".$value."'"; } $sets = implode(',', $sets); $sql = "UPDATE $table SET $sets"; if (is_array($cond_array)) { $sql .= " WHERE ".$this->conditions($cond_array); } } return $this->sqlordie($sql); } ////////////////////////////////////////////////////////////////////////////// // // MySQLDB->getRow(<table>, [<condition array> [, <fields> [, <fetch_type>]]]) // or // MySQLDB->getRow(<query>) // // Returns query result as the first single resulting row based on the passed arguments. // A full regular SQL SELECT query can be passed if desired. // If <condition array> is omitted, no WHERE clause is used. // If no <fields> are given, the query equals 'SELECT * FROM <table>...' // <fetch_type> defaults to MYSQL_BOTH. Can also be MYSQL_NUM or MYSQL_ASSOC. // // Example usage: // $row = $db->getRow('users', 'username' => 'admin', 'username, password'); // echo "Username ".$row['username']." has password ".$row[1]; // // $row = $db->getRow("SELECT username, password FROM users WHERE username = 'admin'",,"MYSQL_NUM"); // echo "Username ".$row[0]." has password ".$row[1]; ////////////////////////////////////////////////////////////////////////////// public function getRow($table, $cond_array = '', $fields = '*', $fetch_type = MYSQL_BOTH) { if (strtoupper(substr(trim($table), 0, 6)) == "SELECT") { $sql = $table; } else { $sql = "SELECT $fields FROM $table"; if (is_array($cond_array)) { $sql .= " WHERE ".$this->conditions($cond_array); } } $result = $this->sqlordie($sql); return mysql_fetch_array($result, $fetch_type); } ////////////////////////////////////////////////////////////////////////////// // // MySQLDB->getRows(<table>, [<condition array> [, <fields> [, <orderfields> [, <ordertype> [, <fetch_type>]]]]]) // or // MySQLDB->getRows(<query>) // // Returns query result as an array of rows based on the passed arguments. // A full regular SQL SELECT query can be passed if desired. // If <condition array> is omitted, no WHERE clause is used (all rows selected). // If <fields> is empty, the query equals 'SELECT * FROM <table>...' // If <orderfields> is empty, no sorting will be performed. // <ordertype> defaults to ASC. Can also be DESC. // <fetch_type> defaults to MYSQL_BOTH. Can also be MYSQL_NUM or MYSQL_ASSOC. // // Example usage: // $rows = $db->getRows('users', 'level' => 'admin', 'firstname, lastname, username', 'lastname', 'DESC'); // foreach ($rows as $user) { // echo $user['lastname'].", ".$user['firstname'].": ".$user[2]; // } // // Equals to this call of the getRows function if full query is preferred: // $rows = $db->getRows("SELECT firstname, lastname, username FROM users WHERE level = 'admin' ORDER BY lastname DESC"); ////////////////////////////////////////////////////////////////////////////// public function getRows($table, $cond_array = '', $fields = '*', $orderfields = '', $ordertype = 'ASC', $fetch_type = MYSQL_BOTH) { if (strtoupper(substr(trim($table), 0, 6)) == "SELECT") { $sql = $table; } else { $sql = "SELECT $fields FROM $table"; if (is_array($cond_array)) { $sql .= " WHERE ".$this->conditions($cond_array); } if ($orderfields != '') { $sql .= " ORDER BY ".$orderfields." ".$ordertype; } } $result = $this->sqlordie($sql); while($row = mysql_fetch_array($result, $fetch_type)) { $records[] = $row; } if (isset($records)) { return $records; } } ////////////////////////////////////////////////////////////////////////////// // // MySQLDB->numRows(<table> [, <condition array>]) // or // MySQLDB->numRows(<query>) // // Returns the number of rows in a query result based on the passed arguments. // A full regular SQL SELECT query can be passed if desired. // If <condition array> is omitted, no WHERE clause is used (all rows selected). // // Example usage: // $num = $db->numRows('users', 'level' => 'admin'); // echo "There are ".$num." users which has admin access."; // // Equals to this call of the numRows function if full query is preferred: // $num = $db->numRows("SELECT * FROM users WHERE level = 'admin'"); ////////////////////////////////////////////////////////////////////////////// public function numRows($table, $cond_array = '', $fields = '*') { if (strtoupper(substr(trim($table), 0, 6)) == "SELECT") { $sql = $table; } else { $sql = "SELECT $fields FROM $table"; if (is_array($cond_array)) { $sql .= " WHERE ".$this->conditions($cond_array); } } $result = $this->sqlordie($sql); $num = mysql_num_rows($result); return $num; } ////////////////////////////////////////////////////////////////////////////// // // MySQLDB->query(<query>) // // General simple function to pass any queries directly in SQL. // The function returns the same value(s) as mysql_query(<query>) would have. // // Example usage: // $users = $db->query("SELECT COUNT(userid) FROM users"); // Would execute the query and return the result to be put in $users ////////////////////////////////////////////////////////////////////////////// public function query($sql) { return $this->sqlordie($sql); } /* / Private functions used within the class */ // Parse the conditions array private function conditions($multiple) { $str = ""; foreach ($multiple as $field => $value) { $str .= $field." = '".$value."' AND "; } return substr($str, 0, -4); } // Perform the actual SQL query private function sqlordie($sql) { $return_result = mysql_query($sql, $this->conn); if($return_result) { return $return_result; } else { $this->sql_error($sql); } } // Error handling private function sql_error($sql) { echo mysql_error($this->conn).'<br>'; die('error: '. $sql); } } // end of class ?>
um nen tip von Eurer seite waere ich echt Dankbar
Link zu der Fehler meldung ist
http://msi.fly-wow.de/install/install.php -
*gg* ich denk mal wenn ichd as eingebe :D:D:D:D:D
nein im ernst, das lohnt sich glaub ich net denn dazu hab ich das panel ja haben wollen xD
-
japp melde mich wuerde schon interesse haben
-
es ging generell darum dasd ich immer (notice) meldungen auf der HP hatte und die weghaben wollte und das ist ja auch der Fall aber zu deiner frage bin ich inzwischen soweit das es doch nur 1 und 0 gibt oder bin ich da fehlinformiert?
-
wird gemacht sind verweise mit Link hierauf erlaubt ? xD
sry ich frag einfach mal blond
-
Hallo Afrael.
Nein im grunde sollte da nun nichts mehr geaendert werden nur habe ich gedacht, das man das ganze Script vlt ja doch etwas einfacher gestalten oder ist das Komplett schon so einfach in PHP gehalten wie es geht ?LG
christian -
sry aber verstehe jetzt grade nicht Wo ich das einbauen soll ? oO sry ich kenn mich da absolut net m it aus ich sag ja bin zu doof da zu *gg*
ne mal im ernst gibt es die moeglichkeit das komplett zu bekommen von einem von euch ? ich mein soll auch nicht ohne gegenleistung sein
-
UserCheckerAndInserter.class.php so eine habe ich der folgende code steht in der php datei
PHP
Alles anzeigen<?php /** * Class UserCheckerAndInserter, checks the user and insert him/her to db, if possible * * LICENSE: CREATIVE COMMONS PUBLIC LICENSE "Namensnennung — Nicht-kommerziell 2.0" * * @copyright 2009 <SEDesign /> * @license http://creativecommons.org/licenses/by-nc/2.0/de/ * @version $3.0.6$ * @link http://www.sedesign.de/de_produkte_chat-v3.html * @since File available since Alpha 1.0 */ class UserCheckerAndInserter extends EtChatConfig { /** * DB-Connection Obj * @var ConnectDB */ private $dbObj; /** * array with all user data * @var array */ protected $_user_exists; /** * user name * @var string */ protected $_user; /** * user pw * @var string */ protected $_pw; /** * user sex * @var string */ protected $_gender; /** * XMLParser Obj * @var XMLParser */ protected $_lang; /** * this var is a status var and will be occupied with different values in subjection of needs, so it can get value "1" for ok, or just an other error message * @var string */ public $status; /** * Constructor * * @param ConnectDB $dbObj, Obj with the db connection handler * @param array $user_exists * @param string $user * @param string $pw * @param string $gender * @param XMLParser $lang * @uses ConnectDB::sqlSet() * @return void */ public function __construct ($dbObj, $user_exists, $user, $pw, $gender, $lang){ // call parent Constructor from class EtChatConfig parent::__construct(); $this->dbObj = $dbObj; // set the class vars $this->_user_exists=$user_exists; $this->_user=$user; $this->_pw=$pw; $this->_gender=$gender; $this->_lang=$lang; // if the user name is just exists in the user table if (is_array($this->_user_exists)){ // update needed user params $this->dbObj->sqlSet("UPDATE {$this->_prefix}etchat_user SET etchat_usersex = '".$this->_gender{0}."' WHERE etchat_user_id = ".$this->_user_exists[0][0]); // need pw input? if ($this->_pw=="") $this->userWithoutPw(); else $this->userWithPw(); } else $this->createNewUser(); } /** * CreateNewUser, if there is no such user name in user tab, creates a new dataset * * @uses ConnectDB::sqlSet() * @return void */ private function createNewUser(){ $this->dbObj->sqlSet("INSERT INTO {$this->_prefix}etchat_user ( etchat_username, etchat_usersex ) VALUES ( '".$this->_user."', '".$this->_gender{0}."')"); $user_neu=$this->dbObj->sqlGet("SELECT etchat_user_id, etchat_username, etchat_userprivilegien FROM {$this->_prefix}etchat_user WHERE etchat_username = '".$this->_user."' LIMIT 1"); $_SESSION['etchat_v3_user_id'] = $user_neu[0][0]; $_SESSION['etchat_v3_username'] = $user_neu[0][1]; $_SESSION['etchat_v3_user_priv'] = $user_neu[0][2]; $this->status=1; } /** * UserWithPw, user name and user pw were committed from login form * * @return void */ private function userWithPw(){ if ($this->_user_exists[0][2]==md5($this->_pw)){ $_SESSION['etchat_v3_user_id'] = $this->_user_exists[0][0]; $_SESSION['etchat_v3_username'] = $this->_user_exists[0][1]; $_SESSION['etchat_v3_user_priv'] = $this->_user_exists[0][3]; if ($_SESSION['etchat_v3_user_priv']=='admin' || $_SESSION['etchat_v3_user_priv']=='mod') setcookie("cookie_anzahl_logins_in_XX_sek",1); $this->status=1; } else $this->status = $this->_lang->pw_falsch[0]->tagData; } /** * UserWithoutPw, this user has a pw in db, so the status is "pw" to make a invitation in login-form to insert a pw * * @return void */ private function userWithoutPw(){ if (!empty($this->_user_exists[0][2])) { // if the user shpul get the invisible feeld in PW enter $this->status = ($this->_user_exists[0][3]=="admin") ? "pw+invisible" : "pw"; } else { $_SESSION['etchat_v3_user_id'] = $this->_user_exists[0][0]; $_SESSION['etchat_v3_username'] = $this->_user_exists[0][1]; $_SESSION['etchat_v3_user_priv'] = $this->_user_exists[0][3]; if ($_SESSION['etchat_v3_user_priv']=='admin' || $_SESSION['etchat_v3_user_priv']=='mod') setcookie("cookie_anzahl_logins_in_XX_sek",1); $this->status = 1; } } }
darauf hinn habe ich mal den dateinamen hinnein geschrieben und nun erhalte ich eine nurnoch weisse seite ... DER code DAzu sieht folgendermaßen aus
PHP
Alles anzeigen<?php session_start(); $username = $_SESSION['phpfusion_username']; $gender = "n"; $_SESSION['etchat_v3_logout_url'] = "../index.php?logout=true"; function __autoload($class_name) { require_once ('class/'.$class_name.'.class.php'); } new Check_CheckerAndInserter(true, $username, $gender); ?>
hoffe das ich es nun so eingebaut habe wie du meinntest -
Ja da kenne ich mich ja eben nicht aus es soll angeblich ueber die infusion passen da ich in der config fuer den Chat extra die database einegfuegt habe und der chat nun direkt mit den user der Homepage direkt funktionieren soll ich verzweifel daran noch habe auch schon versucht Kontakt mit dem Homepage betreiber aufzunehmen jedoch ohne erfolg.
-
Grevas danke ich teste es grade mal aus und erhielt folgende meldung :
ZitatFatal error: Cannot instantiate non-existent class: check_username in C:\Inetpub\vhosts\fly-wow.de\httpdocs\infusions\chat_panel\et_chat\start.php on line 14
lol mit dem gleichen code wie vorher nur eben angepasst wie du sagst
-
PHP
Alles anzeigen<?php /*-------------------------------------------------------+ | PHP-Fusion Content Management System | Copyright © 2002 - 2008 Nick Jones | http://www.php-fusion.co.uk/ +--------------------------------------------------------+ | Letzte Songs Panel for PHP-Fusion v7 | Author: Christian Krause (ckoneman04) | Homepage: http://www.djchrissi.de.ms +--------------------------------------------------------+ | This program is released as free software under the | Affero GPL license. You can redistribute it and/or | modify it under the terms of this license which you | can read by viewing the included agpl.txt or online | at www.gnu.org/licenses/agpl.html. Removal of this | copyright header is strictly prohibited without | written permission from the original author(s). +--------------------------------------------------------*/ opensidex("History","on"); // --------------------------------------------------- // HIER DIE SERVERDATEN EINGEBEN $scast_host = 'fly-wow.de'; // SHOUTCAST HOST IP $scast_port = '8000'; // SHOOUTCAST PORT $scast_pass = 'xx5x4b3'; // SHOUTCAST ADMIN PASSWORT // --------------------------------------------------- if (isset($_REQUEST['history'])){ $show_sc_songhistory = 1; } else { $show_sc_songhistory = 1; } if (isset($_REQUEST['listener'])){ $show_sc_listeners = 1; } else { $show_sc_listeners = 1; } if($fp = @fsockopen($scast_host, $scast_port, $errno, $errstr, 30)) { if(fputs($fp, "GET /admin.cgi?pass=".$scast_pass."&mode=viewxml HTTP/1.0\r\nUser-Agent: XML Getter (Mozilla Compatible)\r\n\r\n")) { $xmldata = ""; while(!feof($fp)) $xmldata .= fgets($fp, 1000); $xmldata = explode("\r\n", $xmldata); $xmldata = $xmldata[3]; } } function get_item($name, $source) { preg_match('#<'.$name.'>(.*?)</'.$name.'>#', $source, $matches); return $matches[1]; } function get_items($name, $source) { preg_match_all('#<'.$name.'>(.*?)</'.$name.'>#', $source, $matches); return $matches[1]; } $sc_stream_status = get_item("STREAMSTATUS", $xmldata); if(isset($sc_stream_status)) { $sc_stream_bitrate = get_item("BITRATE", $xmldata); $sc_listeners_cur = get_item("CURRENTLISTENERS", $xmldata); $sc_listeners_peak = get_item("PEAKLISTENERS", $xmldata); $sc_listeners_max = get_item("MAXLISTENERS", $xmldata); $sc_server_title = get_item("SERVERTITLE", $xmldata); $sc_server_url = get_item("SERVERURL", $xmldata); $sc_server_version = get_item("VERSION", $xmldata); $sc_current_song = get_item("SONGTITLE", $xmldata); } if(!($sc_stream_bitrate)) { echo " Server offline!" . "\n"; } else { if ($show_sc_songhistory) { echo "\n" . " <center><h3><font color="red">Titelspeicher</font></h3></center>" . "\n"; echo " <center><table border=0></center>" . "\n"; $scast_songs = get_items("SONG", $xmldata); $count = 0; for($i=0; $i<count($scast_songs); $i++) { $sc_song_playtime = strftime("%H:%M", get_item("PLAYEDAT", $scast_songs[$i])); $sc_song_title = get_item("TITLE", $scast_songs[$i]); echo " <tr><td>$sc_song_playtime</td><td>$sc_song_title</td></tr>" . "\n"; } echo " </table>" . "\n"; } else { $sc_songhistory = ""; } if ($show_sc_listeners) { echo "\n" . " <h3><font color="red">Zuhoerer</font></h3></center></h3>" . "\n"; echo " <table border=1>" . "\n"; echo " <tr><th>No.</th><th>Connecttime</th></tr>" . "\n"; $scast_listeners = get_items("LISTENER", $xmldata); $count = 0; for($i=0; $i<count($scast_listeners); $i++) { $sc_no = $i+1; $sc_connecttime = gmstrftime("%H:%M:%S", get_item("CONNECTTIME", $scast_listeners[$i])); echo " <tr><td>$sc_no</td><td>$sc_connecttime</td></tr>" . "\n"; } echo " </table>" . "\n"; } else { $sc_listeners = ""; } } closesidex(); ?>
so sieht es nun aus hat noch jemand eine Idee zur weitern verinfachung? LG und netten abend noch christian