2003-07-18 21:38:51 +00:00
|
|
|
<?php
|
|
|
|
require_once('../include.php');
|
2003-07-18 22:36:22 +00:00
|
|
|
require_once('../util.inc');
|
2003-07-18 21:38:51 +00:00
|
|
|
require_once('forum.inc');
|
|
|
|
doHeader('Forum');
|
|
|
|
|
|
|
|
/* sanitize variable */
|
|
|
|
$_GET['id'] = stripslashes(strip_tags($_GET['id']));
|
|
|
|
|
|
|
|
$thread = getThread($_GET['id']);
|
|
|
|
$thread->incView();
|
|
|
|
|
|
|
|
$forum = getForum($thread->forum);
|
2003-07-18 22:36:22 +00:00
|
|
|
|
|
|
|
$logged_in_user = get_logged_in_user(false);
|
2003-07-26 00:19:41 +00:00
|
|
|
|
|
|
|
$is_subscribed = false;
|
|
|
|
|
|
|
|
if ($logged_in_user) {
|
|
|
|
$result = sql_query("SELECT * FROM subscriptions WHERE (userid = " . $logged_in_user->id . ") AND (threadid = " . $thread->id . ")");
|
|
|
|
if ($result) {
|
|
|
|
$is_subscribed = (sql_num_rows($result) > 0);
|
|
|
|
}
|
|
|
|
}
|
2003-07-18 21:38:51 +00:00
|
|
|
?>
|
|
|
|
|
|
|
|
<p>
|
2003-07-26 00:19:41 +00:00
|
|
|
<span class="title"><?php echo $thread->title ?></span>
|
2003-07-18 22:36:22 +00:00
|
|
|
<br><a href="index.php"><?php echo $cfg['sitename'] ?> Forum</a> -> <a href="forum.php?id=<?php echo $forum->id ?>"><?php echo $forum->title ?></a>
|
2003-07-18 21:38:51 +00:00
|
|
|
</p>
|
|
|
|
<p>
|
2003-07-25 20:27:58 +00:00
|
|
|
<a href=reply.php?thread=<?php echo $thread->id ?>#input>Reply to this thread</a><br>
|
2003-07-26 00:19:41 +00:00
|
|
|
<?php
|
|
|
|
if ($is_subscribed) {
|
|
|
|
echo "You are currently subscribed to this thread. <a href=subscribe.php?action=unsubscribe&thread=$thread->id>Click here to unsubscribe</a>.";
|
|
|
|
} else {
|
|
|
|
echo "<a href=subscribe.php?action=subscribe&thread=$thread->id>Subscribe to this thread</a>";
|
|
|
|
}
|
|
|
|
?>
|
2003-07-18 21:38:51 +00:00
|
|
|
</p>
|
|
|
|
<p style="text-align:center">
|
|
|
|
<table class="content" border="0" cellpadding="5" cellspacing="0" width="100%">
|
|
|
|
<tr>
|
|
|
|
<th style="width: 150px">Author</th>
|
|
|
|
<th>Message</th>
|
|
|
|
</tr>
|
2003-07-29 01:15:00 +00:00
|
|
|
<?php show_posts($thread, true, true) ?>
|
2003-07-18 21:38:51 +00:00
|
|
|
</table>
|
|
|
|
</p>
|
2003-07-28 22:18:14 +00:00
|
|
|
<p>
|
|
|
|
<a href=reply.php?thread=<?php echo $thread->id ?>#input>Reply to this thread</a><br>
|
|
|
|
</p>
|
2003-07-18 21:38:51 +00:00
|
|
|
<?php
|
|
|
|
doFooter();
|
2003-07-21 22:02:20 +00:00
|
|
|
?>
|