1 | <?php |
---|
2 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
3 | global $template, $conf, $user; |
---|
4 | include_once(PHPWG_ROOT_PATH .'admin/include/tabsheet.class.php'); |
---|
5 | load_language('plugin.lang', PDHR_PATH); |
---|
6 | $my_base_url = get_admin_plugin_menu_link(__FILE__); |
---|
7 | |
---|
8 | // +-----------------------------------------------------------------------+ |
---|
9 | // | Check Access and exit when user status is not ok | |
---|
10 | // +-----------------------------------------------------------------------+ |
---|
11 | check_status(ACCESS_ADMINISTRATOR); |
---|
12 | |
---|
13 | //-------------------------------------------------------- sections definitions |
---|
14 | |
---|
15 | |
---|
16 | |
---|
17 | // Gestion des onglets |
---|
18 | if (!isset($_GET['tab'])) |
---|
19 | $page['tab'] = 'pdhr'; |
---|
20 | else |
---|
21 | $page['tab'] = $_GET['tab']; |
---|
22 | |
---|
23 | $tabsheet = new tabsheet(); |
---|
24 | $tabsheet->add('pdhr', |
---|
25 | l10n('Purge All'), |
---|
26 | $my_base_url.'&tab=pdhr'); |
---|
27 | |
---|
28 | $tabsheet->select($page['tab']); |
---|
29 | $tabsheet->assign(); |
---|
30 | |
---|
31 | // Onglet gestion par photo |
---|
32 | switch ($page['tab']) |
---|
33 | { |
---|
34 | case 'pdhr': |
---|
35 | |
---|
36 | $template->assign( |
---|
37 | 'gestion', |
---|
38 | array( |
---|
39 | |
---|
40 | )); |
---|
41 | |
---|
42 | //purge photo |
---|
43 | if (isset($_POST['pdhr_all_h'])) |
---|
44 | { |
---|
45 | $query = ' |
---|
46 | UPDATE ' . IMAGES_TABLE . ' |
---|
47 | SET hit= \'0\' |
---|
48 | ;'; |
---|
49 | $result = pwg_query($query); |
---|
50 | |
---|
51 | array_push( $page['infos'], l10n('Hit purge completed successfully') ); |
---|
52 | |
---|
53 | } |
---|
54 | |
---|
55 | if (isset($_POST['pdhr_all_r'])) |
---|
56 | { |
---|
57 | $query = ' |
---|
58 | UPDATE ' . IMAGES_TABLE . ' |
---|
59 | SET rating_score= \'NULL\' |
---|
60 | ;'; |
---|
61 | $result = pwg_query($query); |
---|
62 | |
---|
63 | $query = ' |
---|
64 | TRUNCATE ' . RATE_TABLE . ' |
---|
65 | ;'; |
---|
66 | $result = pwg_query($query); |
---|
67 | |
---|
68 | array_push( $page['infos'], l10n('Rate purge completed successfully') ); |
---|
69 | |
---|
70 | } |
---|
71 | |
---|
72 | break; |
---|
73 | |
---|
74 | } |
---|
75 | |
---|
76 | $template->set_filenames(array('plugin_admin_content' => dirname(__FILE__) . '/admin.tpl')); |
---|
77 | $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); |
---|
78 | ?> |
---|