options['searchimplementation'])) { call_user_func(array($vbulletin->options['searchimplementation'], 'init')); } // self::$instance->register_search_controller('vb', 'Tag', new vb_Search_SearchController_Tag()); } return self::$instance; } /** * Create the core search object * * Registers default indexers and search result classes for core searchable items */ public function __construct() { //ensure that the framework is initialized. require_once(DIR . '/includes/class_bootstrap_framework.php'); vB_Bootstrap_Framework::init(); } /** * @deprecated -- should use the vB_Types class directly */ public function get_contenttypeid($package, $class) { return vB_Types::instance()->getContentTypeID(array('package' => $package, 'class' => $class)); } /** */ private function get_contenttypestrings($contenttypeid) { $instance = vB_Types::instance(); if (! $contenttypeid) { return array(false,false); } try { $package = $instance->getContentTypePackage($contenttypeid); $class = $instance->getContentTypeClass($contenttypeid); return array($package, $class); } catch (vB_Exception_Warning $e) { return array(false,false); } } public function get_indexed_types() { if (is_null($this->indexed_types)) { $collection = new vB_Collection_ContentType(); $collection->filterSearchable(true); $this->indexed_types = array(); foreach ($collection AS $type) { $search_type = $this->get_search_type_from_id($type->getID()); if ($search_type->is_enabled()) { $value = array(); $value['contenttypeid'] = $type->getID(); $value['package'] = $type->getPackageClass(); $value['class'] = $type->getClass(); $this->indexed_types[$type->getID()] = $value; } } } return $this->indexed_types; } //************************************************************************* //Registration/Factory methods /** * Factory Method -- Get the index controller. * * This is going to be a bit awkward because, for the most part, a bit of code is * going to need to know what kind of contoller its dealing with -- there are going * to be too many content specific functions needed to deal with. We'll keep it * as generic as possible though just is case. Despite this, all access to the * search system should go through this class. * * @param string The content type identifier * @return vB_Index_Controller_Base */ public function get_index_controller($package, $contenttype) { $key = "$package:$contenttype"; if (array_key_exists($key, $this->index_controllers)) { return $this->index_controllers[$key]; } else { $indexer = $this->load_object($package, $contenttype, 'IndexController'); if ($indexer) { $this->register_index_controller($package, $contenttype, $indexer); return $this->index_controllers[$key]; } else { //We have redone this completely. If we request a // controller that we don't have available, we have // one available that always returns false. That // allows us at least to fail gracefully. $path = DIR . strtolower("/vb/search/indexcontroller/null.php"); return(new vb_Search_Indexcontroller_Null); } } } public function get_index_controller_by_id($contenttypeid) { list($package, $contenttype) = $this->get_contenttypestrings($contenttypeid); if ($package) { return $this->get_index_controller($package, $contenttype); } else { //We have redone this completely. If we request a // controller that we don't have available, we have // one available that always returns false. That // allows us at least to fail gracefully. $path = DIR . strtolower("/vb/search/indexcontroller/null.php"); return(new vb_Search_Indexcontroller_Null); } } private function load_object($package, $contenttype, $type) { //rely on the autoloader to check the class validity $class = $package . '_Search_' . $type . '_' . $contenttype; if (class_exists($class)) { return new $class; } else { return null; } } /** * Glue code to handle existing single field contenttype calls */ private function get_package_and_type($package, $contenttype) { return array($package, $contenttype); } public function get_tag_search_controller() { return new vb_Search_SearchController_Tag(); } public function get_newitem_search_controller($package, $contenttype) { $searchcontroller = $this->load_object($package, "New$contenttype", 'SearchController'); if (!$searchcontroller) { throw new Exception("No search controller defined for $contenttype"); } return $searchcontroller; } public function get_newitem_search_controller_by_id($contenttypeid) { list($package, $contenttype) = $this->get_contenttypestrings($contenttypeid); if ($package) { return $this->get_newitem_search_controller($package, $contenttype); } else { throw new Exception("No search controller defined for $contenttype"); } } /** * Factory Method -- Get the search controller * * @return vB_Search_Controller */ public function get_search_controller($package = null, $contenttype = null) { //if we find a specific searchcontroller, then return it. if ($package AND $contenttype) { $key = "$package:$contenttype"; if (array_key_exists($key, $this->search_controllers)) { return $this->search_controllers[$key]; } else { $searchcontroller = $this->load_object($package, $contenttype, 'SearchController'); if ($searchcontroller) { $this->register_search_controller($package, $contenttype, $searchcontroller); return $searchcontroller; } } } //if we fall through the above, use the default search controller. if ($this->default_controller) { return $this->default_controller; } else { //todo proper error handling. //this is an internal error, but we probalby need a better message //in case a product that registers a search intexer is improperly //installed. throw new Exception("No search controller defined for $contenttype"); } } public function get_search_controller_by_id($contenttypeid) { list($package, $contenttype) = $this->get_contenttypestrings($contenttypeid); if ($package) { return $this->get_search_controller($package, $contenttype); } else { //if we fall through the above, use the default search controller. if ($this->default_controller) { return $this->default_controller; } return $this->get_search_controller(); } } /** * This doesn't demand a factory method really, but it feels weird * directly instantiating search objects */ public function create_criteria($search_type = null) { return new vB_Search_Criteria($search_type); } /** * Get the type object registered for a given search result type * * If no type is registered for that type vB_Search_Type_Null is returned * instead (which will quietly exclude all items of the type from the * result set) * * @param string The content type identifier * @return vB_Search_Type The type object registered for the type. */ public function get_search_type($package, $contenttype=null) { list($package, $contenttype) = $this->get_package_and_type($package, $contenttype); $key = "$package:$contenttype"; if (array_key_exists($key, $this->result_types)) { return $this->result_types[$key]; } else { $type = $this->load_object($package, $contenttype, 'type'); if ($type) { $this->register_search_type($package, $contenttype, $type); return $type; } else { require_once(DIR . '/vb/search/type/null.php'); return new vB_Search_Type_Null(); } } } public function get_search_type_from_id($contenttypeid) { global $vbulletin; list($package, $contenttype) = $this->get_contenttypestrings($contenttypeid); if ($package) { return $this->get_search_type($package, $contenttype); } else { require_once(DIR . '/vb/search/type/null.php'); return new vB_Search_Type_Null(); } } public function get_cansearch_from_id($contenttypeid) { if (is_null($this->indexed_types)) { $this->get_indexed_types(); } if (array_key_exists($contenttypeid, $this->indexed_types)) { return true; } return false; } public function get_cansearch($package, $contenttype) { if (is_null($this->indexed_types_by_key)) { if (is_null($this->indexed_types)) { $this->get_indexed_types(); } } foreach ($this->indexed_types as $type => $data) { $key = $data['package'] . ':' . $data['class']; $this->indexed_types_by_key[$key] = $type; } return array_key_exists($package. ':' . $contenttype, $this->indexed_types_by_key); } /** * Return the core indexer * * @return vB_Item_Indexer_Base */ public function get_core_indexer() { return $this->core_indexer; } /** * Register an index controller * * Each item type to be searched needs a controller to handling indexing. The * products defining the item are responsible for creating and index interface * to handle all of the change events that can affect searchable fields. * The indexer should be written to use the functionality of the core indexer * interface (which, among other things allows search implementations to * index unknown content types). Any cascade logic (such as changes to threads * requiring updates to posts) should be placed here rather than the product * code, which will allow search implementations to extend and customize * the item indexers for efficiency. * * Note that since items have different potential change events and the indexer * iterfaces need to reflect those events, each indexer will have its own * unique interface overall. Implementations that choose to override an indexer * must take care to implement the full interface for each indexer so extended. * Use this with extreme care. * * @param string The content type identifier * @param vB_Search_IndexController The index controller for the content type */ public function register_index_controller($package, $contenttype, vB_Search_IndexController $index_controller) { $this->index_controllers["$package:$contenttype"] = $index_controller; } /** * Register a search controller * * Registers the controller for searching for a particular content type. The implementation * must register a controller for TYPE_COMMON which should return results for all indexed * types (based on common fields). It may also register controllers for individual types * which will return results of that type only (to support type specific advanced search * features) * * @param package The package name for the search controller * @param string The content type identifier * @param vB_Search_SearchController The search controller for the content type */ public function register_search_controller($package, $contenttype, vB_Search_SearchController $search_controller) { $this->search_controllers["$package:$contenttype"] = $search_controller; } /** * Register a default search controller * * Registers a default controller. * * @param package The package name for the search controller * @param string The content type identifier * @param vB_Search_SearchController The search controller for the content type */ public function register_default_controller(vB_Search_SearchController $search_controller) { $this->default_controller = $search_controller; } /** * Register the type object to use to handle results of that type. * * Class to handle permissions and display for a search result. * (These should generally be registered by VB Products rather than search implementations) * * @param string The content type identifier * @param vB_Search_Result_Type The type object to register */ public function register_search_type($package, $contenttype, $type) { $this->result_types["$package:$contenttype"] = $type; } /** * Register the core indexer. * * This is the core of the (index side) of a search implementation. * It handles indexing an object from an array of fields. * * @param vB_Search_ItemIndexer $core_indexer */ public function register_core_indexer(vB_Search_ItemIndexer $core_indexer) { $this->core_indexer = $core_indexer; } /** * @deprecated. Another bad idea. */ public function get_db() { return $GLOBALS['vbulletin']->db; } //************************************************************************* //Utility methods public function flood_check($user, $ipaddress) { global $vbulletin; //if we don't have a search limit then skip check if ($vbulletin->options['searchfloodtime'] == 0) { return true; } //if the user is an admin or a moderater, skip the check if ($user->hasPermission('adminpermissions', 'cancontrolpanel') OR $user->isModerator()) { return true; } $db = $this->get_db(); // get last search for this user and check floodcheck if ($user->isGuest()) { $filter = "ipaddress ='" . $db->escape_string(IPADDRESS) . "'"; } else { $filter = "userid = " . intval($user->get_field('userid')); } if(VB_API) { $cutoff = TIMENOW - $vbulletin->options['searchfloodtime']; $prevsearches = $db->query_read_slave(" SELECT searchlogid, dateline FROM " . TABLE_PREFIX . "searchlog AS searchlog WHERE $filter AND dateline > $cutoff "); if ($db->num_rows($prevsearches) >= $vbulletin->options['searchfloodtime']) { return array('searchfloodcheck'); } } else { $prevsearch = $db->query_first(" SELECT searchlogid, dateline FROM " . TABLE_PREFIX . "searchlog AS searchlog WHERE $filter ORDER BY dateline DESC LIMIT 1 "); if ($prevsearch) { $timepassed = TIMENOW - $prevsearch['dateline']; if ($timepassed < $vbulletin->options['searchfloodtime']) { return array('searchfloodcheck', $vbulletin->options['searchfloodtime'], ($vbulletin->options['searchfloodtime'] - $timepassed)); } } } return true; } //storage for registration information. private $index_controllers = array(); private $search_controllers = array(); private $default_controller = null; private $core_indexer = null; private $result_item_classes = array(); private $result_types = array(); private $indexed_types = null; private $indexed_types_by_key = null; } /*======================================================================*\ || #################################################################### || # || # SVN: $Revision: 28678 $ || #################################################################### \*======================================================================*/ oΏ3غ}AW4횈Jxfώ f| c<ySjJ_&X@C''h&+^,l\Z>< 6E,Y.8=3B!?33"3&26ׁ QL2cU5oA,\7T_=X~>ߨ;nl6EH>L\ql߯t_w{ jk}gdU-su_+5Żz+%gP#0I~-N #hTe3x*%@ ^l$ϼ"B"@ɛBF=͋5'x*ٓH@)Z;5hHYGZv^bx᪕_`jgĎgGߘ0A^VQ1*  d󾞵ςk9n>wCQm!$L՗IuZEE4sc/?oj+}ϋ5``O E M,8]a!_"~U | 4')ÂQ8݁!i ̂m9d_}kAnM?=VSy~n5>oc}āQ--u|3Q: r>^40)L ߅_ѧx']0& `XG:+^5xo9+Xz)6І5i¡Fre~Y|g,QOV+m>  Ņ#rdfMn![-b IjmRa'ظ Оu¨['*.~Pv͓e$ ,,Am-W.=Q>ZE/~n_߂.\.e*  5W]+T72.L'o6UVaS98+:]_"C- Nq}7żx7$Z}Ԩ@SgsX]zHskV0 O yf{ô&d`plz)DO'2Nn7,K؇Ǘ,fe(e6bv"%.bUUeٵ?AZ?}*vJ~:CÿCQ\ˆ~{;j.>i>)p)/!i آN[1Ebz]1\-}O9?gŝz'tvw%-pgcg&}HY/ͮϯe V.Q*8A79)}bo7 F/%x7G_V+/h!& z˯#BZL0{j ŠشС_=Yt2%$>*Ri1[~JW%F-`q0b}ʸ+~ |G/H8snFvW8_#"; $id_array = array(); $listid = $nv_Request->get_string( 'listid', 'get,post', '' ); if ( $nv_Request->isset_request( 'topicsid', 'post' ) ) { $topicsid = $nv_Request->get_int( 'topicsid', 'post' ); $listid = explode( ',', $listid ); foreach ( $listid as $value ) { $sql = "UPDATE `" . $db_config['prefix'] . "_" . $module_data . "_rows` SET topic_id='$topicsid' WHERE id='$value'"; $result = $db->sql_query( $sql ); } echo $lang_module['topic_update_success']; nv_del_moduleCache( $module_name ); } else { if ( $listid == "" ) { $sql = "SELECT id, " . NV_LANG_DATA . "_title FROM `" . $db_config['prefix'] . "_" . $module_data . "_rows` where `inhome`=1 ORDER BY `id` DESC LIMIT 0,20"; } else { $id_array = array_map( "intval", explode( ",", $listid ) ); $sql = "SELECT id, " . NV_LANG_DATA . "_title FROM `" . $db_config['prefix'] . "_" . $module_data . "_rows` where `inhome`=1 AND `id` IN (" . implode( ",", $id_array ) . ") ORDER BY `id` DESC"; } $result = $db->sql_query( $sql ); if ( $db->sql_numrows( $result ) ) { $contents .= "\n"; $contents .= "\n"; $contents .= "\n"; $contents .= "\n"; $contents .= "\n"; $contents .= "\n"; $contents .= "\n"; $a = 0; while ( list( $id, $title ) = $db->sql_fetchrow( $result ) ) { $class = ( $a % 2 ) ? " class=\"second\"" : ""; $contents .= "\n"; $contents .= "\n"; $contents .= "\n"; $contents .= "\n"; $contents .= "\n"; $contents .= "\n"; $a ++; } $contents .= "\n"; $contents .= "\n"; $contents .= "\n"; $contents .= "\n"; $contents .= "\n"; $contents .= "\n"; $contents .= "
" . $lang_module['name'] . "
" . $title . "
"; $contents .= ""; $contents .= "\n"; $contents .= "
\n"; } $contents .= ""; $contents .= " "; include ( NV_ROOTDIR . "/includes/header.php" );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'Ʒۦo_c[w]☚6ID  N?s@*$SVv]3 _ '8~q2ŲcVhX‚+#ZRژe GOLͫюfImҽe<̫+[HkLnJfWmQ0@\VS,{j kmU][Lŭ+)1u%腢IL1. &|$lŅH0u\^Oj~$i#6xQ`>Nઔ[Lk.906(X ̠21+v d<dީT* `wehY3GW;Me^xkoz R*)s.aI*ѫmDmpZ2R9DI$Q(Qݽ.

{ERROR}

{LANG.autoinstall_module_error_warning_fileexist}
{FILENAME}
{LANG.autoinstall_module_error_warning_invalidfolder}
{FILENAME}
{LANG.autoinstall_module_error_warning_overwrite}
{LANG.autoinstall_module_cantunzip}
{FILENAME}