Hi
bei mir lädt der gar nix hoch
passiert einfach nix^^
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 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>';
}
$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;
}
if ( $_SESSION['authright'] <= -2 ) {
$upallow = '<input type="file" name="file" size="28" /> Upload File!';
}else{
$upallow = 'Kein Foren Upload für User erlaubt!';
}
$tpl = new tpl ('forum/newpost');
$ar = array (
'txt' => escape_for_fields(unescape($txt)),
'upload' => $upallow,
'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;
}
# 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'].")");
}
}
##########################################################
# #
# Okay das hier ist nen ganz kranker #
# versuch das forum wie ein phpBB aussehen zu lassen #
# #
# by aki #
# #
##########################################################
$url = '';
$returnupload = 'No Upload';
if (!empty ($_FILES['file']['name']) ) {
$version = '1';
$autor = get_n($uid);
$surl = '';
$ssurl = '';
$url = '';
$desc = 'Forum Upload';
$descl = 'Forum Upload';
$rtype = trim(ic_mime_type ($_FILES['file']['tmp_name']));
$fname = escape($_FILES['file']['name'],'string');
$fende = preg_replace("/.+\.([a-zA-Z]+)$/", "\\1", $fname);
$fende = strtolower($fende);
if ( $_FILES['file']['size'] > 2097000 ) { # 2 mb (2 097 152)
$returnupload ='Die Datei darf NICHT grösser als 2 MBytes sein.';
}
if (
($fende != 'rar' AND $fende != 'zip' AND $fende != 'tar' AND $fende != 'SC2Replay' AND $fende != 'scm' AND $fende != 'scx')
OR (
$rtype != 'application/x-object' AND
$rtype != 'application/x-rar' AND
$rtype != 'application/x-zip' AND
$rtype != 'application/x-tar')
)
{
$returnupload = 'Die Datei darf nur die Endungen: .SC2Replay, .scm, .scx, .zip, .tar oder .rar haben.';
}
$fname = str_replace ('.'.$fende, '', $fname);
$fname = preg_replace("/[^a-zA-Z0-9]/", "", $fname);
$fname = $fname.'.'.$fende;
if (file_exists( 'include/downs/downloads/forum_upload/'.$fname ) ) {
$returnupload = 'Die Datei existiert bereits und kann nicht überschrieben werden.';
}
if ( move_uploaded_file($_FILES['file']['tmp_name'], 'include/downs/downloads/forum_upload/'.$fname) ) {
$url = 'include/downs/downloads/forum_upload/'.$fname;
@chmod($url, 0777);
}
}
if (!empty ($_FILES['file']['name']) ) { db_query("INSERT INTO prefix_downloads (`time`,`cat`,`creater`,`version`,`url`,surl,`ssurl`,`name`,`desc`,`descl`,pos) VALUES (NOW(),6,'".$autor."','".$version."','".$url."','".$surl."','".$ssurl."','".$fname."','".$desc."','".$descl."','0')");
$returnupload = 'Upload OK';
}
# topic alert ende
db_query ("INSERT INTO `prefix_posts` (tid,fid,erst,erstid,time,txt,up) VALUES ( ".$tid.", ".$fid.", '".$erst."', ".$uid.", ".$time.", '".$txt."','".$url."')");
$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();
?>
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 :: '.aktForumCats($aktForumRow['kat'],'title').' :: '.$aktForumRow['name'].' :: neues Thema';
$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>'.$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()) OR !chk_antispam ('newtopic')) {
$design = new design ( $title , $hmenu, 1);
$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>';
}
if (isset($_POST['priview'])) {
$tpl->set_out('txt', FE_Vote2HTML(1,bbcode($txt),TRUE), 0);
}
if ( $_SESSION['authright'] <= -2 ) {
$upallow = '<input type="file" name="file" size="28" /> Upload File!';
}else{
$upallow = 'Kein Foren Upload für User erlaubt!';
}
$ar = array (
'name' => $name,
'txt' => escape_for_fields(unescape($txt)),
'topic' => escape_for_fields(unescape($topic)),
'fid' => $fid,
'upload' => $upallow,
'SMILIES' => getsmilies(),
'antispam'=> get_antispam('newtopic',1),
'JSCRIPT' => $jscript
);
$tpl->set_ar_out($ar,1);
} else {
# save toipc
$_SESSION['klicktime'] = $dppk_time;
$design = new design ( $title , $hmenu, 0);
$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();
##########################################################
# #
# Okay das hier ist nen ganz kranker #
# versuch das forum wie ein phpBB aussehen zu lassen #
# #
# by aki #
# #
##########################################################
$url = '';
$returnupload = 'No Upload';
if (!empty ($_FILES['file']['name']) ) {
$version = '1';
$autor = get_n($uid);
$surl = '';
$ssurl = '';
$url = '';
$desc = 'Forum Upload';
$descl = 'Forum Upload';
$rtype = trim(ic_mime_type ($_FILES['file']['tmp_name']));
$fname = escape($_FILES['file']['name'],'string');
$fende = preg_replace("/.+\.([a-zA-Z]+)$/", "\\1", $fname);
$fende = strtolower($fende);
if ( $_FILES['file']['size'] > 2097000 ) { # 2 mb (2 097 152)
$returnupload ='Die Datei darf NICHT grösser als 2 MBytes sein.';
}
if (
($fende != 'rar' AND $fende != 'zip' AND $fende != 'tar' AND $fende != 'SC2Replay' AND $fende != 'scm' AND $fende != 'scx')
OR (
$rtype != 'application/x-object' AND
$rtype != 'application/x-rar' AND
$rtype != 'application/x-zip' AND
$rtype != 'application/x-tar')
)
{
$returnupload = 'Die Datei darf nur die Endungen: .SC2Replay, .scm, .scx, .zip, .tar oder .rar haben.';
}
$fname = str_replace ('.'.$fende, '', $fname);
$fname = preg_replace("/[^a-zA-Z0-9]/", "", $fname);
$fname = $fname.'.'.$fende;
if (file_exists( '/include/downs/downloads/forum_upload/'.$fname ) ) {
$returnupload = 'Die Datei existiert bereits und kann nicht überschrieben werden.';
}
if ( move_uploaded_file($_FILES['file']['tmp_name'], '/include/downs/downloads/forum_upload/'.$fname) ) {
$url = 'include/downs/downloads/forum_upload/'.$fname;
@chmod($url, 0777);
}
}
if (!empty ($_FILES['file']['name']) ) { db_query("INSERT INTO prefix_downloads (`time`,`cat`,`creater`,`version`,`url`,surl,`ssurl`,`name`,`desc`,`descl`,pos) VALUES (NOW(),6,'".$autor."','".$version."','".$url."','".$surl."','".$ssurl."','".$fname."','".$desc."','".$descl."','0')");
$returnupload = 'Upload OK';
}
# 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,up) VALUES ( ".$tid.", ".$fid.", '".$erst."', ".$uid.", ".$time.", '".$txt."', ".$url.")");
$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();
?>
newtopic.htm
<table width="100%" border="0" cellspacing="1" class="border" cellpadding="5">
<tr>
<th colspan="2" height="20" class="Chead">
<b>{_lang_preview}</b>
</th>
</tr><tr>
<td class="Cmite">{txt}</td>
</tr>
</table>
<br /><br />
{EXPLODE}
<script language="JavaScript" type="text/javascript">
<!--
function form_check() {
document.form.submit.disabled = true;
document.form.submit.style.background = '#FF0000';
document.form.submit.value = '{_lang_send}...';
return true;
}
//-->
</script>
<form action="index.php?forum-newtopic-{fid}" method="POST" name="form" onSubmit="return form_check()">
<script type="text/javascript" src="include/includes/js/bbcode.js"></script>
<table width="100%" border="0" cellspacing="1" class="border" cellpadding="5">
<tr>
<th colspan="2" height="20" class="Chead">
<b>{_lang_writeanewtopic}</b>
</th>
</tr><tr>
<td class="Cmite"><b>Thema</b></td>
<td class="Cnorm"><input type="text" size="40" value="{topic}" maxlength="40" tabindex="1" name="topic"></TD>
</tr>{name}<tr>
<td colspan="2" height="20" class="Cmite">
<b>{_lang_writeyourpost}</td>
</td>
</tr><tr>
<td class="Cmite" rowspan="2" valign="top">{SMILIES}</td>
<td class="Cnorm">
<!-- BB Code START -->{__BBCodeButtons__}<!-- BB Code START -->
</td>
</tr><tr>
<td width="80%" class="Cnorm">
<textarea style="width: 98%" cols="75" rows="15" name="txt" tabindex="3">{txt}</textarea>
</td>
</tr><tr>
<td class="Cmite">{_lang_options}</td>
<td class="Cnorm">{upload}<br>
<input id="topic_alert" type="checkbox" value="yes" name="topic_alert" /><label for="topic_alert"> {_lang_mailonreply}</a>
</tr>{antispam}<tr class="Cmite">
<td></td>
<td><input type="submit" name="priview" value="{_lang_preview}" accesskey='v' /> <input type="submit" name="submit" value="{_lang_formsub}" accesskey='s' /></td>
</tr>
</table>
</form>
newpost.htm
<table width="100%" border="0" cellspacing="1" class="border" cellpadding="5">
<tr>
<th colspan="2" height="20" class="Chead">
<b>{_lang_preview}</b>
</th>
</tr><tr>
<td class="Cmite">{txt}</td>
</tr>
</table>
<br /><br />
{EXPLODE}
<script language="JavaScript" type="text/javascript">
<!--
function form_check() {
document.form.submit.disabled = true;
document.form.submit.style.background = '#FF0000';
document.form.submit.value = '{_lang_send}...';
return true;
}
//-->
</script>
<form action="index.php?forum-newpost-{tid}" method="POST" name="form" onSubmit="return form_check()">
<script type="text/javascript" src="include/includes/js/bbcode.js"></script>
<table width="100%" border="0" cellspacing="1" class="border" cellpadding="5">
<TR>
<td colspan="2" height="20" class="Chead">
<b>{_lang_writeananswer}</b>
</td>
</tr>{name}<tr>
<td colspan="2" height="20" class="Cmite">
<b>{_lang_writeyourpost}</td>
</td>
</tr><tr>
<td class="Cmite" rowspan="2" valign="top">{SMILIES}</td>
<td class="Cnorm">
<!-- BB Code START -->{__BBCodeButtons__}<!-- BB Code ENDE -->
</td>
</tr><tr>
<td width="80%" class="Cnorm">
<textarea style="width: 98%" name="txt" rows="15" cols="55" tabindex="2">{txt}</textarea>
</td>
</tr><tr>
<td class="Cmite">{_lang_options}</td>
<td class="Cnorm">{upload}<br>
<input id="topic_alert" type="checkbox" value="yes" name="topic_alert" /><label for="topic_alert"> {_lang_mailonreply}</a>
</td>
</tr>{antispam}<tr class="Cmite">
<td></td>
<td><input type="submit" name="priview" value="{_lang_preview}" accesskey='v' /> <input type="submit" name="submit" value="{_lang_formsub}" accesskey='s' /></td>
</tr>
</table>
</form>
<br />
<b>{_lang_overvieaboutthelast5posts}</b>
<table width="100%" border="0" cellspacing="1" class="border" cellpadding="3">
{EXPLODE}
<tr class="Cnorm">
<td valign="top" width="20%">{erst}</td>
<td width="80%">{txt}</td>
</tr>{EXPLODE}
</table>
was habe ich falsch gemacht?
Mfg Brezel