aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/viewtopic.php
diff options
context:
space:
mode:
authorPaul S. Owen <psotfx@users.sourceforge.net>2001-07-24 17:34:40 +0000
committerPaul S. Owen <psotfx@users.sourceforge.net>2001-07-24 17:34:40 +0000
commit44990dd2b7b9debbd38445a21a06effcbe75c301 (patch)
tree044b47d57a6e574910526cf3d242f068d720d72e /phpBB/viewtopic.php
parent70b74fc706a8b79cae1625f773c2dabf82d18d15 (diff)
downloadforums-44990dd2b7b9debbd38445a21a06effcbe75c301.tar
forums-44990dd2b7b9debbd38445a21a06effcbe75c301.tar.gz
forums-44990dd2b7b9debbd38445a21a06effcbe75c301.tar.bz2
forums-44990dd2b7b9debbd38445a21a06effcbe75c301.tar.xz
forums-44990dd2b7b9debbd38445a21a06effcbe75c301.zip
Forum locking now implemented + some updates for future functionality
git-svn-id: file:///svn/phpbb/trunk@744 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/viewtopic.php')
-rw-r--r--phpBB/viewtopic.php51
1 files changed, 43 insertions, 8 deletions
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index b40c8ed55a..7fb63e1f10 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -25,6 +25,37 @@ include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
+
+//
+//
+//
+function smilies_pass($message)
+{
+ global $db, $smilies_url;
+ static $smilies;
+
+ if(empty($smilies))
+ {
+ $sql = "SELECT code, smile_url
+ FROM " . SMILIES_TABLE;
+ if($result = $db->sql_query($sql))
+ {
+ $smilies = $db->sql_fetchrowset($result);
+ }
+ }
+
+ for($i = 0; $i < count($smilies); $i++)
+ {
+ $message = preg_replace("'([\n\\ \\.])" . preg_quote($smilies[$i]['code']) . "'s", '\1<img src="' . $smilies_url . '/' . $smilies[$i]['smile_url'] . '" alt="' . $smilies[$i]['smile_url'] . '">', ' ' . $message);
+ }
+ return($message);
+}
+//
+//
+//
+
+
+
//
// Start initial var setup
//
@@ -104,7 +135,7 @@ $count_sql = (!isset($post_id)) ? "" : ", COUNT(p2.post_id) AS prev_posts";
$order_sql = (!isset($post_id)) ? "" : "GROUP BY p.post_id, t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, f.forum_name, f.forum_id, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_sticky, f.auth_announce, f.auth_votecreate, f.auth_vote, f.auth_attachments ORDER BY p.post_id ASC";
-$sql = "SELECT t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, f.forum_name, f.forum_id, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_sticky, f.auth_announce, f.auth_votecreate, f.auth_vote, f.auth_attachments" . $count_sql . "
+$sql = "SELECT t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, f.forum_name, f.forum_status, f.forum_id, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_sticky, f.auth_announce, f.auth_votecreate, f.auth_vote, f.auth_attachments" . $count_sql . "
FROM $join_sql_table " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f
WHERE $join_sql
AND f.forum_id = t.forum_id
@@ -194,11 +225,7 @@ $ranksrow = $db->sql_fetchrowset($ranksresult);
//
// Dump out the page header and load viewtopic body template
//
-// This is wrong ... more like index is needed
-//if($topic_time > $userdata['session_last_visit'])
-//{
-// setcookie('phpbb2_' . $forum_id . '_' . $topic_id, time(), 0, $cookiepath, $cookiedomain, $cookiesecure);
-//}
+setcookie('phpbb2_' . $forum_id . '_' . $topic_id, time(), time()+6000, $cookiepath, $cookiedomain, $cookiesecure);
$page_title = $lang['View_topic'] ." - $topic_title";
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
@@ -238,6 +265,9 @@ $view_forum_url = append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id"
$view_prev_topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&view=previous");
$view_next_topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&view=next");
+$reply_img = ($forum_row['forum_status'] == FORUM_LOCKED || $forum_row['topic_status'] == TOPIC_LOCKED) ? $images['reply_locked'] : $images['reply_new'];
+$post_img = ($forum_row['forum_status'] == FORUM_LOCKED) ? $images['post_locked'] : $images['post_new'];
+
$template->assign_vars(array(
"FORUM_NAME" => $forum_name,
"TOPIC_TITLE" => $topic_title,
@@ -247,8 +277,8 @@ $template->assign_vars(array(
"L_VIEW_NEXT_TOPIC" => $lang['View_next_topic'],
"L_VIEW_PREVIOUS_TOPIC" => $lang['View_previous_topic'],
- "IMG_POST" => $images['topic_new'],
- "IMG_REPLY" => ( ($forum_row['topic_status'] == TOPIC_LOCKED) ? $images['topic_locked'] : $images['topic_reply'] ),
+ "IMG_POST" => $post_img,
+ "IMG_REPLY" => $reply_img,
"U_VIEW_FORUM" => $view_forum_url,
"U_VIEW_OLDER_TOPIC" => $view_prev_topic_url,
@@ -425,6 +455,11 @@ for($i = 0; $i < $total_posts; $i++)
$message = eregi_replace("\[addsig]$", "<br /><br />_________________<br />" . nl2br($user_sig), $message);
}
+ if($board_config['allow_smilies'])
+ {
+// $message = smilies_pass($message);
+ }
+
//
// Editing information
//