ich habe eine Menge Module, Änderungen und PlugIns drauf...
leider fiel mir heute erst auf, dass bei erstellen eines Neues Posts dieser Fehler auftaucht:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | 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 '= "Dennis3107" ORDER BY id DESC LIMIT 1' at line 1 in Query: SELECT txt FROM `ic1_posts` WHERE erst LIKE = "Dennis3107" ORDER BY id DESC LIMIT 1 Debug backtrace: @ mysql.php:32 -- debug_bt() @ mysql.php:50 -- db_check_error(...) @ new_post.php:121 -- db_query(...) @ forum.php:131 -- require_once(...) @ index.php:40 -- require_once(...) Warning: mysql_result(): supplied argument is not a valid MySQL result resource in /home/www/web185/html/autofreunde/include/includes/func/db/mysql.php on line 54 |
Aber der Posts wird dennoch angezeigt... und bei Editieren des Posts aucht der Fehler nicht auf...
Der Part aus der mysql.php
1 2 3 | function db_result ($erg, $zeile=0, $spalte=0) { return (mysql_result ($erg,$zeile,$spalte)); } |
und die newpost.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 | <?php # Copyright by: Manuel # Support: www.ilch.de defined ( 'main' ) or die ( 'no direct access' ); if ( $aktTopicRow [ 'stat' ] == 0 OR $forum_rights [ 'reply' ] == FALSE ) { if ( $aktTopicRow [ 'stat' ] == 0 AND $_SESSION [ 'authright' ] > '-7' ) { if ( $forum_rights [ 'mods' ] == FALSE) $forum_failure [] = $lang [ 'topicclosed' ]; } elseif ( $aktTopicRow [ 'stat' ] != 0 AND $_SESSION [ 'authright' ] > '-7' ) { if ( $forum_rights [ 'mods' ] == FALSE) $forum_failure [] = $lang [ 'nopermission' ]; } check_forum_failure( $forum_failure ); } $title = $allgAr [ 'title' ]. ' :: Forum :: ' .aktForumCats( $aktForumRow [ 'kat' ], 'title' ). ' :: ' . $aktForumRow [ 'name' ]. ' :: neuer Beitrag' ; $hmenu = $extented_forum_menu . '<a class="smalfont" href="index.php?forum">Forum</a><b> » </b>' .aktForumCats( $aktForumRow [ 'kat' ]). '<b> » </b><a class="smalfont" href="index.php?forum-showtopics-' . $fid . '">' . $aktForumRow [ 'name' ]. '</a><b> » </b>' ; $hmenu .= '<a class="smalfont" href="index.php?forum-showposts-' . $tid . '">' . $aktTopicRow [ 'name' ]. '</a>' . $extented_forum_menu_sufix ; $dppk_time = time(); $time = time(); if (!isset( $_SESSION [ 'klicktime' ])) { $_SESSION [ 'klicktime' ] = 0; } $topic = '' ; $txt = '' ; $xnn = '' ; if (isset( $_POST [ 'txt' ])) { $txt = trim(escape( $_POST [ 'txt' ], 'textarea' )); } if (isset( $_POST [ 'Gname' ])) { $xnn = trim(escape_nickname( $_POST [ 'Gname' ])); } if (( $_SESSION [ 'klicktime' ] + 15) > $dppk_time OR empty ( $txt ) OR ! empty ( $_POST [ 'priview' ]) OR ( empty ( $_POST [ 'Gname' ]) AND !loggedin()) OR !chk_antispam ( 'newpost' )) { $design = new design ( $title , $hmenu , 1); $design ->header(); $name = '' ; if ( !loggedin() ) { $name = '<tr><td class="Cmite"0><b>' . $lang [ 'name' ]. '</b></td>' ; $name .= '<td class="Cnorm"><input type="text" value="' .unescape( $xnn ). '" maxlength="15" name="Gname"></td></tr>' ; } elseif (!is_admin() and db_result( $qry = db_query( "SELECT erstid, id FROM prefix_posts WHERE tid = '$tid' ORDER BY id DESC LIMIT 1" ),0 , 0) == $_SESSION [ 'authid' ]) { $wdlinks = array ( 'Zurück zum Thema' => 'index.php?forum-showposts-' . $tid , 'Letzten Beitrag editieren' => 'index.php?forum-editpost-' . $tid . '-' .db_result( $qry ,0,1), 'Forenübersicht' => 'index.php?forum' ); echo wd( $wdlinks , 'Der letzte Post in diesem Thread ist bereits von Dir, dies ist eine Doppelpostsperre!.<br /> Kleiner Tipp an dieser Stelle: Du kannst deine Beiträge auch editieren.', 15); $design ->footer(1); } $tpl = new tpl ( 'forum/newpost' ); $xtext = '' ; if ( $menu ->getA(3) == 'z' ) { $row = db_fetch_object(db_query( "SELECT txt,erst FROM prefix_posts WHERE id = " . $menu ->getE(3))); $xtext = '[quote=' .escape_nickname( $row ->erst). ']' . "\n" . $row ->txt. "\n[/quote]" ; } if ( $menu ->getA(3) == 'f' ) { $r = db_fetch_assoc(db_query( "SELECT id,text,title FROM prefix_faqs WHERE id = " . $menu ->getE(3))); $xtext = 'FAQ Artikel: [url=index.php?faqs-s' . $r [ 'id' ]. '#FAQ' . $r [ 'id' ]. ']' . $r [ 'title' ]. '[/url]' . "\n" .unescape( $r [ 'text' ]); } if (isset( $_POST [ 'priview' ])) { $tpl ->set_out( 'txt' , FE_Vote2HTML(1,bbcode( $txt ),TRUE), 0); } if ( empty ( $txt )) { $txt = $xtext ; } $tpl = new tpl ( 'forum/newpost' ); $ar = array ( 'txt' => escape_for_fields(unescape( $txt )), 'tid' => $tid , 'name' => $name , 'SMILIES' => getsmilies(), 'antispam' => get_antispam( 'newpost' ,1) ); $tpl ->set_ar_out( $ar ,1); $erg = db_query( 'SELECT id,erst, txt FROM `prefix_posts` WHERE tid = "' . $tid . '" ORDER BY time DESC LIMIT 0,5' ); while ( $row = db_fetch_assoc( $erg )) { $row [ 'txt' ] = bbcode( $row [ 'txt' ]); //Forumex - begin $row [ 'txt' ] = FE_Vote2HTML( $row [ 'id' ], $row [ 'txt' ],TRUE); //Forumex - end $tpl ->set_ar_out( $row , 2); } $tpl ->out(3); } else { # save post $_SESSION [ 'klicktime' ] = $dppk_time ; $design = new design ( $title , $hmenu , 1); $design ->header(); if (loggedin()) { $uid = $_SESSION [ 'authid' ]; $erst = escape( $_SESSION [ 'authname' ], 'string' ); db_query( "UPDATE `prefix_user` set posts = posts+1 WHERE id = " . $uid ); } else { $erst = $xnn ; $uid = 0; } // Doppelpost prüfen $lastdbtxt = db_result(db_query( 'SELECT txt FROM `prefix_posts` WHERE erst LIKE = "' . $erst . '" ORDER BY id DESC LIMIT 1' ),0); if ( $lastdbtxt != $txt ) { # topic alert ausfuehren. $topic_alerts_abf = "SELECT prefix_topics.name as topic, prefix_user.email as email, prefix_user.name as user, prefix_user.id as uid FROM prefix_topic_alerts LEFT JOIN prefix_topics ON prefix_topics.id = prefix_topic_alerts.tid LEFT JOIN prefix_user ON prefix_user.id = prefix_topic_alerts.uid WHERE prefix_topic_alerts.tid = ". $tid ; $topic_alerts_erg = db_query( $topic_alerts_abf ); while ( $topic_alerts_row = db_fetch_assoc( $topic_alerts_erg )) { if ( $uid == $topic_alerts_row [ 'uid' ]) continue ; $page = $_SERVER [ "HTTP_HOST" ]. $_SERVER [ "SCRIPT_NAME" ]; $text = sprintf ( $lang [ 'topicalertmessage' ], $topic_alerts_row [ 'user' ], $topic_alerts_row [ 'topic' ], $page , $tid ); icmail ( $topic_alerts_row [ 'email' ], 'neue Antwort im Thema: "' . $topic_alerts_row [ 'topic' ]. '"' , $text ); debug ( $topic_alerts_row [ 'email' ]); } db_query( "DELETE FROM prefix_topic_alerts WHERE tid = " . $tid ); # topic alert insert wenn gewaehlt. if (! empty ( $_POST [ 'topic_alert' ]) AND $_POST [ 'topic_alert' ] == 'yes' AND loggedin()) { if (0 == db_result(db_query( "SELECT COUNT(*) FROM prefix_topic_alerts WHERE uid = " . $_SESSION [ 'authid' ]. " AND tid = " . $tid ),0)) { db_query( "INSERT INTO prefix_topic_alerts (tid,uid) VALUES (" . $tid . ", " . $_SESSION [ 'authid' ]. ")" ); } } # topic alert ende db_query ( "INSERT INTO `prefix_posts` (tid,fid,erst,erstid,time,txt) VALUES ( " . $tid . ", " . $fid . ", '" . $erst . "', " . $uid . ", " . $time . ", '" . $txt . "')" ); $pid = db_last_id(); db_query( "UPDATE `prefix_topics` SET last_post_id = " . $pid . ", rep = rep + 1 WHERE id = " . $tid ); db_query( "UPDATE `prefix_forums` SET posts = posts + 1, last_post_id = " . $pid . " WHERE id = " . $fid ); //Forumex - begin FE_CreateVote( $pid , $txt ); //Forumex - end $page = ceil ( ( $aktTopicRow [ 'rep' ]+1) / $allgAr [ 'Fpanz' ] ); # toipc als gelesen markieren $_SESSION [ 'forumSEE' ][ $fid ][ $tid ] = time(); wd ( array ( $lang [ 'backtotopic' ] => 'index.php?forum-showposts-' . $tid . '-p' . $page . '#' . $pid , $lang [ 'backtotopicoverview' ] => 'index.php?forum-showtopics-' . $fid ) , $lang [ 'createpostsuccessful' ] , 3 ); } } $design ->footer(); ?> |
Ich hoffe jemand kann mir helfen... manuelle Änderungen an der Datei waren:
- ForumEx eingefügt
- Änderungstext entfernt...
- Doppelpost Sperre eingefügt
betroffene Homepage: externer Link
#EDIT:
Lag an der Doppelpost Sperre...danke dennoch...kann geclosed werden...
1 2 3 | // Doppelpost prüfen $lastdbtxt = db_result(db_query('SELECT txt FROM `prefix_posts` WHERE erst LIKE = "'.$erst.'" ORDER BY id DESC LIMIT 1'),0); if ($lastdbtxt != $txt) { |
So hatte ich es eingefügt, was irgendwie nicht geklappt hat...also einfach wieder gelöscht...^^
Zuletzt modifiziert von Dennis3107 am 25.08.2012 - 11:10:49