From b06638761f326c7f53f157137b119008c2ff7b35 Mon Sep 17 00:00:00 2001 From: jhunkeler Date: Tue, 22 Dec 2009 04:12:44 +0000 Subject: (OC) newsreel admin is working smoothly now git-svn-id: http://svn.3rd-infantry-division.org/testing/branches/Bayonet CMS v2@391 c5b2fb0a-d05d-0410-98c8-828840a80ff6 --- admin/newsreel/functions.php | 51 +++++++++++++++++++++++++++++++++++++++++++- admin/newsreel/index.php | 14 +++++++++++- admin/pages/functions.php | 13 +++++------ 3 files changed, 70 insertions(+), 8 deletions(-) diff --git a/admin/newsreel/functions.php b/admin/newsreel/functions.php index b3c2d5f..583e719 100644 --- a/admin/newsreel/functions.php +++ b/admin/newsreel/functions.php @@ -69,7 +69,9 @@ $(document).ready(function(){ $result = $db->Query("SELECT `title`, `slide_id`, `src` FROM `bayonet_newsreel` WHERE `visible` = 1 ORDER BY `weight` ASC"); while(($row = $db->fetch($result))!= false){ - echo "
  • {$row['title']}
  • "; + echo "
  • "; + PrintSlide($row); + echo "
  • "; } ?> @@ -78,6 +80,53 @@ $(document).ready(function(){ = 6){ + ReportError("There are already 6 active slides. You must disable one in order to enable another."); + PageRedirect(3,"?op=newsreel"); + return; + } + $weight = $lastspot+1; + $db->Query("UPDATE `bayonet_newsreel` SET `visible` = 1, `weight` = '$weight' WHERE `slide_id` = '$slide_id' LIMIT 1"); + PageRedirect(0,"?op=newsreel"); + } + + function DisableSlide($slide_id){ + + global $db; + echo "Disable: ".$slide_id; + $db->Query("UPDATE `bayonet_newsreel` SET `visible` = 0, `weight` = 0 WHERE `slide_id` = '$slide_id' LIMIT 1"); + PageRedirect(0,"?op=newsreel"); + } + + function ListInactive(){ + + global $db; + $result = $db->query("SELECT `slide_id`, `title`, `src` FROM `bayonet_newsreel` WHERE `visible` = 0 ORDER BY `slide_id` DESC"); + while(($row = $db->fetch($result))!= false){ + + echo PrintSlide($row); + echo "


    "; + } + } + + function PrintSlide($slide){ + echo "{$slide['title']}"; + if(file_exists("../modules/newsreel/slides/{$slide['src']}") && $slide['src'] != ""){ + echo "
    "; + } + } + + function GetLastPosition(){ + + global $db; + $result = $db->query("SELECT `weight` FROM `bayonet_newsreel` ORDER BY `weight` DESC LIMIT 1"); + $row = $db->Fetch($result); + return $row['weight']; + } ?> \ No newline at end of file diff --git a/admin/newsreel/index.php b/admin/newsreel/index.php index cd3f0e1..a12eed2 100644 --- a/admin/newsreel/index.php +++ b/admin/newsreel/index.php @@ -27,6 +27,18 @@ include $basedir.'newsreel/functions.php'; - +
    + +
    diff --git a/admin/pages/functions.php b/admin/pages/functions.php index 9d39618..3f8f59f 100644 --- a/admin/pages/functions.php +++ b/admin/pages/functions.php @@ -231,8 +231,7 @@ function ListPages($pid = NULL) - + -  View this Page','../index.php?load=page&id='.$pid); ?> +  View this Page','../index.php?load=page&id='.$pid.'" target=\"blank'); ?> @@ -259,7 +260,7 @@ function ListPages($pid = NULL) "; } -- cgit