-
Notifications
You must be signed in to change notification settings - Fork 0
/
failed_postings.php
executable file
·75 lines (63 loc) · 1.66 KB
/
failed_postings.php
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
<?php
require('includes/header.php');
update_activity('failed_postings');
$page_title = 'Failed postings';
Output::Assign('sidebar',$sidebar);
Output::$tpl->display('dashhead.tpl.php');
$items_per_page = ITEMS_PER_PAGE;
$res=DB::Execute('SELECT time, uid, reason, headline, body FROM {P}FailedPostings ORDER BY time DESC LIMIT '.$items_per_page);
$table = new TablePrinter('tblFail');
$columns = array
(
'Error message',
'Poster',
'Age ▼'
);
if(isPowerUser())
{
array_splice($columns, 1, 1);
}
$table->DefineColumns($columns, 'Error message');
while(list($fail_time, $fail_uid, $fail_reason, $fail_headline, $fail_body)=$res->FetchRow())
{
if(strlen($fail_body) > 600)
{
$fail_body = substr($fail_body, 0, 600) . ' …';
}
$tooltip = '';
if(empty($fail_headline))
{
$tooltip = $fail_body;
}
else if( ! empty($fail_body))
{
$tooltip = 'Headline: ' . $fail_headline . ' Body: ' . $fail_body;
}
$fail_reasons = unserialize($fail_reason);
$error_message = '<ul class="error_message';
if( ! empty($tooltip))
{
$error_message .= ' help';
}
$error_message .= '" title="' . htmlspecialchars($tooltip) . '">';
foreach($fail_reasons as $reason)
{
$error_message .= '<li>' . $reason . '</li>';
}
$error_message .= '</ul>';
$values = array
(
$error_message,
'<a href="/profile/' . $fail_uid . '">' . $fail_uid . '</a>',
'<span class="help" title="' . format_date($fail_time) . '">' . calculate_age($fail_time) . '</span>'
);
if( ! $moderator && ! $administrator)
{
array_splice($values, 1, 1);
}
$table->Row($values);
}
echo $table->Output('failed postings');
Output::$tpl->display('dashfooter.tpl.php');
require('includes/footer.php');
?>