⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 odt.searchbot.php

📁 joomla的图片功能插件,能够有很多图片特效功能
💻 PHP
字号:
<?php/*** @package ODT_Indexer* @copyright (C) 2006 Websmurf* @author Websmurf* * --------------------------------------------------------------------------------* All rights reserved.  ODT Indexer is a component for Joomla and Mambo. * You can use it to search through ODT files** This program is free software; you can redistribute it and/or* modify it under the terms of the Creative Commons - Attribution-NoDerivs 2.5 * license as published by the Creative Commons Organisation* http://creativecommons.org/licenses/by-nd/2.5/.** This program is distributed in the hope that it will be useful,* but WITHOUT ANY WARRANTY; without even the implied warranty of* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  * --------------------------------------------------------------------------------**/// no direct accessdefined( '_VALID_MOS' ) or die( 'Restricted access' );$_MAMBOTS->registerFunction( 'onSearch', 'botSearchODT' );/*** Content Search method** The sql must return the following fields that are used in a common display* routine: href, title, section, created, text, browsernav* @param string Target search string* @param string mathcing option, exact|any|all* @param string ordering option, newest|oldest|popular|alpha|category*/function botSearchODT( $text, $phrase='', $ordering='' ) {	global $my, $database;	global $mosConfig_offset, $mainframe;	// load mambot params info	$query = "SELECT params"	. "\n FROM #__mambots"	. "\n WHERE element = 'odt.searchbot'"	. "\n AND folder = 'search'"	;	$database->setQuery( $query );	$database->loadObject($mambot);		$botParams = new mosParameters( $mambot->params );		$limit 		= $botParams->def( 'search_limit', 50 );	$nullDate 	= $database->getNullDate();	$now 		= date( 'Y-m-d H:i:s', time()+$mosConfig_offset*60*60 );		$text = trim( $text );	if ($text == '') {		return array();	}	$wheres = array();	switch ($phrase) {		case 'exact':			$where = "LOWER(a.content) LIKE '%$text%'";			break;					case 'all':		case 'any':		default:			$words = explode( ' ', $text );			$wheres = array();			foreach ($words as $word) {				$wheres[] = "LOWER(a.content) LIKE '%$text%'";			}			$where = '(' . implode( ($phrase == 'all' ? ') AND (' : ') OR ('), $wheres ) . ')';			break;	}	//	echo "|". $where . "|";	$morder = '';	switch ($ordering) {					  case 'oldest':	    $order = 'a.indexed ASC';			break;	  case 'newest':	    $order = 'a.indexed DESC';			break;		  case 'category':		case 'popular':		case 'alpha':		default:			$order = 'a.path DESC';			break;			}	// search content items	$query = "SELECT a.name AS title,"	. "\n a.content AS text,"	. "\n CONCAT( '". $mainframe->getCfg('live_site') . "/', a.path ) AS href,"	. "\n '1' AS browsernav"	. "\n FROM #__odtindex AS a"	. "\n WHERE ( $where )"//	. "\n AND a.published = 1"//	. "\n AND a.access <= $my->gid"	. "\n GROUP BY a.id"	. "\n ORDER BY $order"	;	$database->setQuery( $query, 0, $limit );	$list = $database->loadObjectList();	echo $database->getErrorMsg();//	echo $database->getQuery();	return $list;}?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -