sql_query("select radminarticle, radminsuper from ".$prefix."_authors where aid='$aid'"); list($radminarticle, $radminsuper) = $db->sql_fetchrow($result); if (($radminarticle==1) OR ($radminsuper==1)) { /*********************************************************/ /* Story/News Functions */ /*********************************************************/ function puthome($ihome, $acomm) { echo "
"._PUBLISHINHOME."  "; if (($ihome == 0) OR ($ihome == "")) { $sel1 = "checked"; $sel2 = ""; } if ($ihome == 1) { $sel1 = ""; $sel2 = "checked"; } echo ""._YES." " .""._NO."" ."  [ "._ONLYIFCATSELECTED." ]
"; echo "
"._ACTIVATECOMMENTS."  "; if (($acomm == 0) OR ($acomm == "")) { $sel1 = "checked"; $sel2 = ""; } if ($acomm == 1) { $sel1 = ""; $sel2 = "checked"; } echo ""._YES." " .""._NO."

"; } function deleteStory($qid) { global $prefix, $db; $result = $db->sql_query("delete from ".$prefix."_queue where qid=$qid"); if (!$result) { return; } Header("Location: system.php?op=submissions"); } function SelectCategory($cat) { global $prefix, $db; $selcat = $db->sql_query("select catid, title from ".$prefix."_stories_cat order by title"); $a = 1; echo ""._CATEGORY." "; echo " [ "._ADD." | "._EDIT." | "._DELETE." ]"; } function putpoll($pollTitle, $optionText) { OpenTable(); echo "
"._ATTACHAPOLL."
" .""._LEAVEBLANKTONOTATTACH."
" ."

"._POLLTITLE.":

" .""._POLLEACHFIELD."
" .""; for($i = 1; $i <= 12; $i++) { echo "" ."" .""; } echo "
"._OPTION." $i:
"; CloseTable(); } function AddCategory () { include ("header.php"); GraphicAdmin(); OpenTable(); echo "
"._CATEGORIESADMIN."
"; CloseTable(); echo "
"; OpenTable(); echo "
"._CATEGORYADD."


" ."
" .""._CATNAME.": " ." " ."" ."" ."
"; CloseTable(); include("footer.php"); } function EditCategory($catid) { global $prefix, $db; $result = $db->sql_query("select title from ".$prefix."_stories_cat where catid='$catid'"); list($title) = $db->sql_fetchrow($result); include ("header.php"); GraphicAdmin(); OpenTable(); echo "
"._CATEGORIESADMIN."
"; CloseTable(); echo "
"; OpenTable(); echo "
"._EDITCATEGORY."
"; if (!$catid) { $selcat = $db->sql_query("select catid, title from ".$prefix."_stories_cat"); echo "
"; echo ""._ASELECTCATEGORY.""; echo ""; echo ""; echo "

"; echo ""._NOARTCATEDIT.""; } else { echo ""; echo ""._CATEGORYNAME.": "; echo " "; echo ""; echo ""; echo "

"; echo ""._NOARTCATEDIT.""; echo "
"; } echo "
"; CloseTable(); include("footer.php"); } function DelCategory($cat) { global $prefix, $db; $result = $db->sql_query("select title from ".$prefix."_stories_cat where catid='$cat'"); list($title) = $db->sql_fetchrow($result); include ("header.php"); GraphicAdmin(); OpenTable(); echo "
"._CATEGORIESADMIN."
"; CloseTable(); echo "
"; OpenTable(); echo "
"._DELETECATEGORY."
"; if (!$cat) { $selcat = $db->sql_query("select catid, title from ".$prefix."_stories_cat"); echo "
" .""._SELECTCATDEL.": " ."" ."" ."" ."
"; } else { $result2 = $db->sql_query("select * from ".$prefix."_stories where catid='$cat'"); $numrows = $db->sql_numrows($result2); if ($numrows == 0) { $db->sql_query("delete from ".$prefix."_stories_cat where catid='$cat'"); echo "

"._CATDELETED."

"._GOTOADMIN.""; } else { echo "

"._WARNING.": "._THECATEGORY." $title "._HAS." $numrows "._STORIESINSIDE."
" .""._DELCATWARNING1."
" .""._DELCATWARNING2."

" .""._DELCATWARNING3."

" ."[ "._YESDEL." | " .""._NOMOVE." ]"; } } echo "
"; CloseTable(); include("footer.php"); } function YesDelCategory($catid) { global $prefix, $db; $db->sql_query("delete from ".$prefix."_stories_cat where catid='$catid'"); $result = $db->sql_query("select sid from ".$prefix."_stories where catid='$catid'"); while(list($sid) = $db->sql_fetchrow($result)) { $db->sql_query("delete from ".$prefix."_stories where catid='$catid'"); $db->sql_query("delete from ".$prefix."_comments where sid='$sid'"); } Header("Location: system.php"); } function NoMoveCategory($catid, $newcat) { global $prefix, $db; $result = $db->sql_query("select title from ".$prefix."_stories_cat where catid='$catid'"); list($title) = $db->sql_fetchrow($result); include ("header.php"); GraphicAdmin(); OpenTable(); echo "
"._CATEGORIESADMIN."
"; CloseTable(); echo "
"; OpenTable(); echo "
"._MOVESTORIES."

"; if (!$newcat) { echo ""._ALLSTORIES." $title "._WILLBEMOVED."

"; $selcat = $db->sql_query("select catid, title from ".$prefix."_stories_cat"); echo "
"; echo ""._SELECTNEWCAT.": "; echo ""; echo ""; echo ""; echo ""; echo "
"; } else { $resultm = $db->sql_query("select sid from ".$prefix."_stories where catid='$catid'"); while(list($sid) = $db->sql_fetchrow($resultm)) { $db->sql_query("update ".$prefix."_stories set catid='$newcat' where sid='$sid'"); } $db->sql_query("delete from ".$prefix."_stories_cat where catid='$catid'"); echo ""._MOVEDONE.""; } CloseTable(); include("footer.php"); } function SaveEditCategory($catid, $title) { global $prefix, $db; $title = ereg_replace("\"","",$title); $check = $db->sql_query("select catid from ".$prefix."_stories_cat where title=$title"); if ($check) { $what1 = _CATEXISTS; $what2 = _GOBACK; } else { $what1 = _CATSAVED; $what2 = "[ "._GOTOADMIN." ]"; $result = $db->sql_query("update ".$prefix."_stories_cat set title='$title' where catid='$catid'"); if (!$result) { return; } } include ("header.php"); GraphicAdmin(); OpenTable(); //echo "
"._CATEGORIESADMIN."
"; echo "
"; CloseTable(); echo "
"; OpenTable(); echo "
$what1

"; echo "$what2
"; CloseTable(); include("footer.php"); } function SaveCategory($title) { global $prefix, $db; $title = ereg_replace("\"","",$title); $check = $db->sql_query("select catid from ".$prefix."_stories_cat where title=$title"); if ($check) { $what1 = _CATEXISTS; $what2 = _GOBACK; } else { $what1 = _CATADDED; $what2 = _GOTOADMIN; $result = $db->sql_query("insert into ".$prefix."_stories_cat values (NULL, '$title', '0')"); if (!$result) { return; } } include ("header.php"); GraphicAdmin(); OpenTable(); //echo "
"._CATEGORIESADMIN."
"; echo "
"; CloseTable(); echo "
"; OpenTable(); echo "
$what1

