(60*60)) safe_query("DELETE FROM ".PREFIX."articles WHERE articlesID='$ds[articlesID]'"); } echo''; } elseif($_GET['delete']) { include("_mysql.php"); include("_settings.php"); include("_functions.php"); if(!isnewsadmin($userID)) die('no access!'); $ds=mysql_fetch_array(safe_query("SELECT screens FROM ".PREFIX."articles WHERE articlesID='".$_GET['articlesID']."'")); if($ds[screens]) { $screens=explode("|", $ds[screens]); if(is_array($screens)) { $filepath = "./images/articles-pics/"; foreach($screens as $screen) { if(file_exists($filepath.$screen)) @unlink($filepath.$screen); } } } safe_query("DELETE FROM ".PREFIX."articles WHERE articlesID='".$_GET['articlesID']."'"); safe_query("DELETE FROM ".PREFIX."comments WHERE parentID='".$_GET['articlesID']."' AND type='ar'"); if($close) echo''; else header("Location: index.php?site=articles"); } function top5() { $pagebg=PAGEBG; $border=BORDER; $bghead=BGHEAD; $bgcat=BGCAT; echo''; unset($ratingpic); $n++; } echo'
'; // RATING $ergebnis=safe_query("SELECT * FROM ".PREFIX."articles WHERE saved='1' ORDER BY rating DESC LIMIT 0,5"); $top='TOP 5 ARTICLES (rating)'; eval ("\$top5_head = \"".gettemplate("top5_head")."\";"); echo $top5_head; $n=1; while($ds=mysql_fetch_array($ergebnis)) { if($n%2) { $bg1=BG_1; $bg2=BG_2; } else { $bg1=BG_3; $bg2=BG_4; } $title=''.clearfromtags($ds[title]).''; $poster=''.getnickname($ds[poster]).''; $viewed='('.$ds[viewed].')'; $ratings=array(0,0,0,0,0,0,0,0,0,0); for($i=0; $i<$ds[rating]; $i++) { $ratings[$i]=1; } $ratingpic=''; foreach($ratings as $pic) { $ratingpic.=''; } echo'
'.$n.'. '.$ratingpic.' '.$title.'
'; echo' '; // POINTS $ergebnis=safe_query("SELECT * FROM ".PREFIX."articles WHERE saved='1' ORDER BY points DESC LIMIT 0,5"); $top='TOP 5 ARTICLES (points)'; eval ("\$top5_head = \"".gettemplate("top5_head")."\";"); echo $top5_head; $n=1; while($ds=mysql_fetch_array($ergebnis)) { $title=''.clearfromtags($ds[title]).''; $viewed='('.$ds[viewed].')'; echo' '.$n.'. '.$ds[points].' '.$title.' '; $n++; } echo'
'; } if($_GET['action']=="new") { include("_mysql.php"); include("_settings.php"); include("_functions.php"); $pagebg=PAGEBG; $border=BORDER; $bghead=BGHEAD; $bgcat=BGCAT; echo' '; if(isnewsadmin($userID)) { safe_query("INSERT INTO ".PREFIX."articles ( date, poster, saved ) VALUES( '".time()."', '$userID', '0' ) "); $articlesID=mysql_insert_id(); $bg1=BG_1; eval ("\$addbbcode = \"".gettemplate("addbbcode")."\";"); eval ("\$addflags = \"".gettemplate("flags")."\";"); eval ("\$articles_post = \"".gettemplate("articles_post")."\";"); echo $articles_post; } else redirect('index.php?site=articles', 'no access!'); } elseif($_GET['action']=="edit") { include("_mysql.php"); include("_settings.php"); include("_functions.php"); $articlesID = $_GET['articlesID']; $pagebg=PAGEBG; $border=BORDER; $bghead=BGHEAD; $bgcat=BGCAT; echo' '; if(isnewsadmin($userID)) { $ds=mysql_fetch_array(safe_query("SELECT * FROM ".PREFIX."articles WHERE articlesID='$articlesID'")); $title=getinput($ds[title]); $message=getinput($ds[content]); $link1=getinput($ds[link1]); $link2=getinput($ds[link2]); $link3=getinput($ds[link3]); $link4=getinput($ds[link4]); $url1=getinput($ds[url1]); $url2=getinput($ds[url2]); $url3=getinput($ds[url3]); $url4=getinput($ds[url4]); if($ds[window1]) $window1=' new window _blank'; else $window1=' new window _self'; if($ds[window2]) $window2=' new window _blank'; else $window2=' new window _self'; if($ds[window3]) $window3=' new window _blank'; else $window3=' new window _self'; if($ds[window4]) $window4=' new window _blank'; else $window4=' new window _self'; $comments=''; $comments=str_replace('value="'.$ds[comments].'"', 'value="'.$ds[comments].'" selected', $comments); $bg1=BG_1; eval ("\$addbbcode = \"".gettemplate("addbbcode")."\";"); eval ("\$addflags = \"".gettemplate("flags")."\";"); eval ("\$articles_edit = \"".gettemplate("articles_edit")."\";"); echo $articles_edit; } else redirect('index.php?site=articles', 'no access!'); } elseif($_GET['action']=="show") { eval ("\$title_articles = \"".gettemplate("title_articles")."\";"); echo $title_articles; $articlesID = $_GET['articlesID']; if(isnewsadmin($userID)) echo' '; echo'

