-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathmilestones.php
146 lines (133 loc) · 4.79 KB
/
milestones.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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<?php
require 'lib/function.php';
$windowtitle="$boardname -- Milestones";
require 'lib/layout.php';
$posts = max(10000, intval($_GET['p']));
$threads = max(1000, intval($_GET['t']));
$tmp1 = $tmp2 = 0;
$milestones = $sql->query("SELECT p.*, t.title as threadname, u.name as uname, u.sex as usex, u.powerlevel as upowerlevel, f.id as fid, f.title as ftitle, f.minpower as mpl "
."FROM posts p "
."LEFT JOIN users u ON p.user = u.id "
."LEFT JOIN threads t ON p.thread = t.id "
."LEFT JOIN forums f ON t.forum = f.id "
."WHERE (p.id % $posts = 0 OR p.id = 1) "
."ORDER BY p.id ASC");
$poststable = "<tr>$tccellh colspan=6 style=\"font-weight:bold;\">Post Milestones</td></tr><tr>
$tccellh width=30> </td>
$tccellh width=280>Forum</td>
$tccellh width=*>In Thread</td>
$tccellh width=200>User</td>
$tccellh width=250>Time</td>
</tr>";
$last = 0;
while ($ms = $sql->fetch($milestones)) {
$tmp2 = $ms['id'];
while (($tmp2 -= $posts) > $tmp1) {
$poststable .= "<tr>
$tccell1>$tmp2</td>
$tccell2><i>(unknown)</i></td>
$tccell2><i>(post deleted)</i></td>
$tccell1>????</td>
$tccell1>????<br>$smallfont(????)</td>
</td>";
}
$tmp1 = $ms['id'];
if ($ms['mpl'] && $ms['mpl'] > $loguser['powerlevel']) {
$forumlink = "<i>(restricted forum)</i>";
$threadlink = "<i>(restricted)</i>";
$userlink = "????";
}
else {
$forumlink = "<a href='forum.php?id=$ms[fid]'>$ms[ftitle]</a>";
$threadlink = "<a href='thread.php?pid=$ms[id]#$ms[id]'>$ms[threadname]</a>";
$userlink = "<a href='profile.php?id=$ms[user]'><font ". getnamecolor($ms['usex'], $ms['upowerlevel']) .">$ms[uname]</font></a>";
}
if ($last)
$timetaken = "<br>$smallfont(".timeunits($ms['date']-$last).")";
else
$timetaken = "<br>$smallfont(first post)";
$last = $ms['date'];
$timestamp = date($dateformat,$ms['date']+$tzoff).$timetaken;
$poststable .= "<tr>
$tccell1>$ms[id]</td>
$tccell2>$forumlink</td>
$tccell2>$threadlink</td>
$tccell1>$userlink</td>
$tccell1>$timestamp</td>
</td>";
}
$tmp1 = $tmp2 = 0;
$milestones = $sql->query("SELECT t.*,u1.name AS name1,u1.sex AS sex1,u1.powerlevel AS power1,u2.name AS name2,u2.sex AS sex2,u2.powerlevel AS power2, f.minpower as mpl, f.title as forumtitle "
."FROM threads t,forums f,users u1,users u2 "
."WHERE (t.id % $threads = 0 OR t.id = 1) "
."AND f.id=t.forum "
."AND u1.id=t.user "
."AND u2.id=t.lastposter "
."ORDER BY t.id ASC");
$threadstable = "<tr>$tccellh colspan=7 style=\"font-weight:bold;\">Thread Milestones</td></tr><tr>
$tccellh width=30></td>
$tccellh colspan=2> Thread</td>
$tccellh width=20%>Started by</td>
$tccellh width=60> Replies</td>
$tccellh width=60> Views</td>
$tccellh width=180> Last post</td>
</tr>";
while ($ms = $sql->fetch($milestones)) {
$tmp2 = $ms['id'];
while (($tmp2 -= $threads) > $tmp1) {
$threadstable .= "<tr>
$tccell1>$tmp2</td>
$tccell1 width=40px> </td>
$tccell2l><i>(thread deleted)</i></td>
$tccell2>????</td>
$tccell1>????</td>
$tccell1>????</td>
$tccell1>????$smallfont<br>by ????</td>
</td>";
}
$tmp1 = $ms['id'];
if ($ms['mpl'] && $ms['mpl'] > $loguser['powerlevel']) {
$threadlink = "<i>(restricted)</i>";
$userlink = "????";
$tpic = " ";
$replies = "????";
$views = "????";
$lastpost = "????$smallfont<br>by ????";
}
else {
$threadlink = "<a href='thread.php?id=$ms[id]'>$ms[title]</a>";
$threadlink .= '<br><span class="fonts" style="position: relative; top: -1px;"> '
."In <a href='forum.php?id=$ms[forum]'>".$ms['forumtitle']."</a>"
.'</span>';
$userlink = "<a href='profile.php?id=$ms[user]'><font ". getnamecolor($ms['sex1'], $ms['power1']) .">$ms[name1]</font></a>";
$lastpost = date($dateformat,$ms['lastpostdate']+$tzoff)."
$smallfont<br>by <a href='profile.php?id=$ms[user]'><font ". getnamecolor($ms['sex2'], $ms['power2']) .">$ms[name2]</font></a>
<a href='thread.php?id=$ms[id]&end=1'>$statusicons[getlast]</a>
";
$replies = $ms['replies'];
$views = $ms['views'];
$tpic = ($ms['icon']) ? "<img src='$ms[icon]'>" : " ";
}
$threadstable .= "<tr>
$tccell1>$ms[id]</td>
$tccell1 width=40px style=\"max-width:40px;max-height:30px;overflow:hidden;\">$tpic</td>
$tccell2l>$threadlink</td>
$tccell2>$userlink</td>
$tccell1>$replies</td>
$tccell1>$views</td>
$tccell1>$lastpost</td>
</td>";
}
print "
$header
<br>
<table class='table' cellspacing='0'>
$poststable
$tblend
<br>
$tblstart
$threadstable
$tblend
$footer";
printtimedif($startingtime);
?>