'; echo' '; if(isnewsadmin($userID)) { safe_query("DELETE FROM ".PREFIX."news WHERE headline1='' AND lang1='' AND lang2='' AND headline2=''"); safe_query("INSERT INTO ".PREFIX."news (date, poster, saved) VALUES ('".time()."', '$userID', '0')"); $newsID=mysql_insert_id(); $newsrubrics=safe_query("SELECT rubricID, rubric FROM ".PREFIX."news_rubrics ORDER BY rubric"); while($dr=mysql_fetch_array($newsrubrics)) { $rubrics.=''; } if($_POST['topnews']) safe_query("UPDATE ".PREFIX."settings SET topnewsID='$newsID'"); $lang=safe_query("SELECT lang, language FROM ".PREFIX."news_languages ORDER BY language"); while($dl=mysql_fetch_array($lang)) { if($dl[lang]=="de") $langs1.=''; else $langs1.=''; if($dl[lang]=="uk") $langs2.=''; else $langs2.=''; } $url1="http://"; $url2="http://"; $url3="http://"; $url4="http://"; $bg1=BG_1; eval ("\$addbbcode = \"".gettemplate("addbbcode")."\";"); eval ("\$addflags = \"".gettemplate("flags")."\";"); eval ("\$news_post = \"".gettemplate("news_post")."\";"); echo $news_post; } else redirect('index.php?site=news', 'no access!'); } elseif($action=="save") { include("_mysql.php"); include("_settings.php"); include("_functions.php"); if(!isnewsadmin($userID)) die('No access.'); $newsID = $_POST['newsID']; $save = $_POST['save']; $preview = $_POST['preview']; $rubric = $_POST['rubric']; $lang1 = $_POST['lang1']; $headline1 = $_POST['headline1']; $message = $_POST['message']; $lang2 = $_POST['lang2']; $headline2 = $_POST['headline2']; $content2 = $_POST['content2']; $link1 = $_POST['link1']; $url1 = $_POST['url1']; $window1 = $_POST['window1']; $link2 = $_POST['link2']; $url2 = $_POST['url2']; $window2 = $_POST['window2']; $link3 = $_POST['link3']; $url3 = $_POST['url3']; $window3 = $_POST['window3']; $link4 = $_POST['link4']; $url4 = $_POST['url4']; $window4 = $_POST['window4']; $intern = $_POST['intern']; $comments = $_POST['comments']; safe_query("UPDATE ".PREFIX."news SET rubric='$rubric', lang1='$lang1', headline1='".mysql_escape_string($headline1)."', content1='".mysql_escape_string($message)."', lang2='$lang2', headline2='".mysql_escape_string($headline2)."', content2='".mysql_escape_string($content2)."', link1='$link1', url1='$url1', window1='$window1', link2='$link2', url2='$url2', window2='$window2', link3='$link3', url3='$url3', window3='$window3', link4='$link4', url4='$url4', window4='$window4', saved='1', intern='$intern', comments='$comments' WHERE newsID='$newsID'"); // löschen der einträge die älter als 1 stunde sind und keinen text enthalten $ergebnis=safe_query("SELECT * FROM ".PREFIX."news WHERE headline1='' OR content1=''"); while($ds=mysql_fetch_array($ergebnis)) { if((time()-$ds[date]) > (60*60)) safe_query("DELETE FROM ".PREFIX."news WHERE newsID='$ds[newsID]'"); } if($_POST['topnews']) safe_query("UPDATE ".PREFIX."settings SET topnewsID='$newsID'"); if($save) echo''; if($preview) header("Location: news.php?action=preview&newsID=$newsID"); } elseif($action=="preview") { include("_mysql.php"); include("_settings.php"); include("_functions.php"); if(!isnewsadmin($userID)) die('No access.'); $newsID = $_GET['newsID']; echo' '; $bg1=BG_1; eval ("\$title_news = \"".gettemplate("title_news")."\";"); echo $title_news; $result=safe_query("SELECT * FROM ".PREFIX."news WHERE newsID='$newsID'"); $ds=mysql_fetch_array($result); $bgcolor=BG_1; $date = date("d.m.Y", $ds[date]); $time = date("H:i", $ds[date]); $rubrikname=getrubricname($ds[rubric]); $rubricpic=''; if(!file_exists($rubricpic)) $rubricpic = ''; $lang=$ds[lang1]; $language1="[flag]".$ds[lang1]."[/flag]"; $language2="[flag]".$ds[lang2]."[/flag]"; if($lang==$ds[lang1]) { if($ds[headline1]) $headline = $ds[headline1]; else $headline = $ds[headline2]; if($ds[content1]) $content = $ds[content1]; else $content='[b]no version in selected language available![/b].[br][br]'.$ds[content2]; $langs=''; if($ds[headline2]) { $langs=''.flags($language2).''; $language=getlanguage($ds[lang2]); $langs = eregi_replace ('(alt=")(.*)(")',"\\1 news in $language\\3",$langs); } } else { if($ds[headline2]) $headline = $ds[headline2]; else $headline = $ds[headline1]; if($ds[content2]) $content = $ds[content2]; else $content='[b]no version in selected language available![/b].[br][br]'.$ds[content1]; $langs=''; if($ds[headline1]) { $langs=''.flags($language1).''; $language=getlanguage($ds[lang1]); $langs = eregi_replace ('(alt=")(.*)(")',"\\1 news in $language\\3",$langs); } } $content = htmloutput($content); $content = toggle($content, $ds[newsID]); $poster=''.getnickname($ds[poster]).''; if($ds[link1] && $ds[url1]!="http://" && $ds[window1]) $related.='• '.$ds[link1].' '; if($ds[link1] && $ds[url1]!="http://" && !$ds[window1]) $related.='• '.$ds[link1].' '; if($ds[link2] && $ds[url2]!="http://" && $ds[window2]) $related.='• '.$ds[link2].' '; if($ds[link2] && $ds[url2]!="http://" && !$ds[window2]) $related.='• '.$ds[link2].' '; if($ds[link3] && $ds[url3]!="http://" && $ds[window3]) $related.='• '.$ds[link3].' '; if($ds[link3] && $ds[url3]!="http://" && !$ds[window3]) $related.='• '.$ds[link3].' '; if($ds[link4] && $ds[url4]!="http://" && $ds[window4]) $related.='• '.$ds[link4].' '; if($ds[link4] && $ds[url4]!="http://" && !$ds[window4]) $related.='• '.$ds[link4].' '; eval ("\$news = \"".gettemplate("news")."\";"); echo $news; echo'
'; } elseif($_POST['quickactiontype']=="publish" OR $_GET['quickactiontype']=="publish") { include("_mysql.php"); include("_settings.php"); include("_functions.php"); if(!isnewsadmin($userID)) die('No access.'); $newsID = $_POST['newsID']; if(is_array($newsID)) { foreach($newsID as $id) { safe_query("UPDATE ".PREFIX."news SET published='1' WHERE newsID='$id'"); } } header("Location: index.php?site=news"); } elseif($_POST['quickactiontype']=="unpublish" OR $_GET['quickactiontype']=="unpublish") { include("_mysql.php"); include("_settings.php"); include("_functions.php"); if(!isnewsadmin($userID)) die('No access.'); $newsID = $_POST['newsID']; if(!$newsID) $newsID[] = $_GET['newsID']; foreach($newsID as $id) { safe_query("UPDATE ".PREFIX."news SET published='0' WHERE newsID='$id'"); } header("Location: index.php?site=news"); } elseif($_POST['quickactiontype']=="delete") { include("_mysql.php"); include("_settings.php"); include("_functions.php"); if(!isnewsadmin($userID)) die('No access.'); $newsID = $_POST['newsID']; foreach($newsID as $id) { $ds=mysql_fetch_array(safe_query("SELECT screens FROM ".PREFIX."news WHERE newsID='$id'")); if($ds[screens]) { $screens=explode("|", $ds[screens]); if(is_array($screens)) { $filepath = "./images/news-pics/"; foreach($screens as $screen) { if(file_exists($filepath.$screen)) @unlink($filepath.$screen); } } } safe_query("DELETE FROM ".PREFIX."news WHERE newsID='$id'"); safe_query("DELETE FROM ".PREFIX."comments WHERE parentID='$id' AND type='ne'"); } header("Location: index.php?site=news"); } elseif($action=="delete") { include("_mysql.php"); include("_settings.php"); include("_functions.php"); if(!isnewsadmin($userID)) die('No access.'); $id = $_GET['id']; $ds=mysql_fetch_array(safe_query("SELECT screens FROM ".PREFIX."news WHERE newsID='$id'")); if($ds[screens]) { $screens=explode("|", $ds[screens]); if(is_array($screens)) { $filepath = "./images/news-pics/"; foreach($screens as $screen) { if(file_exists($filepath.$screen)) @unlink($filepath.$screen); } } } safe_query("DELETE FROM ".PREFIX."news WHERE newsID='$id'"); safe_query("DELETE FROM ".PREFIX."comments WHERE parentID='$id' AND type='ne'"); if($close) echo''; else header("Location: index.php?site=news"); } elseif($action=="edit") { include("_mysql.php"); include("_settings.php"); include("_functions.php"); if(!isnewsadmin($userID)) die('No access.'); $newsID = $_GET['newsID']; echo' '; $ds=mysql_fetch_array(safe_query("SELECT * FROM ".PREFIX."news WHERE newsID='$newsID'")); $lang=safe_query("SELECT lang, language FROM ".PREFIX."news_languages ORDER BY language"); while($dl=mysql_fetch_array($lang)) { if($dl[lang]==$ds[lang1]) $langs1.=''; else $langs1.=''; if($dl[lang]==$ds[lang2]) $langs2.=''; else $langs2.=''; } $headline1=getinput($ds[headline1]); $message=getinput($ds[content1]); $headline2=getinput($ds[headline2]); $content2=getinput($ds[content2]); $newsrubrics=safe_query("SELECT * FROM ".PREFIX."news_rubrics ORDER BY rubric"); while($dr=mysql_fetch_array($newsrubrics)) { if($ds[rubric]==$dr[rubricID]) $rubrics.=''; else $rubrics.=''; } if($ds[intern]) $intern = ''; else $intern = ''; $link1=$ds[link1]; $link2=$ds[link2]; $link3=$ds[link3]; $link4=$ds[link4]; $url1="http://"; $url2="http://"; $url3="http://"; $url4="http://"; if($ds[url1]!="http://") $url1=$ds[url1]; if($ds[url2]!="http://") $url2=$ds[url2]; if($ds[url3]!="http://") $url3=$ds[url3]; if($ds[url4]!="http://") $url4=$ds[url4]; if($ds[window1]) $window1=' new window _self'; else $window1=' new window _self'; if($ds[window2]) $window2=' new window _self'; else $window2=' new window _self'; if($ds[window3]) $window3=' new window _self'; else $window3=' new window _self'; if($ds[window4]) $window4=' new window _self'; else $window4=' new window _self'; if($ds[picalign]=="left") $align=' left right'; else $align=' left right'; $comments=''; $comments=str_replace('value="'.$ds[comments].'"', 'value="'.$ds[comments].'" selected', $comments); $bg1=BG_1; eval ("\$addbbcode = \"".gettemplate("addbbcode")."\";"); eval ("\$addflags = \"".gettemplate("flags")."\";"); eval ("\$news_edit = \"".gettemplate("news_edit")."\";"); echo $news_edit; } elseif($action=="unpublished") { eval ("\$title_news = \"".gettemplate("title_news")."\";"); echo $title_news; if(isnewsadmin($userID)) $post=''; echo $post.'
'; // Not published News if(isnewsadmin($userID)) { $ergebnis=safe_query("SELECT * FROM ".PREFIX."news WHERE published='0' AND saved='1' ORDER BY date ASC"); if(mysql_num_rows($ergebnis)) { echo'

