Lighttpd conf file added for lighttpd webservers
[atbbs.git] / failed_postings.php
blob588b9cc331df1c6d84157935d26a05e998d49a2e
1 <?php
3 require('includes/header.php');
4 update_activity('failed_postings');
5 $page_title = 'Failed postings';
7 $items_per_page = ITEMS_PER_PAGE;
8 $stmt = $link->prepare('SELECT time, uid, reason, headline, body FROM failed_postings ORDER BY time DESC LIMIT ?');
9 $stmt->bind_param('i', $items_per_page);
10 $stmt->execute();
11 $stmt->bind_result($fail_time, $fail_uid, $fail_reason, $fail_headline, $fail_body);
13 $table = new table();
15 $columns = array
17 'Error message',
18 'Poster',
19 'Age ▼'
21 if( ! $moderator && ! $administrator)
23 array_splice($columns, 1, 1);
26 $table->define_columns($columns, 'Error message');
28 while($stmt->fetch())
30 if(strlen($fail_body) > 600)
32 $fail_body = substr($fail_body, 0, 600) . ' …';
35 $tooltip = '';
36 if(empty($fail_headline))
38 $tooltip = $fail_body;
40 else if( ! empty($fail_body))
42 $tooltip = 'Headline: ' . $fail_headline . ' Body: ' . $fail_body;
45 $fail_reasons = unserialize($fail_reason);
46 $error_message = '<ul class="error_message';
47 if( ! empty($tooltip))
49 $error_message .= ' help';
51 $error_message .= '" title="' . htmlspecialchars($tooltip) . '">';
52 foreach($fail_reasons as $reason)
54 $error_message .= '<li>' . $reason . '</li>';
56 $error_message .= '</ul>';
58 $values = array
60 $error_message,
61 '<a href="/profile/' . $fail_uid . '">' . $fail_uid . '</a>',
62 '<span class="help" title="' . format_date($fail_time) . '">' . calculate_age($fail_time) . '</span>'
64 if( ! $moderator && ! $administrator)
66 array_splice($values, 1, 1);
69 $table->row($values);
71 $stmt->close();
72 echo $table->output('failed postings');
74 require('includes/footer.php');