<?php session_start(); include '../class-db.php'; include '../objects/class-news.php'; $ez_news = new ezAdmin_News(); if (isset($_SESSION['ez_admin'])) { $rand = rand('100', '5000'); $now = strtotime('now'); $new_file = $now . '-' . $rand; $allowedExts = array("jpg", "png", "gif", "bmp", "jpeg", "PNG", "JPG", "JPEG", "GIF", "BMP"); $temp = explode(".", $_FILES["file"]["name"]); $extension = end($temp); if (($_FILES["file"]["type"] == "image/gif" || $_FILES["file"]["type"] == "image/jpeg" || $_FILES["file"]["type"] == "image/jpg" || $_FILES["file"]["type"] == "image/pjpeg" || $_FILES["file"]["type"] == "image/x-png" || $_FILES["file"]["type"] == "image/png") && $_FILES["file"]["size"] < 1000000 && in_array($extension, $allowedExts)) { if ($_FILES["file"]["error"] > 0) { echo "Return Code: " . $_FILES["file"]["error"] . "<br>"; } else { if (file_exists("../../../media/" . $now . "-" . $_FILES["file"]["name"])) { echo $now . "-" . $_FILES["file"]["name"] . " already exists. "; } else { move_uploaded_file($_FILES["file"]["tmp_name"], "../../../media/" . $now . "-" . $_FILES["file"]["name"]); $filename = $now . "-" . $_FILES["file"]["name"]; $ez_news->upload_media($filename); header('Location: ../../news.php?page=media '); } } } else { echo "Invalid file"; } } else { echo "admins only.";
<?php session_start(); date_default_timezone_set('America/Chicago'); include './lib/class-db.php'; include './lib/objects/class-news.php'; $ez_news = new ezAdmin_News(); if (!isset($_SESSION['ez_admin'])) { header("Location: login.php"); } else { $username = $_SESSION['ez_admin']; } $media = $ez_news->get_media(); ?> <div class="modal-dialog media-modal"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h4 class="modal-title" id="myModalLabel">Viewing Media Explorer</h4> </div> <div class="modal-body"> <div class="row"> <div class="col-lg-12"> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title text-info">Choose Post Image</h3> </div> <div style="height: auto;" id="collapseOne" class="panel-collapse"> <div class="panel-body"> <?php
<?php session_start(); include '../class-db.php'; include '../class-ezadmin.php'; include '../objects/class-news.php'; $ez = new ezAdmin(); $ez_news = new ezAdmin_News(); if (isset($_POST['form'])) { $form = strip_tags($_POST['form']); switch ($form) { case 'add-news': $title = $_POST['title']; $body = $_POST['body']; $author = $_POST['author']; $game = $_POST['game']; $categories = $_POST['categories']; $media = $_POST['media']; $ez_news->add_news($title, $body, $author, $categories, $game, $media); break; case 'edit-news': $title = $_POST['title']; $body = $_POST['body']; $author = $_POST['author']; $game = $_POST['game']; $categories = $_POST['categories']; $media = $_POST['media']; $post_id = $_POST['post_id']; $ez_news->edit_news($post_id, $title, $body, $author, $categories, $game, $media); break; case 'save-draft':
<?php session_start(); date_default_timezone_set('America/Chicago'); include './lib/class-db.php'; include './lib/objects/class-news.php'; $ez_news = new ezAdmin_News(); if (!isset($_SESSION['ez_admin'])) { header("Location: login.php"); } else { $username = $_SESSION['ez_admin']; } //get an individual media item if (isset($_POST['id'])) { $media_id = $_POST['id']; $media = $ez_news->get_media_upload($media_id); ?> <div class="modal-dialog media-modal"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h4 class="modal-title" id="myModalLabel">Viewing Media Upload</h4> </div> <div class="modal-body"> <div class="row"> <div class="col-lg-12"> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title text-info">Added <em><?php echo date('F d, Y h:ia', strtotime($media['date']));