. */ function EditOrder(){ global $db; echo "
News Reel Order
Click and drag on a slide to change the order. Wait for confirmation indicating the changes have been saved.
= 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; echo "

Disabled Slides

"; $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']; } ?>