Zeile 1 | Zeile 1 |
---|
<?php /** * MyBB 1.4
|
<?php /** * MyBB 1.4
|
* Copyright � 2008 MyBB Group, All Rights Reserved
| * Copyright © 2008 MyBB Group, All Rights Reserved
|
* * Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* * Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* $Id: functions_search.php 3914 2008-06-15 04:19:42Z Tikitiki $
| * $Id: functions_search.php 5379 2011-02-21 11:06:42Z Tomm $
|
*/
/**
| */
/**
|
Zeile 154 | Zeile 154 |
---|
} } $unsearchable = $unsearchableforums;
|
} } $unsearchable = $unsearchableforums;
|
| // Get our unsearchable password protected forums $pass_protected_forums = get_password_protected_forums(); if($unsearchable && $pass_protected_forums) { $unsearchable .= ","; } if($pass_protected_forums) { $unsearchable .= implode(",", $pass_protected_forums); }
|
return $unsearchable;
|
return $unsearchable;
|
| }
/** * Build a array list of the forums this user cannot search due to password protection * * @param int the fids to check (leave null to check all forums) * @return return a array list of password protected forums the user cannot search */ function get_password_protected_forums($fids=array()) { global $forum_cache, $mybb; if(!is_array($fids)) { return false; } if(!is_array($forum_cache)) { $forum_cache = cache_forums(); if(!$forum_cache) { return false; } } if(empty($fids)) { $fids = array_keys($forum_cache); }
$pass_fids = array(); foreach($fids as $fid) { if(empty($forum_cache[$fid]['password'])) { continue; } if(md5($mybb->user['uid'].$forum_cache[$fid]['password']) != $mybb->cookies['forumpass'][$fid]) { $pass_fids[] = $fid; $child_list = get_child_list($fid); } if(is_array($child_list)) { $pass_fids = array_merge($pass_fids, $child_list); } } return array_unique($pass_fids);
|
}
/**
| }
/**
|
Zeile 164 | Zeile 229 |
---|
* @return string The cleaned keywords */ function clean_keywords($keywords)
|
* @return string The cleaned keywords */ function clean_keywords($keywords)
|
{ $keywords = my_strtolower($keywords); $keywords = str_replace("%", "\\%", $keywords); $keywords = preg_replace("#\*{2,}#s", "*", $keywords);
| { $keywords = my_strtolower($keywords); $keywords = str_replace("%", "\\%", $keywords); $keywords = preg_replace("#\*{2,}#s", "*", $keywords);
|
$keywords = str_replace("*", "%", $keywords); $keywords = preg_replace("#([\[\]\|\.\,:'])#s", " ", $keywords); $keywords = preg_replace("#\s+#s", " ", $keywords);
|
$keywords = str_replace("*", "%", $keywords); $keywords = preg_replace("#([\[\]\|\.\,:'])#s", " ", $keywords); $keywords = preg_replace("#\s+#s", " ", $keywords);
|
return trim($keywords);
| // Search for "and" or "or" and remove if it's at the beginning $keywords = trim($keywords); if(my_strpos($keywords, "or") !== false && my_strpos($keywords, "or") == 0) { $keywords = substr_replace($keywords, "", 0, 2); } if(my_strpos($keywords, "and") !== false && my_strpos($keywords, "and") == 0) { $keywords = substr_replace($keywords, "", 0, 3); }
return $keywords;
|
}
/**
| }
/**
|
Zeile 191 | Zeile 268 |
---|
$keywords = preg_replace("#\*{2,}#s", "*", $keywords); $keywords = preg_replace("#([\[\]\|\.\,:])#s", " ", $keywords); $keywords = preg_replace("#\s+#s", " ", $keywords);
|
$keywords = preg_replace("#\*{2,}#s", "*", $keywords); $keywords = preg_replace("#([\[\]\|\.\,:])#s", " ", $keywords); $keywords = preg_replace("#\s+#s", " ", $keywords);
|
| $words = array();
|
if(my_strpos($keywords, "\"") !== false) { $inquote = false;
| if(my_strpos($keywords, "\"") !== false) { $inquote = false;
|
Zeile 459 | Zeile 538 |
---|
SELECT DISTINCT f.fid FROM ".TABLE_PREFIX."forums f LEFT JOIN ".TABLE_PREFIX."forumpermissions p ON (f.fid=p.fid AND p.gid='".$mybb->user['usergroup']."')
|
SELECT DISTINCT f.fid FROM ".TABLE_PREFIX."forums f LEFT JOIN ".TABLE_PREFIX."forumpermissions p ON (f.fid=p.fid AND p.gid='".$mybb->user['usergroup']."')
|
WHERE (','||parentlist||',' LIKE ',%{$forum}%,') > 0 AND active!=0 AND (p.fid IS NULL OR p.cansearch=1)
| WHERE (','||parentlist||',' LIKE ',%{$forum}%,') = true AND active!=0 AND (p.fid IS NULL OR p.cansearch=1)
|
"); break; case "sqlite3":
| "); break; case "sqlite3":
|