das sag mir welchen quelltext ich posten soll (welche datei) damit wir auf fehlersuche gehn können.
Meine contents/forum.php :
<?php
# Copyright by: Manuel
# Support: www.ilch.de
defined ('main') or die ( 'no direct access' );
#Kategorien aufschlüsseln
function aktForumCats ($catAR,$trenn = 'hmenu') {
$out = '';
$i = count($catAR)-1;
if ($trenn == 'hmenu') {
while ($i > 0 ) {
$out .= '<a class="smalfont" href="index.php?forum-showcat-'.$catAR[$i]['id'].'">'.$catAR[$i]['name'].'</a><b> » </b>';
$i--;
}
$out .= '<a class="smalfont" href="index.php?forum-showcat-'.$catAR[$i]['id'].'">'.$catAR[$i]['name'].'</a>';
}
else {
while ($i > 0 ) {
$out .= $catAR[$i]['name'].' :: ';
$i--;
}
$out .= $catAR[$i]['name'];
}
return $out;
}
# 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) == 'editforum'
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.cid as topcid, a.name as cat,b.name,b.view,b.start,b.reply
FROM `prefix_forums` b
LEFT JOIN prefix_forumcats a ON a.id = b.cid
WHERE b.id = ".$fid;
$aktForumErg = db_query($aktForumAbf);
if ( db_num_rows($aktForumErg) > 0 ) {
$aktForumRow = db_fetch_assoc($aktForumErg);
//Unterkategorien
$topcid = $aktForumRow['topcid'];
$catsnr = 1;
$aktForumRow['kat'] = array();
while ( $topcid != 0 ) {
$tmpsql = db_fetch_object(db_query("SELECT id,cid,name FROM `prefix_forumcats` WHERE id = ".$topcid));
$topcid = $tmpsql->cid;
$aktForumRow['kat'][$catsnr] = array();
$aktForumRow['kat'][$catsnr]['id'] = $tmpsql->id;
$aktForumRow['kat'][$catsnr]['name'] = $tmpsql->name;
$catsnr++;
}
$aktForumRow['kat'][0]['id'] = $aktForumRow['cid'];
$aktForumRow['kat'][0]['name'] = $aktForumRow['cat'];
//Unterkategorien - Ende
$forum_rights = array (
'start' => has_right ($aktForumRow['start']),
'reply' => has_right (array($aktForumRow['reply'],$aktForumRow['start'])),
'view' => has_right (array($aktForumRow['view'],$aktForumRow['reply'],$aktForumRow['start'])),
'mods' => forum_user_is_mod($fid),
);
if ($forum_rights['view'] == false) {
$forum_failure[] = $lang['forumidnotfound'];
}
} else {
$forum_failure[] = $lang['forumidnotfound'];
}
}
switch ($menu->get(1)) {
default : $incdatei = 'show_forum.php'; break;
case 'showtopics' : $incdatei = 'show_topic.php'; break;
case 'editforum' : $incdatei = 'edit_forum.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;
}
if ( isset($incdatei) ) {
require_once('include/contents/forum/'.$incdatei);
}
//-----------------------------------------------------------|
?>
Meine contents/forum/edit_topic.php :
<?php
# Copyright by: Manuel
# 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 :: '.aktForumCats($aktForumRow['kat'],'title').' :: '.$aktForumRow['name'].' :: '.$aktTopicRow['name'].' :: Thema ä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> <b> » </b>Thema ändern'.$extented_forum_menu_sufix;
$design = new design ( $title , $hmenu, 1);
$design->header();
$uum = $menu->get(3);
$tid = $menu->get(2);
switch($uum) {
case 1 : # change topic title
db_query("UPDATE `prefix_topics` SET name = '".$_REQUEST['newTopic']."' WHERE id = '".$tid."'");
wd ( array (
'zurück zum Thema' => 'index.php?forum-showposts-'.$tid,
'zur Themen Übersicht' => 'index.php?forum-showtopics-'.$fid
) , 'Das Themas wurde umbennant' , 3 );
break;
case 2 : # delete topic
if (empty($_POST['sub'])) {
echo '<form action="index.php?forum-edittopic-'.$tid.'-2" method="POST">';
echo 'Begründung an den Ersteller (freiwillig)<br /><textarea cols="50" rows="2" name="reason"></textarea>';
echo '<br /><br ><input type="submit" value="'.$lang['delete'].'" name="sub">';
echo '</form>';
} else {
# autor benachrichtigen
if (!empty($_POST['reason'])) {
$uid = db_result(db_query("SELECT erstid FROM prefix_posts WHERE tid = ".$tid." ORDER BY id ASC LIMIT 1"),0);
$top = db_result(db_query("SELECT name FROM prefix_topics WHERE id = ".$tid),0);
$page = $_SERVER["HTTP_HOST"].$_SERVER["SCRIPT_NAME"];
$txt = "Dein Thema \"".$top."\" wurde gelöscht Begründung:\n\n".escape($_POST['reason'], 'string');
sendpm($_SESSION['authid'], $uid, 'Theme gelöscht',$txt);
}
$postsMinus = $aktTopicRow['rep'] + 1;
db_query("DELETE FROM `prefix_topics` WHERE id = '".$tid."' LIMIT 1");
$erg = db_query("SELECT erstid FROM prefix_posts WHERE tid = ".$tid." AND erstid > 0");
while ($row = db_fetch_object($erg) ) {
db_query("UPDATE prefix_user SET posts = posts - 1 WHERE id = ".$row->erstid);
}
db_query("DELETE FROM `prefix_posts` WHERE tid = '".$tid."'");
$pid = db_result(db_query("SELECT MAX(id) FROM prefix_posts WHERE fid = ".$fid),0);
if ( empty($pid) ) { $pid = 0; }
db_query("UPDATE `prefix_forums` SET last_post_id = ".$pid.", `posts` = `posts` - ".$postsMinus.", `topics` = `topics` - 1 WHERE id = ".$fid);
wd ('index.php?forum-showtopics-'.$fid, 'Das Thema wurde gelöscht' , 2 );
}
break;
case 3 : # move topic in another forum
if ( empty ( $_POST['sub'] ) OR $_POST['nfid'] == 'cat' ) {
echo '<form action="index.php?forum-edittopic-'.$tid.'-3" method="POST">';
echo '<input type="hidden" name="afid" value="'.$fid.'">neues Forum auswählen<br />';
echo '<select name="nfid">';
function stufe($anz, $t = 'f') {
$z = ($t == 'f'?' ':'»');
for ($i=0; $i<$anz; $i++) {
$out .= $z;
}
return $out;
}
function forum_admin_selectcats ( $id, $stufe, $sel) {
$q = "SELECT * FROM prefix_forumcats WHERE cid = ".$id." ORDER BY pos";
$erg = db_query($q);
if ( db_num_rows($erg) > 0 ) {
while ($row = db_fetch_object($erg) ) {
echo '<option style="font-weight:bold;" value="cat">'.stufe($stufe,'c').' '.$row->name.'</option>';
forum_admin_selectcats($row->id, $stufe + 1, $sel);
$sql = db_query("SELECT id, name FROM prefix_forums WHERE cid = $row->id");
while ($row2 = db_fetch_object($sql)) {
echo '<option value="'.$row2->id.'"'.($sel == $row2->id?' selected="selected"':'').'>'.stufe($stufe).' '.$row2->name.'</option>';
}
}
}
}
forum_admin_selectcats(0,0,$fid);
echo '</select><br /><input type="checkbox" name="alertautor" value="yes" /> Den Autor über das verschieben informieren?<br /><input type="submit" value="Verschieben" name="sub"></form>';
} else {
$postsMinus = $aktTopicRow['rep'] + 1;
db_query("UPDATE `prefix_topics` SET `fid` = ".$_POST['nfid']." WHERE id = ".$tid);
db_query("UPDATE prefix_posts SET `fid` = ".$_POST['nfid']." WHERE tid = ".$tid);
$apid = db_result(db_query("SELECT MAX(id) FROM prefix_posts WHERE fid = ".$_POST['afid']),0);
$npid = db_result(db_query("SELECT MAX(id) FROM prefix_posts WHERE fid = ".$_POST['nfid']),0);
if ( empty($apid) ) { $apid = 0; }
db_query("UPDATE `prefix_forums` SET last_post_id = ".$apid.", `posts` = `posts` - ".$postsMinus.", `topics` = `topics` - 1 WHERE id = ".$_POST['afid']);
db_query("UPDATE `prefix_forums` SET last_post_id = ".$npid.", `posts` = `posts` + ".$postsMinus.", `topics` = `topics` + 1 WHERE id = ".$_POST['nfid']);
# autor benachrichtigen
if (isset($_POST['alertautor']) AND $_POST['alertautor'] == 'yes') {
$uid = db_result(db_query("SELECT erstid FROM prefix_posts WHERE tid = ".$tid." ORDER BY id ASC LIMIT 1"),0);
$fal = db_result(db_query("SELECT name FROM prefix_forums WHERE id = ".$_POST['afid']),0);
$fne = db_result(db_query("SELECT name FROM prefix_forums WHERE id = ".$_POST['nfid']),0);
$top = db_result(db_query("SELECT name FROM prefix_topics WHERE id = ".$tid),0);
$page = $_SERVER["HTTP_HOST"].$_SERVER["SCRIPT_NAME"];
$txt = 'Dein Thema "'.$top.'" wurde von dem Forum "'.$fal.'" in das neue Forum "'.$fne.'" verschoben... ';
$txt .= "\n\n- [url=http://".$page."?forum-showposts-".$tid."]Link zum Thema[/url]";
$txt .= "\n- [url=http://".$page."?forum-showtopics-".$_POST['nfid']."]Link zum neuen Forum[/url]";
$txt .= "\n- [url=http://".$page."?forum-showtopics-".$_POST['afid']."]Link zum alten Forum[/url]";
sendpm($_SESSION['authid'], $uid, 'Thema verschoben',$txt);
}
wd ( array (
'neue Themen Übersicht' => 'index.php?forum-showtopics-'.$_POST['nfid'],
'alte Themen Übersicht' => 'index.php?forum-showtopics-'.$_POST['afid'],
'Zum Thema' => 'index.php?forum-showposts-'.$tid
) , 'Thema erfolgreich verschoben' , 3 );
}
break;
case 4 : # change topic status
$aktion = ( $aktTopicRow['stat'] == 1 ? 0 : 1 );
db_query("UPDATE `prefix_topics` SET stat = '".$aktion."' WHERE id = '".$tid."'");
wd ( 'index.php?forum-showposts-'.$tid , 'geändert' , 0 );
break;
case 5 : # change topic art
$nart = ( $aktTopicRow['art'] == 0 ? 1 : 0 );
db_query("UPDATE `prefix_topics` SET art = '".$nart."' WHERE id = ".$tid );
wd ( array (
'zurück zum Thema' => 'index.php?forum-showposts-'.$tid,
'zur Themen Übersicht' => 'index.php?forum-showtopics-'.$fid
) , 'Die Art des Themas wurde geändert' , 3 );
break;
}
$design->footer();
?>
Zuletzt modifiziert von kugelschubs am 15.11.2007 - 13:38:52