mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-22 14:23:57 -07:00
r152
git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@152 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293
This commit is contained in:
parent
3187ecea03
commit
627a2effc1
2 changed files with 4 additions and 10 deletions
|
@ -219,7 +219,7 @@ function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_
|
||||||
$post_id = DB()->sql_nextid();
|
$post_id = DB()->sql_nextid();
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = ($mode != 'editpost') ? "INSERT INTO " . BB_POSTS_TEXT . " (post_id, post_subject, post_text) VALUES ($post_id, '$post_subject', '$post_message')" : "UPDATE " . BB_POSTS_TEXT . " SET post_text = '$post_message', post_subject = '$post_subject' WHERE post_id = $post_id";
|
$sql = ($mode != 'editpost') ? "INSERT INTO " . BB_POSTS_TEXT . " (post_id, post_text) VALUES ($post_id, '$post_message')" : "UPDATE " . BB_POSTS_TEXT . " SET post_text = '$post_message' WHERE post_id = $post_id";
|
||||||
if (!DB()->sql_query($sql))
|
if (!DB()->sql_query($sql))
|
||||||
{
|
{
|
||||||
message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
|
message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
|
||||||
|
@ -721,8 +721,8 @@ function insert_post ($mode, $topic_id, $forum_id = '', $old_forum_id = '', $new
|
||||||
$post_id = DB()->sql_nextid();
|
$post_id = DB()->sql_nextid();
|
||||||
$post_text = DB()->escape($post_text);
|
$post_text = DB()->escape($post_text);
|
||||||
|
|
||||||
$post_text_columns = 'post_id, post_subject, post_text';
|
$post_text_columns = 'post_id, post_text';
|
||||||
$post_text_values = "$post_id, '$post_subject', '$post_text'";
|
$post_text_values = "$post_id, '$post_text'";
|
||||||
|
|
||||||
DB()->query("INSERT INTO ". BB_POSTS_TEXT ." ($post_text_columns) VALUES ($post_text_values)");
|
DB()->query("INSERT INTO ". BB_POSTS_TEXT ." ($post_text_columns) VALUES ($post_text_values)");
|
||||||
}
|
}
|
||||||
|
|
|
@ -375,8 +375,7 @@ $sql = "
|
||||||
u.user_avatar, u.user_avatar_type,
|
u.user_avatar, u.user_avatar_type,
|
||||||
u.user_opt,
|
u.user_opt,
|
||||||
p.*,
|
p.*,
|
||||||
h.post_html, IF(h.post_html IS NULL, pt.post_text, NULL) AS post_text,
|
h.post_html, IF(h.post_html IS NULL, pt.post_text, NULL) AS post_text
|
||||||
pt.post_subject
|
|
||||||
FROM ". BB_POSTS ." p
|
FROM ". BB_POSTS ." p
|
||||||
LEFT JOIN ". BB_USERS ." u ON(u.user_id = p.poster_id)
|
LEFT JOIN ". BB_USERS ." u ON(u.user_id = p.poster_id)
|
||||||
LEFT JOIN ". BB_POSTS_TEXT ." pt ON(pt.post_id = p.post_id)
|
LEFT JOIN ". BB_POSTS_TEXT ." pt ON(pt.post_id = p.post_id)
|
||||||
|
@ -857,8 +856,6 @@ for($i = 0; $i < $total_posts; $i++)
|
||||||
//
|
//
|
||||||
// Parse message and sig
|
// Parse message and sig
|
||||||
//
|
//
|
||||||
$post_subject = ( $postrow[$i]['post_subject'] != '' ) ? $postrow[$i]['post_subject'] : '';
|
|
||||||
|
|
||||||
$message = get_parsed_post($postrow[$i]);
|
$message = get_parsed_post($postrow[$i]);
|
||||||
|
|
||||||
$user_sig = ($bb_cfg['allow_sig'] && !$user->opt_js['h_sig'] && $postrow[$i]['user_sig']) ? $postrow[$i]['user_sig'] : '';
|
$user_sig = ($bb_cfg['allow_sig'] && !$user->opt_js['h_sig'] && $postrow[$i]['user_sig']) ? $postrow[$i]['user_sig'] : '';
|
||||||
|
@ -875,8 +872,6 @@ for($i = 0; $i < $total_posts; $i++)
|
||||||
//
|
//
|
||||||
if (count($orig_word))
|
if (count($orig_word))
|
||||||
{
|
{
|
||||||
$post_subject = preg_replace($orig_word, $replacement_word, $post_subject);
|
|
||||||
|
|
||||||
if ($user_sig)
|
if ($user_sig)
|
||||||
{
|
{
|
||||||
$user_sig = str_replace('\"', '"', substr(@preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "@preg_replace(\$orig_word, \$replacement_word, '\\0')", '>' . $user_sig . '<'), 1, -1));
|
$user_sig = str_replace('\"', '"', substr(@preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "@preg_replace(\$orig_word, \$replacement_word, '\\0')", '>' . $user_sig . '<'), 1, -1));
|
||||||
|
@ -971,7 +966,6 @@ for($i = 0; $i < $total_posts; $i++)
|
||||||
'POSTER_AVATAR' => $poster_avatar,
|
'POSTER_AVATAR' => $poster_avatar,
|
||||||
'POST_NUMBER' => ($i + $start + 1),
|
'POST_NUMBER' => ($i + $start + 1),
|
||||||
'POST_DATE' => $post_date,
|
'POST_DATE' => $post_date,
|
||||||
'POST_SUBJECT' => $post_subject,
|
|
||||||
'MESSAGE' => $message,
|
'MESSAGE' => $message,
|
||||||
'SIGNATURE' => $user_sig,
|
'SIGNATURE' => $user_sig,
|
||||||
'EDITED_MESSAGE' => $l_edited_by,
|
'EDITED_MESSAGE' => $l_edited_by,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue