Project

General

Profile

1
<?php
2
/**
3
 *
4
 * @category        admin
5
 * @package         pages
6
 * @author          WebsiteBaker Project
7
 * @copyright       2004-2009, Ryan Djurovich
8
 * @copyright       2009-2011, 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 5.2.2 and higher
13
 * @version         $Id: empty_trash.php 2 2017-07-02 15:14:29Z Manuela $
14
 * @filesource        $HeadURL: svn://isteam.dynxs.de/wb/2.10.x/branches/main/admin/pages/empty_trash.php $
15
 * @lastmodified    $Date: 2017-07-02 17:14:29 +0200 (Sun, 02 Jul 2017) $
16
 *
17
 */
18

    
19
require('../../config.php');
20
require_once(WB_PATH.'/framework/class.admin.php');
21
$admin = new admin('Pages', 'pages');
22

    
23
// Include the WB functions file
24
require_once(WB_PATH.'/framework/functions.php');
25

    
26
// Get page list from database
27
// $database = new database();
28
$query = "SELECT * FROM ".TABLE_PREFIX."pages WHERE visibility = 'deleted' ORDER BY level DESC";
29
$get_pages = $database->query($query);
30

    
31
// Insert values into main page list
32
if($get_pages->numRows() > 0)    {
33
    while($page = $get_pages->fetchRow()) {
34
        // Delete page subs
35
        $sub_pages = get_subs($page['page_id'], array());
36
        foreach($sub_pages AS $sub_page_id) {
37
            delete_page($sub_page_id);
38
        }    
39
        // Delete page
40
        delete_page($page['page_id']);
41
    }
42
}
43

    
44
// Check if there is a db error, otherwise say successful
45
if($database->is_error()) {
46
    $admin->print_error($database->get_error());
47
} else {
48
    $admin->print_success($TEXT['TRASH_EMPTIED']);
49
}
50

    
51
// Print admin 
52
$admin->print_footer();
53

    
54
?>
(4-4/25)