-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin_version_log.php
More file actions
126 lines (117 loc) · 3.95 KB
/
Copy pathadmin_version_log.php
File metadata and controls
126 lines (117 loc) · 3.95 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<?php
/***************************************************************************
* admin_version_log.php
* -------------------
* begin : December 31, 2005
* author : Fountain of Apples < webmacster87@gmail.com >
* copyright : (C) 2005-2006 Douglas Bell
*
***************************************************************************/
/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/
//
// Let the ACP know this file exists
//
define('IN_PHPBB', 1);
if( !empty($setmodules) )
{
$file = basename(__FILE__);
$module['AVC_AVersioncheck']['AVC_Log'] = $file;
return;
}
//
// Load the default header
//
$phpbb_root_path = './../';
require($phpbb_root_path . 'extension.inc');
require($phpbb_root_path . 'admin/pagestart.' . $phpEx);
include_once($phpbb_root_path . 'includes/constants_avc.' . $phpEx);
//
// Figure out which tpl we're using
//
$template->set_filenames(array(
"body" => "admin/version_log.tpl")
);
//
// Select everything from the logs table
//
$sql = "SELECT * FROM " . VERSION_LOG_TABLE . " ORDER BY log_id DESC";
if ( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, $lang['No_Version_Log'], '', __LINE__, __FILE__, $sql);
}
//
// Loop through each MOD
//
$i = 0;
while ( $row = $db->sql_fetchrow($result) )
{
$log_id = $row['log_id'];
// Was a form submitted? If so, we need to see which entries we need to remove
if ( isset($HTTP_POST_VARS['submit']) )
{
// Was the delete checkbox for this MOD pressed?
if ( $HTTP_POST_VARS['delete_' . $log_id] )
{
// Delete this log action from the database
$sql = "DELETE FROM " . VERSION_LOG_TABLE . " WHERE log_id = $log_id";
if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, sprintf($lang['No_Delete_Log'], $log_id), '', __LINE__, __FILE__, $sql);
}
}
}
// Only display this log entry if the user didn't want it deleted
if ( !isset($HTTP_POST_VARS['submit']) || !$HTTP_POST_VARS['delete_' . $log_id] )
{
$log_timestamp = create_date($board_config['default_dateformat'], $row['log_timestamp'], $board_config['board_timezone']);
if ( $row['mod_name'] == 'mod_cat_hierarchy' )
{
$mod_name = 'Categories Hierarchy';
}
elseif ( $row['mod_name'] == 'mod_topic_calendar_CH' )
{
$mod_name = 'Topic Calendar';
}
else
{
$mod_name = $row['mod_name'];
}
// Assign our vars for this loop
$template->assign_block_vars('version_log_loop', array(
'ROW_CLASS' => ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'],
'LOG_ID' => $log_id,
'LOG_TIMESTAMP' => $log_timestamp,
'L_MOD_NAME' => $mod_name,
'L_LOG_MSG' => $row['log_action'])
);
$i = $i + 1;
}
}
$db->sql_freeresult($result);
//
// Assign the rest of our vars
//
$template->assign_vars(array(
'L_VERSION_LOG' => $lang['Update_log'],
'L_VERSION_LOG_EXPLAIN' => $lang['Update_log_explain'],
'S_VERSION_ACTION' => append_sid("admin_version_log.$phpEx"),
'L_TIME' => $lang['Time'],
'L_MOD_NAME' => $lang['MOD_Name'],
'L_LOG_MESSAGE' => $lang['Log_message'],
'L_DELETE_ENTRIES' => $lang['Delete_entries'],
'L_MARK_ALL' => $lang['Mark_all'],
'L_UNMARK_ALL' => $lang['Unmark_all'])
);
//
// Now let's just close the document properly.
//
$template->pparse('body');
include($phpbb_root_path . 'admin/page_footer_admin.'.$phpEx);
?>