diff --git a/html/forum/thread.php b/html/forum/thread.php index d6dc359fd8..d62b792f6e 100644 --- a/html/forum/thread.php +++ b/html/forum/thread.php @@ -13,16 +13,30 @@ $thread->incView(); $forum = getForum($thread->forum); $logged_in_user = get_logged_in_user(false); - + +$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); + } +} ?>
- title ?>
+title ?>
Forum -> title ?>
id ?>#input>Reply to this thread
-id ?>>Subscribe to this thread
+id>Click here to unsubscribe.";
+} else {
+ echo "id>Subscribe to this thread";
+}
+?>
Author | Message | - - getPosts(); - while ($post = getNextPost($posts)) { - show_post_hierarchy($post, $thread, 0); - } - ?> +
---|
- has_profile) { ?> - name ?> - name; } ?> -
-
- Joined: create_time) ?>
-
Posts: posts ?>
-
- Posted: timestamp) ?>id\">[Edit this post]" ?>
- modified) echo "
Last Modified: ", date('D M j, Y g:i a', $post->modified) ?>
-
content)) ?>
- -