Example #1
0
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program; if not, see <http://www.gnu.org/licenses/>.
 *
 *   @author          Black Cat Development
 *   @copyright       2013, Black Cat Development
 *   @link            http://blackcat-cms.org
 *   @license         http://www.gnu.org/licenses/gpl.html
 *   @category        CAT_Modules
 *   @package         lib_search
 *
 */
if (defined('CAT_PATH')) {
    include CAT_PATH . '/framework/class.secure.php';
} else {
    $root = "../";
    $level = 1;
    while ($level < 10 && !file_exists($root . '/framework/class.secure.php')) {
        $root .= "../";
        $level += 1;
    }
    if (file_exists($root . '/framework/class.secure.php')) {
        include $root . '/framework/class.secure.php';
    } else {
        trigger_error(sprintf("[ <b>%s</b> ] Can't include class.secure.php!", $_SERVER['SCRIPT_NAME']), E_USER_ERROR);
    }
}
require_once CAT_PATH . '/modules/' . basename(dirname(__FILE__)) . '/library.php';
// init & execute the Search
$search = new CATSearch();
$search->exec();
Example #2
0
        include $root . '/framework/class.secure.php';
    } else {
        trigger_error(sprintf("[ <b>%s</b> ] Can't include class.secure.php!", $_SERVER['SCRIPT_NAME']), E_USER_ERROR);
    }
}
if (!file_exists(CAT_PATH . '/modules/' . SEARCH_LIBRARY . '/library.php')) {
    $page_id = CAT_Helper_Validate::get('_REQUEST', 'page_id');
    CAT_Object::printFatalError(CAT_Object::lang()->translate('No search library installed!'), CAT_Helper_Page::getLink($page_id));
}
// Required page details
$page_id = -1;
$page_description = '';
$page_keywords = '';
// load search library
require_once CAT_PATH . '/modules/' . SEARCH_LIBRARY . '/library.php';
$s = new CATSearch();
$page_id = $s->getSearchPageID();
// load droplets extensions
$h = CAT_Helper_Droplet::getInstance();
$h->register_droplet_css('SearchBox', $page_id, '/modules/' . SEARCH_LIBRARY . '/templates/default/', 'search.box.css');
$h->register_droplet_js('SearchBox', $page_id, '/modules/' . SEARCH_LIBRARY . '/templates/default/', 'search.box.js');
if (isset($_GET['string'])) {
    CAT_Helper_Page::addCSS(CAT_URL . '/modules/' . SEARCH_LIBRARY . '/templates/default/frontend.css');
}
// add language file
CAT_Helper_I18n::getInstance()->addFile(LANGUAGE . '.php', CAT_PATH . '/modules/' . SEARCH_LIBRARY . '/languages/');
// add template search path
global $parser;
$parser->setPath(CAT_PATH . '/modules/' . SEARCH_LIBRARY . '/templates/custom');
$parser->setFallbackPath(CAT_PATH . '/modules/' . SEARCH_LIBRARY . '/templates/default');
define('PAGE_CONTENT', CAT_PATH . '/modules/' . SEARCH_LIBRARY . '/index.php');