query("UPDATE staff_blog SET Title='".db_string($_POST['title'])."', Body='".db_string($_POST['body'])."' WHERE ID='".db_string($_POST['blogid'])."'"); $Cache->delete_value('staff_blog'); $Cache->delete_value('staff_feed_blog'); } header('Location: staffblog.php'); break; case 'editblog': if(is_number($_GET['id'])){ $BlogID = $_GET['id']; $DB->query("SELECT Title, Body FROM staff_blog WHERE ID=$BlogID"); list($Title, $Body, $ThreadID) = $DB->next_record(); } break; case 'deleteblog': if(is_number($_GET['id'])){ authorize(); $DB->query("DELETE FROM staff_blog WHERE ID='".db_string($_GET['id'])."'"); $Cache->delete_value('staff_blog'); $Cache->delete_value('staff_feed_blog'); } header('Location: staffblog.php'); break; case 'takenewblog': authorize(); if (empty($_POST['title'])) { error("Please enter a title."); } $Title = db_string($_POST['title']); $Body = db_string($_POST['body']); $DB->query("INSERT INTO staff_blog (UserID, Title, Body, Time) VALUES ('$LoggedUser[ID]', '".db_string($_POST['title'])."', '".db_string($_POST['body'])."', '".sqltime()."')"); $Cache->delete_value('staff_blog'); send_irc("PRIVMSG ".ADMIN_CHAN." :!blog " . $_POST['title']); header('Location: staffblog.php'); break; } } ?>

Title

/>

Body





get_value('staff_blog')) { $DB->query("SELECT b.ID, um.Username, b.Title, b.Body, b.Time FROM staff_blog AS b LEFT JOIN users_main AS um ON b.UserID=um.ID ORDER BY Time DESC LIMIT 20"); $Blog = $DB->to_array(); $Cache->cache_value('Blog',$Blog,1209600); } $DB->query("INSERT INTO staff_blog_visits (UserID, Time) VALUES (".$LoggedUser['ID'].", NOW()) ON DUPLICATE KEY UPDATE Time=NOW()"); $Cache->delete_value('staff_blog_read_'.$LoggedUser['ID']); foreach ($Blog as $BlogItem) { list($BlogID, $Author, $Title, $Body, $BlogTime) = $BlogItem; ?>
- posted by - [Edit] [Delete]
full_format($Body)?>