News

cat = htmlspecialchars(@$_REQUEST['cat']); $news->cattype = htmlspecialchars(@$_REQUEST['cattype']); $news->pri = htmlspecialchars(@$_REQUEST['pri']); $news->pritype = htmlspecialchars(@$_REQUEST['pritype']); $news->newslist = (@$_REQUEST['newslist']) ? true : false; $news->orderby = htmlspecialchars(@$_REQUEST['orderby']); $news->showall = isset($_REQUEST['showall']) ? true : false; $news->nouserfilter = isset($_REQUEST['nouserfilter']) ? true : false; $news->from = $from; $news->to = $to; $news->page = $page; if (!$news->page) $news->page = 1; if ($news->cat === "0") { unset($news->cat); unset($news->cattype); } if (isset($_REQUEST['disableuserfilter'])) $news->nouserfilter = true; if (isset($_POST['add']) && loggedin()) { $news->nick = $_SESSION['in_nick']; $news->pass = $_SESSION['in_pass']; $news->id = $_SESSION['in_id']; $news->catagory = intval($_POST['catagory']); $news->priority = intval($_POST['priority']); $news->headline = htmlspecialchars($_POST['headline']); $news->body = htmlspecialchars($_POST['body']); $news->date_day = intval($_POST['date_day']); $news->date_month = intval($_POST['date_month']); $news->date_year = intval($_POST['date_year']); $news->date_time = htmlspecialchars($_POST['date_time']); $news->author = htmlspecialchars($_POST['author']); $news->from = htmlspecialchars($_POST['from']); $news->to = htmlspecialchars($_POST['to']); $news->cat = htmlspecialchars($_POST['cat']); $news->cattype = htmlspecialchars($_POST['cattype']); $news->pri = htmlspecialchars($_POST['pri']); $news->pritype = htmlspecialchars($_POST['pritype']); $news->page = htmlspecialchars($_POST['page']); if (!$news->check() || !$news->checkaddpriv() || !$news->checkkuski()) { printerrors($news->error); $news->printaddform(); newsexit(); } else { if (!$news->addnews()) printerrors($news->errors); else { if ($newsHTML['AnnounceOnAdd']) newsexit( str_replace(array("[[[phpself]]]", "[[[phpselfdata]]]"), array($phpself, $phpself.$news->getdataurl()."&page=".$news->page), $newsHTML['AddAnnouncement']) ); else { print $newsHTML['NewsAdded']; $news->printnews(); newsexit(); } } } } if (isset($_POST['edit']) && loggedin()) { $news->nick = $_POST['in_nick']; $news->pass = $_POST['in_pass']; $news->catagory = htmlspecialchars($_POST['catagory']); $news->priority = htmlspecialchars($_POST['priority']); $news->headline = htmlspecialchars($_POST['headline']); $news->body = htmlspecialchars($_POST['body']); $news->id = htmlspecialchars($_POST['id']); $news->date_day = htmlspecialchars($_POST['date_day']); $news->date_month = htmlspecialchars($_POST['date_month']); $news->date_year = htmlspecialchars($_POST['date_year']); $news->date_time = htmlspecialchars($_POST['date_time']); $news->author = htmlspecialchars($_POST['author']); if (!$news->checkkuski() || !$news->checkeditpriv()) { printerrors($news->error); //$news->printnews(); newsexit(); } else { if ($news->editnews()) { if ($newsHTML['AnnounceOnEdit']) newsexit( str_replace(array("[[[phpself]]]", "[[[phpselfdata]]]"), array($phpself, $phpself.$news->getdataurl()."&page=".$news->page), $newsHTML['EditAnnouncement']) ); else { unset($news->nick, $news->pass, $news->catagory, $news->priority, $news->headline, $news->body, $news->id); $news->printnews(); newsexit(); } } else { printerrors($news->error); $news->printeditform(); newsexit(); } } } if (isset($_REQUEST['editing']) && loggedin()) { $news->nick = $in_nick; $news->pass = $in_pass; $news->id = $id; $news->getnewsdata(); if (!$news->checknewsid() && !$news->checkeditpriv()) // && is intentional, most likely { printerrors($news->error); $id = "show"; newsexit(); } else { if ($_POST['action'] == "del" || $_GET['action'] == "del") { if (!$_POST['confirmdelete']) { print str_replace(array("[[[PHP_SELF]]]", "[[[newsid]]]"), array($PHP_SELF, $id), $newsHTML['ConfirmDeleteNews']); } else { $news->delnews(); if ($newsHTML['AnnounceOnDelete']) newsexit( str_replace(array("[[[phpself]]]", "[[[phpselfdata]]]"), array($phpself, $phpself.$news->getdataurl()."&page=".$news->page), $newsHTML['DeleteAnnouncement']) ); else { unset($news->nick, $news->pass, $news->catagory, $news->priority, $news->headline, $news->body, $news->id); $news->printnews(); newsexit(); } } } if ($_POST['action'] == "edit" || $_GET['action'] == "edit") { $news->printeditform(); newsexit('', true); } } } if ($id == "add") { if (!loggedin() || (loggedin() && !$news->checkaddpriv("_all_", end($prioritynames)))) print $newsHTML['addNot']; else $news->printaddform(); } if ($id == "show") { if ($news->newslist) $news->printnewslist(); else $news->printnews(); } if ($id == "newslist") { $news->printnewslist(); } if ($id == "edit") { $news->printloginform(); } newsexit(); function NewsRightSide() { global $menu, $news, $newsHTML; ?>
>

¬ Temporary filters

phpself) list($cleanself) = explode("?", $PHP_SELF); else list($cleanself) = explode("?", $news->phpself); $catform = $news->catform(); $priform = $news->priform(); $tmp = ''; if ($news->nouserfilter || !isset($_REQUEST['cat'])) $tmp = 'checked="checked"'; print str_replace(array("[[[phpself]]]", "[[[catform]]]", "[[[priform]]]", "[[[checked]]]"), array($cleanself, $catform, $priform, $tmp), $newsHTML['NewsPageLeft']); ?>

¬ Archive

from, $news->to); $m = date("Y"); if ($m < 2005) $m = 2005; for($n=$m; $n>=1998; $n--) { $news->from = "01-01-".$n; $news->to = "31-12-".$n; print "getdataurl()."\">".$n.""; if ($n != 1998) print ","; print "\r\n"; } list($news->from, $news->to) = $tmp; ?>


>

¬ BBcode