diff options
author | deva <deva> | 2009-04-23 08:05:41 +0000 |
---|---|---|
committer | deva <deva> | 2009-04-23 08:05:41 +0000 |
commit | 9ecc7372ae70b397f5546adb60b0e4542a6bbb78 (patch) | |
tree | 47e739d384c8099204610cf860b45c2003fc3f59 | |
parent | 0f3ed98adf5505672397f609965173adcef578fc (diff) |
A little cleaning up... a lot more to come...
-rw-r--r-- | htdocs/index.php | 2 | ||||
-rw-r--r-- | utils/admin.php (renamed from pages/admin.php) | 0 | ||||
-rw-r--r-- | utils/admin_news.php | 121 |
3 files changed, 1 insertions, 122 deletions
diff --git a/htdocs/index.php b/htdocs/index.php index 5d05807..797f10b 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -73,7 +73,7 @@ foreach($menu as $_m => $_t) { ?>> <?php if($page == "admin") { - include($PAGE_DIR."/admin.php"); + include($UTIL_DIR."/admin.php"); } else { if($page) $p = $pages->getPage($page); else $p = $pages->getPage($config->value('default')); diff --git a/pages/admin.php b/utils/admin.php index 8efbb56..8efbb56 100644 --- a/pages/admin.php +++ b/utils/admin.php diff --git a/utils/admin_news.php b/utils/admin_news.php deleted file mode 100644 index b27cf31..0000000 --- a/utils/admin_news.php +++ /dev/null @@ -1,121 +0,0 @@ -<h2>News</h2> -<?php -include_once($UTIL_DIR."/news.php"); -include_once($UTIL_DIR."/convert.php"); -include_once($UTIL_DIR."/newsletter.php"); -include_once($UTIL_DIR."/rss.php"); - -if($task == "confirmnews") { - $time = strtotime($month."/" .$day . "/" . $year . " " . $hour . ":" . $minute . ":" . $second); - - $title = convert($title); - $description = convert($description); - - $newsentry = new NewsEntry($title, $time, $category, $description); - $newsentry->show(); - - echo "<p>Category: " . $category . "</p>\n"; - if($newsletter) echo "<p><strong>WARNING:</strong> This news will be sent out a newsletter if <em>yes</em> is pressed.</p>\n"; -?> -Is this news correct?<br/> -<form method="post" action="?page=admin&module=news&task=postnews"> - <input name="title" type="hidden" value="<?php echo $title ?>"/> - <input name="category" type="hidden" value="<?php echo $category ?>"/> - <input name="newsletter" type="hidden" value="<?php echo $newsletter ?>"/> - <input name="day" type="hidden" value="<?php echo $day ?>"/> - <input name="month" type="hidden" value="<?php echo $month ?>"/> - <input name="year" type="hidden" value="<?php echo $year ?>"/> - <input name="hour" type="hidden" value="<?php echo $hour ?>"/> - <input name="minute" type="hidden" value="<?php echo $minute ?>"/> - <input name="second" type="hidden" value="<?php echo $second ?>"/> - <input name="description" type="hidden" value="<?php echo $description ?>"/> - <button type="submit">Yes</button> -</form> -<form method="post" action="?page=admin&module=news"> - <input name="title" type="hidden" value="<?php echo $title ?>"/> - <input name="category" type="hidden" value="<?php echo $category ?>"/> - <input name="newsletter" type="hidden" value="<?php echo $newsletter ?>"/> - <input name="day" type="hidden" value="<?php echo $day ?>"/> - <input name="month" type="hidden" value="<?php echo $month ?>"/> - <input name="year" type="hidden" value="<?php echo $year ?>"/> - <input name="hour" type="hidden" value="<?php echo $hour ?>"/> - <input name="minute" type="hidden" value="<?php echo $minute ?>"/> - <input name="second" type="hidden" value="<?php echo $second ?>"/> - <input name="description" type="hidden" value="<?php echo $description ?>"/> - <button type="submit">No</button> -</form> -<?php - - $title = ""; - $category = ""; - $newsletter = ""; - $day = ""; - $month = ""; - $year = ""; - $hour = ""; - $minute = ""; - $second = ""; - $description = ""; -} -?> - -<?php -if($task == "postnews") { - $time = strtotime($month."/" .$day . "/" . $year . " " . $hour . ":" . $minute . ":" . $second); - - $title = convert($title); - $description = convert($description); - - $news = new News($DATA_DIR."/news.xml"); - $newsentry = new NewsEntry($title, $time, $category, $description); - $news->add($newsentry); - $news->write(); - - // Now update the RSS feed. - $rss = new RSS($DATA_DIR."/news.xml", "rss.xml"); - $rss->write(); - - echo "<p>News posted successfully.</p>"; - - // if($newsletter == "on") sendNewsLetter($title, $description); - - $title = ""; - $category = ""; - $newsletter = ""; - $day = ""; - $month = ""; - $year = ""; - $hour = ""; - $minute = ""; - $second = ""; - $description = ""; -} -?> - -<?php -$now = time(); -if($day == "") $day = date("j", $now); -if($month =="") $month = date("n", $now); -if($year == "") $year = date("Y", $now); -if($hour == "") $hour = date("G", $now); -if($minute == "") $minute = date("i", $now); -if($second == "") $second = date("s", $now); -?> - -<div class="small_header">Post news</div> -<form method="post" action="?page=admin&module=news&task=confirmnews"> - Title: <input name="title" width="40" value="<?php echo convert($title) ?>"/><br/> - Category: - <select name="category"> - <option value="main" <?php if($category == "main") echo "selected"; ?>>main</option> - <option value="site" <?php if($category == "site") echo "selected"; ?>>site</option> - </select><br/> - Date: <input name="day" maxlength="2" style="width: 20px;" value="<?php echo $day ?>"/>/ - <input name="month" maxlength="2" style="width: 20px;" value="<?php echo $month ?>"/>- - <input name="year" maxlength="4" style="width: 40px;" value="<?php echo $year ?>"/><br/> - Time: <input name="hour" maxlength="2" style="width: 20px;" value="<?php echo $hour ?>"/>: - <input name="minute" maxlength="2" style="width: 20px;" value="<?php echo $minute ?>"/>: - <input name="second" maxlength="2" style="width: 20px;" value="<?php echo $second ?>"/><br/> - Description: <textarea name="description"><?php echo convert($description) ?></textarea><br/> - <button type="submit">Post news</button> -</form> |