ich denke mal ich habe hier schon irgendwo einen fehler gemacht.
bei new_topic.php, forum.php, new_post.php usw... die musste man ändern
include/contents/forum.php:
<?php
# Copyright by: Manuel Staechele
# Support: www.ilch.de
defined ('main') or die ( 'no direct access' );
# variablen suchen und definieren.
if ($menu->get(1) == 'showcat') {
$cid = escape($menu->get(2), 'integer');
$fid = db_result(db_query("SELECT b.id FROM prefix_forums as b WHERE (b.view >= ".$_SESSION['authright']." OR b.reply >= ".$_SESSION['authright']." OR b.start >= ".$_SESSION['authright'].") AND b.cid = ".$cid." LIMIT 1"),0,0);
}
if ( $menu->get(1) == 'showtopics'
OR $menu->get(1) == 'savetopic'
OR $menu->get(1) == 'newtopic' ) {
$fid = escape($menu->get(2), 'integer');
}
if ( $menu->get(1) == 'showposts'
OR $menu->get(1) == 'newpost'
OR $menu->get(1) == 'editpost'
OR $menu->get(1) == 'edittopic'
OR $menu->get(1) == 'delpost'
OR $menu->get(1) == 'savepost' ) {
$tid = escape($menu->get(2), 'integer');
}
# menu
require_once('include/contents/forum/menu.php');
$forum_failure = array();
$forum_rights = array();
if ( !empty ($tid) ) {
$aktTopicAbf = "SELECT * FROM `prefix_topics` WHERE id = ".$tid;
$aktTopicErg = db_query($aktTopicAbf);
if ( db_num_rows($aktTopicErg) == 1 ) {
$aktTopicRow = db_fetch_assoc($aktTopicErg);
if (empty($fid)) {
$fid = $aktTopicRow['fid'];
}
} else {
$forum_failure[] = $lang['topicidnotfound'];
}
}
if ( !empty ($fid) ) {
$aktForumAbf = "SELECT
a.id as cid, a.name as kat,b.name,b.view,b.start,b.reply
FROM `prefix_forums` b
LEFT JOIN prefix_forumcats a ON a.id = b.cid
WHERE (b.view >= ".$_SESSION['authright']."
OR b.reply >= ".$_SESSION['authright']."
OR b.start >= ".$_SESSION['authright'].")
AND b.id = ".$fid;
$aktForumErg = db_query($aktForumAbf);
if ( db_num_rows($aktForumErg) > 0 ) {
$aktForumRow = db_fetch_assoc($aktForumErg);
$forum_rights = array (
'start' => has_right ($aktForumRow['start']),
'reply' => has_right ($aktForumRow['reply']),
'view' => has_right ($aktForumRow['view']),
'mods' => forum_user_is_mod($fid),
);
} else {
$forum_failure[] = $lang['forumidnotfound'];
}
}
switch ($menu->get(1)) {
default : $incdatei = 'show_forum.php'; break;
case 'showtopics' : $incdatei = 'show_topic.php'; break;
case 'showcat' : $incdatei = 'show_cat.php'; break;
case 'showposts' : $incdatei = 'show_posts.php'; break;
case 'newtopic' : $incdatei = 'new_topic.php'; break;
case 'savetopic' : $incdatei = 'save_topic.php'; break;
case 'newpost' : $incdatei = 'new_post.php'; break;
case 'savepost' : $incdatei = 'save_post.php'; break;
case 'edittopic' : $incdatei = 'edit_topic.php'; break;
case 'delpost' : $incdatei = 'del_post.php'; break;
case 'editpost' : $incdatei = 'edit_post.php'; break;
case 'privmsg' : $incdatei = 'privmsg.php'; break;
case 'search' : $incdatei = 'suchen.php'; break;
case 'vote' : $incdatei = 'vote.php'; break;
}
if ( isset($incdatei) ) {
require_once('include/contents/forum/'.$incdatei);
}
//-----------------------------------------------------------|
?>
include/contents/forum/new_topic.php:
<?php
# Copyright by: Manuel Staechele
# Support: www.ilch.de
defined ('main') or die ( 'no direct access' );
if ( $forum_rights['start'] == FALSE ) {
$forum_failure[] = $lang['nopermission'];
check_forum_failure($forum_failure);
}
$title = $allgAr['title'].' :: Forum :: '.$aktForumRow['kat'].' :: '.$aktForumRow['name'].' :: neues Thema';
$hmenu = $extented_forum_menu.'<a class="smalfont" href="index.php?forum">Forum</a><b> » </b><a class="smalfont" href="index.php?forum-showcat-'.$aktForumRow['cid'].'">'.$aktForumRow['kat'].'</a><b> » </b><a class="smalfont" href="index.php?forum-showtopics-'.$fid.'">'.$aktForumRow['name'].'</a>'.$extented_forum_menu_sufix;
$dppk_time = time();
$time = time();
if (!isset($_SESSION['klicktime'])) { $_SESSION['klicktime'] = 0; }
$topic = '';
$txt = '';
$xnn = '';
if (isset($_POST['topic'])) {
$topic = trim(escape($_POST['topic'], 'string'));
}
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($topic) OR empty($txt) OR !empty($_POST['priview']) OR (empty($_POST['Gname']) AND !loggedin())) {
$design = new design ( $title , $hmenu, 1, 'forum/index.htm' );
$design->header();
$tpl = new tpl ( 'forum/newtopic' );
$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>';
$uquery = db_query("SELECT name FROM prefix_user");
while ($uds = db_fetch_object($uquery)) {
$username = $uds -> name;
if (!empty($users)) $users = $users.', ';
$users = $users.'"'.$username.'"';
}
$br = chr(13).chr(10);
$jscript = 'user = new Array('.$users.');'.$br.
'for (i=0;i<user.length;i++)'.$br.
'if (document.form.Gname.value == user[i] ) {'.$br.
'alert("Dies ist der Benutzername eines registrierten Users, benutzen sie einen anderen.");'.$br.
'return false;'.$br.
'}'.$br.
'if (document.form.Gname.value == "") {'.$br.
'alert ("Das Namensfeld ist leer.");'.$br.
'return false;'.$br.
'}'.$br;
}
if (isset($_POST['priview'])) {
$tpl->set_out('txt', FE_Vote2HTML(1,bbcode($txt),TRUE), 0);
}
$ar = array (
'name' => $name,
'txt' => escape_for_fields(unescape($txt)),
'topic' => escape_for_fields(unescape($topic)),
'fid' => $fid,
'SMILIES' => getsmilies(),
'JSCRIPT' => $jscript
);
$tpl->set_ar_out($ar,1);
} else {
# save toipc
$_SESSION['klicktime'] = $dppk_time;
$design = new design ( $title , $hmenu, 0, 'forum/index.htm' );
$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_topics` (fid, name, erst, stat) VALUES ( ".$fid.", '".$topic."', '".$erst."', 1 )");
$tid = db_last_id();
# topic alert
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'].")");
}
}
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." WHERE id = ".$tid);
db_query("UPDATE `prefix_forums` SET posts = posts + 1, last_post_id = ".$pid.", topics = topics + 1 WHERE id = ".$fid);
//Forumex - begin
FE_CreateVote($pid,$txt);
//Forumex - end
# toipc als gelesen markieren
$_SESSION['forumSEE'][$fid][$tid] = time();
wd('index.php?forum-showposts-'.$tid,$lang['createtopicsuccessful']);
}
$design->footer();
?>
include/contents/forum/new_post.php:
<?php
# Copyright by: Manuel Staechele
# Support: www.ilch.de
defined ('main') or die ( 'no direct access' );
if ($aktTopicRow['stat'] == 0 OR $forum_rights['reply'] == FALSE ) {
if ( $aktTopicRow['stat'] == 0 ) {
$forum_failure[] = $lang['topicclosed'];
} else {
$forum_failure[] = $lang['nopermission'];
}
check_forum_failure($forum_failure);
}
$title = $allgAr['title'].' :: Forum :: '.$aktForumRow['kat'].' :: '.$aktForumRow['name'].' :: '.$aktForumRow['name'].' :: neuer Beitrag';
$hmenu = $extented_forum_menu.'<a class="smalfont" href="index.php?forum">Forum</a><b> » </b><a class="smalfont" href="index.php?forum-showcat-'.$aktForumRow['cid'].'">'.$aktForumRow['kat'].'</a><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())) {
$design = new design ( $title , $hmenu, 1, 'forum/index.htm' );
$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>';
$uquery = db_query("SELECT name FROM prefix_user");
while ($uds = db_fetch_object($uquery)) {
$username = $uds -> name;
if (!empty($users)) $users = $users.', ';
$users = $users.'"'.$username.'"';
}
$br = chr(13).chr(10);
$jscript = 'user = new Array('.$users.');'.$br.
'for (i=0;i<user.length;i++)'.$br.
'if (document.form.Gname.value == user[i] ) {'.$br.
'alert("Dies ist der Benutzername eines registrierten Users, benutzen sie einen anderen.");'.$br.
'return false;'.$br.
'}'.$br.
'if (document.form.Gname.value == "") {'.$br.
'alert ("Das Namensfeld ist leer.");'.$br.
'return false;'.$br.
'}'.$br;
}
$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(),
'JSCRIPT' => $jscript
);
$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, 'forum/index.htm' );
$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;
}
# topic alert ausfuehren.
$topic_alerts_abf = "SELECT
prefix_topics.name as topic,
prefix_user.email as email,
prefix_user.name as user
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)) {
$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();
?>
include/contents/forum/del_post.php:
<?php
# Copyright by: Manuel Staechele
# Support: www.ilch.de
defined ('main') or die ( 'no direct access' );
if ( $forum_rights['mods'] == FALSE ) {
$forum_failure[] = 'Keine Berechtigung dieses Forum zu moderiren';
check_forum_failure($forum_failure);
}
$title = $allgAr['title'].' :: Forum :: '.$aktForumRow['kat'].' :: '.$aktForumRow['name'].' :: '.$aktTopicRow['name'].' :: Beitrag löschen';
$hmenu = $extented_forum_menu.'<a class="smalfont" href="index.php?forum">Forum</a><b> » </b><a class="smalfont" href="index.php?forum-showcat-'.$aktForumRow['cid'].'">'.$aktForumRow['kat'].'</a><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> <b> » </b>Beitrag löschen'.$extented_forum_menu_sufix;
$design = new design ( $title , $hmenu, 1, 'forum/index.htm' );
$design->header();
if ( empty($_POST['delete']) ) {
$tpl = new tpl ( 'forum/del_post' );
$tpl->set_ar(array('tid'=>$tid,'get3'=>$menu->get(3)));
$tpl->out(0);
} else {
db_query("DELETE FROM `prefix_posts` WHERE id = ".$menu->get(3)." LIMIT 1");
$erg = db_query("SELECT MAX(id) FROM prefix_posts WHERE tid = ".$tid );
$max = db_result($erg,0);
db_query("UPDATE `prefix_topics` SET last_post_id = ".$max.", `rep` = `rep` - 1 WHERE id = ".$tid );
db_query("UPDATE `prefix_forums` SET last_post_id = ".$max.", posts = posts - 1 WHERE id = ".$fid );
//Forumex - begin
FE_CreateVote($menu->get(3),'');
//Forumex - end
$tpl = new tpl ( 'forum/del_post' );
$tpl->set_out('tid',$tid,1);
}
$design->footer();
?>
USW... sind noch mehr dateien
wie und wo bekomme ich denn die standards her? ist wohl einfacher, als wenn ich jetzt als probiere
Zuletzt modifiziert von Sabaton70 am 02.11.2012 - 20:27:01
Das Chaos sei Willkommen, die Ordnung hat versagt !