'; 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'