More work on posting. Editing now works. Also replies can have subjects.

git-svn-id: file:///svn/phpbb/trunk@336 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
James Atkinson 2001-05-27 03:11:27 +00:00
parent 1fc155f93d
commit 9889b8ba53
8 changed files with 214 additions and 138 deletions

View file

@ -108,6 +108,7 @@ else
$board_config['default_lang'] = stripslashes($config['default_lang']);
$board_config['board_email'] = stripslashes(str_replace("<br />", "\n", $config['email_sig']));
$board_config['board_email_from'] = stripslashes($config['email_from']);
$board_config['flood_interval'] = $config['flood_interval'];
}
include('language/lang_'.$board_config['default_lang'].'.'.$phpEx);

View file

@ -57,6 +57,7 @@ CREATE TABLE phpbb_config (
hot_threshold int(10),
email_sig varchar(255),
email_from varchar(100),
flood_interval int(4) NOT NULL,
default_theme int(11) DEFAULT '1' NOT NULL,
default_lang varchar(255),
default_dateformat varchar(14) DEFAULT 'd M Y H:i' NOT NULL,
@ -161,6 +162,7 @@ DROP TABLE IF EXISTS phpbb_posts_text;
CREATE TABLE phpbb_posts_text (
post_id int(10) DEFAULT '0' NOT NULL,
post_subject varchar(255),
post_text text,
PRIMARY KEY (post_id)
);

View file

@ -5,22 +5,22 @@
$Id$
*/
CREATE SEQUENCE phpbb_banlist_id_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
CREATE SEQUENCE phpbb_categories_id_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
CREATE SEQUENCE phpbb_config_id_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
CREATE SEQUENCE phpbb_disallow_id_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
CREATE SEQUENCE phpbb_forums_id_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
CREATE SEQUENCE phpbb_posts_id_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
CREATE SEQUENCE phpbb_privmsgs_id_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
CREATE SEQUENCE phpbb_ranks_id_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
CREATE SEQUENCE phpbb_smilies_id_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
CREATE SEQUENCE phpbb_themes_id_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
CREATE SEQUENCE phpbb_topics_id_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
CREATE SEQUENCE phpbb_users_id_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
CREATE SEQUENCE phpbb_words_id_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
CREATE SEQUENCE phpbb_banlist_id_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
CREATE SEQUENCE phpbb_categories_id_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
CREATE SEQUENCE phpbb_config_id_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
CREATE SEQUENCE phpbb_disallow_id_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
CREATE SEQUENCE phpbb_forums_id_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
CREATE SEQUENCE phpbb_posts_id_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
CREATE SEQUENCE phpbb_privmsgs_id_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
CREATE SEQUENCE phpbb_ranks_id_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
CREATE SEQUENCE phpbb_smilies_id_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
CREATE SEQUENCE phpbb_themes_id_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
CREATE SEQUENCE phpbb_topics_id_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
CREATE SEQUENCE phpbb_users_id_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
CREATE SEQUENCE phpbb_words_id_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
/* --------------------------------------------------------
Table structure for table phpbb_auth_forums
/* --------------------------------------------------------
Table structure for table phpbb_auth_forums
-------------------------------------------------------- */
CREATE TABLE phpbb_auth_forums (
forum_id int4 DEFAULT '0' NOT NULL,
@ -33,8 +33,8 @@ CREATE TABLE phpbb_auth_forums (
);
/* --------------------------------------------------------
Table structure for table phpbb_auth_groups
/* --------------------------------------------------------
Table structure for table phpbb_auth_groups
-------------------------------------------------------- */
CREATE TABLE phpbb_auth_groups (
group_id int4 DEFAULT '0' NOT NULL,
@ -49,8 +49,8 @@ CREATE TABLE phpbb_auth_groups (
);
/* --------------------------------------------------------
Table structure for table phpbb_auth_hosts
/* --------------------------------------------------------
Table structure for table phpbb_auth_hosts
-------------------------------------------------------- */
CREATE TABLE phpbb_auth_hosts (
host_id int2 DEFAULT '0' NOT NULL,
@ -60,8 +60,8 @@ CREATE TABLE phpbb_auth_hosts (
);
/* --------------------------------------------------------
Table structure for table phpbb_banlist
/* --------------------------------------------------------
Table structure for table phpbb_banlist
-------------------------------------------------------- */
CREATE TABLE phpbb_banlist (
ban_id int4 DEFAULT nextval('phpbb_banlist_id_seq'::text) NOT NULL,
@ -75,8 +75,8 @@ CREATE TABLE phpbb_banlist (
CREATE INDEX ban_userid_phpbb_banlist_index ON phpbb_banlist (ban_userid);
/* --------------------------------------------------------
Table structure for table phpbb_categories
/* --------------------------------------------------------
Table structure for table phpbb_categories
-------------------------------------------------------- */
CREATE TABLE phpbb_categories (
cat_id int4 DEFAULT nextval('phpbb_categories_id_seq'::text) NOT NULL,
@ -86,8 +86,8 @@ CREATE TABLE phpbb_categories (
);
/* --------------------------------------------------------
Table structure for table phpbb_config
/* --------------------------------------------------------
Table structure for table phpbb_config
-------------------------------------------------------- */
CREATE TABLE phpbb_config (
config_id int2 NOT NULL,
@ -108,13 +108,14 @@ CREATE TABLE phpbb_config (
system_timezone int4 NOT NULL,
sys_template varchar(50) NOT NULL,
override_themes int2 NOT NULL,
flood_interval int NOT NULL,
selected int2 NOT NULL,
CONSTRAINT phpbb_config_pkey PRIMARY KEY (config_id)
);
/* --------------------------------------------------------
Table structure for table phpbb_disallow
/* --------------------------------------------------------
Table structure for table phpbb_disallow
-------------------------------------------------------- */
CREATE TABLE phpbb_disallow (
disallow_id int4 DEFAULT nextval('phpbb_disallow_id_s'::text) NOT NULL,
@ -123,8 +124,8 @@ CREATE TABLE phpbb_disallow (
);
/* --------------------------------------------------------
Table structure for table phpbb_forum_access
/* --------------------------------------------------------
Table structure for table phpbb_forum_access
-------------------------------------------------------- */
CREATE TABLE phpbb_forum_access (
forum_id int4 DEFAULT '0' NOT NULL,
@ -134,8 +135,8 @@ CREATE TABLE phpbb_forum_access (
CREATE INDEX _phpbb_forum_access_index ON phpbb_forum_access (forum_id, user_id);
/* --------------------------------------------------------
Table structure for table phpbb_forum_mods
/* --------------------------------------------------------
Table structure for table phpbb_forum_mods
-------------------------------------------------------- */
CREATE TABLE phpbb_forum_mods (
forum_id int4 DEFAULT '0' NOT NULL,
@ -145,8 +146,8 @@ CREATE TABLE phpbb_forum_mods (
CREATE INDEX _phpbb_forum_mods_index ON phpbb_forum_mods (forum_id, user_id);
/* --------------------------------------------------------
Table structure for table phpbb_forums
/* --------------------------------------------------------
Table structure for table phpbb_forums
-------------------------------------------------------- */
CREATE TABLE phpbb_forums (
forum_id int4 DEFAULT nextval('phpbb_forums_id_seq'::text) NOT NULL,
@ -167,8 +168,8 @@ CREATE INDEX forum_type_phpbb_forums_index ON phpbb_forums (forum_type);
CREATE INDEX forums_order_phpbb_forums_index ON phpbb_forums (forum_order);
/* --------------------------------------------------------
Table structure for table phpbb_groups
/* --------------------------------------------------------
Table structure for table phpbb_groups
-------------------------------------------------------- */
CREATE TABLE phpbb_groups (
group_id int4 DEFAULT '0' NOT NULL,
@ -178,8 +179,8 @@ CREATE TABLE phpbb_groups (
);
/* --------------------------------------------------------
Table structure for table phpbb_posts
/* --------------------------------------------------------
Table structure for table phpbb_posts
-------------------------------------------------------- */
CREATE TABLE phpbb_posts (
post_id int4 DEFAULT nextval('phpbb_posts_id_seq'::text) NOT NULL,
@ -197,8 +198,8 @@ CREATE INDEX poster_id_phpbb_posts_index ON phpbb_posts (poster_id);
CREATE INDEX topic_id_phpbb_posts_index ON phpbb_posts (topic_id);
/* --------------------------------------------------------
Table structure for table phpbb_posts_text
/* --------------------------------------------------------
Table structure for table phpbb_posts_text
-------------------------------------------------------- */
CREATE TABLE phpbb_posts_text (
post_id int4 DEFAULT '0' NOT NULL,
@ -208,8 +209,8 @@ CREATE TABLE phpbb_posts_text (
CREATE INDEX post_id_phpbb_posts_text_index ON phpbb_posts_text (post_id);
/* --------------------------------------------------------
Table structure for table phpbb_privmsgs
/* --------------------------------------------------------
Table structure for table phpbb_privmsgs
-------------------------------------------------------- */
CREATE TABLE phpbb_privmsgs (
msg_id int4 DEFAULT nextval('phpbb_privmsgs_id_seq'::text) NOT NULL,
@ -225,8 +226,8 @@ CREATE TABLE phpbb_privmsgs (
CREATE INDEX to_userid_phpbb_privmsgs_index ON phpbb_privmsgs (to_userid);
/* --------------------------------------------------------
Table structure for table phpbb_ranks
/* --------------------------------------------------------
Table structure for table phpbb_ranks
-------------------------------------------------------- */
CREATE TABLE phpbb_ranks (
rank_id int4 DEFAULT nextval('phpbb_ranks_id_seq'::text) NOT NULL,
@ -242,8 +243,8 @@ CREATE INDEX rank_max_phpbb_ranks_index ON phpbb_ranks (rank_max);
CREATE INDEX rank_min_phpbb_ranks_index ON phpbb_ranks (rank_min);
/* --------------------------------------------------------
Table structure for table phpbb_session
/* --------------------------------------------------------
Table structure for table phpbb_session
-------------------------------------------------------- */
CREATE TABLE phpbb_session (
session_id char(32) DEFAULT '0' NOT NULL,
@ -258,8 +259,8 @@ CREATE TABLE phpbb_session (
CREATE INDEX session_user_id ON phpbb_session (session_user_id);
CREATE INDEX session_id_ip_user_id ON phpbb_session (session_id, session_ip, session_user_id);
/* --------------------------------------------------------
Table structure for table phpbb_session_keys
/* --------------------------------------------------------
Table structure for table phpbb_session_keys
-------------------------------------------------------- */
CREATE TABLE phpbb_session_keys (
key_user_id int4 DEFAULT '0' NOT NULL,
@ -270,8 +271,8 @@ CREATE TABLE phpbb_session_keys (
CREATE INDEX key_ip_phpbb_session_keys_index ON phpbb_session_keys (key_ip);
/* --------------------------------------------------------
Table structure for table phpbb_smilies
/* --------------------------------------------------------
Table structure for table phpbb_smilies
-------------------------------------------------------- */
CREATE TABLE phpbb_smilies (
smilies_id int4 DEFAULT nextval('phpbb_smilies_id_seq'::text) NOT NULL,
@ -282,8 +283,8 @@ CREATE TABLE phpbb_smilies (
);
/* --------------------------------------------------------
Table structure for table phpbb_themes
/* --------------------------------------------------------
Table structure for table phpbb_themes
-------------------------------------------------------- */
CREATE TABLE phpbb_themes (
themes_id int4 DEFAULT nextval('phpbb_themes_id_seq'::text) NOT NULL,
@ -323,8 +324,8 @@ CREATE TABLE phpbb_themes (
CREATE INDEX themes_name_phpbb_themes_index ON phpbb_themes (themes_name);
/* --------------------------------------------------------
Table structure for table phpbb_themes_name
/* --------------------------------------------------------
Table structure for table phpbb_themes_name
-------------------------------------------------------- */
CREATE TABLE phpbb_themes_name (
themes_id int4 DEFAULT '0' NOT NULL,
@ -354,8 +355,8 @@ CREATE TABLE phpbb_themes_name (
);
/* --------------------------------------------------------
Table structure for table phpbb_topics
/* --------------------------------------------------------
Table structure for table phpbb_topics
-------------------------------------------------------- */
CREATE TABLE phpbb_topics (
topic_id int4 DEFAULT nextval('phpbb_topics_id_seq'::text) NOT NULL,
@ -374,8 +375,8 @@ CREATE INDEX _phpbb_topics_index ON phpbb_topics (forum_id, topic_id);
CREATE INDEX forum_id_phpbb_topics_index ON phpbb_topics (forum_id);
/* --------------------------------------------------------
Table structure for table phpbb_user_groups
/* --------------------------------------------------------
Table structure for table phpbb_user_groups
-------------------------------------------------------- */
CREATE TABLE phpbb_user_groups (
group_id int4 DEFAULT '0' NOT NULL,
@ -383,8 +384,8 @@ CREATE TABLE phpbb_user_groups (
);
/* --------------------------------------------------------
Table structure for table phpbb_users
/* --------------------------------------------------------
Table structure for table phpbb_users
-------------------------------------------------------- */
CREATE TABLE phpbb_users (
user_id int4 DEFAULT nextval('phpbb_users_id_seq'::text) NOT NULL,
@ -424,8 +425,8 @@ CREATE TABLE phpbb_users (
);
/* --------------------------------------------------------
Table structure for table phpbb_words
/* --------------------------------------------------------
Table structure for table phpbb_words
-------------------------------------------------------- */
CREATE TABLE phpbb_words (
word_id int4 DEFAULT nextval('phpbb_words_id_seq'::text) NOT NULL,

View file

@ -28,7 +28,7 @@ function get_db_stat($mode)
switch($mode){
case 'postcount':
$sql = "SELECT count(*) AS total
$sql = "SELECT count(*) AS total
FROM ".POSTS_TABLE;
break;
@ -44,12 +44,12 @@ function get_db_stat($mode)
FROM ".USERS_TABLE."
WHERE user_id <> " . ANONYMOUS. "
AND user_level <> ". DELETED ."
ORDER BY user_id DESC
ORDER BY user_id DESC
LIMIT 1";
break;
case 'usersonline':
$sql = "SELECT COUNT(*) AS online
$sql = "SELECT COUNT(*) AS online
FROM ".SESSIONS_TABLE;
break;
}
@ -154,7 +154,7 @@ function init_userprefs($userdata)
{
$theme = setuptheme($userdata['user_theme']);
}
else
else
{
$theme = setuptheme($board_config['default_theme']);
}
@ -208,10 +208,10 @@ function setuptheme($theme)
{
global $db;
$sql = "SELECT *
FROM ".THEMES_TABLE."
$sql = "SELECT *
FROM ".THEMES_TABLE."
WHERE themes_id = $theme";
if(!$result = $db->sql_query($sql))
{
return(0);
@ -234,14 +234,14 @@ function generate_activation_key()
$max_elements = count($chars) - 1;
srand((double)microtime()*1000000);
$act_key = '';
for($i = 0; $i < 8; $i++)
{
$act_key .= $chars[rand(0,$max_elements)];
}
$act_key_md = md5($act_key);
return($act_key_md);
}
@ -276,7 +276,8 @@ function create_date($format, $gmepoch, $tz)
//
function get_gmt_ts()
{
return(gmmktime(gmdate("H, i, s, m, d, Y")));
$time = time();
return($time);
}
//
@ -287,7 +288,7 @@ function generate_pagination($base_url, $num_items, $per_page, $start_item, $add
{
global $l_prevpage, $l_nextpage;
$total_pages = ceil($num_items/$per_page);
if($total_pages == 1)
{
@ -321,7 +322,7 @@ function generate_pagination($base_url, $num_items, $per_page, $start_item, $add
{
$page_string_prepend .= "<a href=\"".append_sid($base_url."&start=".($i*$per_page))."\">" . ( ($i == 0) ? ($i+1) : $i) . " - " . ($i+9) . "</a>, ";
}
$page_string = $page_string_prepend . $page_string;
}
@ -336,10 +337,10 @@ function generate_pagination($base_url, $num_items, $per_page, $start_item, $add
$page_string_append .= ", ";
}
}
$page_string .= $page_string_append;
}
if($add_prevnext_text)
{
if($on_page > 1)

View file

@ -365,7 +365,10 @@ $l_htmlis = "$l_html is";
$l_bbcodeis = "$l_bbcode is";
$l_notify = "Notify by email when replies are posted";
// "
$l_flooderror = "Your last post was less then ".$board_config['flood_interval']." seconds ago. You must wait befor you post again!";
// Newtopic
$l_postnew = "Post New Topic";
$l_postnewin = "Post New Topic in:";

View file

@ -80,7 +80,6 @@ function prepare_message($message, $html_on, $bbocde_on, $smile_on, $bbcode_uid
// End Posting specific functions.
//
//
// Put AUTH code here
//
@ -88,11 +87,35 @@ function prepare_message($message, $html_on, $bbocde_on, $smile_on, $bbcode_uid
$error = FALSE;
//
// Prepare our message and subject on a 'submit'
// Prepare our message and subject on a 'submit'
//
if(isset($HTTP_POST_VARS['submit']))
{
$subject = trim(strip_tags(htmlspecialchars($HTTP_POST_VARS['subject'])));
//
// Flood control
//
if($mode != 'editpost')
{
$enc_ip = encode_ip($user_ip);
$sql = "SELECT max(post_time) AS last_post_time FROM ".POSTS_TABLE." WHERE poster_ip = '$enc_ip'";
if($result = $db->sql_query($sql))
{
$db_row = $db->sql_fetchrowset($result);
$last_post_time = $db_row[0]['last_post_time'];
$current_time = get_gmt_ts();
if(($current_time - $last_post_time) < $board_config['flood_interval'])
{
$error = TRUE;
$error_msg = $l_flooderror;
}
}
}
//
// End: Flood control
//
$subject = trim(strip_tags(htmlspecialchars($HTTP_POST_VARS['subject'])));
if($mode == 'newtopic' && empty($subject))
{
$error = TRUE;
@ -102,7 +125,7 @@ if(isset($HTTP_POST_VARS['submit']))
}
$error_msg .= $l_emptysubj;
}
if(!empty($HTTP_POST_VARS['message']))
{
if(!$error)
@ -125,7 +148,7 @@ if(isset($HTTP_POST_VARS['submit']))
$uid = make_bbcode_uid();
$bbocde_on = TRUE;
}
if(isset($HTTP_POST_VARS['disable_smile']))
{
$smile_on = FALSE;
@ -136,7 +159,7 @@ if(isset($HTTP_POST_VARS['submit']))
}
$message = prepare_message($HTTP_POST_VARS['message'], $html_on, $bbocde_on, $smile_on, $uid);
if(isset($HTTP_POST_VARS['attach_sig']) && !empty($userdata['user_sig']))
{
$message .= "[addsig]";
@ -164,7 +187,7 @@ switch($mode)
case 'newtopic':
$page_title = " $l_postnew";
$section_title = $l_postnewin;
if(isset($HTTP_POST_VARS['submit']) && !$error)
{
$topic_time = get_gmt_ts();
@ -181,7 +204,7 @@ switch($mode)
if($db->sql_query($sql))
{
$new_post_id = $db->sql_nextid();
$sql = "INSERT INTO ".POSTS_TEXT_TABLE." VALUES ($new_post_id, '".$message."')";
$sql = "INSERT INTO ".POSTS_TEXT_TABLE." (post_id, post_subject, post_text) VALUES ($new_post_id, '".$subject."', '".$message."')";
if($db->sql_query($sql))
{
$sql = "UPDATE ".TOPICS_TABLE." SET topic_last_post_id = $new_post_id WHERE topic_id = $new_topic_id";
@ -278,7 +301,7 @@ switch($mode)
case 'reply':
$page_title = " $l_reply";
$section_title = $l_postreplyto;
if(isset($HTTP_POST_VARS['submit']) && !$error)
{
$new_topic_id = $HTTP_POST_VARS[POST_TOPIC_URL];
@ -290,7 +313,7 @@ switch($mode)
if($db->sql_query($sql))
{
$new_post_id = $db->sql_nextid();
$sql = "INSERT INTO ".POSTS_TEXT_TABLE." VALUES ($new_post_id, '".$message."')";
$sql = "INSERT INTO ".POSTS_TEXT_TABLE." (post_id, post_subject, post_text) VALUES ($new_post_id, '".$subject."', '".$message."')";
if($db->sql_query($sql))
{
$sql = "UPDATE ".TOPICS_TABLE." SET topic_last_post_id = $new_post_id, topic_replies = topic_replies + 1 WHERE topic_id = $new_topic_id";
@ -301,7 +324,7 @@ switch($mode)
{
if($userdata['user_id'] != ANONYMOUS)
{
$sql = "UPDATE ".USERS_TABLE." SET user_posts = user_posts + 1 WHERE user_id = ".$userdata['user_id'];
$db->sql_query($sql);
}
@ -372,14 +395,51 @@ switch($mode)
{
if(isset($HTTP_POST_VARS['delete_post']))
{
}
else
{
$post_id = $HTTP_POST_VARS[POST_POST_URL];
$new_topic_id = $HTTP_POST_VARS[POST_TOPIC_URL];
$sql = "UPDATE ".POSTS_TEXT_TABLE." SET post_text = '$message', post_subject = '$subject' WHERE post_id = ".$HTTP_POST_VARS[POST_POST_URL];
if($db->sql_query($sql))
{
if($is_first_post)
{
// Update topics table here, set notification level and such
}
else
{
include('includes/page_header.'.$phpEx);
// If we get here the post has been inserted successfully.
$msg = "$l_stored<br />$l_click <a href=\"".append_sid("viewtopic.$phpEx?".POST_TOPIC_URL."=$new_topic_id#$post_id")."\">$l_here</a>
$l_viewmsg<br />$l_click <a href=\"".append_sid("viewforum.$phpEx?".POST_FORUM_URL."=$forum_id")."\">$l_here</a> $l_returntopic";
$template->set_filenames(array(
"reg_header" => "error_body.tpl"
));
$template->assign_vars(array(
"ERROR_MESSAGE" => $msg
));
$template->pparse("reg_header");
include('includes/page_tail.'.$phpEx);
}
}
else
{
if(DEBUG)
{
$error = $db->sql_error();
error_die(QUERY_ERROR, "Error updateing posts text table.<br>Reason: ".$error['message']."<br>Query: $sql", __LINE__, __FILE__);
}
else
{
error_die(QUERY_ERROR);
}
}
}
}
else
@ -388,37 +448,42 @@ switch($mode)
if(!empty($post_id))
{
$sql = "SELECT p.*, pt.post_text, u.username, u.user_id, u.user_sig, t.topic_title, t.topic_notify
FROM ".POSTS_TABLE." p, ".USERS_TABLE." u, ".TOPICS_TABLE." t, ".POSTS_TEXT_TABLE." pt
WHERE (p.post_id = '$post_id')
$sql = "SELECT p.*, pt.post_text, pt.post_subject, u.username, u.user_id, u.user_sig, t.topic_title, t.topic_notify
FROM ".POSTS_TABLE." p, ".USERS_TABLE." u, ".TOPICS_TABLE." t, ".POSTS_TEXT_TABLE." pt
WHERE (p.post_id = '$post_id')
AND pt.post_id = p.post_id
AND (p.topic_id = t.topic_id)
AND (p.topic_id = t.topic_id)
AND (p.poster_id = u.user_id)";
if($result = $db->sql_query($sql))
{
$postrow = $db->sql_fetchrowset($result);
$subject = stripslashes($postrow[0]['post_subject']);
$message = stripslashes($postrow[0]['post_text']);
$message = eregi_replace("\[addsig]$", "\n_________________\n" . stripslashes($postrow[0]['user_sig']), $message);
if(eregi("\[addsig]$", $message))
{
$attach_sig = TRUE;
}
$message = eregi_replace("\[addsig]$", "", $message);
$message = str_replace("<br />", "\n", $message);
// These have not been implemented yet!
/*
$message = bbdecode($message);
$message = desmile($message);
*/
$message = undo_htmlspecialchars($message);
// Special handling for </textarea> tags in the message, which can break the editing form..
$message = preg_replace('#</textarea>#si', '&lt;/TEXTAREA&gt;', $message);
// is_first_post needs functionality!
if($postrow[0]['topic_notify'] && $is_first_post)
{
$notify = TRUE;
}
if($is_first_post)
{
$subject = stripslashes($postrow[0]['topic_title']);
@ -476,7 +541,7 @@ if($error)
error_die(GENERAL_ERROR, "Sorry, no there is no such forum");
}
$sql = "SELECT forum_name, forum_access
FROM ".FORUMS_TABLE."
WHERE forum_id = $forum_id";
@ -511,7 +576,7 @@ if($error)
"SELECT_NAME" => POST_FORUM_URL)
);
$template->assign_var_from_handle("JUMPBOX", "jumpbox");
$template->assign_vars(array(
"L_POSTNEWIN" => $section_title,
@ -574,16 +639,13 @@ if($error)
}
$smile_toggle .= "> $l_disable $l_smilies $l_onthispost";
if($mode != 'editpost')
$sig_toggle = '<input type="checkbox" name="attach_sig" ';
if($attach_sig || $userdata['user_attachsig'] == 1)
{
$sig_toggle = '<input type="checkbox" name="attach_sig" ';
if($attach_sig || $userdata['user_attachsig'] == 1)
{
$sig_toggle .= "checked";
}
$sig_toggle .= "> $l_attachsig";
$sig_toggle .= "checked";
}
$sig_toggle .= "> $l_attachsig";
if($mode == 'newtopic' || ($mode == 'editpost' && $notify))
{
$notify_toggle = '<input type="checkbox" name="notify" ';
@ -597,8 +659,9 @@ if($error)
if($mode == 'reply' || $mode == 'editpost')
{
$topic_id = ($HTTP_GET_VARS[POST_TOPIC_URL]) ? $HTTP_GET_VARS[POST_TOPIC_URL] : $HTTP_POST_VARS[POST_TOPIC_URL];
$post_id = ($HTTP_GET_VARS[POST_POST_URL]) ? $HTTP_GET_VARS[POST_POST_URL] : $HTTP_POST_VARS[POST_POST_URL];
}
$hidden_form_fields = "<input type=\"hidden\" name=\"mode\" value=\"$mode\"><input type=\"hidden\" name=\"".POST_FORUM_URL."\" value=\"$forum_id\"><input type=\"hidden\" name=\"".POST_TOPIC_URL."\" value=\"$topic_id\">";
$hidden_form_fields = "<input type=\"hidden\" name=\"mode\" value=\"$mode\"><input type=\"hidden\" name=\"".POST_FORUM_URL."\" value=\"$forum_id\"><input type=\"hidden\" name=\"".POST_TOPIC_URL."\" value=\"$topic_id\"><input type=\"hidden\" name=\"".POST_POST_URL."\" value=\"$post_id\">";
$template->assign_vars(array(
"L_ABOUT_POST" => $l_aboutpost,

View file

@ -4,17 +4,17 @@
<tr>
<td>
<table border="0" align="left" width="20%" bgcolor="#000000" cellpadding="0" cellspacing="1">
<tr>
<td>
<tr>
<td>
<table border="0" width="100%" bgcolor="#CCCCCC" cellpadding="1" cellspacing="1">
<tr>
<tr>
<td align="left" valign="bottom" style="{font-size: 8pt; height: 55px;}" nowrap>
<a href="{U_INDEX}">{SITENAME} - Forum Index</a> >> <a href="{U_VIEW_FORUM}">{FORUM_NAME}</a> >> {TOPIC_TITLE}
</td>
</tr>
</table>
</td>
</tr>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table border="0" align="right" width="20%" bgcolor="#000000" cellpadding="0" cellspacing="1">
<tr>
@ -52,18 +52,18 @@
</tr>
<tr>
<td>
<table border="0" align="center" width="100%" bgcolor="#000000" cellpadding="0" cellspacing="1">
<tr>
<td>
<table border="0" width="100%" cellpadding="3" cellspacing="1">
<tr class="tableheader">
<td width="15%">Author</td>
<td>{TOPIC_TITLE}</td>
<td colspan="2">{TOPIC_TITLE}</td>
</tr>
<!-- BEGIN postrow -->
<tr bgcolor="{postrow.ROW_COLOR}" class="tablebody">
<td width="20%" align="left" valign="top" nowrap>
<td width="20%" align="left" valign="top" nowrap rowspan="2">
<a name="{postrow.U_POST_ID}">
<font style="{font-size: 10pt; font-weight: bold;}">{postrow.POSTER_NAME}</font><br>
{postrow.POSTER_RANK}<br>
@ -72,11 +72,14 @@
<font style="{font-size: 8pt;}">
{L_JOINED}: {postrow.POSTER_JOINED}<br>{L_POSTS}: {postrow.POSTER_POSTS}<br>{postrow.POSTER_FROM}</font>
</td>
<td>
<img src="images/posticon.gif"><font style="{font-size: 8pt;}">{L_POSTED}: {postrow.POST_DATE}</font><hr>
{postrow.MESSAGE}<hr>
<td><i><b>{postrow.POST_SUBJECT}</b></i></td>
<td align="right" width="15%"><img src="images/posticon.gif"><font style="{font-size: 8pt;}">{L_POSTED}: {postrow.POST_DATE}</font></td>
</tr>
<tr bgcolor="{postrow.ROW_COLOR}" class="tablebody">
<td colspan="3">
{postrow.MESSAGE}<hr>
{postrow.PROFILE_IMG}&nbsp;{postrow.EMAIL_IMG}&nbsp;{postrow.WWW_IMG}&nbsp;{postrow.ICQ_STATUS_IMG}&nbsp;{postrow.ICQ_ADD_IMG}&nbsp;{postrow.AIM_IMG}&nbsp;{postrow.YIM_IMG}&nbsp;{postrow.MSN_IMG}&nbsp;<img src="images/div.gif">&nbsp;{postrow.EDIT_IMG}&nbsp;{postrow.QUOTE_IMG}&nbsp;{postrow.PMSG_IMG}&nbsp;<img src="images/div.gif">&nbsp;{postrow.IP_IMG}&nbsp;{postrow.DELPOST_IMG}
</td>
</td>
</tr>
<!-- END postrow -->
</table>
@ -127,19 +130,19 @@
</td>
</tr>
</table>
<table border="0" align="right" width="20%" bgcolor="#000000" cellpadding="0" cellspacing="1">
<tr>
<td>
<tr>
<td>
<table border="0" width="100%" bgcolor="#CCCCCC" cellpadding="1" cellspacing="1">
<tr>
<td align="right" style="{font-size: 8pt; height: 55px;}">{JUMPBOX}</td>
</tr>
</table>
</td>
<td align="right" style="{font-size: 8pt; height: 55px;}">{JUMPBOX}</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>

View file

@ -201,7 +201,7 @@ if(!isset($start))
$start = 0;
}
$sql = "SELECT u.username, u.user_id, u.user_posts, u.user_from, u.user_website, u.user_icq, u.user_aim, u.user_yim, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, p.post_time, p.post_id, p.bbcode_uid, pt.post_text
$sql = "SELECT u.username, u.user_id, u.user_posts, u.user_from, u.user_website, u.user_icq, u.user_aim, u.user_yim, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, p.post_time, p.post_id, p.bbcode_uid, pt.post_text, pt.post_subject
FROM ".POSTS_TABLE." p, ".USERS_TABLE." u, ".POSTS_TEXT_TABLE." pt
WHERE p.topic_id = $topic_id
AND p.poster_id = u.user_id
@ -321,6 +321,7 @@ for($x = 0; $x < $total_posts; $x++)
$delpost_img = "<a href=\"".append_sid("topicadmin.$phpEx?mode=delpost$post_id=".$postrow[$x]['post_id'])."\"><img src=\"".$images['delpost']."\" alt=\"$l_delete\" border=\"0\"></a>";
}
$post_subject = stripslashes($postrow[$x]['post_subject']);
$message = stripslashes($postrow[$x]['post_text']);
$bbcode_uid = $postrow[$x]['bbcode_uid'];
$user_sig = stripslashes($postrow[$x]['user_sig']);
@ -365,6 +366,7 @@ for($x = 0; $x < $total_posts; $x++)
"POSTER_POSTS" => $poster_posts,
"POSTER_FROM" => $poster_from,
"POST_DATE" => $post_date,
"POST_SUBJECT" => $post_subject,
"MESSAGE" => $message,
"PROFILE_IMG" => $profile_img,
"EMAIL_IMG" => $email_img,