Version 2.2.2
This commit is contained in:
1 parent
22f1b963ee
commit
a3bb603c96
858 files changed
+479463
-188140
No files matched your search
@@ -2,18 +2,26 @@
|
||||
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Board
|
||||
| Invision Power Board 2.2.2
|
||||
| =============================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2006 Invision Power Services, Inc.
|
||||
| http://www.invisionpower.com
|
||||
| =============================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| http://www.ibresource.ru/products/invisionpowerboard/
|
||||
| Time: Monday 05th of March 2007 10:10:54 PM
|
||||
| Release: e3790216629e5a2aaf37070b32237f06
|
||||
| Licence Info: http://www.invisionboard.com/?license
|
||||
| http://www.ibresource.ru/license
|
||||
+---------------------------------------------------------------------------
|
||||
| > $Date: 2006-09-22 11:28:54 +0100 (Fri, 22 Sep 2006) $
|
||||
| > $Revision: 567 $
|
||||
| > $Author: matt $
|
||||
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
|
||||
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
|
||||
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
|
||||
+---------------------------------------------------------------------------
|
||||
| > $Date: 2006-11-22 12:58:39 -0600 (Wed, 22 Nov 2006) $
|
||||
| > $Revision: 739 $
|
||||
| > $Author: bfarber $
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > MySQL Manual Search Library
|
||||
@@ -24,9 +32,9 @@
|
||||
+--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
print "<h1>Íåâåðíûé âõîä</h1> Ó Âàñ íåò äîñòóïà ê äèðåêòèâå ýòîãî ôàéëà. Åñëè Âû ïðîâîäèëè îáíîâëåíèÿ, óáåäèòåñü, ÷òî íå çàáûëè îáíîâèòü 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
@@ -220,7 +228,7 @@ class search_lib extends Search
|
||||
|
||||
$member_string = preg_replace( "/,$/", "", $member_string );
|
||||
|
||||
// Error out of we matched no members
|
||||
// Error out if we matched no members
|
||||
|
||||
if ($member_string == "")
|
||||
{
|
||||
@@ -232,9 +240,13 @@ class search_lib extends Search
|
||||
|
||||
}
|
||||
|
||||
if ( strlen(trim($keywords)) > 100 )
|
||||
{
|
||||
$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'search_word_long', 'EXTRA' => 100) );
|
||||
}
|
||||
|
||||
if ( $type != 'nameonly' )
|
||||
{
|
||||
|
||||
if (preg_match( "/ and|or /", $keywords) )
|
||||
{
|
||||
preg_match_all( "/(^|and|or)\s{1,}(\S+?)\s{1,}/", $keywords, $matches );
|
||||
@@ -281,58 +293,6 @@ class search_lib extends Search
|
||||
|
||||
$unique_id = md5(uniqid(microtime(),1));
|
||||
|
||||
if ($type != 'nameonly')
|
||||
{
|
||||
if( $this->is->topic_search_only == 1 )
|
||||
{
|
||||
$topic_filter = " t.tid={$this->is->topic_id} AND ";
|
||||
}
|
||||
else
|
||||
{
|
||||
$topic_filter = "";
|
||||
}
|
||||
|
||||
$topics_query = "SELECT t.tid, t.approved, t.forum_id
|
||||
FROM ".SQL_PREFIX."topics t
|
||||
WHERE {$topic_filter}{$topics_datecut} t.forum_id IN ($forums)
|
||||
$topics_name AND ($title_like)";
|
||||
|
||||
|
||||
$posts_query = "SELECT p.pid, p.queued, t.approved, t.forum_id
|
||||
FROM ".SQL_PREFIX."posts p
|
||||
LEFT JOIN ".SQL_PREFIX."topics t on (t.tid=p.topic_id)
|
||||
WHERE {$topic_filter}{$posts_datecut} t.forum_id IN ($forums)
|
||||
$posts_name AND ($post_like)";
|
||||
}
|
||||
else
|
||||
{
|
||||
$topics_query = "SELECT t.tid, t.approved, t.forum_id
|
||||
FROM ".SQL_PREFIX."topics t
|
||||
WHERE $topics_datecut t.forum_id IN ($forums)
|
||||
$topics_name";
|
||||
|
||||
|
||||
$posts_query = "SELECT p.pid, p.queued, t.approved, t.forum_id
|
||||
FROM ".SQL_PREFIX."posts p
|
||||
LEFT JOIN ".SQL_PREFIX."topics t on (t.tid=p.topic_id)
|
||||
WHERE $posts_datecut t.forum_id IN ($forums)
|
||||
AND p.queued=0
|
||||
$posts_name";
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get the topic ID's to serialize and store into
|
||||
// the database
|
||||
//-----------------------------------------
|
||||
|
||||
$topics = "";
|
||||
$posts = "";
|
||||
$t_cnt = 0;
|
||||
$p_cnt = 0;
|
||||
$more = "";
|
||||
|
||||
//-----------------------------------------
|
||||
|
||||
$my_invisible_forums_t = array();
|
||||
$my_invisible_forums_p = array();
|
||||
|
||||
@@ -364,13 +324,114 @@ class search_lib extends Search
|
||||
}
|
||||
}
|
||||
|
||||
$this->ipsclass->DB->query($topics_query);
|
||||
|
||||
$topic_max_hits = $this->ipsclass->DB->get_num_rows();
|
||||
$t_forum_query = $this->ipsclass->member['g_is_supmod'] ? "t.forum_id IN ($forums)" :
|
||||
( count($my_invisible_forums_t) ? "( (t.forum_id IN ($forums) AND t.approved=1) OR t.forum_id IN(" . implode( ",", $my_invisible_forums_t ) . ") )" :
|
||||
"t.forum_id IN ($forums)" );
|
||||
|
||||
if( $this->ipsclass->member['g_is_supmod'] )
|
||||
{
|
||||
$p_forum_query = "t.forum_id IN ($forums)";
|
||||
}
|
||||
else if( count($my_invisible_forums_p) AND count($my_invisible_forums_t) )
|
||||
{
|
||||
$my_invisible_forums_both = array();
|
||||
|
||||
foreach( $my_invisible_forums_p as $p_fid )
|
||||
{
|
||||
if( in_array( $p_fid, $my_invisible_forums_t ) )
|
||||
{
|
||||
$my_invisible_forums_both[] = $p_fid;
|
||||
}
|
||||
}
|
||||
|
||||
$p_forum_query = "( (t.forum_id IN ($forums) AND t.approved=1 AND p.queued=0) OR
|
||||
t.forum_id IN(" . implode( ",", $my_invisible_forums_both ) . ") OR
|
||||
(t.forum_id IN(" . implode( ",", $my_invisible_forums_p ) . ") AND t.approved=1) OR
|
||||
(t.forum_id IN(" . implode( ",", $my_invisible_forums_t ) . ") AND p.queued=0) )";
|
||||
}
|
||||
else if( count($my_invisible_forums_t) )
|
||||
{
|
||||
$p_forum_query = "( (t.forum_id IN ($forums) AND t.approved=1 AND p.queued=0) OR
|
||||
(t.forum_id IN(" . implode( ",", $my_invisible_forums_t ) . ") AND p.queued=0) )";
|
||||
}
|
||||
else if( count($my_invisible_forums_p) )
|
||||
{
|
||||
$p_forum_query = "( (t.forum_id IN ($forums) AND t.approved=1 AND p.queued=0) OR
|
||||
(t.forum_id IN(" . implode( ",", $my_invisible_forums_p ) . ") AND t.approved=1) )";
|
||||
}
|
||||
else
|
||||
{
|
||||
$p_forum_query = "(t.forum_id IN ($forums) AND t.approved=1 AND p.queued=0)";
|
||||
}
|
||||
|
||||
if ($type != 'nameonly')
|
||||
{
|
||||
if( $this->is->topic_search_only == 1 )
|
||||
{
|
||||
$topic_filter = " t.tid={$this->is->topic_id} AND ";
|
||||
}
|
||||
else
|
||||
{
|
||||
$topic_filter = "";
|
||||
}
|
||||
|
||||
$topics_query = "SELECT t.tid, t.approved, t.forum_id
|
||||
FROM ".SQL_PREFIX."topics t
|
||||
WHERE {$topic_filter}{$topics_datecut} $t_forum_query
|
||||
$topics_name AND ($title_like)
|
||||
LIMIT {$this->resultlimit}";
|
||||
|
||||
|
||||
$posts_query = "SELECT p.pid, p.queued, t.approved, t.forum_id
|
||||
FROM ".SQL_PREFIX."posts p
|
||||
LEFT JOIN ".SQL_PREFIX."topics t on (t.tid=p.topic_id)
|
||||
WHERE {$topic_filter}{$posts_datecut} $p_forum_query
|
||||
$posts_name AND ($post_like)
|
||||
LIMIT {$this->resultlimit}";
|
||||
}
|
||||
else
|
||||
{
|
||||
$topics_query = "SELECT t.tid, t.approved, t.forum_id
|
||||
FROM ".SQL_PREFIX."topics t
|
||||
WHERE $topics_datecut $t_forum_query
|
||||
$topics_name
|
||||
LIMIT {$this->resultlimit}";
|
||||
|
||||
|
||||
$posts_query = "SELECT p.pid, p.queued, t.approved, t.forum_id
|
||||
FROM ".SQL_PREFIX."posts p
|
||||
LEFT JOIN ".SQL_PREFIX."topics t on (t.tid=p.topic_id)
|
||||
WHERE $posts_datecut $p_forum_query
|
||||
AND p.queued=0
|
||||
$posts_name
|
||||
LIMIT {$this->resultlimit}";
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get the topic ID's to serialize and store into
|
||||
// the database
|
||||
//-----------------------------------------
|
||||
|
||||
$topics = "";
|
||||
$posts = "";
|
||||
$t_cnt = 0;
|
||||
$p_cnt = 0;
|
||||
$more = "";
|
||||
|
||||
//-----------------------------------------
|
||||
|
||||
$this->ipsclass->DB->query($topics_query);
|
||||
|
||||
$topic_max_hits = $this->ipsclass->DB->get_num_rows();
|
||||
|
||||
if( $topic_max_hits == $this->resultlimit )
|
||||
{
|
||||
$more = 1;
|
||||
}
|
||||
|
||||
while ($row = $this->ipsclass->DB->fetch_row() )
|
||||
{
|
||||
if( !$row['approved'] )
|
||||
/*if( !$row['approved'] )
|
||||
{
|
||||
if( !$this->ipsclass->member['g_is_supmod'] )
|
||||
{
|
||||
@@ -388,7 +449,7 @@ class search_lib extends Search
|
||||
{
|
||||
$more = 1;
|
||||
break;
|
||||
}
|
||||
}*/
|
||||
|
||||
$topics .= $row['tid'].",";
|
||||
}
|
||||
@@ -401,9 +462,14 @@ class search_lib extends Search
|
||||
|
||||
$post_max_hits = $this->ipsclass->DB->get_num_rows();
|
||||
|
||||
if( $post_max_hits == $this->resultlimit )
|
||||
{
|
||||
$more = 1;
|
||||
}
|
||||
|
||||
while ($row = $this->ipsclass->DB->fetch_row() )
|
||||
{
|
||||
if( $row['queued'] )
|
||||
/*if( $row['queued'] )
|
||||
{
|
||||
if( !$this->ipsclass->member['g_is_supmod'] )
|
||||
{
|
||||
@@ -433,7 +499,7 @@ class search_lib extends Search
|
||||
{
|
||||
$more = 1;
|
||||
break;
|
||||
}
|
||||
}*/
|
||||
|
||||
$posts .= $row['pid'].",";
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user