Vergleich inc/functions_search.php - 1.2.1 - 1.2.7

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 3Zeile 3
 * MyBB 1.2
* Copyright � 2006 MyBB Group, All Rights Reserved
*

 * MyBB 1.2
* Copyright � 2006 MyBB Group, All Rights Reserved
*

 * Website: http://www.mybboard.com
* License: http://www.mybboard.com/eula.html

 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/eula.html

 *

 *

 * $Id: functions_search.php 2281 2006-09-27 12:24:50Z chris $

 * $Id: functions_search.php 3065 2007-05-16 00:36:39Z Tikitiki $

 */

/**

 */

/**

Zeile 81Zeile 81
	}
if($addselect)
{

	}
if($addselect)
{

		$forumlist = "<select name=\"forums\" size=\"15\" multiple=\"multiple\">\n<option value=\"all\" selected=\"selected\">$lang->search_all_forums</option>\n<option value=\"all\">----------------------</option>\n$forumlistbits\n</select>";

		$forumlist = "<select name=\"forums[]\" size=\"15\" multiple=\"multiple\">\n<option value=\"all\" selected=\"selected\">$lang->search_all_forums</option>\n<option value=\"all\">----------------------</option>\n$forumlistbits\n</select>";

	}
return $forumlist;
}

	}
return $forumlist;
}

Zeile 416Zeile 416
		{
$datecut = ">=";
}

		{
$datecut = ">=";
}

 
		$now = time();

		$datelimit = $now-(86400 * $search['postdate']);
$datecut .= "'$datelimit'";
$post_datecut = " AND p.dateline $datecut";
$thread_datecut = " AND t.dateline $datecut";

		$datelimit = $now-(86400 * $search['postdate']);
$datecut .= "'$datelimit'";
$post_datecut = " AND p.dateline $datecut";
$thread_datecut = " AND t.dateline $datecut";

 
	}

$thread_replycut = "";
if($search['numreplies'] != "" && $search['findthreadst'])
{
if(intval($search['findthreadst']) == 1)
{
$thread_replycut = " AND t.replies >= '".intval($search['numreplies'])."'";
}
else
{
$thread_replycut = " AND t.replies <= '".intval($search['numreplies'])."'";
}

	}

$forumin = "";

	}

$forumin = "";

Zeile 450Zeile 464
					if(count($fidlist) > 1)
{
$forumin = " AND t.fid IN (".implode(",", $fidlist).")";

					if(count($fidlist) > 1)
{
$forumin = " AND t.fid IN (".implode(",", $fidlist).")";

					}

					}

				}
}
}

				}
}
}

Zeile 473Zeile 487
	if($search['postthread'] == 1)
{
$searchtype = "titles";

	if($search['postthread'] == 1)
{
$searchtype = "titles";

		$query = $db->query("
SELECT t.tid, t.firstpost
FROM ".TABLE_PREFIX."threads t
WHERE 1=1 $thread_datecut $forumin $thread_usersql $permsql AND t.visible>0 AND t.closed NOT LIKE 'moved|%' $subject_lookin
");
while($thread = $db->fetch_array($query))
{
$threads[$thread['tid']] = $thread['tid'];

		$query = $db->query("
SELECT t.tid, t.firstpost
FROM ".TABLE_PREFIX."threads t
WHERE 1=1 $thread_datecut $thread_replycut $forumin $thread_usersql $permsql AND t.visible>0 AND t.closed NOT LIKE 'moved|%' $subject_lookin
");
while($thread = $db->fetch_array($query))
{
$threads[$thread['tid']] = $thread['tid'];

			if($thread['firstpost'])
{
$posts[$thread['tid']] = $thread['firstpost'];

			if($thread['firstpost'])
{
$posts[$thread['tid']] = $thread['firstpost'];

Zeile 490Zeile 504
			SELECT p.pid, p.tid
FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)

			SELECT p.pid, p.tid
FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)

			WHERE 1=1 $post_datecut $forumin $post_usersql $permsql AND p.visible>0 AND t.visible>0 AND t.closed NOT LIKE 'moved|%' $message_lookin

			WHERE 1=1 $post_datecut $thread_replycut $forumin $post_usersql $permsql AND p.visible>0 AND t.visible>0 AND t.closed NOT LIKE 'moved|%' $message_lookin

		");
while($post = $db->fetch_array($query))
{

		");
while($post = $db->fetch_array($query))
{

Zeile 512Zeile 526
		$query = $db->query("
SELECT t.tid, t.firstpost
FROM ".TABLE_PREFIX."threads t

		$query = $db->query("
SELECT t.tid, t.firstpost
FROM ".TABLE_PREFIX."threads t

			WHERE 1=1 $thread_datecut $forumin $thread_usersql $permsql AND t.visible>0 $subject_lookin

			WHERE 1=1 $thread_datecut $thread_replycut $forumin $thread_usersql $permsql AND t.visible>0 $subject_lookin

		");
while($thread = $db->fetch_array($query))
{

		");
while($thread = $db->fetch_array($query))
{

Zeile 541Zeile 555
				$posts[$post['pid']] = $post['pid'];
}
$posts = implode(",", $posts);

				$posts[$post['pid']] = $post['pid'];
}
$posts = implode(",", $posts);

		}

		}

	}
return array(
"searchtype" => $searchtype,

	}
return array(
"searchtype" => $searchtype,

Zeile 598Zeile 612
					}
if(my_strlen($word) < $mybb->settings['minsearchword'])
{

					}
if(my_strlen($word) < $mybb->settings['minsearchword'])
{

						$lang->error_minsearchlength = sprintf($lang->error_minsearchlength, $mybb->settings['minsearchword']);
error($lang->error_minsearchlength);





						$all_too_short = true;
}
else
{
$all_too_short = false;
break;

					}
}
}

					}
}
}

Zeile 608Zeile 626
				$phrase = str_replace(array("+", "-", "*"), "", $phrase);
if(my_strlen($phrase) < $mybb->settings['minsearchword'])
{

				$phrase = str_replace(array("+", "-", "*"), "", $phrase);
if(my_strlen($phrase) < $mybb->settings['minsearchword'])
{

					$lang->error_minsearchlength = sprintf($lang->error_minsearchlength, $mybb->settings['minsearchword']);
error($lang->error_minsearchlength);





					$all_too_short = true;
}
else
{
$all_too_short = false;
break;

				}
}
$inquote = !$inquote;

				}
}
$inquote = !$inquote;

 
		}
// Show the minimum search term error only if all search terms are too short
if($all_too_short == true)
{
$lang->error_minsearchlength = sprintf($lang->error_minsearchlength, $mybb->settings['minsearchword']);
error($lang->error_minsearchlength);

		}
$message_lookin = "AND MATCH(message) AGAINST('".$db->escape_string($keywords)."' IN BOOLEAN MODE)";
$subject_lookin = "AND MATCH(subject) AGAINST('".$db->escape_string($keywords)."' IN BOOLEAN MODE)";

		}
$message_lookin = "AND MATCH(message) AGAINST('".$db->escape_string($keywords)."' IN BOOLEAN MODE)";
$subject_lookin = "AND MATCH(subject) AGAINST('".$db->escape_string($keywords)."' IN BOOLEAN MODE)";

Zeile 631Zeile 659
			$search['author'] = strtolower($search['author']);
$query = $db->query("SELECT uid FROM ".TABLE_PREFIX."users WHERE LOWER(username) LIKE '%".$db->escape_string($search['author'])."%'");
}

			$search['author'] = strtolower($search['author']);
$query = $db->query("SELECT uid FROM ".TABLE_PREFIX."users WHERE LOWER(username) LIKE '%".$db->escape_string($search['author'])."%'");
}

 
		

		while($user = $db->fetch_array($query))
{
$userids[] = $user['uid'];

		while($user = $db->fetch_array($query))
{
$userids[] = $user['uid'];

Zeile 657Zeile 686
		{
$datecut = ">=";
}

		{
$datecut = ">=";
}

 
		$now = time();

		$datelimit = $now-(86400 * $search['postdate']);
$datecut .= "'$datelimit'";
$post_datecut = " AND p.dateline $datecut";
$thread_datecut = " AND t.dateline $datecut";

		$datelimit = $now-(86400 * $search['postdate']);
$datecut .= "'$datelimit'";
$post_datecut = " AND p.dateline $datecut";
$thread_datecut = " AND t.dateline $datecut";

 
	}

$thread_replycut = "";
if($search['numreplies'] != "" && $search['findthreadst'])
{
if(intval($search['findthreadst']) == 1)
{
$thread_replycut = " AND t.replies >= '".intval($search['numreplies'])."'";
}
else
{
$thread_replycut = " AND t.replies <= '".intval($search['numreplies'])."'";
}

	}

$forumin = "";

	}

$forumin = "";

Zeile 717Zeile 760
		$query = $db->query("
SELECT t.tid, t.firstpost
FROM ".TABLE_PREFIX."threads t

		$query = $db->query("
SELECT t.tid, t.firstpost
FROM ".TABLE_PREFIX."threads t

			WHERE 1=1 $thread_datecut $forumin $thread_usersql $permsql AND t.visible>0 AND t.closed NOT LIKE 'moved|%' $subject_lookin

			WHERE 1=1 $thread_datecut $thread_replycut $forumin $thread_usersql $permsql AND t.visible>0 AND t.closed NOT LIKE 'moved|%' $subject_lookin

		");
while($thread = $db->fetch_array($query))
{

		");
while($thread = $db->fetch_array($query))
{

Zeile 731Zeile 774
			SELECT p.pid, p.tid
FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)

			SELECT p.pid, p.tid
FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)

			WHERE 1=1 $post_datecut $forumin $post_usersql $permsql AND p.visible>0 AND t.visible>0 AND t.closed NOT LIKE 'moved|%' $message_lookin

			WHERE 1=1 $post_datecut $thread_replycut $forumin $post_usersql $permsql AND p.visible>0 AND t.visible>0 AND t.closed NOT LIKE 'moved|%' $message_lookin

		");
while($post = $db->fetch_array($query))
{

		");
while($post = $db->fetch_array($query))
{

Zeile 753Zeile 796
		$query = $db->query("
SELECT t.tid, t.firstpost
FROM ".TABLE_PREFIX."threads t

		$query = $db->query("
SELECT t.tid, t.firstpost
FROM ".TABLE_PREFIX."threads t

			WHERE 1=1 $thread_datecut $forumin $thread_usersql $permsql AND t.visible>0 $subject_lookin

			WHERE 1=1 $thread_datecut $thread_replycut $forumin $thread_usersql $permsql AND t.visible>0 $subject_lookin

		");
while($thread = $db->fetch_array($query))
{

		");
while($thread = $db->fetch_array($query))
{