ich denke mal ihr könnt mir da helfen!
Auf unserer Seite funktioniert alles enwandfrei.
Das einzige Problem was schon länger besteht, betrifft die Usergallerie.
Bilder hochladen funktioniert nur das löschen geht nicht.
Ich erhalte dann immer diese Fehlermeldung:
MySQL Error:
1064 : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-24,24' at line 1
in Query:
SELECT name, besch, endung, id FROM ic1_usergallery WHERE uid = 1 ORDER BY id DESC LIMIT -24,24
Debug backtrace:
@ mysql.php:32 -- debug_bt()
@ mysql.php:50 -- db_check_error(...)
@ usergallery.php:104 -- db_query(...)
@ user.php:24 -- require_once(...)
@ index.php:36 -- require_once(...)
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\Inetpub\vhosts\0pro-clan.de\httpdocs\include\includes\func\db\mysql.php on line 71
verwendete ilchClan Version: 1.1 O
betroffene Homepage: externer Link
mysql.php
<?php # Copyright by Manuel # Support www.ilch.de defined ('main') or die ( 'no direct access' ); $count_query_xyzXYZ = 0; function db_connect () { if (defined('CONN')) { return; } define ( 'CONN', @mysql_pconnect(DBHOST, DBUSER, DBPASS)); $db = @mysql_select_db(DBDATE, CONN); if (!CONN) { die('Verbindung nicht möglich, bitte prüfen Sie ihre mySQL Daten wie Passwort, Username und Host<br />'); } if ( !$db ) { die ('Kann Datenbank "'.DBDATE.'" nicht benutzen : ' . mysql_error(CONN)); } } function db_close () { mysql_close ( CONN ); } function db_check_error (&$r, $q) { if (!$r AND mysql_errno(CONN) <> 0 AND function_exists('is_coadmin') AND is_coadmin()) { // var_export (debug_backtrace(), true) echo('<font color="#FF0000">MySQL Error:</font><br>'.mysql_errno(CONN).' : '.mysql_error(CONN).'<br>in Query:<br>'.$q.'<pre>'.debug_bt().'</pre>'); } return ($r); } function db_query ($q) { global $count_query_xyzXYZ; $count_query_xyzXYZ++; if (preg_match ("/^UPDATE `?prefix_\S+`?\s+SET/is", $q)) { $q = preg_replace("/^UPDATE `?prefix_(\S+?)`?([\s\.,]|$)/i","UPDATE `".DBPREF."\\1`\\2", $q); } elseif (preg_match ("/^INSERT INTO `?prefix_\S+`?\s+[a-z0-9\s,\)\(]*?VALUES/is", $q)) { $q = preg_replace("/^INSERT INTO `?prefix_(\S+?)`?([\s\.,]|$)/i", "INSERT INTO `".DBPREF."\\1`\\2", $q); } else { $q = preg_replace("/prefix_(\S+?)([\s\.,]|$)/", DBPREF."\\1\\2", $q); } return (db_check_error(@mysql_query($q, CONN), $q)); } function db_result ($erg, $zeile=0, $spalte=0) { return (mysql_result ($erg,$zeile,$spalte)); } function db_fetch_assoc ($erg) { return (mysql_fetch_assoc($erg)); } function db_fetch_row ($erg) { return (mysql_fetch_row($erg)); } function db_fetch_object ($erg) { return (mysql_fetch_object($erg)); } function db_num_rows ($erg) { return (mysql_num_rows ($erg)); } function db_last_id () { return ( mysql_insert_id (CONN)); } function db_count_query ( $query ) { return (db_result(db_query($query),0)); } function db_list_tables ( $db ) { return (mysql_list_tables ($db, CONN)); } function db_tablename ($db, $i) { return (mysql_tablename ($db, $i)); } function db_check_erg ($erg) { if ($erg == false OR @db_num_rows($erg) == 0) { exit ('Es ist ein Fehler aufgetreten'); } } function db_make_sites ($page ,$where ,$limit ,$link ,$table, $anzahl = NULL) { $hvmax = 4; // hinten und vorne links nach page $maxpage = ''; if ( empty ($MPL) ) { $MPL = ''; } if ( is_null ( $anzahl ) ) { $resultID = db_query ( "SELECT COUNT(*) FROM prefix_".$table." ".$where ); $total = db_result($resultID,0); } else { $total = $anzahl; } if ($limit < $total) { $maxpage = $total / $limit; if (is_double($maxpage)) { $maxpage = ceil($maxpage); } $ibegin = $page - $hvmax; $iende = $page + $hvmax ; $vgl1 = $iende + $ibegin; $vgl2 = ($hvmax * 2) + 1; if ( $vgl1 <= $vgl2 ) { $iende = $vgl2; } $vgl3 = $maxpage - ($vgl2 -1); if ($vgl3 < $ibegin ) { $ibegin = $vgl3; } if ($ibegin < 1) { $ibegin = 1; } if ($iende > $maxpage) { $iende = $maxpage; } $vMPL = ''; if ($ibegin > 1) { $vMPL = '<a href="'.$link.'-p1">«</a> '; } $MPL = $vMPL.'[ '; for($i=$ibegin; $i <= $iende; $i++) { if($i == $page) { $MPL .= $i; } else { $MPL .= '<a href="'.$link.'-p'.$i.'">'.$i.'</a>'; } if ($i != $iende) { $MPL .= ' | '; } } $MPL .= ' ]'; if ($iende < $maxpage) { $MPL .= ' <a href="'.$link.'-p'.$maxpage.'">»</a>'; } } return $MPL; } ?>
usergallery.php
<?php # Copyright by: Manuel # Support: www.ilch.de # Modifiziert von: DjGeCk0 # www.swat-report.net defined ('main') or die ( 'no direct access' ); if ($allgAr['forum_usergallery'] == 0) { exit(); } $uid = escape($menu->get(2), 'integer'); $img_per_site = $allgAr['gallery_imgs_per_site']; $img_per_line = $allgAr['gallery_imgs_per_line']; # zeige alle gallery if (empty($uid)) { $title = $allgAr['title'].' :: Users :: Gallery'; $hmenu = $extented_forum_menu.'<a class="smalfont" href="?user">Users</a><b> » </b>Gallery'.$extented_forum_menu_sufix; $design = new design ( $title , $hmenu, 1); $design->header(); $i = 0; $class = 'Cmite'; $x = ''; if (loggedin()) { $x .= '<a href="index.php?user-usergallery-'.$_SESSION['authid'].'">Meine Gallery</a><br /><br />'; } $erg = db_query("SELECT uid, prefix_user.name as uname, COUNT(*) as anz FROM prefix_usergallery LEFT JOIN prefix_user ON prefix_usergallery.uid = prefix_user.id GROUP BY uid, uname ORDER BY anz DESC"); while ($r = db_fetch_assoc($erg)) { $class = ( $class == 'Cmite' ? 'Cnorm' : 'Cmite' ); $x .= '<div class="'.$class.'" style="float: left; padding: 5px;"><a href="index.php?user-usergallery-'.$r['uid'].'">'.$r['uname'].'</a><br /><span class="smalfont">Anzahl Bilder: '.$r['anz'].'</span></a></div>'; if ( $i <> 0 AND ($i % 5 ) == 0 ) { $x .= '<br />'; } } $tpl = new tpl ( 'user/gallery'); $tpl->set_out('x',$x,4); $design->footer(); exit(); } # user gallery zeigen $uname = db_result(db_query("SELECT name FROM prefix_user WHERE id = ".$uid),0,0); $title = $allgAr['title'].' :: Users :: Gallery'; $hmenu = $extented_forum_menu.'<a class="smalfont" href="index.php?user">Users</a><b> » </b><a class="smalfont" href="?user-usergallery">Gallery</a><b> » </b>von '.$uname.$extented_forum_menu_sufix; $design = new design ( $title , $hmenu, 1); $design->header(); $tpl = new tpl ('user/gallery'); $tpl->set('uid', $uid); $tpl->set('uname', $uname); # bild loeschen... if ($menu->getA(4) == 'd' AND is_numeric($menu->getE(4)) AND loggedin() AND (is_siteadmin() OR $uid == $_SESSION['authid'])) { $delid = escape($menu->getE(4), 'integer'); $x = @db_result(db_query("SELECT endung FROM prefix_usergallery WHERE uid = ".$uid." AND id = ".$delid),0,0); if (!empty($x)) { @unlink ( 'include/images/usergallery/img_thumb_'.$delid.'.'.$x ); @unlink ( 'include/images/usergallery/img_'.$delid.'.'.$x ); @db_query("DELETE FROM prefix_usergallery WHERE uid = ".$uid." AND id = ".$delid); } } # bild hochladen if (!empty($_FILES['file']['name']) AND is_writeable('include/images/usergallery') AND loggedin() AND $uid == $_SESSION['authid'] AND substr ( ic_mime_type($_FILES['file']['tmp_name']) , 0 , 6 ) == 'image/') { require_once('include/includes/func/gallery.php'); $size = @getimagesize ($_FILES['file']['tmp_name']); $fende = preg_replace("/.+\.([a-zA-Z]+)$/", "\\1", $_FILES['file']['name']); $fende = strtolower($fende); if (!empty($_FILES['file']['name']) AND $size[0] > 10 AND $size[1] > 10 AND ($size[2] == 2 OR $size[2] == 3 OR $size[2] == 1) AND ($fende == 'gif' OR $fende == 'jpg' OR $fende == 'jpeg' OR $fende == 'png')) { $name = $_FILES['file']['name']; $tmp = explode('.',$name); $tm1 = count($tmp) -1; $endung = escape($tmp[$tm1], 'string'); unset($tmp[$tm1]); $name = escape(implode('',$tmp), 'string'); $besch = escape($_POST['text'], 'string'); $id = db_result(db_query("SHOW TABLE STATUS FROM `". DBDATE ."` LIKE 'prefix_usergallery'"),0,'Auto_increment'); $bild_url = 'include/images/usergallery/img_'.$id.'.'.$endung; if (@move_uploaded_file ($_FILES['file']['tmp_name'], $bild_url)) { @chmod($bild_url, 0777); db_query("INSERT INTO prefix_usergallery (uid,name,endung,besch) VALUES (".$uid.",'".$name."','".$endung."','".$besch."')"); $bild_thumb = 'include/images/usergallery/img_thumb_'.$id.'.'.$endung; create_thumb ($bild_url, $bild_thumb, $allgAr['gallery_preview_width']); @chmod($bild_thumb, 0777); echo '<b>Datei '.$name.'.'.$endung.' erfolgreich hochgeladen</b><br /><br /><br /> <b> BB-Code </b><br /> coming soon<br> <br>'; $page = $_SERVER["HTTP_HOST"]. dirname($_SERVER["SCRIPT_NAME"]); echo 'Bildlink: <a target="_blank" href="http://'.$page.'/'.$bild_url.'">http://'.$page.'/'.$bild_url.'</a><br />'; echo 'Oder klein: <a target="_blank" href="http://'.$page.'/'.$bild_thumb.'">http://'.$page.'/'.$bild_thumb.'</a><br /><br />'; } } } # bilder abfragen $limit = $img_per_site; $page = ($menu->getA(3) == 'p' ? $menu->getE(3) : 1 ); $MPL = db_make_sites ($page , '' , $limit , 'index.php?user-usergallery-'.$uid , "usergallery WHERE uid = ".$uid); $anfang = ($page - 1) * $limit; $erg = db_query("SELECT name, besch, endung, id FROM prefix_usergallery WHERE uid = ".$uid." ORDER BY id DESC LIMIT ".$anfang.",".$limit); $tpl->set('imgperline', $allgAr['gallery_imgs_per_line']); $tpl->set('MPL',$MPL); $tpl->out(0); $class = 'Cnorm'; $i = 0; if ( db_num_rows($erg) > 0 ) { while($row = db_fetch_assoc($erg) ) { $class = ( $class == 'Cmite' ? 'Cnorm' : 'Cmite' ); $row['class'] = $class; $row['besch'] = unescape($row['besch']); if (loggedin() AND (is_siteadmin() OR $uid == $_SESSION['authid'])) { $page = $_SERVER["HTTP_HOST"]. dirname($_SERVER["SCRIPT_NAME"]); $row['besch'] .= '<a href="index.php?user-usergallery-'.$uid.'-p'.$page.'-d'.$row['id'].'"><img src="include/images/icons/del.gif" border="0" alt="löschen" title="löschen" /></a><br><br> <b> BB-Code </b><br /> <textarea rows="2">[url=http://'.$page.'include/images/usergallery/img_'.$row['id'].'.'.$row['endung'].'] [img]http://'.$page.'include/images/usergallery/img_thumb_'.$row['id'].'.'.$row['endung'].'[/img][/url]</textarea> <br> '; } $row['width'] = round( 100 / $img_per_line ); if ( $i <> 0 AND ($i % $img_per_line ) == 0 ) { echo '</tr><tr>'; } $tpl->set_ar_out($row,1); $i++; } if ( $i % $img_per_line <> 0 ) { $anzahl = $img_per_line - ($i % $img_per_line); for($x=1;$x<=$anzahl;$x++){ echo '<td class="'.$class.'"></td>'; } } } $tpl->out(2); # bilder abfragen echo '<br><center>extended Usergallery by <a href="http://swat-report.net">DjGeCk0</a></center>'; # bild hochladen if (is_writeable('include/images/usergallery') AND loggedin() AND $uid == $_SESSION['authid']) { $tpl->out(3); } $design->footer(); ?>
Zuletzt modifiziert von NFCTOTO am 06.09.2013 - 11:01:14