|
From: Paul S. O. <ps...@us...> - 2002-05-13 01:31:02
|
Update of /cvsroot/phpbb/phpBB2
In directory usw-pr-cvs1:/tmp/cvs-serv13533
Modified Files:
Tag: phpBB-2_0_0
search.php viewtopic.php
Log Message:
More fixes and updates
Index: search.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/search.php,v
retrieving revision 1.72.2.3
retrieving revision 1.72.2.4
diff -C2 -r1.72.2.3 -r1.72.2.4
*** search.php 7 Apr 2002 19:18:04 -0000 1.72.2.3
--- search.php 13 May 2002 01:30:59 -0000 1.72.2.4
***************
*** 119,122 ****
--- 119,127 ----
//
+ // encoding match for workaround
+ //
+ $multibyte_charset = 'utf-8, big5, shift_jis, euc-kr, gb2312';
+
+ //
// Begin core code
//
***************
*** 236,243 ****
$split_search = array();
! $cleaned_search = clean_words('search', stripslashes($search_keywords), $stopword_array, $synonym_array);
! $split_search = split_words($cleaned_search, 'search');
! $search_msg_only = ( !$search_fields ) ? "AND m.title_match = 0" : '';
$word_count = 0;
--- 241,247 ----
$split_search = array();
! $split_search = ( !strstr($multibyte_charset, $lang['ENCODING']) ) ? split_words(clean_words('search', stripslashes($search_keywords), $stopword_array, $synonym_array), 'search') : split(' ', $search_keywords);
! $search_msg_only = ( !$search_fields ) ? "AND m.title_match = 0" : ( ( strstr($multibyte_charset, $lang['ENCODING']) ) ? '' : '' );
$word_count = 0;
***************
*** 269,280 ****
}
! $match_word = str_replace('*', '%', $split_search[$i]);
!
! $sql = "SELECT m.post_id
! FROM " . SEARCH_WORD_TABLE . " w, " . SEARCH_MATCH_TABLE . " m
! WHERE w.word_text LIKE '$match_word'
! AND m.word_id = w.word_id
! AND w.word_common <> 1
$search_msg_only";
if ( !($result = $db->sql_query($sql)) )
{
--- 273,295 ----
}
! if ( !strstr($multibyte_charset, $lang['ENCODING']) )
! {
! $match_word = str_replace('*', '%', $split_search[$i]);
! $sql = "SELECT m.post_id
! FROM " . SEARCH_WORD_TABLE . " w, " . SEARCH_MATCH_TABLE . " m
! WHERE w.word_text LIKE '$match_word'
! AND m.word_id = w.word_id
! AND w.word_common <> 1
! $search_msg_only";
! }
! else
! {
! $match_word = addslashes('%' . str_replace('*', '', $split_search[$i]) . '%');
! $search_msg_only = ( $search_fields ) ? "OR post_subject LIKE '$match_word'" : '';
! $sql = "SELECT post_id
! FROM " . POSTS_TEXT_TABLE . "
! WHERE post_text LIKE '$match_word'
$search_msg_only";
+ }
if ( !($result = $db->sql_query($sql)) )
{
Index: viewtopic.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/viewtopic.php,v
retrieving revision 1.186.2.3
retrieving revision 1.186.2.4
diff -C2 -r1.186.2.3 -r1.186.2.4
*** viewtopic.php 12 May 2002 01:21:57 -0000 1.186.2.3
--- viewtopic.php 13 May 2002 01:30:59 -0000 1.186.2.4
***************
*** 141,147 ****
$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, t.topic_type, t.topic_vote, 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_pollcreate, 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, t.topic_type, t.topic_vote, 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_pollcreate, f.auth_vote, f.auth_attachments" . $count_sql . "
FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f" . $join_sql_table . "
WHERE $join_sql
--- 141,147 ----
$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, t.topic_type, t.topic_vote, t.topic_last_post_id, 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_pollcreate, 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, t.topic_type, t.topic_vote, t.topic_last_post_id, 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_pollcreate, f.auth_vote, f.auth_attachments" . $count_sql . "
FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f" . $join_sql_table . "
WHERE $join_sql
***************
*** 153,162 ****
}
! if ( !($forum_row = $db->sql_fetchrow($result)) )
{
message_die(GENERAL_MESSAGE, 'Topic_post_not_exist');
}
! $forum_id = $forum_row['forum_id'];
//
--- 153,162 ----
}
! if ( !($forum_topic_data = $db->sql_fetchrow($result)) )
{
message_die(GENERAL_MESSAGE, 'Topic_post_not_exist');
}
! $forum_id = $forum_topic_data['forum_id'];
//
***************
*** 173,177 ****
//
$is_auth = array();
! $is_auth = auth(AUTH_ALL, $forum_id, $userdata, $forum_row);
if( !$is_auth['auth_view'] || !$is_auth['auth_read'] )
--- 173,177 ----
//
$is_auth = array();
! $is_auth = auth(AUTH_ALL, $forum_id, $userdata, $forum_topic_data);
if( !$is_auth['auth_view'] || !$is_auth['auth_read'] )
***************
*** 193,204 ****
//
! $forum_name = $forum_row['forum_name'];
! $topic_title = $forum_row['topic_title'];
! $topic_id = $forum_row['topic_id'];
! $topic_time = $forum_row['topic_time'];
if ( !empty($post_id) )
{
! $start = floor(($forum_row['prev_posts'] - 1) / $board_config['posts_per_page']) * $board_config['posts_per_page'];
}
--- 193,204 ----
//
! $forum_name = $forum_topic_data['forum_name'];
! $topic_title = $forum_topic_data['topic_title'];
! $topic_id = $forum_topic_data['topic_id'];
! $topic_time = $forum_topic_data['topic_time'];
if ( !empty($post_id) )
{
! $start = floor(($forum_topic_data['prev_posts'] - 1) / $board_config['posts_per_page']) * $board_config['posts_per_page'];
}
***************
*** 343,347 ****
else
{
! $total_replies = $forum_row['topic_replies'] + 1;
$limit_posts_time = '';
--- 343,347 ----
else
{
! $total_replies = $forum_topic_data['topic_replies'] + 1;
$limit_posts_time = '';
***************
*** 500,507 ****
);
! $reply_img = ( $forum_row['forum_status'] == FORUM_LOCKED || $forum_row['topic_status'] == TOPIC_LOCKED ) ? $images['reply_locked'] : $images['reply_new'];
! $reply_alt = ( $forum_row['forum_status'] == FORUM_LOCKED || $forum_row['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['Reply_to_topic'];
! $post_img = ( $forum_row['forum_status'] == FORUM_LOCKED ) ? $images['post_locked'] : $images['post_new'];
! $post_alt = ( $forum_row['forum_status'] == FORUM_LOCKED ) ? $lang['Forum_locked'] : $lang['Post_new_topic'];
//
--- 500,507 ----
);
! $reply_img = ( $forum_topic_data['forum_status'] == FORUM_LOCKED || $forum_topic_data['topic_status'] == TOPIC_LOCKED ) ? $images['reply_locked'] : $images['reply_new'];
! $reply_alt = ( $forum_topic_data['forum_status'] == FORUM_LOCKED || $forum_topic_data['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['Reply_to_topic'];
! $post_img = ( $forum_topic_data['forum_status'] == FORUM_LOCKED ) ? $images['post_locked'] : $images['post_new'];
! $post_alt = ( $forum_topic_data['forum_status'] == FORUM_LOCKED ) ? $lang['Forum_locked'] : $lang['Post_new_topic'];
//
***************
*** 568,572 ****
$topic_mod .= '<a href="' . append_sid("modcp.$phpEx?" . POST_TOPIC_URL . "=$topic_id&mode=move"). '"><img src="' . $images['topic_mod_move'] . '" alt="' . $lang['Move_topic'] . '" title="' . $lang['Move_topic'] . '" border="0" /></a> ';
! $topic_mod .= ( $forum_row['topic_status'] == TOPIC_UNLOCKED ) ? '<a href="' . append_sid("modcp.$phpEx?" . POST_TOPIC_URL . "=$topic_id&mode=lock") . '"><img src="' . $images['topic_mod_lock'] . '" alt="' . $lang['Lock_topic'] . '" title="' . $lang['Lock_topic'] . '" border="0" /></a> ' : '<a href="' . append_sid("modcp.$phpEx?" . POST_TOPIC_URL . "=$topic_id&mode=unlock") . '"><img src="' . $images['topic_mod_unlock'] . '" alt="' . $lang['Unlock_topic'] . '" title="' . $lang['Unlock_topic'] . '" border="0" /></a> ';
$topic_mod .= '<a href="' . append_sid("modcp.$phpEx?" . POST_TOPIC_URL . "=$topic_id&mode=split") . '"><img src="' . $images['topic_mod_split'] . '" alt="' . $lang['Split_topic'] . '" title="' . $lang['Split_topic'] . '" border="0" /></a> ';
--- 568,572 ----
$topic_mod .= '<a href="' . append_sid("modcp.$phpEx?" . POST_TOPIC_URL . "=$topic_id&mode=move"). '"><img src="' . $images['topic_mod_move'] . '" alt="' . $lang['Move_topic'] . '" title="' . $lang['Move_topic'] . '" border="0" /></a> ';
! $topic_mod .= ( $forum_topic_data['topic_status'] == TOPIC_UNLOCKED ) ? '<a href="' . append_sid("modcp.$phpEx?" . POST_TOPIC_URL . "=$topic_id&mode=lock") . '"><img src="' . $images['topic_mod_lock'] . '" alt="' . $lang['Lock_topic'] . '" title="' . $lang['Lock_topic'] . '" border="0" /></a> ' : '<a href="' . append_sid("modcp.$phpEx?" . POST_TOPIC_URL . "=$topic_id&mode=unlock") . '"><img src="' . $images['topic_mod_unlock'] . '" alt="' . $lang['Unlock_topic'] . '" title="' . $lang['Unlock_topic'] . '" border="0" /></a> ';
$topic_mod .= '<a href="' . append_sid("modcp.$phpEx?" . POST_TOPIC_URL . "=$topic_id&mode=split") . '"><img src="' . $images['topic_mod_split'] . '" alt="' . $lang['Split_topic'] . '" title="' . $lang['Split_topic'] . '" border="0" /></a> ';
***************
*** 647,651 ****
// Does this topic contain a poll?
//
! if ( !empty($forum_row['topic_vote']) )
{
$sql = "SELECT vd.vote_id, vd.vote_text, vd.vote_start, vd.vote_length, vr.vote_option_id, vr.vote_option_text, vr.vote_result
--- 647,651 ----
// Does this topic contain a poll?
//
! if ( !empty($forum_topic_data['topic_vote']) )
{
$sql = "SELECT vd.vote_id, vd.vote_text, vd.vote_start, vd.vote_length, vr.vote_option_id, vr.vote_option_text, vr.vote_result
***************
*** 690,694 ****
$poll_expired = ( $vote_info[0]['vote_length'] ) ? ( ( $vote_info[0]['vote_start'] + $vote_info[0]['vote_length'] < time() ) ? TRUE : 0 ) : 0;
! if ( $user_voted || $view_result || $poll_expired || !$is_auth['auth_vote'] || $forum_row['topic_status'] == TOPIC_LOCKED )
{
$template->set_filenames(array(
--- 690,694 ----
$poll_expired = ( $vote_info[0]['vote_length'] ) ? ( ( $vote_info[0]['vote_start'] + $vote_info[0]['vote_length'] < time() ) ? TRUE : 0 ) : 0;
! if ( $user_voted || $view_result || $poll_expired || !$is_auth['auth_vote'] || $forum_topic_data['topic_status'] == TOPIC_LOCKED )
{
$template->set_filenames(array(
***************
*** 988,992 ****
$ip = '';
! if ( $userdata['user_id'] == $poster_id && $is_auth['auth_delete'] && $i == $total_replies - 1 )
{
$temp_url = append_sid("posting.$phpEx?mode=delete&" . POST_POST_URL . "=" . $postrow[$i]['post_id']);
--- 988,992 ----
$ip = '';
! if ( $userdata['user_id'] == $poster_id && $is_auth['auth_delete'] && $forum_topic_data['topic_last_post_id'] == $postrow[$i]['post_id'] )
{
$temp_url = append_sid("posting.$phpEx?mode=delete&" . POST_POST_URL . "=" . $postrow[$i]['post_id']);
|