"; echo "$what2
"; CloseTable(); include("footer.php"); } function autodelete($anid) { global $prefix, $db; $db->sql_query("delete from ".$prefix."_autonews where anid=$anid"); Header("Location: system.php?op=adminMain"); } function autoEdit($anid) { global $aid, $bgcolor1, $bgcolor2, $prefix, $db, $multilingual; $result = $db->sql_query("select radminarticle, radminsuper from ".$prefix."_authors where aid='$aid'"); list($radminarticle, $radminsuper) = $db->sql_fetchrow($result); $result2 = $db->sql_query("select aid from ".$prefix."_stories where sid='$sid'"); list($aaid) = $db->sql_fetchrow($result2); if (($radminarticle == 1) AND ($aaid == $aid) OR ($radminsuper == 1)) { include ("header.php"); $result = $db->sql_query("select catid, aid, title, time, hometext, bodytext, topic, informant, notes, ihome, alanguage, acomm from ".$prefix."_autonews where anid=$anid"); list($catid, $aid, $title, $time, $hometext, $bodytext, $topic, $informant, $notes, $ihome, $alanguage, $acomm) = $db->sql_fetchrow($result); ereg ("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $time, $datetime); GraphicAdmin(); OpenTable(); echo "
"._ARTICLEADMIN."
"; CloseTable(); echo "
"; OpenTable(); $today = getdate(); $tday = $today[mday]; if ($tday < 10){ $tday = "0$tday"; } $tmonth = $today[month]; $tyear = $today[year]; $thour = $today[hours]; if ($thour < 10){ $thour = "0$thour"; } $tmin = $today[minutes]; if ($tmin < 10){ $tmin = "0$tmin"; } $tsec = $today[seconds]; if ($tsec < 10){ $tsec = "0$tsec"; } $date = "$tmonth $tday, $tyear @ $thour:$tmin:$tsec"; echo "
"._AUTOSTORYEDIT."


" ."
"; $title = stripslashes($title); $hometext = stripslashes($hometext); $bodytext = stripslashes($bodytext); $notes = stripslashes($notes); $result=$db->sql_query("select topicimage from ".$prefix."_topics where topicid=$topic"); list($topicimage) = $db->sql_fetchrow($result); echo "
" ."
" .""; themepreview($title, $hometext, $bodytext); echo "
" ."

"._TITLE."
" ."

" .""._TOPIC."

"; $cat = $catid; SelectCategory($cat); echo "
"; puthome($ihome, $acomm); if ($multilingual == 1) { echo "
"._LANGUAGE.": " .""; } else { echo ""; } echo "

"._STORYTEXT."
" ."

" .""._EXTENDEDTEXT."
" ."
" .""._ARESUREURL."

"; if ($aid != $informant) { echo ""._NOTES."


"; } echo "
"._CHNGPROGRAMSTORY."

