Zeile 24 | Zeile 24 |
---|
$query = $db->simple_select("warnings", "*", "wid='".$mybb->get_input('wid', MyBB::INPUT_INT)."'"); $warning = $db->fetch_array($query);
|
$query = $db->simple_select("warnings", "*", "wid='".$mybb->get_input('wid', MyBB::INPUT_INT)."'"); $warning = $db->fetch_array($query);
|
if(!$warning['wid'])
| if(!$warning)
|
{ flash_message($lang->error_invalid_warning, 'error'); admin_redirect("index.php?module=tools-warninglog");
| { flash_message($lang->error_invalid_warning, 'error'); admin_redirect("index.php?module=tools-warninglog");
|
Zeile 96 | Zeile 96 |
---|
"); $warning = $db->fetch_array($query);
|
"); $warning = $db->fetch_array($query);
|
if(!$warning['wid'])
| if(!$warning)
|
{ flash_message($lang->error_invalid_warning, 'error'); admin_redirect("index.php?module=tools-warninglog");
| { flash_message($lang->error_invalid_warning, 'error'); admin_redirect("index.php?module=tools-warninglog");
|
Zeile 110 | Zeile 110 |
---|
$page->output_header($lang->warning_details);
|
$page->output_header($lang->warning_details);
|
$user_link = build_profile_link($user['username'], $user['uid'], "_blank");
| $user_link = build_profile_link(htmlspecialchars_uni($user['username']), $user['uid'], "_blank");
|
|
|
if(is_array($warn_errors))
| if(isset($warn_errors) && is_array($warn_errors))
|
{ $page->output_inline_error($warn_errors); $mybb->input['reason'] = htmlspecialchars_uni($mybb->input['reason']);
| { $page->output_inline_error($warn_errors); $mybb->input['reason'] = htmlspecialchars_uni($mybb->input['reason']);
|
Zeile 142 | Zeile 142 |
---|
$table->construct_row(); }
|
$table->construct_row(); }
|
$issuedby = build_profile_link($warning['username'], $warning['issuedby'], "_blank");
| $issuedby = build_profile_link(htmlspecialchars_uni($warning['username']), $warning['issuedby'], "_blank");
|
$notes = nl2br(htmlspecialchars_uni($warning['notes']));
$date_issued = my_date('relative', $warning['dateline']);
| $notes = nl2br(htmlspecialchars_uni($warning['notes']));
$date_issued = my_date('relative', $warning['dateline']);
|
Zeile 204 | Zeile 204 |
---|
$form_container = new FormContainer($lang->revoke_warning); echo $form->generate_hidden_field('action', 'do_revoke'); echo $form->generate_hidden_field('wid', $warning['wid']);
|
$form_container = new FormContainer($lang->revoke_warning); echo $form->generate_hidden_field('action', 'do_revoke'); echo $form->generate_hidden_field('wid', $warning['wid']);
|
$form_container->output_row("", $lang->revoke_warning_desc, $form->generate_text_area('reason', $mybb->input['reason'], array('id' => 'reason')), 'reason');
| $form_container->output_row("", $lang->revoke_warning_desc, $form->generate_text_area('reason', $mybb->get_input('reason'), array('id' => 'reason')), 'reason');
|
$form_container->end(); $buttons[] = $form->generate_submit_button($lang->revoke_warning);
| $form_container->end(); $buttons[] = $form->generate_submit_button($lang->revoke_warning);
|
Zeile 215 | Zeile 215 |
---|
{ $date_revoked = my_date('relative', $warning['daterevoked']); $revoked_user = get_user($warning['revokedby']);
|
{ $date_revoked = my_date('relative', $warning['daterevoked']); $revoked_user = get_user($warning['revokedby']);
|
$revoked_by = build_profile_link($revoked_user['username'], $revoked_user['uid'], "_blank");
| $revoked_by = build_profile_link(htmlspecialchars_uni($revoked_user['username']), $revoked_user['uid'], "_blank");
|
$revoke_reason = nl2br(htmlspecialchars_uni($warning['revokereason']));
$revoke_table = new Table;
| $revoke_reason = nl2br(htmlspecialchars_uni($warning['revokereason']));
$revoke_table = new Table;
|
Zeile 245 | Zeile 245 |
---|
);
$page->output_nav_tabs($sub_tabs, 'warning_logs');
|
);
$page->output_nav_tabs($sub_tabs, 'warning_logs');
|
| if(empty($mybb->input['filter'])) { $mybb->input['filter'] = array(); }
|
// Filter options $where_sql = '';
| // Filter options $where_sql = '';
|
Zeile 253 | Zeile 258 |
---|
$search_user = get_user_by_username($mybb->input['filter']['username']);
$mybb->input['filter']['uid'] = (int)$search_user['uid'];
|
$search_user = get_user_by_username($mybb->input['filter']['username']);
$mybb->input['filter']['uid'] = (int)$search_user['uid'];
|
$mybb->input['filter']['uid'] = $db->fetch_field($query, "uid");
| |
}
|
}
|
if($mybb->input['filter']['uid'])
| if(!empty($mybb->input['filter']['uid']))
|
{ $search['uid'] = (int)$mybb->input['filter']['uid']; $where_sql .= " AND w.uid='{$search['uid']}'";
| { $search['uid'] = (int)$mybb->input['filter']['uid']; $where_sql .= " AND w.uid='{$search['uid']}'";
|
Zeile 271 | Zeile 275 |
---|
$mybb->input['filter']['mod_uid'] = (int)$mod_user['uid']; }
|
$mybb->input['filter']['mod_uid'] = (int)$mod_user['uid']; }
|
if($mybb->input['filter']['mod_uid'])
| if(!empty($mybb->input['filter']['mod_uid']))
|
{ $search['mod_uid'] = (int)$mybb->input['filter']['mod_uid']; $where_sql .= " AND w.issuedby='{$search['mod_uid']}'";
| { $search['mod_uid'] = (int)$mybb->input['filter']['mod_uid']; $where_sql .= " AND w.issuedby='{$search['mod_uid']}'";
|
Zeile 281 | Zeile 285 |
---|
$mybb->input['search']['mod_username'] = $mod_user['username']; } }
|
$mybb->input['search']['mod_username'] = $mod_user['username']; } }
|
if($mybb->input['filter']['reason'])
| if(!empty($mybb->input['filter']['reason']))
|
{ $search['reason'] = $db->escape_string_like($mybb->input['filter']['reason']); $where_sql .= " AND (w.notes LIKE '%{$search['reason']}%' OR t.title LIKE '%{$search['reason']}%' OR w.title LIKE '%{$search['reason']}%')"; } $sortbysel = array();
|
{ $search['reason'] = $db->escape_string_like($mybb->input['filter']['reason']); $where_sql .= " AND (w.notes LIKE '%{$search['reason']}%' OR t.title LIKE '%{$search['reason']}%' OR w.title LIKE '%{$search['reason']}%')"; } $sortbysel = array();
|
switch($mybb->input['filter']['sortby'])
| $sortby_input = ''; if(!empty($mybb->input['filter']['sortby'])) { $sortby_input = $mybb->input['filter']['sortby']; } switch($sortby_input)
|
{ case "username": $sortby = "u.username";
| { case "username": $sortby = "u.username";
|
Zeile 305 | Zeile 314 |
---|
$sortby = "w.dateline"; $sortbysel['dateline'] = ' selected="selected"'; }
|
$sortby = "w.dateline"; $sortbysel['dateline'] = ' selected="selected"'; }
|
$order = $mybb->input['filter']['order'];
| |
$ordersel = array();
|
$ordersel = array();
|
if($order != "asc")
| if(empty($mybb->input['filter']['order']) || $mybb->input['filter']['order'] != "asc")
|
{ $order = "desc"; $ordersel['desc'] = ' selected="selected"';
| { $order = "desc"; $ordersel['desc'] = ' selected="selected"';
|
Zeile 328 | Zeile 336 |
---|
SELECT COUNT(wid) as count FROM ".TABLE_PREFIX."warnings w
|
SELECT COUNT(wid) as count FROM ".TABLE_PREFIX."warnings w
|
LEFT JOIN ".TABLE_PREFIX."warningtypes t ON (w.tid=t.tid) WHERE 1=1
| LEFT JOIN ".TABLE_PREFIX."warningtypes t ON (w.tid=t.tid) WHERE 1=1
|
{$where_sql} "; $query = $db->query($sql); $total_warnings = $db->fetch_field($query, 'count'); $view_page = 1; if(isset($mybb->input['page']) && $mybb->get_input('page', MyBB::INPUT_INT) > 0)
|
{$where_sql} "; $query = $db->query($sql); $total_warnings = $db->fetch_field($query, 'count'); $view_page = 1; if(isset($mybb->input['page']) && $mybb->get_input('page', MyBB::INPUT_INT) > 0)
|
{
| {
|
$view_page = $mybb->get_input('page', MyBB::INPUT_INT); } $per_page = 20;
| $view_page = $mybb->get_input('page', MyBB::INPUT_INT); } $per_page = 20;
|
Zeile 345 | Zeile 353 |
---|
$per_page = (int)$mybb->input['filter']['per_page']; } $start = ($view_page-1) * $per_page;
|
$per_page = (int)$mybb->input['filter']['per_page']; } $start = ($view_page-1) * $per_page;
|
| $pages = ceil($total_warnings / $per_page); if($view_page > $pages) { $start = 0; $view_page = 1; }
|
// Build the base URL for pagination links $url = 'index.php?module=tools-warninglog'; if(is_array($mybb->input['filter']) && count($mybb->input['filter']))
| // Build the base URL for pagination links $url = 'index.php?module=tools-warninglog'; if(is_array($mybb->input['filter']) && count($mybb->input['filter']))
|
Zeile 353 | Zeile 367 |
---|
{ $value = urlencode($value); $url .= "&filter[{$field}]={$value}";
|
{ $value = urlencode($value); $url .= "&filter[{$field}]={$value}";
|
} }
| } }
|
// The actual query $sql = " SELECT
| // The actual query $sql = " SELECT
|
Zeile 391 | Zeile 405 |
---|
}
$trow = alt_trow();
|
}
$trow = alt_trow();
|
$username = format_name($row['username'], $row['usergroup'], $row['displaygroup']);
| $username = format_name(htmlspecialchars_uni($row['username']), $row['usergroup'], $row['displaygroup']);
|
if(!$row['uid']) { $username_link = $username;
| if(!$row['uid']) { $username_link = $username;
|
Zeile 400 | Zeile 414 |
---|
{ $username_link = build_profile_link($username, $row['uid'], "_blank"); }
|
{ $username_link = build_profile_link($username, $row['uid'], "_blank"); }
|
$mod_username = format_name($row['mod_username'], $row['mod_usergroup'], $row['mod_displaygroup']);
| $mod_username = format_name(htmlspecialchars_uni($row['mod_username']), $row['mod_usergroup'], $row['mod_displaygroup']);
|
$mod_username_link = build_profile_link($mod_username, $row['mod_uid'], "_blank"); $issued_date = my_date('relative', $row['dateline']); $revoked_text = '';
| $mod_username_link = build_profile_link($mod_username, $row['mod_uid'], "_blank"); $issued_date = my_date('relative', $row['dateline']); $revoked_text = '';
|
Zeile 408 | Zeile 422 |
---|
{ $revoked_date = my_date('relative', $row['daterevoked']); $revoked_text = "<br /><small><strong>{$lang->revoked}</strong> {$revoked_date}</small>";
|
{ $revoked_date = my_date('relative', $row['daterevoked']); $revoked_text = "<br /><small><strong>{$lang->revoked}</strong> {$revoked_date}</small>";
|
}
| }
|
if($row['expires'] > 0)
|
if($row['expires'] > 0)
|
{
| {
|
$expire_date = my_date('relative', $row['expires']); } else { $expire_date = $lang->never;
|
$expire_date = my_date('relative', $row['expires']); } else { $expire_date = $lang->never;
|
}
| }
|
$title = $row['title']; if(empty($row['title']))
|
$title = $row['title']; if(empty($row['title']))
|
{
| {
|
$title = $row['custom_title']; } $title = htmlspecialchars_uni($title); if($row['points'] > 0) {
|
$title = $row['custom_title']; } $title = htmlspecialchars_uni($title); if($row['points'] > 0) {
|
$points = '+'.$row['points'];
| $row['points'] = "+{$row['points']}";
|
}
|
}
|
| $points = $lang->sprintf($lang->warning_points, $row['points']);
|
$table->construct_cell($username_link);
|
$table->construct_cell($username_link);
|
$table->construct_cell("{$title} ({$points})");
| $table->construct_cell("{$title} {$points}");
|
$table->construct_cell($issued_date, array("class" => "align_center")); $table->construct_cell($expire_date.$revoked_text, array("class" => "align_center")); $table->construct_cell($mod_username_link); $table->construct_cell("<a href=\"index.php?module=tools-warninglog&action=view&wid={$row['wid']}\">{$lang->view}</a>", array("class" => "align_center"));
|
$table->construct_cell($issued_date, array("class" => "align_center")); $table->construct_cell($expire_date.$revoked_text, array("class" => "align_center")); $table->construct_cell($mod_username_link); $table->construct_cell("<a href=\"index.php?module=tools-warninglog&action=view&wid={$row['wid']}\">{$lang->view}</a>", array("class" => "align_center"));
|
$table->construct_row(); }
| $table->construct_row(); }
|
if($table->num_rows() == 0) { $table->construct_cell($lang->no_warning_logs, array("colspan" => "6"));
| if($table->num_rows() == 0) { $table->construct_cell($lang->no_warning_logs, array("colspan" => "6"));
|
Zeile 449 | Zeile 464 |
---|
if($total_warnings > $per_page) { echo draw_admin_pagination($view_page, $per_page, $total_warnings, $url)."<br />";
|
if($total_warnings > $per_page) { echo draw_admin_pagination($view_page, $per_page, $total_warnings, $url)."<br />";
|
}
| }
|
$sort_by = array( 'expires' => $lang->expiry_date,
| $sort_by = array( 'expires' => $lang->expiry_date,
|
Zeile 462 | Zeile 477 |
---|
'asc' => $lang->asc, 'desc' => $lang->desc );
|
'asc' => $lang->asc, 'desc' => $lang->desc );
|
| $user_filters = array(); $input_filters = $mybb->get_input('filter', MyBB::INPUT_ARRAY); foreach(array('username', 'mod_username', 'reason', 'sortby') as $key) { if(isset($input_filters[$key])) { $user_filters[$key] = $input_filters[$key]; } else { $user_filters[$key] = ''; } }
|
$form = new Form("index.php?module=tools-warninglog", "post"); $form_container = new FormContainer($lang->filter_warning_logs);
|
$form = new Form("index.php?module=tools-warninglog", "post"); $form_container = new FormContainer($lang->filter_warning_logs);
|
$form_container->output_row($lang->filter_warned_user, "", $form->generate_text_box('filter[username]', $mybb->input['filter']['username'], array('id' => 'filter_username')), 'filter_username'); $form_container->output_row($lang->filter_issued_by, "", $form->generate_text_box('filter[mod_username]', $mybb->input['filter']['mod_username'], array('id' => 'filter_mod_username')), 'filter_mod_username'); $form_container->output_row($lang->filter_reason, "", $form->generate_text_box('filter[reason]', $mybb->input['filter']['reason'], array('id' => 'filter_reason')), 'filter_reason'); $form_container->output_row($lang->sort_by, "", $form->generate_select_box('filter[sortby]', $sort_by, $mybb->input['filter']['sortby'], array('id' => 'filter_sortby'))." {$lang->in} ".$form->generate_select_box('filter[order]', $order_array, $order, array('id' => 'filter_order'))." {$lang->order}", 'filter_order');
| $form_container->output_row($lang->filter_warned_user, "", $form->generate_text_box('filter[username]', $user_filters['username'], array('id' => 'filter_username')), 'filter_username'); $form_container->output_row($lang->filter_issued_by, "", $form->generate_text_box('filter[mod_username]', $user_filters['mod_username'], array('id' => 'filter_mod_username')), 'filter_mod_username'); $form_container->output_row($lang->filter_reason, "", $form->generate_text_box('filter[reason]', $user_filters['reason'], array('id' => 'filter_reason')), 'filter_reason'); $form_container->output_row($lang->sort_by, "", $form->generate_select_box('filter[sortby]', $sort_by, $user_filters['sortby'], array('id' => 'filter_sortby'))." {$lang->in} ".$form->generate_select_box('filter[order]', $order_array, $order, array('id' => 'filter_order'))." {$lang->order}", 'filter_order');
|
$form_container->output_row($lang->results_per_page, "", $form->generate_numeric_field('filter[per_page]', $per_page, array('id' => 'filter_per_page', 'min' => 1)), 'filter_per_page');
$form_container->end();
| $form_container->output_row($lang->results_per_page, "", $form->generate_numeric_field('filter[per_page]', $per_page, array('id' => 'filter_per_page', 'min' => 1)), 'filter_per_page');
$form_container->end();
|