NOT PUBLISHED NEWS:

'; echo'
'; eval ("\$news_archive_head = \"".gettemplate("news_archive_head")."\";"); echo $news_archive_head; $i=1; while($ds=mysql_fetch_array($ergebnis)) { if($i%2) { $bg1=BG_1; $bg2=BG_2; } else { $bg1=BG_3; $bg2=BG_4; } $date=date("d.m.Y", $ds[date]); $rubric=getrubricname($ds[rubric]); $language1="[flag]".$ds[lang1]."[/flag]"; $language2="[flag]".$ds[lang2]."[/flag]"; if($ds[headline1]) { $langs=''.flags($language1).''; $language=getlanguage($ds[lang1]); $langs = eregi_replace ('(alt=")(.*)(")',"\\1 news in $language\\3",$langs); $headline=''.$ds[headline1].''; } if($ds[headline2]) { $lang2=' '.flags($language2).''; $language=getlanguage($ds[lang2]); $lang2 = eregi_replace ('(alt=")(.*)(")',"\\1 news in $language\\3",$lang2); $langs.=$lang2; $headline.=' - '.$ds[headline2].''; } $poster=''.getnickname($ds[poster]).''; $multiple=''; $admdel=''; if(isnewsadmin($userID)) { $multiple=''; $admdel='
select all
'; } eval ("\$news_archive_content = \"".gettemplate("news_archive_content")."\";"); echo $news_archive_content; $i++; } eval ("\$news_archive_foot = \"".gettemplate("news_archive_foot")."\";"); echo $news_archive_foot; unset($ds); } } } elseif($action=="archive") { eval ("\$title_news = \"".gettemplate("title_news")."\";"); echo $title_news; $page=$_GET['page']; $sort=$_GET['sort']; $type=$_GET['type']; $post=''; $publish=''; if(isnewsadmin($userID)) { $post=''; $unpublished=safe_query("SELECT newsID FROM ".PREFIX."news WHERE published='0' AND saved='1'"); $unpublished=mysql_num_rows($unpublished); if($unpublished) $publish=' '; } echo $post.' '.$publish.'
'; $all=safe_query("SELECT newsID FROM ".PREFIX."news WHERE published='1' AND intern<=".isclanmember($userID)); $all=mysql_num_rows($all); $pages=1; if(!isset($page)) $page = 1; if(!isset($sort)) $sort = "date"; if(!isset($type)) $type = "DESC"; $max = empty($maxnewsarchiv) ? 20 : $maxnewsarchiv; for ($n=$max; $n<=$all; $n+=$max) { if($all>$n) $pages++; } if($pages>1) $page_link = makepagelink("index.php?site=news&action=archive&sort=$sort&type=$type", $page, $pages); if ($page == "1") { $ergebnis = safe_query("SELECT * FROM ".PREFIX."news WHERE published='1' AND intern<=".isclanmember($userID)." ORDER BY $sort $type LIMIT 0,$max"); if($type=="DESC") $n=$gesamt; else $n=1; } else { $start=$page*$max-$max; $ergebnis = safe_query("SELECT * FROM ".PREFIX."news WHERE published='1' AND intern<=".isclanmember($userID)." ORDER BY $sort $type LIMIT $start,$max"); if($type=="DESC") $n = ($gesamt)-$page*$max+$max; else $n = ($gesamt+1)-$page*$max+$max; } if($all) { if($type=="ASC") echo'Sort:    '; else echo'Sort:    '; if($pages>1) echo $page_link; if(isnewsadmin($userID)) echo'
'; eval ("\$news_archive_head = \"".gettemplate("news_archive_head")."\";"); echo $news_archive_head; $i=1; while($ds=mysql_fetch_array($ergebnis)) { if($i%2) { $bg1=BG_1; $bg2=BG_2; } else { $bg1=BG_3; $bg2=BG_4; } $date=date("d.m.Y", $ds[date]); $rubric=getrubricname($ds[rubric]); $language1="[flag]".$ds[lang1]."[/flag]"; $language2="[flag]".$ds[lang2]."[/flag]"; $comms = getanzcomments($ds[newsID], 'ne'); if($ds[headline1]) { $langs=''.flags($language1).''; $language=getlanguage($ds[lang1]); $langs = eregi_replace ('(alt=")(.*)(")',"\\1 news in $language\\3",$langs); $headline=''.getinput($ds[headline1]).''; } if($ds[headline2]) { $lang2=' '.flags($language2).''; $language=getlanguage($ds[lang2]); $lang2 = eregi_replace ('(alt=")(.*)(")',"\\1 news in $language\\3",$lang2); $langs.=$lang2; $headline.=' - '.getinput($ds[headline2]).''; } $poster=''.getnickname($ds[poster]).''; $multiple=''; $admdel=''; if(isnewsadmin($userID)) $multiple=''; eval ("\$news_archive_content = \"".gettemplate("news_archive_content")."\";"); echo $news_archive_content; $i++; } if(isnewsadmin($userID)) $admdel='
select all
'; eval ("\$news_archive_foot = \"".gettemplate("news_archive_foot")."\";"); echo $news_archive_foot; unset($ds); } else echo'no entries'; } else { eval ("\$title_news = \"".gettemplate("title_news")."\";"); echo $title_news; $post=''; $publish=''; if(isnewsadmin($userID)) { $post=''; $unpublished=safe_query("SELECT newsID FROM ".PREFIX."news WHERE published='0' AND saved='1'"); $unpublished=mysql_num_rows($unpublished); if($unpublished) $publish=' '; } echo $post.' '.$publish.'
'; if($_GET['show']) { $result=safe_query("SELECT rubricID FROM ".PREFIX."news_rubrics WHERE rubric='".$_GET['show']."' LIMIT 0,1"); $dv=mysql_fetch_array($result); $showonly = "AND rubric='".$dv[rubricID]."'"; } $result=safe_query("SELECT * FROM ".PREFIX."news WHERE published='1' AND intern<=".isclanmember($userID)." $showonly ORDER BY date DESC LIMIT 0,$maxshownnews"); $i=1; while($ds=mysql_fetch_array($result)) { if($i%2) $bg1=BG_1; else $bg1=BG_2; $date = date("d.m.Y", $ds[date]); $time = date("H:i", $ds[date]); $rubrikname=getrubricname($ds[rubric]); $rubricpic_path = "images/news-rubrics/".getrubricpic($ds[rubric]); $rubricpic=''; echo $rubripic; if(!is_file($rubricpic_path)) $rubricpic=''; $lang=$ds[lang1]; $language1="[flag]".$ds[lang1]."[/flag]"; $language2="[flag]".$ds[lang2]."[/flag]"; if($lang==$ds[lang1]) { if($ds[headline1]) $headline = $ds[headline1]; else $headline = $ds[headline2]; if($ds[content1]) $content = $ds[content1]; else $content='[b]no version in selected language available![/b].[br][br]'.$ds[content2]; if($ds[headline2]) { $langs=''.flags($language2).''; $language=getlanguage($ds[lang2]); $langs = eregi_replace ('(alt=")(.*)(")',"\\1 news in $language\\3",$langs); } else $langs=''; } else { if($ds[headline2]) $headline = $ds[headline2]; else $headline = $ds[headline1]; if($ds[content2]) $content = $ds[content2]; else $content='[b]no version in selected language available![/b].[br][br]'.$ds[content1]; if($ds[headline1]) { $langs=''.flags($language1).''; $language=getlanguage($ds[lang1]); $langs = eregi_replace ('(alt=")(.*)(")',"\\1 news in $language\\3",$langs); } else $langs=''; } $content = htmloutput($content); $content = toggle($content, $ds[newsID]); $poster=''.getnickname($ds[poster]).''; if($ds[link1] && $ds[url1]!="http://" && $ds[window1]) $related.='• '.$ds[link1].' '; if($ds[link1] && $ds[url1]!="http://" && !$ds[window1]) $related.='• '.$ds[link1].' '; if($ds[link2] && $ds[url2]!="http://" && $ds[window2]) $related.='• '.$ds[link2].' '; if($ds[link2] && $ds[url2]!="http://" && !$ds[window2]) $related.='• '.$ds[link2].' '; if($ds[link3] && $ds[url3]!="http://" && $ds[window3]) $related.='• '.$ds[link3].' '; if($ds[link3] && $ds[url3]!="http://" && !$ds[window3]) $related.='• '.$ds[link3].' '; if($ds[link4] && $ds[url4]!="http://" && $ds[window4]) $related.='• '.$ds[link4].' '; if($ds[link4] && $ds[url4]!="http://" && !$ds[window4]) $related.='• '.$ds[link4].' '; if(empty($related)) $related="n/a"; if($ds[comments]) { if($ds[cwID]) { // CLANWAR-NEWS $anzcomments = getanzcomments($ds[cwID], 'cw'); if($anzcomments) $comments='['.$anzcomments.'] comments latest by '.getlastcommentposter($ds[cwID], 'cw').' - '.date("d.m.Y - H:i", getlastcommentdate($ds[cwID], 'cw')); else $comments='[0] comments'; } else { $anzcomments = getanzcomments($ds[newsID], 'ne'); if($anzcomments) $comments='['.$anzcomments.'] comments latest by '.getlastcommentposter($ds[newsID], 'ne').' - '.date("d.m.Y - H:i", getlastcommentdate($ds[newsID], 'ne')); else $comments='[0] comments'; } } else $comments=''; if(isnewsadmin($userID)) $adminaction=' '; else $adminaction=''; eval ("\$news = \"".gettemplate("news")."\";"); echo $news; $i++; unset($related); unset($comments); unset($lang); unset($ds); } } ?>