<?php
	require_once( $GLOBALS["site_root"] . "/includes/widgets/FrontendSuperGrid.inc.php" );
	require_once( $GLOBALS["site_root"] . "/includes/widgets/ForumTopicsGrid.inc.php" );


	class ForumSearchHitsTopics extends ForumTopicsGrid {
		public function __construct( $id , $parent ) {
			parent::__construct( $id , $parent );
			$this->sTitle = __("forum_Search_in_topics" );
			$this->sNoRows = __("forum_search_No_topic_found" );

			$this->_pagenum = "ftpn";
			$this->_pagesize = "ftps";
			$this->_ordering = "fto";
			$this->_orderingdir = "ftod";
		
		}

		protected function whereClause() {
			$filters = array();

			$f = (isset( $this->aG["forum_search_text"] )) ? $this->aG["forum_search_text"] : "";
			$filters[] = sprintf( "forum_topic_title ilike '%%%s%%'" , FNTH_db_addslashes( $f ) );

			if (empty( $filters )) return "";
			return " where " . implode( " and " , $filters );
		}
	}

?>
