Hallo,
mein Problem ist wenn jemand z.B seinen Forum Beitrag 2-3x ändert, dass unter seinem Post dann auch 2-3x zuletzt modifiziert von steht.
Wo und wie kann ich dies auf 1x zuletzt modifiziert von Begrenzen?
Ilch v. 1.1P
Hier kann eine Notiz zum Merk-Eintrag hinzugefügt werden (optional)
Geschlossen |
$s = preg_quote($lang['postlastchangedby']); if (preg_match("/.*".$s." ([^\ ])* am \d\d\.\d\d\.\d\d\d\d - \d\d:\d\d:\d\d$/", $txt)) { $txt = preg_replace("/".$s." ([^\ ])* am \d\d\.\d\d\.\d\d\d\d - \d\d:\d\d:\d\d$/", $lang['postlastchangedby'].' '.$_SESSION['authname'].' am '.date("d.m.Y - H:i:s"), $txt); } else { $txt .= "\n\n\n".$lang['postlastchangedby'].' '.$_SESSION['authname'].' am '.date("d.m.Y - H:i:s"); }
$s = preg_quote($lang['postlastchangedby']); if (preg_match("/.*".$s." ([^\ ])* am \d\d\.\d\d\.\d\d\d\d - \d\d:\d\d:\d\d$/", $txt)) { $txt = preg_replace("/".$s." ([^\ ])* am \d\d\.\d\d\.\d\d\d\d - \d\d:\d\d:\d\d$/", $lang['postlastchangedby'].' '.$_SESSION['authname'].' am '.date("d.m.Y - H:i:s"), $txt); } else { $txt .= "\n\n\n".$lang['postlastchangedby'].' '.$_SESSION['authname'].' am '.date("d.m.Y - H:i:s"); }
<?php # Copyright by: Manuel # Support: www.ilch.de defined ('main') or die ( 'no direct access' ); if ( $forum_rights['reply'] == FALSE ) { $forum_failure[] = $lang['nopermission']; check_forum_failure($forum_failure); } # definie oid $oid = escape($menu->get(3), 'integer'); $title = $allgAr['title'].' :: Forum :: '.aktForumCats($aktForumRow['kat'],'title').' :: '.$aktForumRow['name'].' :: '.$aktTopicRow['name'].' :: Beitrag ändern'; $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; $design = new design ( $title , $hmenu, 1); $design->header(); if (!loggedin()) { echo 'Gäste dürfen keine Beiträge editieren<br><a href="index.php?user-regist">Registrieren</a> / <a href="index.php?user-login">Einloggen</a> um deine Beiträge editieren zu können'; $design->footer(1); } $row = @db_fetch_object(@db_query("SELECT txt,erstid FROM `prefix_posts` WHERE id = ".$oid)); if ($_SESSION['authid'] <> $row->erstid AND $forum_rights['mods'] == FALSE ) { echo $lang['nopermission']; $design->footer(1); } list($usec, $sec) = explode(" ", microtime()); $dppk_time = (float)$usec + (float)$sec; $time = time(); if (!isset($_SESSION['klicktime'])) { $_SESSION['klicktime'] = 0; } $txt = ''; if (isset($_POST['txt'])) { $txt = trim(escape($_POST['txt'], 'textarea')); } if ($_SESSION['klicktime'] > ($dppk_time - 15) OR empty($txt) OR !empty($_POST['priview'])) { $tpl = new tpl ( 'forum/postedit' ); if (isset($_POST['priview'])) { $tpl->set_out('txt', bbcode(unescape($txt)), 0); } if (empty($txt)) { $txt = $row->txt; } $ar = array ( 'tid' => $tid, 'oid' => $oid, 'txt' => (isset($_POST['priview']) ? escape_for_fields(unescape($txt)) : escape_for_fields($txt)), 'SMILIES' => getsmilies() ); $tpl->set_ar_out($ar,1); $erg = db_query('SELECT 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']); $tpl->set_ar_out($row, 2); } $tpl->out(3); } else { $s = preg_quote($lang['postlastchangedby']); if (preg_match("/.*".$s." ([^\ ])* am \d\d\.\d\d\.\d\d\d\d - \d\d:\d\d:\d\d$/", $txt)) { $txt = preg_replace("/".$s." ([^\ ])* am \d\d\.\d\d\.\d\d\d\d - \d\d:\d\d:\d\d$/", $lang['postlastchangedby'].' '.$_SESSION['authname'].' am '.date("d.m.Y - H:i:s"), $txt); } else { $txt .= "\n\n\n".$lang['postlastchangedby'].' '.$_SESSION['authname'].' am '.date("d.m.Y - H:i:s"); } db_query("UPDATE `prefix_posts` set txt = '".$txt."' WHERE id = ".$oid); $page = ceil ( ($aktTopicRow->rep+1) / $allgAr['Fpanz'] ); wd('index.php?forum-showposts-'.$tid.'-p'.$page.'#'.$oid,$lang['changepostsuccessful']); } $design->footer(); ?>
else { $s = preg_quote($lang['postlastchangedby']); if (preg_match("/.*".$s." ([^\ ])* am \d\d\.\d\d\.\d\d\d\d - \d\d:\d\d:\d\d$/", $txt)) { $txt = preg_replace("/".$s." ([^\ ])* am \d\d\.\d\d\.\d\d\d\d - \d\d:\d\d:\d\d$/", $lang['postlastchangedby'].' '.$_SESSION['authname'].' '.date("d.m.Y - H:i:s"), $txt); } else { $txt .="\n\n\n".$lang['postlastchangedby'].' '.$_SESSION['authname'].' am '.date("d.m.Y - H:i:s"); }
<?php # Copyright by: Manuel Staechele # Support: www.ilch.de defined ('main') or die ( 'no direct access' ); # check ob ein fehler aufgetreten ist. check_forum_failure($forum_failure); # toipc als gelesen markieren $_SESSION['forumSEE'][$fid][$tid] = time(); $title = $allgAr['title'].' :: Forum :: '.$aktTopicRow['name'].' :: Beiträge zeigen'; $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 .= $aktTopicRow['name'].$extented_forum_menu_sufix; $design = new design ( $title , $hmenu, 1); $design->header(); # Topic Hits werden eins hochgesetzt. db_query('UPDATE `prefix_topics` SET hit = hit + 1 WHERE id = "'.$tid.'"'); $erg = db_query("SELECT fid FROM `prefix_posts` WHERE tid = ".$tid); $row = db_fetch_assoc($erg); $newth = '<a href="index.php?forum-newtopic-'.$row['fid'].'"><img src="include/images/forum/newth.png" border="0"></a>'; # mehrere seiten fals gefordert $limit = $allgAr['Fpanz']; // Limit $page = ($menu->getA(3) == 'p' ? $menu->getE(3) : 1 ); $MPL = db_make_sites ($page , "WHERE tid = ".$tid , $limit , 'index.php?forum-showposts-'.$tid , 'posts' ); $anfang = ($page - 1) * $limit; $antworten = ''; if (($aktTopicRow['stat'] == 1 AND $forum_rights['reply'] == TRUE) OR ($_SESSION['authright'] <= '-7' OR $forum_rights['mods'] == TRUE)) { $antworten = '<a href="index.php?forum-newpost-'.$tid.'"><img src="include/images/forum/antw.png" border="0"></a>'; } $class = 'Cmite'; $tpl = new tpl ( 'forum/showpost' ); $ar = array ( 'SITELINK' => $MPL, 'tid' => $tid, 'ANTWORTEN' => $antworten, 'TOPICNAME' => $aktTopicRow['name'], 'HMENU' => $hmenu, 'NEWTH' => $newth ); $tpl->set_ar_out($ar,0); $i = $anfang +1; $ges_ar = array ('wurstegal', 'maennlich', 'weiblich'); ################################## #Forenmod by matthias-schlich.de - Vorlage von Benjamin Rau #Posts $erg = db_query("SELECT geschlecht, ic1_grundrechte.name as gruppe, ic1_posts.id,txt,time,erstid,erstip,erst,sig,avatar,gebdatum,posts FROM `ic1_posts` LEFT JOIN ic1_user ON ic1_posts.erstid = ic1_user.id LEFT JOIN ic1_grundrechte ON ic1_grundrechte.id = ic1_user.recht WHERE tid = ".$tid." ORDER BY time LIMIT ".$anfang.",".$limit); while($row = db_fetch_assoc($erg)) { $class = ( $class == 'Cnorm' ? 'Cmite' : 'Cnorm' ); # # Start RENOMMEE # $row['tid'] = $tid; ## Auslesen der Renopunkte für den Ersteller $renopts = db_result(db_query("SELECT SUM(punkte) FROM `prefix_reno` WHERE uid = '".$row['erstid']."'")); ## Einträge zählen die auf Renopunkte passen $countbild = db_result(db_query("SELECT count(bild) FROM `prefix_reno_set` WHERE '".$renopts."' >= `pmin` AND '".$renopts."' <= `pmax` ")); # Falls kein Bild vorhanden das passt. if ($countbild == 0) { $bild = 1; } else { # Bild ausgeben $bild = db_result(db_query("SELECT bild FROM `prefix_reno_set` WHERE '".$renopts."' >= `pmin` AND '".$renopts."' <= `pmax`")); } $row['reno'] = '<img src="include/images/reno/'.$bild.'.png" border="0" \>'; ## Abfragen ob Ersteller der User ist if ($row['erstid'] == $_SESSION['authid']) { $row['renovote'] = ''; $row['reno'] = '<a href="?renomy-'.$row['tid'].'"><img src="include/images/reno/'.$bild.'.png" border="0" \></a>'; } else { $row['renovote'] = '<a href="?reno-'.$row['erstid'].'-'.$tid.'"><img src="Bilder/bewerten.gif" alt="Bewerten" border="0"></a></a>'; $row['reno'] = '<img src="include/images/reno/'.$bild.'.png" border="0" \>'; } # # ENDE RENOMMEE # $icq1 = str_replace("-","",$row['icq']); $icq2 = str_replace(" ","",$icq1); // icq abfrage // 0 - keine ICQ abfrage // 1 - ICQ standartbilder bei &design= kann man zwischen den 26 verschiedenen icq bildern wechseln // 2 - für eigne ICQ Statsubilder $own_pics = "1"; $icqdesign = "25"; if ($own_pics == "1") { if (is_numeric($icq2) ){ $row['icq'] = '<a href="http://www.icq.com/whitepages/cmd.php?uin='.$icq2.'&action=add"><img src="http://web.icq.com/whitepages/online?web='.$icq2.'&img='.$icqdesign.'" border="0"></a>'; } else {$row['icq'] = '';} } elseif ($own_pics == "0"){ $row['icq'] = '';} else{ if (is_numeric($icq2) ){ // Eigene ICQ-Bilder $status = (icq_status($icq2)); if ($status == "1"){ $row['icq'] = '<a href="http://www.icq.com/whitepages/cmd.php?uin='.$icq2.'&action=add"><img src="include/images/forum/icqonline.png" border="0"></a>'; }elseif ($status == "0"){ $row['icq'] = '<a href="http://www.icq.com/whitepages/cmd.php?uin='.$icq2.'&action=add"><img src="include/images/forum/icqoffline.png" border="0"></a>'; }elseif ($status == "2"){ $row['icq'] = '<a href="http://www.icq.com/whitepages/cmd.php?uin='.$icq2.'&action=add"><img src="include/images/forum/icqinactive.png" border="0"></a>'; }else {$row['icq'] = '';} }else {$row['icq'] = '';} } # define some vars. $row['danke'] = ''; $row['THX'] = ''; $row['sig'] = ( empty($row['sig']) ? '' : '<br /><br><div style="border:0px #30180E solid;background:#F7FEFF;color:#708588;padding:1px;margin:10px;"><center><hr style="width: 90%;" align="center">'.bbcode($row['sig']) ); $row['TID'] = $tid; $row['class'] = $class; $row['date'] = date ('d.m.Y - H:i:s', $row['time'] ); $row['delete'] = ''; $row['change'] = ''; if (file_exists($row['avatar'])) { $row['avatar'] = '<br /><br /><img src="'.$row['avatar'].'" alt="User Pic" border="0" /><br />'; } elseif ($allgAr['forum_default_avatar']) { $row['avatar'] = '<br /><br /><img src="include/images/avatars/'.$ges_ar[$row['geschlecht']].'.jpg" alt="" border="0" /><br />'; } else { $row['avatar'] = ''; } $row['rang2'] = userrang ($row['posts'],$row['erstid']); $rank_name = $row['rang2']; $row['txt'] = (isset($_GET['such']) ? markword(bbcode ($row['txt']),$_GET['such']) : bbcode ($row['txt']) ); $row['i'] = $i; $row['gb'] = (date("Ymd") === str_replace("-","",date("Y").substr($row['gebdatum'],4) ) ? $row['gb'] = "<font size='-2'><i>Happy Birthday</i></font><br><img src='Bilder/gbrose.gif' alt='Heute Geburtstag'>" : $row['gb'] = "" ); if ( $row['erstid'] != '' ) { $user_row = db_fetch_assoc(db_query("SELECT posts,regist FROM prefix_user WHERE id = ".$row['erstid'])); $posts = $row['posts']; $row['posts'] = 'Posts: '.$row['posts'].'<br />'; if ( $posts == '' ) { $row['posts'] = 'Nicht registriert<br>';} #Ranking Balken #Grafiken definieren $rank_01 = '<br><font size="-2"><i><font color="#5B2E00"></font></i></font>'; $rank_02 = '<br><font size="-2"><i><font color="#623100"></font></i></font>'; $rank_03 = '<br><font size="-2"><i><font color="#623100"></font></i></font>'; $rank_04 = '<br><font size="-2"><i><font color="#623100"></font></i></font>'; $rank_05 = '<br><font size="-2"><i><font color="#CC0000"></font></i></font>'; #Bezugnehmen auf das Ranking des users if ( $row['posts'] != '' ) { $row['rang'] = $rank_name.'<br>'; if ($posts <= '20') { $row['rang'] .= $rank_01; } elseif ($posts <= '40') { $row['rang'] .= $rank_02;} elseif ($posts <= '80') { $row['rang'] .= $rank_03; } elseif ($posts < '150') { $row['rang'] .= $rank_04; } elseif ($posts >= '150') { $row['rang'] .= $rank_05; } } else {$row['rang'] .= ""; } } #User Details if ( $posts != '' ) { $abf1 = 'SELECT * FROM prefix_user where id = '.$row["erstid"]; $erg1 = db_query($abf1); $user = db_fetch_object($erg1); $zeit = date('d. M Y',$user->regist); $llogin = date('d. M Y',$user->llogin); $ort = $user->wohnort; $www = $user->homepage; $email = $user->opt_mail; $pm = $user->opt_pm; $land = $user->staat; #Flagge if ($land != '') {$row['land'] = '<img src="include/images/flags/'.$land.'" >';} else{$row['land'] = '';} #Dabei seit $row['details'] = "<br><br>Dabei seit: ".$zeit."<br>"; #Wohnort if ($ort != ''){$row['details'] .= "Wohnort: ".$ort."<br>";} #Homepage if ($www != ''){$row['www'] = '<a href="'.$www.'" target="_blank"><img src="include/images/forum/www.png" border="0" alt="Website des Users besuchen"></a>';} else{$row['www'] = '';} #Letzter Login $row['details'] .= "Letzter Login: ".$llogin."<br>"; #PM if ($pm == '1'){ $row['pm'] = "<a href='?forum-privmsg-new=0&empfid=".$row['erstid']."'><img src='include/images/forum/pm.png' border='0' alt='Private Nachricht an den User senden'></a>"; }else{$row['pm'] = '';} #email if ($email == '1'){ $row['email'] = "<a href='?user-mail-".$row['erstid']."'><img src='include/images/forum/email.png' border='0' alt='E-Mail an den User senden'></a>"; }else{$row['email'] = '';} } else { $row['details'] = ""; $row['land'] = ''; $row['pm'] = ''; $row['email'] = ''; $row['www'] = ''; } if ( $posts != '' ) { #User Online o Offline $abf1 = "SELECT * FROM prefix_online where uid = ".$row['erstid']; $erg1 = db_query($abf1); $status = db_fetch_object($erg1); if ($status->uid == $row['erstid']) { $row['online'] = ' <img src="include/images/forum/uonline.png" border="0">'; } else { $row['online'] = ' <img src="include/images/forum/uoffline.png" border="0">'; } } else {$row['online'] = '';} # #Edit Ende ################################## $row['page'] = $page; if ( $posts != 0 ) { $row['erst'] = '<a href="index.php?user-details-'.$row['erstid'].'"><b>'.$row['erst'].'</b></a>'; } elseif ( $row['erstid'] == 0 ) { $row['rang'] = 'Gast<br>'; } if ($forum_rights['mods'] == TRUE AND $i>1) { $row['delete'] = '<a href="index.php?forum-delpost-'.$tid.'-'.$row['id'].'">'.$lang['delete'].'</a>'; } if ( $forum_rights['reply'] == TRUE AND loggedin() ) { $row['change'] = ' <a href="index.php?forum-editpost-'.$tid.'-'.$row['id'].'">'.$lang['change'].'</a>'; } $row['posts'] = ($row['posts']?'<br />'.$row['posts']:'').'<br />'; if ($forum_rights['mods'] == TRUE OR has_right(-7)) { $row['erstip'] = $row['erstip']; }else{ $row['erstip'] = ''; } // Danke-Link anzeigen oder ausblenden falls user == ersteller oder Gast if ($row['erstid'] == $_SESSION['authid'] or $_SESSION['authid'] == 0) { $row['THX'] = ''; } else { # Zufallszahl generieren um Missbrauch vorzubeugen if (!isset($_SESSION['thx_rand']) OR empty($_SESSION['thx_rand'][$row['id']])) { $_SESSION['thx_rand'][$row['id']] = rand(000,999); } $row['THX'] = '<a href="index.php?danke-'.$row['id'].'-'.$_SESSION['thx_rand'][$row['id']].'-'.$tid.'-'.$row['erstid'].'-'.$_SESSION['authid'].'-'.$_SESSION['authname'].'"><b>Sag Danke</b></a>'; } // Ausgeben der Danke-Liste im Post $thxcount = db_count_query("SELECT COUNT(id) FROM `prefix_danke` WHERE pid = ".$row['id'].""); if ($thxcount['thxcount'] >= 1) { $row['danke'] .= '<hr><font size="-3"><img src="/Bilder/danke.jpg" alt="" border="0"><br></font></strong>'; $thx_qry = db_query("SELECT bedankername,bedankerid FROM `prefix_danke` WHERE pid = ".$row['id'].""); while ($thx_row = db_fetch_assoc($thx_qry)) { $row['danke'] .= '<a href="index.php?user-details-'.$thx_row['bedankerid'].'"><font size="-2">'.$thx_row['bedankername'].'</font></a> '; } } //Forumex - begin $row['txt'] = FE_Vote2HTML($row['id'],$row['txt']); //Forumex - end $tpl->set_ar_out($row,1); $i++; } $tpl->set_ar_out( array ( 'SITELINK' => $MPL, 'ANTWORTEN' => $antworten ) , 2 ); // anfang qpost if (loggedin()) { $dppk_time = time(); $time = time(); if (!isset($_SESSION['klicktime'])) { $_SESSION['klicktime'] = 0; } $topic = ''; $txt = ''; $xnn = ''; if (isset($_POST['txt_qp'])) { $txt = trim(escape($_POST['txt_qp'], 'textarea')); } $tpl = new tpl ('forum/qpost'); $ar = array ( 'txt_qp' => escape_for_fields(unescape($txt)), 'tid' => $tid, ); $tpl->set_ar_out($ar,1); if (($_SESSION['klicktime'] + 150) > $dppk_time OR empty($txt) OR !empty($_POST['priview']) OR (empty($_POST['Gname']) AND !loggedin())) { } else { # save qpost $_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; } 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 ); $page = ceil ( ($aktTopicRow['rep']+1) / $allgAr['Fpanz'] ); # topic 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 ); } } $tpl = new tpl ( 'forum/showpost' ); // end qpost if (loggedin()) { if ($menu->get(3) == 'topicalert') { if (1 == db_result(db_query("SELECT COUNT(*) FROM prefix_topic_alerts WHERE uid = ".$_SESSION['authid']." AND tid = ".$tid),0)) { db_query("DELETE FROM prefix_topic_alerts WHERE uid = ".$_SESSION['authid']." AND tid = ".$tid); } else { db_query("INSERT INTO prefix_topic_alerts (tid,uid) VALUES (".$tid.", ".$_SESSION['authid'].")"); } } echo 'Optionen:'; if (1 == db_result(db_query("SELECT COUNT(*) FROM prefix_topic_alerts WHERE uid = ".$_SESSION['authid']." AND tid = ".$tid),0)) { echo '<br />- <a href="index.php?forum-showposts-'.$tid.'-topicalert">'.$lang['nomailonreply'].'</a><br />'; } else { echo '<br />- <a href="index.php?forum-showposts-'.$tid.'-topicalert">'.$lang['mailonreply'].'</a><br />'; } } if ( $forum_rights['mods'] == TRUE ) { $tpl->set ( 'status', ($aktTopicRow['stat'] == 1 ? $lang['close'] : $lang['open'] ) ); $tpl->set ( 'festnorm', ($aktTopicRow['art'] == 0 ? $lang['fixedtopic'] : $lang['normaltopic'] ) ); $tpl->set('tid',$tid); $tpl->out(3); } $design->footer(); ?>
Geschlossen | ||
Zurück zu Fehlersuche und Probleme |