Hier kann eine Notiz zum Merk-Eintrag hinzugefügt werden (optional)
| [ 1 | 2 ] | [ Anmelden zum schreiben ] |
| Doppelposts unterbinden | |||
|---|---|---|---|
| corian Mitglied
Posts: 33 |
erledigt! Danke an Lord!
Zuletzt modifiziert von corian am 16.09.2011 - 19:31:34 |
||
| QuantumTecstar Mitglied
Posts: 205 |
Hallo Liebe Ilcher ,
ich habe mir mal die Doppelpostsperre eingebaut und war mir eig sicher das diese geht . Jetzt konnte meine Frau aber Doppelposten . Hier mal die php Datei <?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_siteadmin() and db_result($qry = db_query("SELECT erstid, id FROM xic_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, 'Du hast bereits den letzten Post in diesem Thema gemacht und dies ist eine Doppelpostsperre ;).<br />
An dieser Stelle der Tipp: 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 xic_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 xic_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', bbcode(unescape($txt)), 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 erst, txt FROM `xic_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 {
# 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 `xic_user` set posts = posts+1 WHERE id = ".$uid);
} else {
$erst = $xnn;
$uid = 0;
}
# topic alert ausfuehren.
$topic_alerts_abf = "SELECT
xic_topics.name as topic,
xic_user.email as email,
xic_user.name as user,
xic_user.id as uid
FROM xic_topic_alerts
LEFT JOIN xic_topics ON xic_topics.id = xic_topic_alerts.tid
LEFT JOIN xic_user ON xic_user.id = xic_topic_alerts.uid
WHERE xic_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 xic_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 xic_topic_alerts WHERE uid = ".$_SESSION['authid']." AND tid = ".$tid),0)) {
db_query("INSERT INTO xic_topic_alerts (tid,uid) VALUES (".$tid.", ".$_SESSION['authid'].")");
}
}
# topic alert ende
db_query ("INSERT INTO `xic_posts` (tid,fid,erst,erstid,time,txt) VALUES ( ".$tid.", ".$fid.", '".$erst."', ".$uid.", ".$time.", '".$txt."')");
$pid = db_last_id();
db_query("UPDATE `xic_topics` SET last_post_id = ".$pid.", rep = rep + 1 WHERE id = ".$tid);
db_query("UPDATE `xic_forums` SET posts = posts + 1, last_post_id = ".$pid." WHERE id = ".$fid );
$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();
?>
Kann sich das vllt mal jmd anschauen ? Betroffene Hp www.fcboard.de LG Quantum EDIT : Gerade gestestet und als Moderator ... kann man Doppelposten , wie ändert man den das Recht ab wann man Doppelposten kann und wann nicht . LG die 2te Zuletzt modifiziert von QuantumTecstar am 07.12.2011 - 17:13:14 Tja Qauntum halt^^ |
||
| Lord|Schirmer Administrator
Posts: 4603 |
!is_siteadmin() entfernen!
Zuletzt modifiziert von Lord|Schirmer am 07.12.2011 - 18:01:05 "In mir schlummert ein Genie, leider wacht es nicht auf!" my portfolio | my community | important link |
||
| QuantumTecstar Mitglied
Posts: 205 |
Okay Danke dir und dann können es nur noch Admins?
habe das mal eben gemacht , dabei kam das raus Parse error: syntax error, unexpected T_LOGICAL_AND, expecting '(' in /var/www/vhosts/nftb-clan.de/fcboard/include/contents/forum/new_post.php on line 49 LG Zuletzt modifiziert von QuantumTecstar am 07.12.2011 - 18:08:37 Tja Qauntum halt^^ |
||
| Lord|Schirmer Administrator
Posts: 4603 |
Nein dann keiner mehr! Sonst !is_admin() einfügen!
"In mir schlummert ein Genie, leider wacht es nicht auf!" my portfolio | my community | important link |
||
| QuantumTecstar Mitglied
Posts: 205 |
Okay es geht nun
hatte nen kleinen Fehler drinne
Aber diese Doppelpostsperre ist nur für Antworten nicht für die schnell Antwort oder?? weil da scheint es nicht zu gehen . bzw nicht immer LG Zuletzt modifiziert von QuantumTecstar am 07.12.2011 - 18:14:04 Tja Qauntum halt^^ |
||
| Lord|Schirmer Administrator
Posts: 4603 |
Schnellantwort?
"In mir schlummert ein Genie, leider wacht es nicht auf!" my portfolio | my community | important link |
||
| QuantumTecstar Mitglied
Posts: 205 |
ja schnellantwort
siehe Screen , da scheint es mal zu gehen und mal nicht
LG Tja Qauntum halt^^ |
||
| Lord|Schirmer Administrator
Posts: 4603 |
Das ist nicht das Standardforum, oder?
Das Prinzip müsste aber das Gleiche sein ... also die Prüfung ob der letzte Eintrag schonmal vorhanden ist. "In mir schlummert ein Genie, leider wacht es nicht auf!" my portfolio | my community | important link |
||
| QuantumTecstar Mitglied
Posts: 205 |
ne das war das ilch BB Forum .
Im Prinzip schon ^^ man Postet geht woanderrs hin geht dann wieder zum Thema und kann wieder Posten. Das geht aber nur manchmal ^^ vllt entferne ich die schnellantwort auch Ich danke dir erstmal für deine Hilfe Tja Qauntum halt^^ |
||
| oink ForenTroll
Posts: 727 |
puh dachte schon es ginge um meine schnellantwort ^^
before creation there must be destruction |
||
| she Mitglied
Posts: 963 |
Und ich dachte es ging um kekse
Google+shelfinger.eu |
||
| oink ForenTroll
Posts: 727 |
ne dein circlejerk war bestimmt auf nem anderen board mädel
before creation there must be destruction |
||
| she Mitglied
Posts: 963 |
Kommt immer drauf an welches Board du meinst. Bin nicht nur auf ilch angemeldet.
Google+shelfinger.eu |
||
| oink ForenTroll
Posts: 727 |
what i said
before creation there must be destruction |
||
| Lord|Schirmer Administrator
Posts: 4603 |
Na Mädels ... macht Euch doch ein Date aus! ^^
[BTT Please] "In mir schlummert ein Genie, leider wacht es nicht auf!" my portfolio | my community | important link |
||
| she Mitglied
Posts: 963 |
Kann ja schonmal loslaufe
Google+shelfinger.eu |
||
| [ 1 | 2 ] | [ Anmelden zum schreiben ] |