1) $birthdays.=', '.$db[nickname].' ('.$years.')';
else $birthdays.=''.$db[nickname].' ('.$years.')';
}
if(!$n) $birthdays="n/a";
// WEEK birthdays
$ergebnis=safe_query("SELECT nickname, userID, DATE_FORMAT(FROM_DAYS(TO_DAYS(FROM_UNIXTIME(".(time()+(7*24*3600)).")) - TO_DAYS(birthday)), '%y') 'age' FROM ".PREFIX."user WHERE DAYOFYEAR(birthday)<=DAYOFYEAR(FROM_UNIXTIME(".(time()+(7*24*3600)).")) AND DAYOFYEAR(birthday)>DAYOFYEAR(NOW())");
$n=0;
while($db=mysql_fetch_array($ergebnis)) {
$n++;
$years=$db['age'];
if($n>1) $birthweek.=', '.$db[nickname].' ('.$years.')';
else $birthweek.=''.$db[nickname].' ('.$years.')';
}
if(!$n) $birthweek="n/a";
// WHOISONLINE
$guests = mysql_num_rows(safe_query("SELECT ip FROM ".PREFIX."whoisonline WHERE userID=''"));
$user = mysql_num_rows(safe_query("SELECT userID FROM ".PREFIX."whoisonline WHERE ip=''"));
$useronline = $guests + $user;
if($user==1) $user_on='1 registered user';
else $user_on=$user.' registered users';
if($guests==1) $guests_on='1 guest';
else $guests_on= $guests.' guests';
$ergebnis = safe_query("SELECT * FROM ".PREFIX."whoisonline WHERE ip='' ORDER BY nickname");
if($user) {
$n=1;
while($ds=mysql_fetch_array($ergebnis)) {
if(isforumadmin($ds['userID'])) $nickname=''.getnickname($ds[userID]).'';
elseif (isanymoderator($ds['userID'])) $nickname=''.getnickname($ds[userID]).'';
else $nickname=getnickname($ds[userID]);
if($n>1) $user_names .= ', '.$nickname.'';
else $user_names = ''.$nickname.'';
$n++;
}
}
$dt=mysql_fetch_array(safe_query("SELECT count(topicID) FROM ".PREFIX."forum_topics WHERE moveID='0'"));
$topics=$dt[0];
$dt=mysql_fetch_array(safe_query("SELECT count(postID) FROM ".PREFIX."forum_posts"));
$posts=$dt[0];
$posts=$posts-$topics;
$dt=mysql_fetch_array(safe_query("SELECT count(userID) FROM ".PREFIX."user"));
$registered=$dt[0];
$newestuser=safe_query("SELECT userID, nickname FROM ".PREFIX."user ORDER BY registerdate DESC LIMIT 0,1");
$dn=mysql_fetch_array($newestuser);
$dm=mysql_fetch_array(safe_query("SELECT maxonline FROM ".PREFIX."counter"));
$maxonline=$dm['maxonline'];
$newestmember=''.$dn[nickname].'';
eval ("\$forum_stats = \"".gettemplate("forum_stats")."\";");
echo $forum_stats;
}
function boardmain() {
global $maxposts;
global $userID;
global $action;
global $loggedin;
global $hideinternboards;
$pagebg=PAGEBG;
$border=BORDER;
$bghead=BGHEAD;
$bgcat=BGCAT;
eval ("\$title_messageboard = \"".gettemplate("title_messageboard")."\";");
echo $title_messageboard;
if($action=="markall") {
$alltopics=safe_query("SELECT topicID FROM ".PREFIX."forum_topics");
while($mark=mysql_fetch_array($alltopics)) {
$array[]=$mark[topicID];
$array[]=time();
}
$string_new=implode(":", $array);
safe_query("UPDATE ".PREFIX."user SET topics='$string_new' WHERE userID='$userID'");
}
eval ("\$forum_main_head = \"".gettemplate("forum_main_head")."\";");
echo $forum_main_head;
// KATEGORIEN
if(isinternboarduser($userID) OR !$hideinternboards) $intern=1;
else $intern=0;
$kath=safe_query("SELECT catID, name, info FROM ".PREFIX."forum_categories WHERE intern<=".$intern." ORDER BY sort");
while($dk=mysql_fetch_array($kath)) {
$kathname=$dk[name];
$info='';
if($dk[info]) $info=$dk[info];
eval ("\$forum_main_kath = \"".gettemplate("forum_main_kath")."\";");
echo $forum_main_kath;
// BOARDS MIT KATEGORIE
$boards=safe_query("SELECT * FROM ".PREFIX."forum_boards WHERE category='$dk[catID]' AND intern<=".$intern." ORDER BY sort");
$i=1;
while($db=mysql_fetch_array($boards)) {
if($i%2) {
$bg1=BG_1;
$bg2=BG_2;
}
else {
$bg1=BG_3;
$bg2=BG_4;
}
$board=$db['boardID'];
$anztopics=$db['topics'];
$anzposts=$db['posts'];
$boardname = $db['name'];
$boardname='• '.$boardname.'';
$boardinfo='';
if($db[info]) $boardinfo=$db[info];
$moderators=getmoderators($db[boardID]);
if($moderators) $moderators='moderated by: '.$moderators;
$lp=mysql_fetch_array(safe_query("SELECT topicID, lastdate, lastposter, replys FROM ".PREFIX."forum_topics WHERE boardID='$db[boardID]' AND moveID='0' ORDER BY lastdate DESC LIMIT 0,1"));
$date='';
$time='';
$poster='';
$member='';
if(is_array($lp)) {
$date=date("d.m.Y", $lp[lastdate]);
$today=date("d.m.Y", time());
$yesterday = date("d.m.Y", time()-3600*24);
if($date==$today) $date="today";
elseif($date==$yesterday && $date<$today) $date="yesterday";
else $date=$date;
$time=date("- H:i", $lp[lastdate]);
$poster=''.getnickname($lp[lastposter]).'';
if(isclanmember($lp[lastposter])) $member=' ';
else $member='';
$topic=$lp[topicID];
$post=getlastpost($topicID);
$postlink='index.php?site=forum_topic&topic='.$topic.'&type=ASC&page='.ceil(($lp['replys']+1)/$maxposts);
}
// viewed topics
$getviewedtopics=safe_query("SELECT topics FROM ".PREFIX."user WHERE userID='$userID'");
$gv=mysql_fetch_array($getviewedtopics);
if($gv[topics]!="") {
$string=$gv[topics];
$array=explode(":", $string);
$boardtopics=safe_query("SELECT topicID, lastdate, moveID FROM ".PREFIX."forum_topics WHERE boardID='$board' AND lastdate>".(time()-(30*24*3600))." ORDER BY lastdate DESC LIMIT 0,100");
$found=0;
while($bt=mysql_fetch_array($boardtopics) AND ($found<1)) {
if(!$bt[moveID]) {
if (in_array($bt[topicID], $array)){
$x=array_search($bt[topicID], $array);
if($array[$x+1]<$bt[lastdate]) $found++;
}
else $found++;
}
}
if($found) $icon='
';
else $icon='
';
}
else $icon='
';
if(!$loggedin) $icon='
';
// end viewed topics
if($db[intern]) {
if(isinternboarduser($userID)) {
eval ("\$forum_main_board = \"".gettemplate("forum_main_board")."\";");
echo $forum_main_board;
}
elseif(!$hideinternboards) {
if(!isinternboarduser($userID)) $icon='
';
eval ("\$forum_main_board = \"".gettemplate("forum_main_board")."\";");
echo $forum_main_board;
}
}
else {
eval ("\$forum_main_board = \"".gettemplate("forum_main_board")."\";");
echo $forum_main_board;
}
$i++;
}
}
// BOARDS OHNE KATEGORIE
$boards=safe_query("SELECT * FROM ".PREFIX."forum_boards WHERE category='0' ORDER BY sort");
$i=1;
while($db=mysql_fetch_array($boards)) {
if($i%2) {
$bg1=BG_1;
$bg2=BG_2;
}
else {
$bg1=BG_3;
$bg2=BG_4;
}
$board=$db[boardID];
$anztopics=$db['topics'];
$anzposts=$db['posts'];
$boardname = $db[name];
$boardname='• '.$boardname.'';
$boardinfo='';
if($db[info]) $boardinfo=$db[info];
$moderators=getmoderators($db[boardID]);
if($moderators) $moderators='moderated by: '.$moderators;
$lp=mysql_fetch_array(safe_query("SELECT * FROM ".PREFIX."forum_topics WHERE boardID='$db[boardID]' AND moveID='0' ORDER BY lastdate DESC LIMIT 0,1"));
$date='';
$time='';
$poster='';
$member='';
if(is_array($lp)) {
$date=date("d.m.Y", $lp[lastdate]);
$today=date("d.m.Y", time());
$yesterday = date("d.m.Y", time()-3600*24);
if($date==$today) $date="today";
elseif($date==$yesterday && $date<$today) $date="yesterday";
else $date=$date;
$time=date("- H:i", $lp[lastdate]);
$poster=''.getnickname($lp[lastposter]).'';
if(isclanmember($lp[lastposter])) $member='
';
else $member='';
$topic=$lp[topicID];
}
// viewed topics
$getviewedtopics=safe_query("SELECT topics FROM ".PREFIX."user WHERE userID='$userID'");
$gv=mysql_fetch_array($getviewedtopics);
if($gv[topics]!="") {
$string=$gv[topics];
$array=explode(":", $string);
$anzarray=count($array);
$boardtopics=safe_query("SELECT topicID, lastdate, moveID FROM ".PREFIX."forum_topics WHERE boardID='$board'");
$found=0;
while($bt=mysql_fetch_array($boardtopics)) {
if(!$bt[moveID]) {
if (in_array($bt[topicID], $array)){
$x=array_search($bt[topicID], $array);
if($array[$x+1]<$bt[lastdate]) $found++;
}
else $found++;
}
}
if($found) $icon='
';
else $icon='
';
}
else $icon='
';
if(!$loggedin) $icon='
';
// end viewed topics
if($db[intern]) {
if(isinternboarduser($userID)) {
eval ("\$forum_main_board = \"".gettemplate("forum_main_board")."\";");
echo $forum_main_board;
}
elseif(!$hideinternboards) {
if(!isinternboarduser($userID)) $icon='
';
eval ("\$forum_main_board = \"".gettemplate("forum_main_board")."\";");
echo $forum_main_board;
}
}
else {
eval ("\$forum_main_board = \"".gettemplate("forum_main_board")."\";");
echo $forum_main_board;
}
$i++;
}
eval ("\$forum_main_foot = \"".gettemplate("forum_main_foot")."\";");
echo $forum_main_foot;
if($loggedin) {
eval ("\$forum_main_legend = \"".gettemplate("forum_main_legend")."\";");
echo $forum_main_legend;
}
forum_stats();
}
function showboard($board) {
global $userID;
global $loggedin;
global $maxtopics;
global $maxposts;
global $page;
global $action;
$pagebg=PAGEBG;
$border=BORDER;
$bghead=BGHEAD;
$bgcat=BGCAT;
eval ("\$title_messageboard = \"".gettemplate("title_messageboard")."\";");
echo $title_messageboard;
$alle=safe_query("SELECT topicID FROM ".PREFIX."forum_topics WHERE boardID='$board'");
$gesamt=mysql_num_rows($alle);
if($action=="markall") {
$getviewedtopics=safe_query("SELECT topics FROM ".PREFIX."user WHERE userID='$userID'");
$gv=mysql_fetch_array($getviewedtopics);
$time=time();
$string=$gv[topics];
$array=explode(":", $string);
while($ma=mysql_fetch_array($alle)) {
if($gv[topics]!="") {
if(in_array($ma[topicID], $array)) {
$x=array_search($ma[topicID], $array);
$y=$x+1;
$array[$y]=$time;
}
else {
$array[]=$ma[topicID];
$array[]=$time;
}
}
else {
$array[]=$ma[topicID];
$array[]=$time;
}
}
$string_new=implode(":", $array);
safe_query("UPDATE ".PREFIX."user SET topics='$string_new' WHERE userID='$userID'");
}
$pages=1;
if(!isset($page) || $page=='') $page=1;
$max=$maxtopics;
for ($n=$max; $n<=$gesamt; $n+=$max) {
if($gesamt>$n) $pages++;
}
if($pages>1) $page_link = makepagelink("index.php?site=forum&board=$board", $page, $pages);
if($page==1) $start=0;
if($page>1) $start=$page*$max-$max;
$ergebnis = safe_query("SELECT * FROM ".PREFIX."forum_boards WHERE boardID='$board' ");
$db = mysql_fetch_array($ergebnis);
$boardname = $db[name];
if($db[intern]) {
$check=safe_query("SELECT userID FROM ".PREFIX."user_groups WHERE internboards='1' AND userID='$userID'");
if(! mysql_NUM_ROWS($check)) die('You have no permission to view intern boards!
');
}
$moderators=getmoderators($board);
if($moderators) $moderators='(moderated by: '.$moderators.')';
eval ("\$forum_head = \"".gettemplate("forum_head")."\";");
echo $forum_head;
if(isforumadmin($userID)) $actions=' ';
$actions.='
';
if($loggedin) {
$mark='• mark all topics read';
$actions.='
';
}
$i=1;
// ANNOUNCEMENTS
$announce=safe_query("SELECT * FROM ".PREFIX."forum_announcements WHERE boardID='$board' ORDER BY date DESC");
$anz=mysql_num_rows(safe_query("SELECT announceID FROM ".PREFIX."forum_announcements WHERE boardID='$board'"));
if($anz) {
eval ("\$forum_announcement_head = \"".gettemplate("forum_announcement_head")."\";");
echo $forum_announcement_head;
while($da=mysql_fetch_array($announce)) {
if($i%2) {
$bg1=BG_1;
$bg2=BG_2;
}
else {
$bg1=BG_3;
$bg2=BG_4;
}
$date=date("d.m.Y", $da[date]);
$time=date("H:i", $da[date]);
$topicname=cleartext($da[topic]);
$today=date("d.m.Y", time());
$yesterday = date("d.m.Y", time()-3600*24);
if($date==$today) $date="today";
elseif($date==$yesterday && $date<$today) $date="yesterday";
else $date=$date;
$gesamt=1;
$folder='
';
$topictitle=cleartext($da[topic]);
$poster=''.getnickname($da[userID]).'';
if(isclanmember($da[userID])) $member1='
';
else $member1='';
$lastposter=''.getnickname($da[userID]).'';
if(isclanmember($da[userID])) $member='
';
else $member='';
$link=''.$topictitle.'';
$replys=0;
$views=$da[views];
eval ("\$forum_announcement_content = \"".gettemplate("forum_announcement_content")."\";");
echo $forum_announcement_content;
$i++;
}
eval ("\$forum_announcement_foot = \"".gettemplate("forum_announcement_foot")."\";");
echo $forum_announcement_foot;
}
eval ("\$forum_actions = \"".gettemplate("forum_actions")."\";");
echo $forum_actions;
// TOPICS
$topics = safe_query("SELECT * FROM ".PREFIX."forum_topics WHERE boardID='$board' ORDER BY sticky DESC, lastdate DESC LIMIT $start,$max");
$anztopics = mysql_num_rows(safe_query("SELECT boardID FROM ".PREFIX."forum_topics WHERE boardID='$board'"));
$i=1;
unset($link);
if($anztopics) {
eval ("\$forum_topics_head = \"".gettemplate("forum_topics_head")."\";");
echo $forum_topics_head;
while($dt=mysql_fetch_array($topics)) {
if($i%2) {
$bg1=BG_1;
$bg2=BG_2;
}
else {
$bg1=BG_3;
$bg2=BG_4;
}
if($dt[moveID]) $gesamt=0;
else $gesamt=$dt[replys]+1;
$topicpages=1;
$max=$maxposts;
for ($n=$max; $n<=$gesamt; $n+=$max) {
if($gesamt>$n) $topicpages++;
}
if($topicpages>1) $topicpage_link = makepagelink("index.php?site=forum_topic&topic=$dt[topicID]", 1, $topicpages);
if($dt[icon]) $icon='
';
else $icon='';
// viewed topics
if($dt[closed]) $folder='
';
elseif($dt[moveID]) $folder='
';
elseif($dt[sticky]) $folder='
';
else {
$getviewedtopics=safe_query("SELECT topics FROM ".PREFIX."user WHERE userID='$userID'");
$gv=mysql_fetch_array($getviewedtopics);
if($gv[topics]!="") {
$string=$gv[topics];
$array=explode(":", $string);
$anzarray=count($array);
if (in_array($dt[topicID], $array)) {
$x=array_search($dt[topicID], $array);
if($array[$x+1]<$dt[lastdate]) {
if($dt[replys]>15 || $dt[views]>150) $folder='
';
else $folder='
';
}
else {
if($dt[replys]>15 || $dt[views]>150) $folder='
';
else $folder='
';
}
}
else {
if($dt[replys]>15 || $dt[views]>150) $folder='
';
else $folder='
';
}
}
else {
if($dt[replys]>15 || $dt[views]>150) $folder='
';
else $folder='
';
}
}
// end viewed topics
if(!$loggedin) {
if($gesamt>15) $folder='
';
else $folder='
';
}
if($dt[sticky]) $folder='
';
$topictitle=getinput($dt[topic]);
$topictitle=str_break($topictitle, 60);
$poster=''.getnickname($dt[userID]).'';
if(isclanmember($posterID)) $member1='
';
else $member1='';
$replys='0';
$views='0';
if($dt[moveID]) { // MOVED TOPIC
$move=safe_query("SELECT * FROM ".PREFIX."forum_topics WHERE topicID='$dt[moveID]'");
$dm=mysql_fetch_array($move);
if($dm[replys]) $replys=$dm[replys];
if($dm[views]) $views=$dm[views];
$date=date("d.m.y", $dm[lastdate]);
$time=date("H:i", $dm[lastdate]);
$today=date("d.m.y", time());
$yesterday = date("d.m.y", time()-3600*24);
if($date==$today) $date="today, ".$time;
elseif($date==$yesterday && $date<$today) $date="yesterday, ".$time;
else $date=$date.", ".$time;
$lastposter=''.getnickname($dm[lastposter]).'';
if(isclanmember($dm[lastposter])) $member='
';
else $member='';
$link='MOVED: '.$topictitle.'';
}
else { // NO MOVED TOPIC
if($dt[replys]) $replys=$dt[replys];
if($dt[views]) $views=$dt[views];
$date=date("d.m.y", $dt[lastdate]);
$time=date("H:i", $dt[lastdate]);
$today=date("d.m.y", time());
$yesterday = date("d.m.y", time()-3600*24);
if($date==$today) $date="today, ".$time;
elseif($date==$yesterday && $date<$today) $date="yesterday, ".$time;
else $date=$date.", ".$time;
$lastposter=''.getnickname($dt[lastposter]).'';
if(isclanmember($dt[lastposter])) $member='
';
else $member='';
$link=''.$topictitle.'';
}
eval ("\$forum_topics_content = \"".gettemplate("forum_topics_content")."\";");
echo $forum_topics_content;
$i++;
unset($topicpage_link);
unset($lastposter);
unset($member);
unset($member1);
unset($date);
unset($time);
unset($link);
}
eval ("\$forum_topics_foot = \"".gettemplate("forum_topics_foot")."\";");
echo $forum_topics_foot;
eval ("\$forum_actions = \"".gettemplate("forum_actions")."\";");
echo $forum_actions;
}
if($loggedin) {
eval ("\$forum_topics_legend = \"".gettemplate("forum_topics_legend")."\";");
echo $forum_topics_legend;
}
if(!$loggedin) echo'
To start a topic you have to be registered and logged in!
• register now
• login';
unset($page_link);
}
if($_POST['submit'] || $_POST['movetopic'] || $_GET['addtopic'] || $_POST['addtopic'] || $_GET['action'] == "admin-action") {
if($_POST['admaction']=="closetopic") {
include("_mysql.php");
include("_settings.php");
include('_functions.php');
$topicID = $_POST['topicID'];
$board = $_POST['board'];
if(!isforumadmin($userID) AND !ismoderator($userID, $board)) die('No access');
safe_query("UPDATE ".PREFIX."forum_topics SET closed='1' WHERE topicID='$topicID' ");
header("Location: index.php?site=forum&board=$board");
}
elseif($_POST['admaction']=="opentopic") {
include("_mysql.php");
include("_settings.php");
include('_functions.php');
$topicID = $_POST['topicID'];
$board = $_POST['board'];
if(!isforumadmin($userID) AND !ismoderator($userID, $board)) die('No access');
safe_query("UPDATE ".PREFIX."forum_topics SET closed='0' WHERE topicID='$topicID' ");
header("Location: index.php?site=forum&board=$board");
}
elseif($_POST['admaction']=="deletetopic") {
include("_mysql.php");
include("_settings.php");
include('_functions.php');
$topicID = $_POST['topicID'];
$board = $_POST['board'];
if(!isforumadmin($userID) AND !ismoderator($userID, $board)) die('No access');
safe_query("DELETE FROM ".PREFIX."forum_topics WHERE topicID='$topicID' ");
safe_query("DELETE FROM ".PREFIX."forum_topics WHERE moveID='$topicID' ");
safe_query("DELETE FROM ".PREFIX."forum_posts WHERE topicID='$topicID' ");
header("Location: index.php?site=forum&board=$board");
}
elseif($_POST['admaction']=="stickytopic") {
include("_mysql.php");
include("_settings.php");
include('_functions.php');
$topicID = $_POST['topicID'];
$board = $_POST['board'];
if(!isforumadmin($userID) AND !ismoderator($userID, $board)) die('No access');
safe_query("UPDATE ".PREFIX."forum_topics SET sticky='1' WHERE topicID='$topicID' ");
header("Location: index.php?site=forum&board=$board");
}
elseif($_POST['admaction']=="unstickytopic") {
include("_mysql.php");
include("_settings.php");
include('_functions.php');
$topicID = $_POST['topicID'];
$board = $_POST['board'];
if(!isforumadmin($userID) AND !ismoderator($userID, $board)) die('No access');
safe_query("UPDATE ".PREFIX."forum_topics SET sticky='0' WHERE topicID='$topicID' ");
header("Location: index.php?site=forum&board=$board");
}
elseif($_POST['admaction']=="delposts") {
include("_mysql.php");
include("_settings.php");
include('_functions.php');
$topicID = $_POST['topicID'];
$postID = $_POST['postID'];
$board = $_POST['board'];
if(!isforumadmin($userID) AND !ismoderator($userID, $board)) die('No access');
foreach($postID as $id) {
$last = safe_query("SELECT * FROM ".PREFIX."forum_posts WHERE topicID = '$topicID' ");
$anz = mysql_num_rows($last);
if($anz > 1) {
safe_query("DELETE FROM ".PREFIX."forum_posts WHERE postID='$id' ");
$last = safe_query("SELECT * FROM ".PREFIX."forum_posts WHERE topicID = '$topicID' ORDER BY date DESC LIMIT 0,1 ");
$dl = mysql_fetch_array($last);
safe_query("UPDATE ".PREFIX."forum_topics SET lastdate='$dl[date]', lastposter='$dl[poster]', replys=replys-1 WHERE topicID='$topicID' ");
$deleted=false;
}
else {
safe_query("DELETE FROM ".PREFIX."forum_posts WHERE postID='$id' ");
safe_query("DELETE FROM ".PREFIX."forum_topics WHERE topicID='$topicID' ");
safe_query("DELETE FROM ".PREFIX."forum_topics WHERE moveID='$topicID' ");
$deleted=true;
}
}
if($deleted) header("Location: index.php?site=forum&board=$board");
else header("Location: index.php?site=forum&board=$board&topic=$topicID");
}
elseif($_GET['admaction']=="announce") {
$board = $_GET['board'];
$ergebnis = safe_query("SELECT * FROM ".PREFIX."forum_boards WHERE boardID='$board' ");
$db = mysql_fetch_array($ergebnis);
$boardname = $db[name];
$bg1=BG_1;
$bg2=BG_2;
$bg3=BG_3;
$bg4=BG_4;
$moderators=getmoderators($board);
eval ("\$forum_head = \"".gettemplate("forum_head")."\";");
echo $forum_head;
eval ("\$addbbcode = \"".gettemplate("addbbcode")."\";");
eval ("\$forum_announcement_post = \"".gettemplate("forum_announcement_post")."\";");
echo $forum_announcement_post;
}
elseif($_POST['movetopic']) {
include("_mysql.php");
include("_settings.php");
include('_functions.php');
$toboard = $_POST['toboard'];
$topicID = $_POST['topicID'];
if(!isanyadmin($userID) AND !ismoderator($userID, getboardid($topicID))) die('No access');
$di=mysql_fetch_array(safe_query("SELECT intern FROM ".PREFIX."forum_boards WHERE boardID='$toboard'"));
$ergebnis=safe_query("SELECT * FROM ".PREFIX."forum_topics WHERE topicID='$topicID'");
$ds=mysql_fetch_array($ergebnis);
// EINTAG DES moveID
if($_POST['movelink']) safe_query("INSERT INTO ".PREFIX."forum_topics (boardID, icon, intern, userID, date, topic, lastdate, lastposter, replys, views, closed, moveID)
values ('$ds[boardID]', '', '', '$ds[userID]', '$ds[date]', '$ds[topic]', '$ds[lastdate]', '', '', '', '', '$topicID') ");
// ÄNDERN DES EINTRAGES
safe_query("UPDATE ".PREFIX."forum_topics SET boardID='$toboard', intern='$ds[intern]' WHERE topicID='$topicID'");
safe_query("UPDATE ".PREFIX."forum_posts SET boardID='$toboard' WHERE topicID='$topicID'");
$post_num = mysql_affected_rows();
safe_query("UPDATE ".PREFIX."forum_boards SET topics=topics+1 WHERE boardID='$toboard'");
safe_query("UPDATE ".PREFIX."forum_boards SET topics=topics-1 WHERE boardID='".$ds['boardID']."'");
safe_query("UPDATE ".PREFIX."forum_boards SET posts=posts+".$post_num." WHERE boardID='".$toboard."'");
safe_query("UPDATE ".PREFIX."forum_boards SET posts=posts-".$post_num." WHERE boardID='".$ds['boardID']."'");
header("Location: index.php?site=forum&board=$toboard");
}
elseif($_POST['admaction']=="movetopic") {
include("_mysql.php");
include("_settings.php");
include('_functions.php');
if(!isanyadmin($userID) AND !ismoderator($userID, getboardid($_POST['topicID']))) die('No access');
echo'
'.cleartext($topicname).' | |