|
indvdum@0
|
1 |
<?php
|
|
indvdum@0
|
2 |
/**
|
|
indvdum@0
|
3 |
*
|
|
indvdum@0
|
4 |
* @package mcp
|
|
indvdum@0
|
5 |
* @version $Id$
|
|
indvdum@0
|
6 |
* @copyright (c) 2005 phpBB Group
|
|
indvdum@0
|
7 |
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
|
indvdum@0
|
8 |
*
|
|
indvdum@0
|
9 |
*/
|
|
indvdum@0
|
10 |
|
|
indvdum@0
|
11 |
/**
|
|
indvdum@0
|
12 |
* @ignore
|
|
indvdum@0
|
13 |
*/
|
|
indvdum@0
|
14 |
if (!defined('IN_PHPBB'))
|
|
indvdum@0
|
15 |
{
|
|
indvdum@0
|
16 |
exit;
|
|
indvdum@0
|
17 |
}
|
|
indvdum@0
|
18 |
|
|
indvdum@0
|
19 |
/**
|
|
indvdum@0
|
20 |
* MCP Front Panel
|
|
indvdum@0
|
21 |
*/
|
|
indvdum@0
|
22 |
function mcp_front_view($id, $mode, $action)
|
|
indvdum@0
|
23 |
{
|
|
indvdum@0
|
24 |
global $phpEx, $phpbb_root_path, $config;
|
|
indvdum@0
|
25 |
global $template, $db, $user, $auth, $module;
|
|
indvdum@0
|
26 |
|
|
indvdum@0
|
27 |
// Latest 5 unapproved
|
|
indvdum@0
|
28 |
if ($module->loaded('queue'))
|
|
indvdum@0
|
29 |
{
|
|
indvdum@0
|
30 |
$forum_list = array_values(array_intersect(get_forum_list('f_read'), get_forum_list('m_approve')));
|
|
indvdum@0
|
31 |
$post_list = array();
|
|
indvdum@0
|
32 |
$forum_names = array();
|
|
indvdum@0
|
33 |
|
|
indvdum@0
|
34 |
$forum_id = request_var('f', 0);
|
|
indvdum@0
|
35 |
|
|
indvdum@0
|
36 |
$template->assign_var('S_SHOW_UNAPPROVED', (!empty($forum_list)) ? true : false);
|
|
indvdum@0
|
37 |
|
|
indvdum@0
|
38 |
if (!empty($forum_list))
|
|
indvdum@0
|
39 |
{
|
|
indvdum@0
|
40 |
$sql = 'SELECT COUNT(post_id) AS total
|
|
indvdum@0
|
41 |
FROM ' . POSTS_TABLE . '
|
|
indvdum@0
|
42 |
WHERE forum_id IN (0, ' . implode(', ', $forum_list) . ')
|
|
indvdum@0
|
43 |
AND post_approved = 0';
|
|
indvdum@0
|
44 |
$result = $db->sql_query($sql);
|
|
indvdum@0
|
45 |
$total = (int) $db->sql_fetchfield('total');
|
|
indvdum@0
|
46 |
$db->sql_freeresult($result);
|
|
indvdum@0
|
47 |
|
|
indvdum@0
|
48 |
if ($total)
|
|
indvdum@0
|
49 |
{
|
|
indvdum@0
|
50 |
$global_id = $forum_list[0];
|
|
indvdum@0
|
51 |
|
|
indvdum@0
|
52 |
$sql = 'SELECT forum_id, forum_name
|
|
indvdum@0
|
53 |
FROM ' . FORUMS_TABLE . '
|
|
indvdum@0
|
54 |
WHERE ' . $db->sql_in_set('forum_id', $forum_list);
|
|
indvdum@0
|
55 |
$result = $db->sql_query($sql);
|
|
indvdum@0
|
56 |
|
|
indvdum@0
|
57 |
while ($row = $db->sql_fetchrow($result))
|
|
indvdum@0
|
58 |
{
|
|
indvdum@0
|
59 |
$forum_names[$row['forum_id']] = $row['forum_name'];
|
|
indvdum@0
|
60 |
}
|
|
indvdum@0
|
61 |
$db->sql_freeresult($result);
|
|
indvdum@0
|
62 |
|
|
indvdum@0
|
63 |
$sql = 'SELECT post_id
|
|
indvdum@0
|
64 |
FROM ' . POSTS_TABLE . '
|
|
indvdum@0
|
65 |
WHERE forum_id IN (0, ' . implode(', ', $forum_list) . ')
|
|
indvdum@0
|
66 |
AND post_approved = 0
|
|
indvdum@0
|
67 |
ORDER BY post_time DESC';
|
|
indvdum@0
|
68 |
$result = $db->sql_query_limit($sql, 5);
|
|
indvdum@0
|
69 |
|
|
indvdum@0
|
70 |
while ($row = $db->sql_fetchrow($result))
|
|
indvdum@0
|
71 |
{
|
|
indvdum@0
|
72 |
$post_list[] = $row['post_id'];
|
|
indvdum@0
|
73 |
}
|
|
indvdum@0
|
74 |
$db->sql_freeresult($result);
|
|
indvdum@0
|
75 |
|
|
indvdum@0
|
76 |
if (empty($post_list))
|
|
indvdum@0
|
77 |
{
|
|
indvdum@0
|
78 |
$total = 0;
|
|
indvdum@0
|
79 |
}
|
|
indvdum@0
|
80 |
}
|
|
indvdum@0
|
81 |
|
|
indvdum@0
|
82 |
if ($total)
|
|
indvdum@0
|
83 |
{
|
|
indvdum@0
|
84 |
$sql = 'SELECT p.post_id, p.post_subject, p.post_time, p.poster_id, p.post_username, u.username, u.username_clean, u.user_colour, t.topic_id, t.topic_title, t.topic_first_post_id, p.forum_id
|
|
indvdum@0
|
85 |
FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . USERS_TABLE . ' u
|
|
indvdum@0
|
86 |
WHERE ' . $db->sql_in_set('p.post_id', $post_list) . '
|
|
indvdum@0
|
87 |
AND t.topic_id = p.topic_id
|
|
indvdum@0
|
88 |
AND p.poster_id = u.user_id
|
|
indvdum@0
|
89 |
ORDER BY p.post_time DESC';
|
|
indvdum@0
|
90 |
$result = $db->sql_query($sql);
|
|
indvdum@0
|
91 |
|
|
indvdum@0
|
92 |
while ($row = $db->sql_fetchrow($result))
|
|
indvdum@0
|
93 |
{
|
|
indvdum@0
|
94 |
$global_topic = ($row['forum_id']) ? false : true;
|
|
indvdum@0
|
95 |
if ($global_topic)
|
|
indvdum@0
|
96 |
{
|
|
indvdum@0
|
97 |
$row['forum_id'] = $global_id;
|
|
indvdum@0
|
98 |
}
|
|
indvdum@0
|
99 |
|
|
indvdum@0
|
100 |
$template->assign_block_vars('unapproved', array(
|
|
indvdum@0
|
101 |
'U_POST_DETAILS' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=approve_details&f=' . $row['forum_id'] . '&p=' . $row['post_id']),
|
|
indvdum@0
|
102 |
'U_MCP_FORUM' => (!$global_topic) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=forum_view&f=' . $row['forum_id']) : '',
|
|
indvdum@0
|
103 |
'U_MCP_TOPIC' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=topic_view&f=' . $row['forum_id'] . '&t=' . $row['topic_id']),
|
|
indvdum@0
|
104 |
'U_FORUM' => (!$global_topic) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']) : '',
|
|
indvdum@0
|
105 |
'U_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&t=' . $row['topic_id']),
|
|
indvdum@0
|
106 |
|
|
indvdum@0
|
107 |
'AUTHOR_FULL' => get_username_string('full', $row['poster_id'], $row['username'], $row['user_colour']),
|
|
indvdum@0
|
108 |
'AUTHOR' => get_username_string('username', $row['poster_id'], $row['username'], $row['user_colour']),
|
|
indvdum@0
|
109 |
'AUTHOR_COLOUR' => get_username_string('colour', $row['poster_id'], $row['username'], $row['user_colour']),
|
|
indvdum@0
|
110 |
'U_AUTHOR' => get_username_string('profile', $row['poster_id'], $row['username'], $row['user_colour']),
|
|
indvdum@0
|
111 |
|
|
indvdum@0
|
112 |
'FORUM_NAME' => (!$global_topic) ? $forum_names[$row['forum_id']] : $user->lang['GLOBAL_ANNOUNCEMENT'],
|
|
indvdum@0
|
113 |
'POST_ID' => $row['post_id'],
|
|
indvdum@0
|
114 |
'TOPIC_TITLE' => $row['topic_title'],
|
|
indvdum@0
|
115 |
'SUBJECT' => ($row['post_subject']) ? $row['post_subject'] : $user->lang['NO_SUBJECT'],
|
|
indvdum@0
|
116 |
'POST_TIME' => $user->format_date($row['post_time']))
|
|
indvdum@0
|
117 |
);
|
|
indvdum@0
|
118 |
}
|
|
indvdum@0
|
119 |
$db->sql_freeresult($result);
|
|
indvdum@0
|
120 |
}
|
|
indvdum@0
|
121 |
|
|
indvdum@0
|
122 |
$s_hidden_fields = build_hidden_fields(array(
|
|
indvdum@0
|
123 |
'redirect' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main' . (($forum_id) ? '&f=' . $forum_id : ''))
|
|
indvdum@0
|
124 |
));
|
|
indvdum@0
|
125 |
|
|
indvdum@0
|
126 |
$template->assign_vars(array(
|
|
indvdum@0
|
127 |
'S_HIDDEN_FIELDS' => $s_hidden_fields,
|
|
indvdum@0
|
128 |
'S_MCP_QUEUE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue"),
|
|
indvdum@0
|
129 |
));
|
|
indvdum@0
|
130 |
|
|
indvdum@0
|
131 |
if ($total == 0)
|
|
indvdum@0
|
132 |
{
|
|
indvdum@0
|
133 |
$template->assign_vars(array(
|
|
indvdum@0
|
134 |
'L_UNAPPROVED_TOTAL' => $user->lang['UNAPPROVED_POSTS_ZERO_TOTAL'],
|
|
indvdum@0
|
135 |
'S_HAS_UNAPPROVED_POSTS' => false)
|
|
indvdum@0
|
136 |
);
|
|
indvdum@0
|
137 |
}
|
|
indvdum@0
|
138 |
else
|
|
indvdum@0
|
139 |
{
|
|
indvdum@0
|
140 |
$template->assign_vars(array(
|
|
indvdum@0
|
141 |
'L_UNAPPROVED_TOTAL' => ($total == 1) ? $user->lang['UNAPPROVED_POST_TOTAL'] : sprintf($user->lang['UNAPPROVED_POSTS_TOTAL'], $total),
|
|
indvdum@0
|
142 |
'S_HAS_UNAPPROVED_POSTS' => true)
|
|
indvdum@0
|
143 |
);
|
|
indvdum@0
|
144 |
}
|
|
indvdum@0
|
145 |
}
|
|
indvdum@0
|
146 |
}
|
|
indvdum@0
|
147 |
|
|
indvdum@0
|
148 |
// Latest 5 reported
|
|
indvdum@0
|
149 |
if ($module->loaded('reports'))
|
|
indvdum@0
|
150 |
{
|
|
indvdum@0
|
151 |
$forum_list = array_values(array_intersect(get_forum_list('f_read'), get_forum_list('m_report')));
|
|
indvdum@0
|
152 |
|
|
indvdum@0
|
153 |
$template->assign_var('S_SHOW_REPORTS', (!empty($forum_list)) ? true : false);
|
|
indvdum@0
|
154 |
|
|
indvdum@0
|
155 |
if (!empty($forum_list))
|
|
indvdum@0
|
156 |
{
|
|
indvdum@0
|
157 |
$sql = 'SELECT COUNT(r.report_id) AS total
|
|
indvdum@0
|
158 |
FROM ' . REPORTS_TABLE . ' r, ' . POSTS_TABLE . ' p
|
|
indvdum@0
|
159 |
WHERE r.post_id = p.post_id
|
|
indvdum@0
|
160 |
AND r.pm_id = 0
|
|
indvdum@0
|
161 |
AND r.report_closed = 0
|
|
indvdum@0
|
162 |
AND p.forum_id IN (0, ' . implode(', ', $forum_list) . ')';
|
|
indvdum@0
|
163 |
$result = $db->sql_query($sql);
|
|
indvdum@0
|
164 |
$total = (int) $db->sql_fetchfield('total');
|
|
indvdum@0
|
165 |
$db->sql_freeresult($result);
|
|
indvdum@0
|
166 |
|
|
indvdum@0
|
167 |
if ($total)
|
|
indvdum@0
|
168 |
{
|
|
indvdum@0
|
169 |
$global_id = $forum_list[0];
|
|
indvdum@0
|
170 |
|
|
indvdum@0
|
171 |
$sql = $db->sql_build_query('SELECT', array(
|
|
indvdum@0
|
172 |
'SELECT' => 'r.report_time, p.post_id, p.post_subject, p.post_time, u.username, u.username_clean, u.user_colour, u.user_id, u2.username as author_name, u2.username_clean as author_name_clean, u2.user_colour as author_colour, u2.user_id as author_id, t.topic_id, t.topic_title, f.forum_id, f.forum_name',
|
|
indvdum@0
|
173 |
|
|
indvdum@0
|
174 |
'FROM' => array(
|
|
indvdum@0
|
175 |
REPORTS_TABLE => 'r',
|
|
indvdum@0
|
176 |
REPORTS_REASONS_TABLE => 'rr',
|
|
indvdum@0
|
177 |
TOPICS_TABLE => 't',
|
|
indvdum@0
|
178 |
USERS_TABLE => array('u', 'u2'),
|
|
indvdum@0
|
179 |
POSTS_TABLE => 'p'
|
|
indvdum@0
|
180 |
),
|
|
indvdum@0
|
181 |
|
|
indvdum@0
|
182 |
'LEFT_JOIN' => array(
|
|
indvdum@0
|
183 |
array(
|
|
indvdum@0
|
184 |
'FROM' => array(FORUMS_TABLE => 'f'),
|
|
indvdum@0
|
185 |
'ON' => 'f.forum_id = p.forum_id'
|
|
indvdum@0
|
186 |
)
|
|
indvdum@0
|
187 |
),
|
|
indvdum@0
|
188 |
|
|
indvdum@0
|
189 |
'WHERE' => 'r.post_id = p.post_id
|
|
indvdum@0
|
190 |
AND r.pm_id = 0
|
|
indvdum@0
|
191 |
AND r.report_closed = 0
|
|
indvdum@0
|
192 |
AND r.reason_id = rr.reason_id
|
|
indvdum@0
|
193 |
AND p.topic_id = t.topic_id
|
|
indvdum@0
|
194 |
AND r.user_id = u.user_id
|
|
indvdum@0
|
195 |
AND p.poster_id = u2.user_id
|
|
indvdum@0
|
196 |
AND p.forum_id IN (0, ' . implode(', ', $forum_list) . ')',
|
|
indvdum@0
|
197 |
|
|
indvdum@0
|
198 |
'ORDER_BY' => 'p.post_time DESC'
|
|
indvdum@0
|
199 |
));
|
|
indvdum@0
|
200 |
$result = $db->sql_query_limit($sql, 5);
|
|
indvdum@0
|
201 |
|
|
indvdum@0
|
202 |
while ($row = $db->sql_fetchrow($result))
|
|
indvdum@0
|
203 |
{
|
|
indvdum@0
|
204 |
$global_topic = ($row['forum_id']) ? false : true;
|
|
indvdum@0
|
205 |
if ($global_topic)
|
|
indvdum@0
|
206 |
{
|
|
indvdum@0
|
207 |
$row['forum_id'] = $global_id;
|
|
indvdum@0
|
208 |
}
|
|
indvdum@0
|
209 |
|
|
indvdum@0
|
210 |
$template->assign_block_vars('report', array(
|
|
indvdum@0
|
211 |
'U_POST_DETAILS' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'f=' . $row['forum_id'] . '&p=' . $row['post_id'] . "&i=reports&mode=report_details"),
|
|
indvdum@0
|
212 |
'U_MCP_FORUM' => (!$global_topic) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'f=' . $row['forum_id'] . "&i=$id&mode=forum_view") : '',
|
|
indvdum@0
|
213 |
'U_MCP_TOPIC' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'f=' . $row['forum_id'] . '&t=' . $row['topic_id'] . "&i=$id&mode=topic_view"),
|
|
indvdum@0
|
214 |
'U_FORUM' => (!$global_topic) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']) : '',
|
|
indvdum@0
|
215 |
'U_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&t=' . $row['topic_id']),
|
|
indvdum@0
|
216 |
|
|
indvdum@0
|
217 |
'REPORTER_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']),
|
|
indvdum@0
|
218 |
'REPORTER' => get_username_string('username', $row['user_id'], $row['username'], $row['user_colour']),
|
|
indvdum@0
|
219 |
'REPORTER_COLOUR' => get_username_string('colour', $row['user_id'], $row['username'], $row['user_colour']),
|
|
indvdum@0
|
220 |
'U_REPORTER' => get_username_string('profile', $row['user_id'], $row['username'], $row['user_colour']),
|
|
indvdum@0
|
221 |
|
|
indvdum@0
|
222 |
'AUTHOR_FULL' => get_username_string('full', $row['author_id'], $row['author_name'], $row['author_colour']),
|
|
indvdum@0
|
223 |
'AUTHOR' => get_username_string('username', $row['author_id'], $row['author_name'], $row['author_colour']),
|
|
indvdum@0
|
224 |
'AUTHOR_COLOUR' => get_username_string('colour', $row['author_id'], $row['author_name'], $row['author_colour']),
|
|
indvdum@0
|
225 |
'U_AUTHOR' => get_username_string('profile', $row['author_id'], $row['author_name'], $row['author_colour']),
|
|
indvdum@0
|
226 |
|
|
indvdum@0
|
227 |
'FORUM_NAME' => (!$global_topic) ? $row['forum_name'] : $user->lang['GLOBAL_ANNOUNCEMENT'],
|
|
indvdum@0
|
228 |
'TOPIC_TITLE' => $row['topic_title'],
|
|
indvdum@0
|
229 |
'SUBJECT' => ($row['post_subject']) ? $row['post_subject'] : $user->lang['NO_SUBJECT'],
|
|
indvdum@0
|
230 |
'REPORT_TIME' => $user->format_date($row['report_time']),
|
|
indvdum@0
|
231 |
'POST_TIME' => $user->format_date($row['post_time']),
|
|
indvdum@0
|
232 |
));
|
|
indvdum@0
|
233 |
}
|
|
indvdum@0
|
234 |
}
|
|
indvdum@0
|
235 |
|
|
indvdum@0
|
236 |
if ($total == 0)
|
|
indvdum@0
|
237 |
{
|
|
indvdum@0
|
238 |
$template->assign_vars(array(
|
|
indvdum@0
|
239 |
'L_REPORTS_TOTAL' => $user->lang['REPORTS_ZERO_TOTAL'],
|
|
indvdum@0
|
240 |
'S_HAS_REPORTS' => false)
|
|
indvdum@0
|
241 |
);
|
|
indvdum@0
|
242 |
}
|
|
indvdum@0
|
243 |
else
|
|
indvdum@0
|
244 |
{
|
|
indvdum@0
|
245 |
$template->assign_vars(array(
|
|
indvdum@0
|
246 |
'L_REPORTS_TOTAL' => ($total == 1) ? $user->lang['REPORT_TOTAL'] : sprintf($user->lang['REPORTS_TOTAL'], $total),
|
|
indvdum@0
|
247 |
'S_HAS_REPORTS' => true)
|
|
indvdum@0
|
248 |
);
|
|
indvdum@0
|
249 |
}
|
|
indvdum@0
|
250 |
}
|
|
indvdum@0
|
251 |
}
|
|
indvdum@0
|
252 |
|
|
indvdum@0
|
253 |
// Latest 5 reported PMs
|
|
indvdum@0
|
254 |
if ($module->loaded('pm_reports') && $auth->acl_getf_global('m_report'))
|
|
indvdum@0
|
255 |
{
|
|
indvdum@0
|
256 |
$template->assign_var('S_SHOW_PM_REPORTS', true);
|
|
indvdum@0
|
257 |
$user->add_lang(array('ucp'));
|
|
indvdum@0
|
258 |
|
|
indvdum@0
|
259 |
$sql = 'SELECT COUNT(r.report_id) AS total
|
|
indvdum@0
|
260 |
FROM ' . REPORTS_TABLE . ' r, ' . PRIVMSGS_TABLE . ' p
|
|
indvdum@0
|
261 |
WHERE r.post_id = 0
|
|
indvdum@0
|
262 |
AND r.pm_id = p.msg_id
|
|
indvdum@0
|
263 |
AND r.report_closed = 0';
|
|
indvdum@0
|
264 |
$result = $db->sql_query($sql);
|
|
indvdum@0
|
265 |
$total = (int) $db->sql_fetchfield('total');
|
|
indvdum@0
|
266 |
$db->sql_freeresult($result);
|
|
indvdum@0
|
267 |
|
|
indvdum@0
|
268 |
if ($total)
|
|
indvdum@0
|
269 |
{
|
|
indvdum@0
|
270 |
include($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx);
|
|
indvdum@0
|
271 |
|
|
indvdum@0
|
272 |
$sql = $db->sql_build_query('SELECT', array(
|
|
indvdum@0
|
273 |
'SELECT' => 'r.report_id, r.report_time, p.msg_id, p.message_subject, p.message_time, p.to_address, p.bcc_address, u.username, u.username_clean, u.user_colour, u.user_id, u2.username as author_name, u2.username_clean as author_name_clean, u2.user_colour as author_colour, u2.user_id as author_id',
|
|
indvdum@0
|
274 |
|
|
indvdum@0
|
275 |
'FROM' => array(
|
|
indvdum@0
|
276 |
REPORTS_TABLE => 'r',
|
|
indvdum@0
|
277 |
REPORTS_REASONS_TABLE => 'rr',
|
|
indvdum@0
|
278 |
USERS_TABLE => array('u', 'u2'),
|
|
indvdum@0
|
279 |
PRIVMSGS_TABLE => 'p'
|
|
indvdum@0
|
280 |
),
|
|
indvdum@0
|
281 |
|
|
indvdum@0
|
282 |
'WHERE' => 'r.pm_id = p.msg_id
|
|
indvdum@0
|
283 |
AND r.post_id = 0
|
|
indvdum@0
|
284 |
AND r.report_closed = 0
|
|
indvdum@0
|
285 |
AND r.reason_id = rr.reason_id
|
|
indvdum@0
|
286 |
AND r.user_id = u.user_id
|
|
indvdum@0
|
287 |
AND p.author_id = u2.user_id',
|
|
indvdum@0
|
288 |
|
|
indvdum@0
|
289 |
'ORDER_BY' => 'p.message_time DESC'
|
|
indvdum@0
|
290 |
));
|
|
indvdum@0
|
291 |
$result = $db->sql_query_limit($sql, 5);
|
|
indvdum@0
|
292 |
|
|
indvdum@0
|
293 |
$pm_by_id = $pm_list = array();
|
|
indvdum@0
|
294 |
while ($row = $db->sql_fetchrow($result))
|
|
indvdum@0
|
295 |
{
|
|
indvdum@0
|
296 |
$pm_by_id[(int) $row['msg_id']] = $row;
|
|
indvdum@0
|
297 |
$pm_list[] = (int) $row['msg_id'];
|
|
indvdum@0
|
298 |
}
|
|
indvdum@0
|
299 |
|
|
indvdum@0
|
300 |
$address_list = get_recipient_strings($pm_by_id);
|
|
indvdum@0
|
301 |
|
|
indvdum@0
|
302 |
foreach ($pm_list as $message_id)
|
|
indvdum@0
|
303 |
{
|
|
indvdum@0
|
304 |
$row = $pm_by_id[$message_id];
|
|
indvdum@0
|
305 |
|
|
indvdum@0
|
306 |
$template->assign_block_vars('pm_report', array(
|
|
indvdum@0
|
307 |
'U_PM_DETAILS' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'r=' . $row['report_id'] . "&i=pm_reports&mode=pm_report_details"),
|
|
indvdum@0
|
308 |
|
|
indvdum@0
|
309 |
'REPORTER_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']),
|
|
indvdum@0
|
310 |
'REPORTER' => get_username_string('username', $row['user_id'], $row['username'], $row['user_colour']),
|
|
indvdum@0
|
311 |
'REPORTER_COLOUR' => get_username_string('colour', $row['user_id'], $row['username'], $row['user_colour']),
|
|
indvdum@0
|
312 |
'U_REPORTER' => get_username_string('profile', $row['user_id'], $row['username'], $row['user_colour']),
|
|
indvdum@0
|
313 |
|
|
indvdum@0
|
314 |
'PM_AUTHOR_FULL' => get_username_string('full', $row['author_id'], $row['author_name'], $row['author_colour']),
|
|
indvdum@0
|
315 |
'PM_AUTHOR' => get_username_string('username', $row['author_id'], $row['author_name'], $row['author_colour']),
|
|
indvdum@0
|
316 |
'PM_AUTHOR_COLOUR' => get_username_string('colour', $row['author_id'], $row['author_name'], $row['author_colour']),
|
|
indvdum@0
|
317 |
'U_PM_AUTHOR' => get_username_string('profile', $row['author_id'], $row['author_name'], $row['author_colour']),
|
|
indvdum@0
|
318 |
|
|
indvdum@0
|
319 |
'PM_SUBJECT' => $row['message_subject'],
|
|
indvdum@0
|
320 |
'REPORT_TIME' => $user->format_date($row['report_time']),
|
|
indvdum@0
|
321 |
'PM_TIME' => $user->format_date($row['message_time']),
|
|
indvdum@0
|
322 |
'RECIPIENTS' => implode(', ', $address_list[$row['msg_id']]),
|
|
indvdum@0
|
323 |
));
|
|
indvdum@0
|
324 |
}
|
|
indvdum@0
|
325 |
}
|
|
indvdum@0
|
326 |
|
|
indvdum@0
|
327 |
if ($total == 0)
|
|
indvdum@0
|
328 |
{
|
|
indvdum@0
|
329 |
$template->assign_vars(array(
|
|
indvdum@0
|
330 |
'L_PM_REPORTS_TOTAL' => $user->lang['PM_REPORTS_ZERO_TOTAL'],
|
|
indvdum@0
|
331 |
'S_HAS_PM_REPORTS' => false)
|
|
indvdum@0
|
332 |
);
|
|
indvdum@0
|
333 |
}
|
|
indvdum@0
|
334 |
else
|
|
indvdum@0
|
335 |
{
|
|
indvdum@0
|
336 |
$template->assign_vars(array(
|
|
indvdum@0
|
337 |
'L_PM_REPORTS_TOTAL' => ($total == 1) ? $user->lang['PM_REPORT_TOTAL'] : sprintf($user->lang['PM_REPORTS_TOTAL'], $total),
|
|
indvdum@0
|
338 |
'S_HAS_PM_REPORTS' => true)
|
|
indvdum@0
|
339 |
);
|
|
indvdum@0
|
340 |
}
|
|
indvdum@0
|
341 |
}
|
|
indvdum@0
|
342 |
|
|
indvdum@0
|
343 |
// Latest 5 logs
|
|
indvdum@0
|
344 |
if ($module->loaded('logs'))
|
|
indvdum@0
|
345 |
{
|
|
indvdum@0
|
346 |
$forum_list = array_values(array_intersect(get_forum_list('f_read'), get_forum_list('m_')));
|
|
indvdum@0
|
347 |
|
|
indvdum@0
|
348 |
if (!empty($forum_list))
|
|
indvdum@0
|
349 |
{
|
|
indvdum@0
|
350 |
// Add forum_id 0 for global announcements
|
|
indvdum@0
|
351 |
$forum_list[] = 0;
|
|
indvdum@0
|
352 |
|
|
indvdum@0
|
353 |
$log_count = false;
|
|
indvdum@0
|
354 |
$log = array();
|
|
indvdum@0
|
355 |
view_log('mod', $log, $log_count, 5, 0, $forum_list);
|
|
indvdum@0
|
356 |
|
|
indvdum@0
|
357 |
foreach ($log as $row)
|
|
indvdum@0
|
358 |
{
|
|
indvdum@0
|
359 |
$template->assign_block_vars('log', array(
|
|
indvdum@0
|
360 |
'USERNAME' => $row['username_full'],
|
|
indvdum@0
|
361 |
'IP' => $row['ip'],
|
|
indvdum@0
|
362 |
'TIME' => $user->format_date($row['time']),
|
|
indvdum@0
|
363 |
'ACTION' => $row['action'],
|
|
indvdum@0
|
364 |
'U_VIEW_TOPIC' => (!empty($row['viewtopic'])) ? $row['viewtopic'] : '',
|
|
indvdum@0
|
365 |
'U_VIEWLOGS' => (!empty($row['viewlogs'])) ? $row['viewlogs'] : '')
|
|
indvdum@0
|
366 |
);
|
|
indvdum@0
|
367 |
}
|
|
indvdum@0
|
368 |
}
|
|
indvdum@0
|
369 |
|
|
indvdum@0
|
370 |
$template->assign_vars(array(
|
|
indvdum@0
|
371 |
'S_SHOW_LOGS' => (!empty($forum_list)) ? true : false,
|
|
indvdum@0
|
372 |
'S_HAS_LOGS' => (!empty($log)) ? true : false)
|
|
indvdum@0
|
373 |
);
|
|
indvdum@0
|
374 |
}
|
|
indvdum@0
|
375 |
|
|
indvdum@0
|
376 |
$template->assign_var('S_MCP_ACTION', append_sid("{$phpbb_root_path}mcp.$phpEx"));
|
|
indvdum@0
|
377 |
make_jumpbox(append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=forum_view'), 0, false, 'm_', true);
|
|
indvdum@0
|
378 |
}
|
|
indvdum@0
|
379 |
|
|
indvdum@0
|
380 |
?> |