'; safe_query("UPDATE ".PREFIX."articles SET viewed=viewed+1 WHERE articlesID='$articlesID'"); $result=safe_query("SELECT * FROM ".PREFIX."articles WHERE articlesID='$articlesID'"); if(mysql_num_rows($result)) { $ds=mysql_fetch_array($result); $date = date("d.m.Y", $ds[date]); $time = date("H:i", $ds[date]); $title = clearfromtags($ds[title]); $content = htmloutput($ds[content]); $content = toggle($content, $ds[articlesID]); $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"; $comments_allowed = $ds[comments]; $ratings=array(0,0,0,0,0,0,0,0,0,0); for($i=0; $i<$ds[rating]; $i++) { $ratings[$i]=1; } $ratingpic=''; foreach($ratings as $pic) { $ratingpic.=''; } if(isnewsadmin($userID)) $adminaction='

'; else $adminaction=''; if($loggedin) { $getarticles=safe_query("SELECT articles FROM ".PREFIX."user WHERE userID='$userID'"); $found=false; if(mysql_num_rows($getarticles)) { $ga=mysql_fetch_array($getarticles); if($ga[articles]!="") { $string=$ga[articles]; $array=explode(":", $string); $anzarray=count($array); for($i=0; $i<$anzarray; $i++) { if($array[$i]==$articlesID) $found=true; } } } if($found) $rateform="You already rated this article."; else $rateform='
(rate with 0-10 points)
'; } else $rateform="
To rate this article you have to be registered and logged in!"; $bg1=BG_1; eval ("\$articles = \"".gettemplate("articles")."\";"); echo $articles; unset($related); unset($comments); unset($lang); unset($ds); unset($ratingpic); $parentID = $articlesID; $type = "ar"; $referer = "index.php?site=articles&action=show&articlesID=$articlesID"; include("comments.php"); } else echo'no entries!'; } else { $page = $_GET['page']; $sort = $_GET['sort']; $type = $_GET['type']; eval ("\$title_articles = \"".gettemplate("title_articles")."\";"); echo $title_articles; if(isnewsadmin($userID)) echo'

'; $alle=safe_query("SELECT articlesID FROM ".PREFIX."articles WHERE saved='1'"); $gesamt = mysql_num_rows($alle); $pages=1; if(!isset($page)) $page = 1; if(!isset($sort)) $sort = "date"; if(!isset($type)) $type = "DESC"; $max=$maxarticles; for ($n=$max; $n<=$gesamt; $n+=$max) { if($gesamt>$n) $pages++; } if($pages>1) $page_link = makepagelink("index.php?site=articles&sort=$sort&type=$type", $page, $pages); if ($page == "1") { $ergebnis = safe_query("SELECT * FROM ".PREFIX."articles WHERE saved='1' 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."articles WHERE saved='1' ORDER BY $sort $type LIMIT $start,$max"); if($type=="DESC") $n = ($gesamt)-$page*$max+$max; else $n = ($gesamt+1)-$page*$max+$max; } if($gesamt) { top5(); if($type=="ASC") echo'Sort:    '; else echo'Sort:    '; if($pages>1) echo $page_link; echo'

'; eval ("\$articles_head = \"".gettemplate("articles_head")."\";"); echo $articles_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]); $title=''.clearfromtags($ds[title]).''; $poster=''.getnickname($ds[poster]).''; $viewed='('.$ds[viewed].')'; $ratings=array(0,0,0,0,0,0,0,0,0,0); for($i=0; $i<$ds[rating]; $i++) { $ratings[$i]=1; } $ratingpic=''; foreach($ratings as $pic) { $ratingpic.=''; } eval ("\$articles_content = \"".gettemplate("articles_content")."\";"); echo $articles_content; unset($ratingpic); $i++; } eval ("\$articles_foot = \"".gettemplate("articles_foot")."\";"); echo $articles_foot; unset($ds); } else echo'no entries'; } ?>