" .""._NOWIS.": $date

"; $xday = 1; echo ""._DAY.": "; $xmonth = 1; echo ""._UMONTH.": "; echo ""._YEAR.": "; echo "
"._HOUR.": "; echo ": "; echo ": 00

"; CloseTable(); include ('footer.php'); } else { include ('header.php'); GraphicAdmin(); OpenTable(); //echo "
"._ARTICLEADMIN."
"; echo "
"; CloseTable(); echo "
"; OpenTable(); echo "
"._NOTAUTHORIZED1."

" .""._NOTAUTHORIZED2."

" .""._GOBACK.""; CloseTable(); include("footer.php"); } } function autoSaveEdit($anid, $year, $day, $month, $hour, $min, $title, $hometext, $bodytext, $topic, $notes, $catid, $ihome, $alanguage, $acomm) { global $aid, $ultramode, $prefix, $db; $result = $db->sql_query("select radminarticle, radminsuper from ".$prefix."_authors where aid='$aid'"); list($radminarticle, $radminsuper) = $db->sql_fetchrow($result); $result2 = $db->sql_query("select aid from ".$prefix."_stories where sid='$sid'"); list($aaid) = $db->sql_fetchrow($result2); if (($radminarticle == 1) AND ($aaid == $aid) OR ($radminsuper == 1)) { if ($day < 10) { $day = "0$day"; } if ($month < 10) { $month = "0$month"; } $sec = "00"; $date = "$year-$month-$day $hour:$min:$sec"; $title = stripslashes(FixQuotes($title)); $hometext = stripslashes(FixQuotes($hometext)); $bodytext = stripslashes(FixQuotes($bodytext)); $notes = stripslashes(FixQuotes($notes)); $result = $db->sql_query("update ".$prefix."_autonews set catid='$catid', title='$title', time='$date', hometext='$hometext', bodytext='$bodytext', topic='$topic', notes='$notes', ihome='$ihome', alanguage='$alanguage', acomm='$acomm' where anid=$anid"); if (!$result) { exit(); } if ($ultramode) { ultramode(); } Header("Location: system.php?op=adminMain"); } else { include ('header.php'); GraphicAdmin(); OpenTable(); //echo "
"._ARTICLEADMIN."
"; echo "
"; CloseTable(); echo "
"; OpenTable(); echo "
"._NOTAUTHORIZED1."

" .""._NOTAUTHORIZED2."

" .""._GOBACK.""; CloseTable(); include("footer.php"); } } function displayStory($qid) { global $user, $subject, $story, $bgcolor1, $bgcolor2, $anonymous, $prefix, $db, $multilingual; include ('header.php'); GraphicAdmin(); OpenTable(); echo "
"._SUBMISSIONSADMIN."
"; CloseTable(); echo "
"; $today = getdate(); $tday = $today[mday]; if ($tday < 10){ $tday = "0$tday"; } $tmonth = $today[month]; $ttmon = $today[mon]; if ($ttmon < 10){ $ttmon = "0$ttmon"; } $tyear = $today[year]; $thour = $today[hours]; if ($thour < 10){ $thour = "0$thour"; } $tmin = $today[minutes]; if ($tmin < 10){ $tmin = "0$tmin"; } $tsec = $today[seconds]; if ($tsec < 10){ $tsec = "0$tsec"; } $date = "$tmonth $tday, $tyear @ $thour:$tmin:$tsec"; $result = $db->sql_query("SELECT qid, uid, uname, subject, story, storyext, topic, alanguage FROM ".$prefix."_queue where qid=$qid"); list($qid, $uid, $uname, $subject, $story, $storyext, $topic, $alanguage) = $db->sql_fetchrow($result); $subject = stripslashes($subject); $story = stripslashes($story); $storyext = stripslashes($storyext); OpenTable(); echo "" ."
" .""._NAME."
" .""; if ($uname != $anonymous) { $res = $db->sql_query("select email from ".$prefix."_users where uname='$uname'"); list($email) = $db->sql_fetchrow($res); echo "  [ Email User | Send Private Message ]"; } echo "

"._TITLE."
" ."

"; if($topic=="") { $topic = 1; } $result = $db->sql_query("select topicimage from ".$prefix."_topics where topicid=$topic"); list($topicimage) = $db->sql_fetchrow($result); echo "
" ."
" ."\"\""; $storypre = "$story

$storyext"; themepreview($subject, $storypre); echo "
" ."
"._TOPIC." "; echo "

"; SelectCategory($cat); echo "
"; puthome($ihome, $acomm); if ($multilingual == 1) { echo "
"._LANGUAGE.": " .""; } else { echo ""; } echo "

"._STORYTEXT."
" ."

" .""._EXTENDEDTEXT."
" ."
" .""._AREYOUSURE."

" .""._NOTES."
" ."
" ."" ."" ."
"._PROGRAMSTORY."  " .""._YES."   " .""._NO."

" .""._NOWIS.": $date

"; $day = 1; echo ""._DAY.": "; $month = 1; echo ""._UMONTH.": "; $date = getdate(); $year = $date[year]; echo ""._YEAR.": "; echo "
"._HOUR.": "; echo ": "; echo ": 00

