2003-12-21 05:55:48 +00:00
|
|
|
<?php
|
2004-12-27 03:42:11 +00:00
|
|
|
|
2004-02-02 23:34:39 +00:00
|
|
|
require_once('../inc/util.inc');
|
|
|
|
require_once('../inc/time.inc');
|
|
|
|
require_once('../inc/forum.inc');
|
2005-01-23 10:04:39 +00:00
|
|
|
require_once('../inc/user.inc');
|
|
|
|
require_once('../inc/db.inc');
|
2004-12-27 03:42:11 +00:00
|
|
|
db_init();
|
|
|
|
|
2005-02-13 21:33:02 +00:00
|
|
|
$userid = get_int("userid");
|
|
|
|
$offset = get_int("offset", true);
|
2004-01-06 22:09:19 +00:00
|
|
|
if (!$offset) $offset=0;
|
2005-02-13 21:33:02 +00:00
|
|
|
$hide = true;
|
2004-01-06 22:09:19 +00:00
|
|
|
$count = 10;
|
2003-12-21 05:55:48 +00:00
|
|
|
|
|
|
|
$user = lookup_user_id($userid);
|
2005-01-23 10:04:39 +00:00
|
|
|
$logged_in_user = get_logged_in_user(false);
|
2003-12-21 05:55:48 +00:00
|
|
|
|
2005-01-23 10:04:39 +00:00
|
|
|
if( $logged_in_user = get_logged_in_user(false) ) {
|
2005-02-13 21:33:02 +00:00
|
|
|
$logged_in_user = getForumPreferences($logged_in_user);
|
|
|
|
if ($user->id==$logged_in_user->id || isSpecialUser($logged_in_user,0)) {
|
|
|
|
$hide = false;
|
|
|
|
}
|
2005-01-23 10:04:39 +00:00
|
|
|
}
|
2003-12-21 05:55:48 +00:00
|
|
|
page_head("Posts by $user->name");
|
2005-01-23 10:04:39 +00:00
|
|
|
|
2005-02-13 21:33:02 +00:00
|
|
|
if($hide) {
|
|
|
|
$result = mysql_query("select * from post
|
|
|
|
where user=$userid
|
|
|
|
and hidden=0
|
|
|
|
order by id desc limit $offset,$count"
|
|
|
|
);
|
2005-01-23 10:04:39 +00:00
|
|
|
} else {
|
2005-02-13 21:33:02 +00:00
|
|
|
$result = mysql_query("select * from post
|
|
|
|
where user=$userid
|
|
|
|
order by id desc limit $offset,$count"
|
|
|
|
);
|
2005-01-23 10:04:39 +00:00
|
|
|
}
|
2004-01-06 22:09:19 +00:00
|
|
|
$n = 0;
|
2004-01-10 01:08:50 +00:00
|
|
|
start_table();
|
2005-02-13 21:33:02 +00:00
|
|
|
while ($post = mysql_fetch_object($result)) {
|
2004-01-06 22:09:19 +00:00
|
|
|
show_post2($post, $n+$offset+1);
|
2003-12-21 05:55:48 +00:00
|
|
|
$n++;
|
|
|
|
}
|
|
|
|
echo "</table>\n";
|
|
|
|
mysql_free_result($result);
|
|
|
|
|
2004-01-06 22:09:19 +00:00
|
|
|
if ($n == $count) {
|
|
|
|
$offset += $count;
|
|
|
|
echo "
|
2004-01-10 01:08:50 +00:00
|
|
|
<br><br>
|
2004-06-01 18:55:59 +00:00
|
|
|
<a href=forum_user_posts.php?userid=$userid&offset=$offset><b>Next $count posts</b></a>
|
2004-01-06 22:09:19 +00:00
|
|
|
";
|
|
|
|
}
|
2004-01-10 01:08:50 +00:00
|
|
|
|
|
|
|
page_tail();
|
2003-12-21 05:55:48 +00:00
|
|
|
?>
|