forked from necrophcodr/Muks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshow_user_posts.php
72 lines (66 loc) · 3.54 KB
/
show_user_posts.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
<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2011 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: my_posts.php
| Author: Nick Jones (Digitanium)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "maincore.php";
require_once THEMES."templates/header.php";
if (!iSUPERADMIN || !isset($_GET['lookup']) || !isnum($_GET['lookup'])) { redirect("/index.php"); }
$lookup = $_GET['lookup'];
add_to_title(' - Liste over brugers indlæg');
$result = dbquery(
"SELECT tp.post_id, tp.post_alias FROM ".DB_POSTS." tp
INNER JOIN ".DB_THREADS." tt ON tp.thread_id = tt.thread_id
INNER JOIN ".DB_FORUMS." tf ON tp.forum_id = tf.forum_id
WHERE ".groupaccess('forum_access')." AND post_author='".$lookup."' AND post_hidden='0' AND thread_hidden='0' AND tp.post_alias = '-1'"
);
$rows = dbrows($result);
if ($rows) {
if (!isset($_GET['rowstart']) || !isnum($_GET['rowstart'])) { $_GET['rowstart'] = 0; }
$result = dbquery(
"SELECT tp.forum_id, tp.thread_id, tp.post_id, tp.post_author, tp.post_datestamp, tp.post_alias,
tf.forum_name, tf.forum_access, tt.thread_subject
FROM ".DB_POSTS." tp
INNER JOIN ".DB_FORUMS." tf ON tp.forum_id=tf.forum_id
INNER JOIN ".DB_THREADS." tt ON tp.thread_id=tt.thread_id
WHERE ".groupaccess('tf.forum_access')." AND tp.post_author='".$lookup."' AND post_hidden='0' AND thread_hidden='0'".(iSUPERADMIN ? '' : ' AND tp.post_alias = "-1"')."
ORDER BY tp.post_datestamp DESC LIMIT ".$_GET['rowstart'].",20"
);
$i = 0;
opentable('Liste over brugers indlæg');
echo "<table cellpadding='0' cellspacing='0' width='100%' class='tbl-border'>\n<tr>\n";
echo "<td width='1%' class='tbl2' style='white-space:nowrap'><strong>".$locale['global_048']."</strong></td>\n";
echo "<td width='100%' class='tbl2'><strong>".$locale['global_044']."</strong></td>\n";
echo "<td align='center' width='1%' class='tbl2' style='white-space:nowrap'><strong>".$locale['global_049']."</strong></td>\n";
echo "</tr>\n";
while ($data = dbarray($result)) {
if ($i % 2 == 0) { $row_color = "tbl1"; } else { $row_color = "tbl2"; }
echo "<tr>\n";
echo "<td width='1%' class='".$row_color."' style='white-space:nowrap'>".trimlink($data['forum_name'], 30)."</td>\n";
echo "<td width='100%' class='".$row_color."'><a href='".FORUM."viewthread.php?thread_id=".$data['thread_id']."&pid=".$data['post_id']."#post_".$data['post_id']."' title='".$data['thread_subject']."'>".trimlink($data['thread_subject'], 40)."</a></td>\n";
echo "<td align='center' width='1%' class='".$row_color."' style='white-space:nowrap'>".showdate("forumdate", $data['post_datestamp'])."</td>\n";
echo "</tr>\n";
$i++;
}
echo "</table>\n";
closetable();
if ($rows > 20) { echo "<div align='center' style='margin-top:5px;'>\n".makepagenav($_GET['rowstart'], 20, $rows, 3, FUSION_SELF.'?lookup='.$lookup.'&')."\n</div>\n"; }
} else {
opentable('Liste over brugers indlæg');
echo "<div style='text-align:center'><br />\n".$locale['global_054']."<br /><br />\n</div>\n";
closetable();
}
require_once THEMES."templates/footer.php";
?>