" ."" ."    [ "._DELETE." ]"; CloseTable(); echo "
"; putpoll($pollTitle, $optionText); echo "
"; include ('footer.php'); } function previewStory($automated, $year, $day, $month, $hour, $min, $qid, $uid, $author, $subject, $hometext, $bodytext, $topic, $notes, $catid, $ihome, $alanguage, $acomm, $pollTitle, $optionText) { global $user, $boxstuff, $anonymous, $bgcolor1, $bgcolor2, $prefix, $db, $multilingual; include ('header.php'); GraphicAdmin(); OpenTable(); //echo "
"._ARTICLEADMIN."
"; echo "
"; CloseTable(); echo "
"; $today = getdate(); $tday = $today[mday]; if ($tday < 10){ $tday = "0$tday"; } $tmonth = $today[month]; $tyear = $today[year]; $thour = $today[hours]; if ($thour < 10){ $thour = "0$thour"; } $tmin = $today[minutes]; if ($tmin < 10){ $tmin = "0$tmin"; } $tsec = $today[seconds]; if ($tsec < 10){ $tsec = "0$tsec"; } $date = "$tmonth $tday, $tyear @ $thour:$tmin:$tsec"; $subject = stripslashes($subject); $hometext = stripslashes($hometext); $bodytext = stripslashes($bodytext); $notes = stripslashes($notes); OpenTable(); echo "" ."
" .""._NAME."
" .""; if ($author != $anonymous) { $res = $db->sql_query("select email from ".$prefix."_users where uname='$author'"); list($email) = $db->sql_fetchrow($res); echo "  [ Email User | Send Private Message ]"; } echo "

"._TITLE."
" ."

"; $result = $db->sql_query("select topicimage from ".$prefix."_topics where topicid=$topic"); list($topicimage) = $db->sql_fetchrow($result); echo "
" ."
" .""; themepreview($subject, $hometext, $bodytext, $notes); echo "
" ."
"._TOPIC." "; echo "

"; $cat = $catid; SelectCategory($cat); echo "
"; puthome($ihome, $acomm); if ($multilingual == 1) { echo "
"._LANGUAGE.": " .""; } else { echo ""; } echo "

"._STORYTEXT."
" ."

" .""._EXTENDEDTEXT."
" ."
" .""._AREYOUSURE."

" .""._NOTES."
" ."

" ."" .""; if ($automated == 1) { $sel1 = "checked"; $sel2 = ""; } else { $sel1 = ""; $sel2 = "checked"; } echo ""._PROGRAMSTORY."  " .""._YES."   " .""._NO."

" .""._NOWIS.": $date

"; $xday = 1; echo ""._DAY.": "; $xmonth = 1; echo ""._UMONTH.": "; echo ""._YEAR.": "; echo "
"._HOUR.": "; echo ": "; echo ": 00

