-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
reports.php
122 lines (121 loc) · 7.12 KB
/
reports.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
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
<?php
require_once "maincore.php";
if (!iADMIN)
{
redirect('/index.php');
}
require_once THEMES."templates/header.php";
$start1 = isset($_GET['start1']) && isnum($_GET['start1']) ? $_GET['start1'] : 0;
$start2 = isset($_GET['start2']) && isnum($_GET['start2']) ? $_GET['start2'] : 0;
opentable('Anmeldelser af misbrug');
$query1 = dbquery('SELECT * FROM '.DB_PREFIX.'reports WHERE report_zap < 1'.(!iSUPERADMIN ? ' AND report_type != "message_id"' : '').' ORDER BY report_id DESC LIMIT '.$start1.', 20');
echo '<table style="width: 99%;"><tr><td style="border: 1px solid black; margin: 1px; padding: 1px;">Type</td><td style="border: 1px solid black; margin: 1px; padding: 1px;">Tidspunkt</td><td style="border: 1px solid black; margin: 1px; padding: 1px;">Snitch</td><td style="border: 1px solid black; margin: 1px; padding: 1px;">Begrundelse</td><td style="border: 1px solid black; margin: 1px; padding: 1px;">Link</td><td style="border: 1px solid black; margin: 1px; padding: 1px;">Zap</td></tr>';
while ($row1 = dbarray($query1))
{
$row1['report_content'] = preg_replace('/\[(\/){0,1}img\]/','[$1url]',phpentities($row1['report_content']));
$report_linky = 'Væk';
if ($row1['report_type'] == 'post_id')
{
$query3 = dbquery('SELECT post_id, thread_id FROM '.DB_POSTS.' WHERE post_id = '.$row1['report_subject']);
if ($row3 = dbarray($query3))
{
$report_linky = '<a href="/forum/viewthread.php?thread_id='.$row3['thread_id'].'&post_id='.$row3['post_id'].'#post_'.$row3['post_id'].'">Link</a>';
}
}
elseif ($row1['report_type'] == 'comment_id')
{
$query3 = dbquery('SELECT comment_id, comment_item_id, comment_type FROM '.DB_PREFIX.'comments WHERE comment_id = '.$row1['report_subject']);
if ($row3 = dbarray($query3))
{
if ($row3['comment_type'] == 'N')
{
$report_linky = '<a href="/news.php?readmore='.$row3['comment_item_id'].'#c'.$row3['comment_id'].'">Link</a>';
}
elseif ($row3['comment_type'] == 'A')
{
$report_linky = '<a href="/articles.php?article_id='.$row3['comment_item_id'].'#c'.$row3['comment_id'].'">Link</a>';
}
}
}
elseif ($row1['report_type'] == 'user_id')
{
$query3 = dbquery('SELECT user_id FROM '.DB_USERS.' WHERE user_id = '.$row1['report_subject']);
if ($row3 = dbarray($query3))
{
$report_linky = '<a href="/profile.php?lookup='.$row3['user_id'].'">Link</a>';
}
}
elseif ($row1['report_type'] == 'bp_id')
{
$query3 = dbquery('SELECT bp_id FROM '.DB_PREFIX.'blogposts WHERE bp_id = '.$row1['report_subject']);
if ($row3 = dbarray($query3))
{
$report_linky = '<a href="/blog/vis.php?bp_id='.$row3['bp_id'].'">Link</a>';
}
}
elseif ($row1['report_type'] == 'message_id')
{
$report_linky = 'Næ';
}
echo '<tr><td style="border: 1px solid black; margin: 1px; padding: 1px;">'.$row1['report_type'].'</td><td style="border: 1px solid black; margin: 1px; padding: 1px;">'.showdate('forumdate',$row1['report_timestamp']).'</td><td style="border: 1px solid black; margin: 1px; padding: 1px;"><a href="/profile.php?lookup='.$row1['report_uid'].'">'.$row1['report_uid'].'</a></td><td style="border: 1px solid black; margin: 1px; padding: 1px;">'.parseubb($row1['report_content']).'</td><td style="border: 1px solid black; margin: 1px; padding: 1px;">'.$report_linky.'</td><td style="border: 1px solid black; margin: 1px; padding: 1px;"><form method="post" action="/report.php?action=zap"><input type="hidden" name="report_id" value="'.$row1['report_id'].'"><input type="submit" value="Zap" /></form></td></tr>';
}
echo '</table>';
echo makepagenav($_GET['start1'],20,dbrows(dbquery('SELECT report_zap FROM '.DB_PREFIX.'reports WHERE report_zap < 1')),3,'/reports.php?start2='.$start2.'&','start1');
closetable();
opentable('Zappede');
$query1 = dbquery('SELECT * FROM '.DB_PREFIX.'reports WHERE report_zap > 0'.(!iSUPERADMIN ? ' AND report_type != "message_id"' : '').' ORDER BY report_id DESC LIMIT '.$start2.', 20');
echo '<table style="width: 99%;"><tr><td style="border: 1px solid black; margin: 1px; padding: 1px;">Type</td><td style="border: 1px solid black; margin: 1px; padding: 1px;">Tid</td><td style="border: 1px solid black; margin: 1px; padding: 1px;">Snitch</td><td style="border: 1px solid black; margin: 1px; padding: 1px;">Grund</td><td style="border: 1px solid black; margin: 1px; padding: 1px;">Zapper</td><td style="border: 1px solid black; margin: 1px; padding: 1px;">Zapped</td><td style="border: 1px solid black; margin: 1px; padding: 1px;">Link</td></tr>';
while ($row1 = dbarray($query1))
{
$row1['report_content'] = preg_replace('/\[(\/){0,1}img\]/','[$1url]',phpentities($row1['report_content']));
$report_linky = 'Væk';
if ($row1['report_type'] == 'post_id')
{
$query3 = dbquery('SELECT post_id, thread_id FROM '.DB_POSTS.' WHERE post_id = '.$row1['report_subject']);
if ($row3 = dbarray($query3))
{
$report_linky = '<a href="/forum/viewthread.php?thread_id='.$row3['thread_id'].'&post_id='.$row3['post_id'].'#post_'.$row3['post_id'].'">Link</a>';
}
}
elseif ($row1['report_type'] == 'comment_id')
{
$query3 = dbquery('SELECT comment_id, comment_item_id, comment_type FROM '.DB_COMMENTS.' WHERE comment_id = '.$row1['report_subject']);
if ($row3 = dbarray($query3))
{
if ($row3['comment_type'] == 'N')
{
$report_linky = '<a href="/news.php?readmore='.$row3['comment_item_id'].'#c'.$row3['comment_id'].'">Link</a>';
}
elseif ($row3['comment_type'] == 'A')
{
$report_linky = '<a href="/articles.php?article_id='.$row3['comment_item_id'].'#c'.$row3['comment_id'].'">Link</a>';
}
}
}
elseif ($row1['report_type'] == 'user_id')
{
$query3 = dbquery('SELECT user_id FROM '.DB_USERS.' WHERE user_id = '.$row1['report_subject']);
if ($row3 = dbarray($query3))
{
$report_linky = '<a href="/profile.php?lookup='.$row3['user_id'].'">Link</a>';
}
}
elseif ($row1['report_type'] == 'bp_id')
{
$query3 = dbquery('SELECT bp_id FROM '.DB_PREFIX.'blogposts WHERE bp_id = '.$row1['report_subject']);
if ($row3 = dbarray($query3))
{
$report_linky = '<a href="/blog/vis.php?bp_id='.$row3['bp_id'].'">Link</a>';
}
}
elseif ($row1['report_type'] == 'message_id')
{
$report_linky = 'Næ';
}
echo '<tr><td style="border: 1px solid black; margin: 1px; padding: 1px;">'.$row1['report_type'].'</td><td style="border: 1px solid black; margin: 1px; padding: 1px;">'.showdate('forumdate',$row1['report_timestamp']).'</td><td style="border: 1px solid black; margin: 1px; padding: 1px;"><a href="/profile.php?lookup='.$row1['report_uid'].'">'.$row1['report_uid'].'</a></td><td style="border: 1px solid black; margin: 1px; padding: 1px;">'.parseubb($row1['report_content']).'</td><td style="border: 1px solid black; margin: 1px; padding: 1px;"><a href="/profile.php?lookup='.$row1['report_zapper'].'">'.$row1['report_zapper'].'</a></td><td style="border: 1px solid black; margin: 1px; padding: 1px;">'.showdate('forumdate',$row1['report_zap']).'</td><td style="border: 1px solid black; margin: 1px; padding: 1px;">'.$report_linky.'</td></tr>';
}
echo '</table>';
echo makepagenav($_GET['start2'],20,dbrows(dbquery('SELECT report_zap FROM '.DB_PREFIX.'reports WHERE report_zap > 0')),3,'/reports.php?start1='.$start1.'&','start2');
closetable();
require_once THEMES."templates/footer.php";
?>