|
From: Paul S. O. <ps...@us...> - 2002-05-13 01:31:02
|
Update of /cvsroot/phpbb/phpBB2/includes
In directory usw-pr-cvs1:/tmp/cvs-serv13533/includes
Modified Files:
Tag: phpBB-2_0_0
auth.php bbcode.php functions_post.php functions_search.php
Log Message:
More fixes and updates
Index: auth.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/includes/auth.php,v
retrieving revision 1.37
retrieving revision 1.37.2.1
diff -C2 -r1.37 -r1.37.2.1
*** auth.php 2 Apr 2002 14:03:58 -0000 1.37
--- auth.php 13 May 2002 01:30:59 -0000 1.37.2.1
***************
*** 159,174 ****
if ( $row = $db->sql_fetchrow($result) )
{
! if ( $forum_id != AUTH_LIST_ALL)
{
! $u_access[] = $row;
! }
! else
! {
! do
{
$u_access[$row['forum_id']][] = $row;
}
- while( $row = $db->sql_fetchrow($result) );
}
}
}
--- 159,174 ----
if ( $row = $db->sql_fetchrow($result) )
{
! do
{
! if ( $forum_id != AUTH_LIST_ALL)
! {
! $u_access[] = $row;
! }
! else
{
$u_access[$row['forum_id']][] = $row;
}
}
+ while( $row = $db->sql_fetchrow($result) );
}
}
Index: bbcode.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/includes/bbcode.php,v
retrieving revision 1.36.2.5
retrieving revision 1.36.2.6
diff -C2 -r1.36.2.5 -r1.36.2.6
*** bbcode.php 12 May 2002 00:47:40 -0000 1.36.2.5
--- bbcode.php 13 May 2002 01:30:59 -0000 1.36.2.6
***************
*** 607,611 ****
// xxxx can only be alpha characters.
// yyyy is anything up to the first space, newline, or comma.
! $ret = preg_replace("#([\n ])([a-z]+?)://([^,\t <\n\r]+)#i", "\\1<a href=\"\\2://\\3\" target=\"_blank\">\\2://\\3</a>", $ret);
// matches a "www.xxxx.yyyy[/zzzz]" kinda lazy URL thing
--- 607,611 ----
// xxxx can only be alpha characters.
// yyyy is anything up to the first space, newline, or comma.
! $ret = preg_replace("#([\n ])([a-z]+?)://([^\t <\n\r]+)#i", "\\1<a href=\"\\2://\\3\" target=\"_blank\">\\2://\\3</a>", $ret);
// matches a "www.xxxx.yyyy[/zzzz]" kinda lazy URL thing
***************
*** 615,619 ****
// This is slightly restrictive - it's not going to match stuff like "forums.foo.com"
// This is to keep it from getting annoying and matching stuff that's not meant to be a link.
! $ret = preg_replace("#([\n ])www\.([a-z0-9\-]+)\.([a-z0-9\-.\~]+)((?:/[^,\t <\n\r]*)?)#i", "\\1<a href=\"http://www.\\2.\\3\\4\" target=\"_blank\">www.\\2.\\3\\4</a>", $ret);
// matches an email@domain type address at the start of a line, or after a space.
--- 615,619 ----
// This is slightly restrictive - it's not going to match stuff like "forums.foo.com"
// This is to keep it from getting annoying and matching stuff that's not meant to be a link.
! $ret = preg_replace("#([\n ])www\.([a-z0-9\-]+)\.([a-z0-9\-.\~]+)((?:/[^\t <\n\r]*)?)#i", "\\1<a href=\"http://www.\\2.\\3\\4\" target=\"_blank\">www.\\2.\\3\\4</a>", $ret);
// matches an email@domain type address at the start of a line, or after a space.
Index: functions_post.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/includes/functions_post.php,v
retrieving revision 1.9.2.2
retrieving revision 1.9.2.3
diff -C2 -r1.9.2.2 -r1.9.2.3
*** functions_post.php 3 May 2002 19:46:34 -0000 1.9.2.2
--- functions_post.php 13 May 2002 01:30:59 -0000 1.9.2.3
***************
*** 398,402 ****
$topic_update_sql .= "topic_replies = topic_replies - 1";
! $sql = "SELECT MAX(post_id) AS post_id
FROM " . POSTS_TABLE . "
WHERE topic_id = $topic_id";
--- 398,402 ----
$topic_update_sql .= "topic_replies = topic_replies - 1";
! $sql = "SELECT MAX(post_id) AS last_post_id
FROM " . POSTS_TABLE . "
WHERE topic_id = $topic_id";
***************
*** 408,412 ****
if ( $row = $db->sql_fetchrow($result) )
{
! $topic_update_sql .= ', topic_last_post_id = ' . $row['post_id'];
}
}
--- 408,412 ----
if ( $row = $db->sql_fetchrow($result) )
{
! $topic_update_sql .= ', topic_last_post_id = ' . $row['last_post_id'];
}
}
***************
*** 414,418 ****
if ( $post_data['last_topic'] )
{
! $sql = "SELECT MAX(post_id) AS post_id
FROM " . POSTS_TABLE . "
WHERE forum_id = $forum_id";
--- 414,418 ----
if ( $post_data['last_topic'] )
{
! $sql = "SELECT MAX(post_id) AS last_post_id
FROM " . POSTS_TABLE . "
WHERE forum_id = $forum_id";
***************
*** 424,428 ****
if ( $row = $db->sql_fetchrow($result) )
{
! $forum_update_sql .= ( $row['post_id'] ) ? ', forum_last_post_id = ' . $row['post_id'] : ', forum_last_post_id = 0';
}
}
--- 424,428 ----
if ( $row = $db->sql_fetchrow($result) )
{
! $forum_update_sql .= ( $row['last_post_id'] ) ? ', forum_last_post_id = ' . $row['last_post_id'] : ', forum_last_post_id = 0';
}
}
***************
*** 430,434 ****
else if ( $post_data['first_post'] )
{
! $sql = "SELECT MIN(post_id) AS post_id
FROM " . POSTS_TABLE . "
WHERE topic_id = $topic_id";
--- 430,434 ----
else if ( $post_data['first_post'] )
{
! $sql = "SELECT MIN(post_id) AS first_post_id
FROM " . POSTS_TABLE . "
WHERE topic_id = $topic_id";
***************
*** 440,444 ****
if ( $row = $db->sql_fetchrow($result) )
{
! $topic_update_sql .= 'topic_replies = topic_replies - 1, topic_first_post_id = ' . $row['post_id'];
}
}
--- 440,444 ----
if ( $row = $db->sql_fetchrow($result) )
{
! $topic_update_sql .= 'topic_replies = topic_replies - 1, topic_first_post_id = ' . $row['first_post_id'];
}
}
***************
*** 518,528 ****
}
- $sql = "DELETE FROM " . SEARCH_MATCH_TABLE . "
- WHERE post_id = $post_id";
- if ( !($db->sql_query($sql)) )
- {
- message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql);
- }
-
$topic_update_sql .= 'topic_replies = topic_replies - 1';
if ( $post_data['last_post'] )
--- 518,521 ----
***************
*** 547,550 ****
--- 540,545 ----
}
}
+
+ remove_search_post($post_id);
}
***************
*** 552,556 ****
{
$sql = "DELETE FROM " . VOTE_DESC_TABLE . "
! WHERE vote_id = $poll_id";
if ( !($db->sql_query($sql)) )
{
--- 547,551 ----
{
$sql = "DELETE FROM " . VOTE_DESC_TABLE . "
! WHERE topic_id = $topic_id";
if ( !($db->sql_query($sql)) )
{
***************
*** 573,577 ****
}
- remove_search_post($post_id);
//
// Ok we set variables above that were intended to update the topics table
--- 568,571 ----
Index: functions_search.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/includes/functions_search.php,v
retrieving revision 1.8.2.3
retrieving revision 1.8.2.4
diff -C2 -r1.8.2.3 -r1.8.2.4
*** functions_search.php 12 May 2002 15:57:45 -0000 1.8.2.3
--- functions_search.php 13 May 2002 01:30:59 -0000 1.8.2.4
***************
*** 22,28 ****
function clean_words($mode, &$entry, &$stopword_list, &$synonym_list)
{
- // Weird, $init_match doesn't work with static when double quotes (") are used...
static $drop_char_match = array('^', '$', '&', '(', ')', '<', '>', '`', '\'', '"', '|', ',', '@', '_', '?', '%', '-', '~', '+', '.', '[', ']', '{', '}', ':', '\\', '/', '=', '#', '\'', ';', '!');
! static $drop_char_replace = array(' ', ' ', ' ', ' ', ' ', ' ', ' ', '', '', ' ', ' ', ' ', ' ', '', ' ', ' ', '', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' , ' ', ' ', ' ', ' ', ' ', ' ');
$entry = ' ' . strip_tags(strtolower($entry)) . ' ';
--- 22,27 ----
function clean_words($mode, &$entry, &$stopword_list, &$synonym_list)
{
static $drop_char_match = array('^', '$', '&', '(', ')', '<', '>', '`', '\'', '"', '|', ',', '@', '_', '?', '%', '-', '~', '+', '.', '[', ']', '{', '}', ':', '\\', '/', '=', '#', '\'', ';', '!');
! static $drop_char_replace = array(' ', ' ', ' ', ' ', ' ', ' ', ' ', '', '', ' ', ' ', ' ', ' ', '', ' ', ' ', '', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' , ' ', ' ', ' ', ' ', ' ', ' ');
$entry = ' ' . strip_tags(strtolower($entry)) . ' ';
***************
*** 43,53 ****
else if ( $mode == 'search' )
{
! $entry = str_replace('+', ' and ', $entry);
! $entry = str_replace('-', ' not ', $entry);
}
- // Replace numbers on their own
- $entry = preg_replace('/\b[0-9]+\b/', ' ', $entry);
-
//
// Filter out strange characters like ^, $, &, change "it's" to "its"
--- 42,49 ----
else if ( $mode == 'search' )
{
! $entry = str_replace(' +', ' and ', $entry);
! $entry = str_replace(' -', ' not ', $entry);
}
//
// Filter out strange characters like ^, $, &, change "it's" to "its"
***************
*** 62,67 ****
$entry = str_replace('*', ' ', $entry);
! // 'words' that consist of <=3 or >=25 characters are removed.
! $entry = preg_replace('/\b([a-z0-9]{1,3}|[a-z0-9]{20,})\b/',' ', $entry);
}
--- 58,63 ----
$entry = str_replace('*', ' ', $entry);
! // 'words' that consist of <=3 or >=20 characters are removed.
! $entry = preg_replace('/\b([a-z0-9]{1,3}|[a-z0-9]{21,})\b/',' ', $entry);
}
***************
*** 96,107 ****
function split_words(&$entry, $mode = 'post')
{
! if ( $mode == 'post' )
! {
! preg_match_all("/\b(\w[\w']*\w+|\w+?)\b/", $entry, $split_entries);
! }
! else
! {
! preg_match_all('/(\*?[à-ÿa-z0-9]+\*?)|\b([à-ÿa-z0-9]+)\b/', $entry, $split_entries);
! }
return $split_entries[1];
--- 92,97 ----
function split_words(&$entry, $mode = 'post')
{
! $rex = ( $mode == 'post' ) ? "/\b(\w[\w']*\w+|\w+?)\b/" : '/(\*?[à-ÿa-z0-9]+\*?)|\b([à-ÿa-z0-9]+)\b/';
! preg_match_all($rex, $entry, $split_entries);
return $split_entries[1];
|