" ."" .""; CloseTable(); echo "
"; putpoll($pollTitle, $optionText); echo "
"; include ('footer.php'); } function postStory($automated, $year, $day, $month, $hour, $min, $qid, $uid, $author, $subject, $hometext, $bodytext, $topic, $notes, $catid, $ihome, $alanguage, $acomm, $pollTitle, $optionText) { global $aid, $ultramode, $prefix, $db; if ($automated == 1) { if ($day < 10) { $day = "0$day"; } if ($month < 10) { $month = "0$month"; } $sec = "00"; $date = "$year-$month-$day $hour:$min:$sec"; if ($uid == 1) $author = ""; if ($hometext == $bodytext) $bodytext = ""; $subject = stripslashes(FixQuotes($subject)); $hometext = stripslashes(FixQuotes($hometext)); $bodytext = stripslashes(FixQuotes($bodytext)); $notes = stripslashes(FixQuotes($notes)); $result = $db->sql_query("insert into ".$prefix."_autonews values (NULL, '$catid', '$aid', '$subject', '$date', '$hometext', '$bodytext', '$topic', '$author', '$notes', '$ihome', '$alanguage', '$acomm')"); if (!$result) { return; } if ($uid == 1) { } else { $db->sql_query("update ".$prefix."_users set counter=counter+1 where uid='$uid'"); } $db->sql_query("update ".$prefix."_authors set counter=counter+1 where aid='$aid'"); if ($ultramode) { ultramode(); } $db->sql_query("delete from ".$prefix."_queue where qid=$qid"); Header("Location: system.php?op=submissions"); } else { if ($uid == 1) $author = ""; if ($hometext == $bodytext) $bodytext = ""; $subject = stripslashes(FixQuotes($subject)); $hometext = stripslashes(FixQuotes($hometext)); $bodytext = stripslashes(FixQuotes($bodytext)); $notes = stripslashes(FixQuotes($notes)); if (($pollTitle != "") AND ($optionText[1] != "") AND ($optionText[2] != "")) { $haspoll = 1; $timeStamp = time(); $pollTitle = FixQuotes($pollTitle); if(!$db->sql_query("INSERT INTO ".$prefix."_poll_desc VALUES (NULL, '$pollTitle', '$timeStamp', 0, '$alanguage', '0')")) { return; } $object = $db->sql_fetchrow($db->sql_query("SELECT pollID FROM ".$prefix."_poll_desc WHERE pollTitle='$pollTitle'")); $id = $object["pollID"]; for($i = 1; $i <= sizeof($optionText); $i++) { if($optionText[$i] != "") { $optionText[$i] = FixQuotes($optionText[$i]); } if(!$db->sql_query("INSERT INTO ".$prefix."_poll_data (pollID, optionText, optionCount, voteID) VALUES ($id, '$optionText[$i]', 0, $i)")) { return; } } } else { $haspoll = 0; $id = 0; } $result = $db->sql_query("insert into ".$prefix."_stories values (NULL, '$catid', '$aid', '$subject', now(), '$hometext', '$bodytext', '0', '0', '$topic', '$author', '$notes', '$ihome', '$alanguage', '$acomm', '$haspoll', '$id', '0', '0')"); $result = $db->sql_query("select sid from ".$prefix."_stories WHERE title='$subject' order by time DESC limit 0,1"); list($artid) = $db->sql_fetchrow($result); $db->sql_query("UPDATE ".$prefix."_poll_desc SET artid='$artid' WHERE pollID='$id'"); if (!$result) { return; } if ($uid == 1) { } else { $db->sql_query("update ".$prefix."_users set counter=counter+1 where uid='$uid'"); } $db->sql_query("update ".$prefix."_authors set counter=counter+1 where aid='$aid'"); if ($ultramode) { ultramode(); } deleteStory($qid); } } function editStory($sid) { global $user, $bgcolor1, $bgcolor2, $aid, $prefix, $db, $multilingual; $result = $db->sql_query("select radminarticle, radminsuper from ".$prefix."_authors where aid='$aid'"); list($radminarticle, $radminsuper) = $db->sql_fetchrow($result); $result2 = $db->sql_query("select aid from ".$prefix."_stories where sid='$sid'"); list($aaid) = $db->sql_fetchrow($result2); if (($radminarticle == 1) AND ($aaid == $aid) OR ($radminsuper == 1)) { include ('header.php'); GraphicAdmin(); OpenTable(); //echo "
"._ARTICLEADMIN."
"; echo "
"; CloseTable(); echo "
"; $result = $db->sql_query("SELECT catid, title, hometext, bodytext, topic, notes, ihome, alanguage, acomm FROM ".$prefix."_stories where sid=$sid"); list($catid, $subject, $hometext, $bodytext, $topic, $notes, $ihome, $alanguage, $acomm) = $db->sql_fetchrow($result); $subject = stripslashes($subject); $hometext = stripslashes($hometext); $bodytext = stripslashes($bodytext); $notes = stripslashes($notes); $result2=$db->sql_query("select topicimage from ".$prefix."_topics where topicid=$topic"); list($topicimage) = $db->sql_fetchrow($result2); OpenTable(); echo "
"._EDITARTICLE."

" ."
" ."
" .""; themepreview($subject, $hometext, $bodytext, $notes); echo "


" ."
" .""._TITLE."
" ."

" .""._TOPIC." "; echo "

"; $cat = $catid; SelectCategory($cat); echo "
"; puthome($ihome, $acomm); if ($multilingual == 1) { echo "
"._LANGUAGE.":" .""; } else { echo ""; } echo "

"._STORYTEXT."
" ."

" .""._EXTENDEDTEXT."
" ."
" .""._AREYOUSURE."

" .""._NOTES."
" ."

" ."" ."" ."" ."
"; CloseTable(); include ('footer.php'); } else { include ('header.php'); GraphicAdmin(); OpenTable(); //echo "
"._ARTICLEADMIN."
"; echo "
"; CloseTable(); echo "
"; OpenTable(); echo "
"._NOTAUTHORIZED1."

" .""._NOTAUTHORIZED2."

" .""._GOBACK.""; CloseTable(); include("footer.php"); } } function removeStory($sid, $ok=0) { global $ultramode, $aid, $prefix, $db; $result = $db->sql_query("select counter, radminarticle, radminsuper from ".$prefix."_authors where aid='$aid'"); list($counter, $radminarticle, $radminsuper) = $db->sql_fetchrow($result); $result2 = $db->sql_query("select aid from ".$prefix."_stories where sid='$sid'"); list($aaid) = $db->sql_fetchrow($result2); if (($radminarticle == 1) AND ($aaid == $aid) OR ($radminsuper == 1)) { if($ok) { $counter--; $db->sql_query("DELETE FROM ".$prefix."_stories where sid=$sid"); $db->sql_query("DELETE FROM ".$prefix."_comments where sid=$sid"); $db->sql_query("update ".$prefix."_poll_desc set artid='0' where artid='$sid'"); $result = $db->sql_query("update ".$prefix."_authors set counter='$counter' where aid='$aid'"); if ($ultramode) { ultramode(); } Header("Location: system.php"); } else { include("header.php"); GraphicAdmin(); OpenTable(); //echo "
"._ARTICLEADMIN."
"; echo "
"; CloseTable(); echo "
"; OpenTable(); echo "
"._REMOVESTORY." $sid "._ANDCOMMENTS.""; echo "

