| 1 | <?php
 | 
  
    | 2 | /**
 | 
  
    | 3 |  *
 | 
  
    | 4 |  * @category        modules
 | 
  
    | 5 |  * @package         news
 | 
  
    | 6 |  * @author          WebsiteBaker Project
 | 
  
    | 7 |  * @copyright       2004-2009, Ryan Djurovich
 | 
  
    | 8 |  * @copyright       2009-2010, Website Baker Org. e.V.
 | 
  
    | 9 |  * @link			http://www.websitebaker2.org/
 | 
  
    | 10 |  * @license         http://www.gnu.org/licenses/gpl.html
 | 
  
    | 11 |  * @platform        WebsiteBaker 2.8.x
 | 
  
    | 12 |  * @requirements    PHP 4.3.4 and higher
 | 
  
    | 13 |  * @version         $Id: move_up.php 1289 2010-02-10 15:13:21Z kweitzel $
 | 
  
    | 14 |  * @filesource		$HeadURL: svn://isteam.dynxs.de/wb-archiv/trunk/wb/modules/news/move_up.php $
 | 
  
    | 15 |  * @lastmodified    $Date: 2010-02-10 16:13:21 +0100 (Wed, 10 Feb 2010) $
 | 
  
    | 16 |  *
 | 
  
    | 17 |  */
 | 
  
    | 18 | 
 | 
  
    | 19 | require('../../config.php');
 | 
  
    | 20 | 
 | 
  
    | 21 | // Get id
 | 
  
    | 22 | if(!isset($_GET['post_id']) OR !is_numeric($_GET['post_id'])) {
 | 
  
    | 23 | 	if(!isset($_GET['group_id']) OR !is_numeric($_GET['group_id'])) {
 | 
  
    | 24 | 
 | 
  
    | 25 | 		header("Location: index.php");
 | 
  
    | 26 | 	    exit( 0 );
 | 
  
    | 27 | 	} else {
 | 
  
    | 28 | 		$id = $_GET['group_id'];
 | 
  
    | 29 | 		$id_field = 'group_id';
 | 
  
    | 30 | 		$table = TABLE_PREFIX.'mod_news_groups';
 | 
  
    | 31 | 	}
 | 
  
    | 32 | } else {
 | 
  
    | 33 | 	$id = $_GET['post_id'];
 | 
  
    | 34 | 	$id_field = 'post_id';
 | 
  
    | 35 | 	$table = TABLE_PREFIX.'mod_news_posts';
 | 
  
    | 36 | }
 | 
  
    | 37 | 
 | 
  
    | 38 | // Include WB admin wrapper script
 | 
  
    | 39 | require(WB_PATH.'/modules/admin.php');
 | 
  
    | 40 | 
 | 
  
    | 41 | // Include the ordering class
 | 
  
    | 42 | require(WB_PATH.'/framework/class.order.php');
 | 
  
    | 43 | 
 | 
  
    | 44 | // Create new order object an reorder
 | 
  
    | 45 | $order = new order($table, 'position', $id_field, 'section_id');
 | 
  
    | 46 | if($order->move_up($id)) {
 | 
  
    | 47 | 	$admin->print_success($TEXT['SUCCESS'], ADMIN_URL.'/pages/modify.php?page_id='.$page_id);
 | 
  
    | 48 | } else {
 | 
  
    | 49 | 	$admin->print_error($TEXT['ERROR'], ADMIN_URL.'/pages/modify.php?page_id='.$page_id);
 | 
  
    | 50 | }
 | 
  
    | 51 | 
 | 
  
    | 52 | // Print admin footer
 | 
  
    | 53 | $admin->print_footer();
 | 
  
    | 54 | 
 | 
  
    | 55 | ?>
 |