-
Notifications
You must be signed in to change notification settings - Fork 1
/
move_img_up.php
50 lines (41 loc) · 1.41 KB
/
move_img_up.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
/**
*
* @category modules
* @package oneforall
* @author WBCE Community
* @copyright 2004-2009, Ryan Djurovich
* @copyright 2009-2010, Website Baker Org. e.V.
* @copyright 2019-, WBCE Community
* @link https://www.wbce.org/
* @license http://www.gnu.org/licenses/gpl.html
* @platform WBCE
*
*/
require('../../config.php');
// Include path
$inc_path = dirname(__FILE__);
// Get module name
require_once($inc_path.'/info.php');
// Get id
if (!isset($_GET['img_id']) OR !is_numeric($_GET['img_id']) OR !isset($_GET['item_id']) OR !is_numeric($_GET['item_id'])) {
header("Location: index.php");
} else {
$id = $_GET['img_id'];
$item_id = $_GET['item_id'];
$id_field = 'img_id';
$table = TABLE_PREFIX.'mod_'.$mod_name.'_images';
}
// Include WB admin wrapper script
require(WB_PATH.'/modules/admin.php');
// Include the ordering class
require(WB_PATH.'/framework/class.order.php');
// Create new order object and reorder
$order = new order($table, 'position', $id_field, 'item_id');
if ($order->move_up($id)) {
$admin->print_success($TEXT['SUCCESS'], WB_URL.'/modules/'.$mod_name.'/modify_item.php?page_id='.$page_id.'§ion_id='.$section_id.'&item_id='.$item_id.'#images');
} else {
$admin->print_error($TEXT['ERROR'], WB_URL.'/modules/'.$mod_name.'/modify_item.php?page_id='.$page_id.'§ion_id='.$section_id.'&item_id='.$item_id.'#images');
}
// Print admin footer
$admin->print_footer();