[ "._NO." | "._YES." ]
"; CloseTable(); include("footer.php"); } } else { include ('header.php'); GraphicAdmin(); OpenTable(); //echo "
"._ARTICLEADMIN."
"; echo "
"; CloseTable(); echo "
"; OpenTable(); echo "
"._NOTAUTHORIZED1."

" .""._NOTAUTHORIZED2."

" .""._GOBACK.""; CloseTable(); include("footer.php"); } } function changeStory($sid, $subject, $hometext, $bodytext, $topic, $notes, $catid, $ihome, $alanguage, $acomm) { global $aid, $ultramode, $prefix, $db; $result = $db->sql_query("select radminarticle, radminsuper from ".$prefix."_authors where aid='$aid'"); list($radminarticle, $radminsuper) = $db->sql_fetchrow($result); $result2 = $db->sql_query("select aid from ".$prefix."_stories where sid='$sid'"); list($aaid) = $db->sql_fetchrow($result2); if (($radminarticle == 1) AND ($aaid == $aid) OR ($radminsuper == 1)) { $subject = stripslashes(FixQuotes($subject)); $hometext = stripslashes(FixQuotes($hometext)); $bodytext = stripslashes(FixQuotes($bodytext)); $notes = stripslashes(FixQuotes($notes)); $db->sql_query("update ".$prefix."_stories set catid='$catid', title='$subject', hometext='$hometext', bodytext='$bodytext', topic='$topic', notes='$notes', ihome='$ihome', alanguage='$alanguage', acomm='$acomm' where sid=$sid"); if ($ultramode) { ultramode(); } Header("Location: system.php?op=adminMain"); } } function adminStory() { global $prefix, $db, $language, $multilingual; include ('header.php'); GraphicAdmin(); OpenTable(); //echo "
"._ARTICLEADMIN."
"; echo "
"; CloseTable(); echo "
"; $today = getdate(); $tday = $today[mday]; if ($tday < 10){ $tday = "0$tday"; } $tmonth = $today[month]; $ttmon = $today[mon]; if ($ttmon < 10){ $ttmon = "0$ttmon"; } $tyear = $today[year]; $thour = $today[hours]; if ($thour < 10){ $thour = "0$thour"; } $tmin = $today[minutes]; if ($tmin < 10){ $tmin = "0$tmin"; } $tsec = $today[seconds]; if ($tsec < 10){ $tsec = "0$tsec"; } $date = "$tmonth $tday, $tyear @ $thour:$tmin:$tsec"; OpenTable(); echo "
"._ADDARTICLE."


" ."
" .""._TITLE."
" ."

" .""._TOPIC.""; $toplist = $db->sql_query("select topicid, topictext from ".$prefix."_topics order by topictext"); echo "

"; $cat = 0; SelectCategory($cat); echo "
"; puthome($ihome, $acomm); if ($multilingual == 1) { echo "
"._LANGUAGE.": " .""; } else { echo ""; } echo "

"._STORYTEXT."
" ."

" .""._EXTENDEDTEXT."
" ."
" .""._ARESUREURL."" ."

"._PROGRAMSTORY."  " .""._YES."   " .""._NO."

" .""._NOWIS.": $date

"; $day = 1; echo ""._DAY.": "; $month = 1; echo ""._UMONTH.": "; $date = getdate(); $year = $date[year]; echo ""._YEAR.": " ."
"._HOUR.": " .": "; echo ": 00

" ."" .""; CloseTable(); echo "
"; putpoll($pollTitle, $optionText); echo "
"; include ('footer.php'); } function previewAdminStory($automated, $year, $day, $month, $hour, $min, $subject, $hometext, $bodytext, $topic, $catid, $ihome, $alanguage, $acomm, $pollTitle, $optionText) { global $user, $bgcolor1, $bgcolor2, $prefix, $db, $alanguage, $multilingual; include ('header.php'); if ($topic<1) { $topic = 1; } GraphicAdmin(); OpenTable(); //echo "
"._ARTICLEADMIN."
"; echo "
"; CloseTable(); echo "
"; $today = getdate(); $tday = $today[mday]; if ($tday < 10){ $tday = "0$tday"; } $tmonth = $today[month]; $tyear = $today[year]; $thour = $today[hours]; if ($thour < 10){ $thour = "0$thour"; } $tmin = $today[minutes]; if ($tmin < 10){ $tmin = "0$tmin"; } $tsec = $today[seconds]; if ($tsec < 10){ $tsec = "0$tsec"; } $date = "$tmonth $tday, $tyear @ $thour:$tmin:$tsec"; OpenTable(); echo "
"._PREVIEWSTORY."


" ."
" .""; $subject = stripslashes($subject); $subject = ereg_replace("\"", "''", $subject); $hometext = stripslashes($hometext); $bodytext = stripslashes($bodytext); $result=$db->sql_query("select topicimage from ".$prefix."_topics where topicid=$topic"); list($topicimage) = $db->sql_fetchrow($result); echo "
" ."
" ."\"\""; themepreview($subject, $hometext, $bodytext); echo "
" ."

"._TITLE."
" ."

" .""._TOPIC."

"; $cat = $catid; SelectCategory($cat); echo "
"; puthome($ihome, $acomm); if ($multilingual == 1) { echo "
"._LANGUAGE.": " .""; } else { echo ""; } echo "

"._STORYTEXT."
" ."

" .""._EXTENDEDTEXT."
" ."

"; if ($automated == 1) { $sel1 = "checked"; $sel2 = ""; } else { $sel1 = ""; $sel2 = "checked"; } echo "
"._PROGRAMSTORY."  " .""._YES."   " .""._NO."

" .""._NOWIS.": $date

"; $xday = 1; echo ""._DAY.": "; $xmonth = 1; echo ""._UMONTH.": "; echo ""._YEAR.": "; echo "
"._HOUR.": "; echo ": "; echo ": 00

" ."" .""; CloseTable(); echo "
"; putpoll($pollTitle, $optionText); echo "
"; include ('footer.php'); } function postAdminStory($automated, $year, $day, $month, $hour, $min, $subject, $hometext, $bodytext, $topic, $catid, $ihome, $alanguage, $acomm, $pollTitle, $optionText) { global $aid, $prefix, $db; if ($automated == 1) { if ($day < 10) { $day = "0$day"; } if ($month < 10) { $month = "0$month"; } $sec = "00"; $date = "$year-$month-$day $hour:$min:$sec"; $notes = ""; $author = $aid; $subject = stripslashes(FixQuotes($subject)); $subject = ereg_replace("\"", "''", $subject); $hometext = stripslashes(FixQuotes($hometext)); $bodytext = stripslashes(FixQuotes($bodytext)); $result = $db->sql_query("insert into ".$prefix."_autonews values (NULL, '$catid', '$aid', '$subject', '$date', '$hometext', '$bodytext', '$topic', '$author', '$notes', '$ihome', '$alanguage', '$acomm')"); if (!$result) { exit(); } $result = $db->sql_query("update ".$prefix."_authors set counter=counter+1 where aid='$aid'"); if ($ultramode) { ultramode(); } Header("Location: system.php?op=adminMain"); } else { $subject = stripslashes(FixQuotes($subject)); $hometext = stripslashes(FixQuotes($hometext)); $bodytext = stripslashes(FixQuotes($bodytext)); if (($pollTitle != "") AND ($optionText[1] != "") AND ($optionText[2] != "")) { $haspoll = 1; $timeStamp = time(); $pollTitle = FixQuotes($pollTitle); if(!$db->sql_query("INSERT INTO ".$prefix."_poll_desc VALUES (NULL, '$pollTitle', '$timeStamp', 0, '$alanguage', '0')")) { return; } $object = $db->sql_fetchrow($db->sql_query("SELECT pollID FROM ".$prefix."_poll_desc WHERE pollTitle='$pollTitle'")); $id = $object["pollID"]; for($i = 1; $i <= sizeof($optionText); $i++) { if($optionText[$i] != "") { $optionText[$i] = FixQuotes($optionText[$i]); } if(!$db->sql_query("INSERT INTO ".$prefix."_poll_data (pollID, optionText, optionCount, voteID) VALUES ($id, '$optionText[$i]', 0, $i)")) { return; } } } else { $haspoll = 0; $id = 0; } $result = $db->sql_query("insert into ".$prefix."_stories values (NULL, '$catid', '$aid', '$subject', now(), '$hometext', '$bodytext', '0', '0', '$topic', '$aid', '$notes', '$ihome', '$alanguage', '$acomm', '$haspoll', '$id', '0', '0')"); $result = $db->sql_query("select sid from ".$prefix."_stories WHERE title='$subject' order by time DESC limit 0,1"); list($artid) = $db->sql_fetchrow($result); $db->sql_query("UPDATE ".$prefix."_poll_desc SET artid='$artid' WHERE pollID='$id'"); if (!$result) { exit(); } $result = $db->sql_query("update ".$prefix."_authors set counter=counter+1 where aid='$aid'"); if ($ultramode) { ultramode(); } Header("Location: system.php?op=adminMain"); } } function submissions() { global $admin, $bgcolor1, $bgcolor2, $prefix, $db, $radminsuper; $dummy = 0; include ("header.php"); GraphicAdmin(); OpenTable(); //echo "
"._SUBMISSIONSADMIN."
"; echo "
"; CloseTable(); echo "
"; OpenTable(); $result = $db->sql_query("SELECT qid, subject, timestamp, alanguage FROM ".$prefix."_queue order by timestamp DESC"); if($db->sql_numrows($result) == 0) { echo "
"._NOSUBMISSIONS."
\n"; } else { echo "
"._NEWSUBMISSIONS."
\n"; while (list($qid, $subject, $timestamp, $alanguage) = $db->sql_fetchrow($result)) { $hour = "AM"; ereg ("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $timestamp, $datetime); if ($datetime[4] > 12) { $datetime[4] = $datetime[4]-12; $hour = "PM"; } $datetime = date(""._DATESTRING."", mktime($datetime[4],$datetime[5],$datetime[6],$datetime[2],$datetime[3],$datetime[1])); echo "\n" ."\n" ."\n"; $dummy++; } if ($dummy < 1) { echo "
 ("._DELETE."\n"; if ($subject == "") { echo " "._NOSUBJECT."\n"; } else { echo " $subject\n"; } if ($alanguage == "") { $alanguage = _ALL; } echo "$alanguage\n"; $timestamp = ereg_replace(" ", "@", $timestamp); echo " $timestamp 
"._NOSUBMISSIONS."
\n"; } else { echo "\n"; } } if ($radminsuper==1) { echo "
" ."[ "._DELETE." ]" ."

"; } CloseTable(); include ("footer.php"); } function subdelete() { global $prefix, $db; $db->sql_query("delete from ".$prefix."_queue"); Header("Location: system.php?op=adminMain"); } //------------------------------------------------------------------------------ // Addon Stephan Acquatella 2002 // ----------------------------------------------------------------------------- // balisteAdminStory // ----------------------------------------------------------------------------- function balisteAdminStory() { global $prefix, $db, $language, $multilingual; include ('header.php'); GraphicAdmin(); OpenTable(); //echo "
"._ARTICLEADMIN."
"; echo "
"; CloseTable(); echo "
"; $today = getdate(); $tday = $today[mday]; if ($tday < 10){ $tday = "0$tday"; } $tmonth = $today[month]; $ttmon = $today[mon]; if ($ttmon < 10){ $ttmon = "0$ttmon"; } $tyear = $today[year]; $thour = $today[hours]; if ($thour < 10){ $thour = "0$thour"; } $tmin = $today[minutes]; if ($tmin < 10){ $tmin = "0$tmin"; } $tsec = $today[seconds]; if ($tsec < 10){ $tsec = "0$tsec"; } $date = "$tmonth $tday, $tyear @ $thour:$tmin:$tsec"; OpenTable(); include ("includes/Balisterichedit.html"); // Hidden form echo "
\n" ."\n" ."

\n" ."

\n"; if ($multilingual == 1) { echo "\n"; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
\n"; // end hedden form echo "
"._ADDARTICLE."


" ."
" .""._TITLE."
" ."

" .""._TOPIC.""; $toplist = $db->sql_query("select topicid, topictext from ".$prefix."_topics order by topictext"); echo "

"; $cat = 0; SelectCategory($cat); echo "
"; puthome($ihome, $acomm); if ($multilingual == 1) { echo "
"._LANGUAGE.": " .""; } else { echo ""; } echo "

"._STORYTEXT."
" ."

" .""._EXTENDEDTEXT."
" ."
" .""._ARESUREURL."" ."

"._PROGRAMSTORY."  " .""._YES."   " .""._NO."

" .""._NOWIS.": $date

"; $day = 1; echo ""._DAY.": "; $month = 1; echo ""._UMONTH.": "; $date = getdate(); $year = $date[year]; echo ""._YEAR.": " ."
"._HOUR.": " .": "; echo ": 00

" ."" .""; CloseTable(); echo "
"; putpoll($pollTitle, $optionText); echo "
"; include ('footer.php'); } switch($op) { case "EditCategory": EditCategory($catid); break; case "subdelete": subdelete(); break; case "DelCategory": DelCategory($cat); break; case "YesDelCategory": YesDelCategory($catid); break; case "NoMoveCategory": NoMoveCategory($catid, $newcat); break; case "SaveEditCategory": SaveEditCategory($catid, $title); break; case "SelectCategory": SelectCategory($cat); break; case "AddCategory": AddCategory(); break; case "SaveCategory": SaveCategory($title); break; case "DisplayStory": displayStory($qid); break; case "PreviewAgain": previewStory($automated, $year, $day, $month, $hour, $min, $qid, $uid, $author, $subject, $hometext, $bodytext, $topic, $notes, $catid, $ihome, $alanguage, $acomm, $pollTitle, $optionText); break; case "PostStory": postStory($automated, $year, $day, $month, $hour, $min, $qid, $uid, $author, $subject, $hometext, $bodytext, $topic, $notes, $catid, $ihome, $alanguage, $acomm, $pollTitle, $optionText); break; case "EditStory": editStory($sid); break; case "RemoveStory": removeStory($sid, $ok); break; case "ChangeStory": changeStory($sid, $subject, $hometext, $bodytext, $topic, $notes, $catid, $ihome, $alanguage, $acomm); break; case "DeleteStory": deleteStory($qid); break; case "adminStory": adminStory($sid); break; case "PreviewAdminStory": previewAdminStory($automated, $year, $day, $month, $hour, $min, $subject, $hometext, $bodytext, $topic, $catid, $ihome, $alanguage, $acomm, $pollTitle, $optionText); break; case "PostAdminStory": postAdminStory($automated, $year, $day, $month, $hour, $min, $subject, $hometext, $bodytext, $topic, $catid, $ihome, $alanguage, $acomm, $pollTitle, $optionText); break; case "autoDelete": autodelete($anid); break; case "autoEdit": autoEdit($anid); break; case "autoSaveEdit": autoSaveEdit($anid, $year, $day, $month, $hour, $min, $title, $hometext, $bodytext, $topic, $notes, $catid, $ihome, $alanguage, $acomm); break; case "submissions": submissions(); break; } } else { display_denied(); } ?>