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

📄 keywords.php

📁 一款基于PHP的网络日记程序。WikyBlog支持:多用户的 BLOG
💻 PHP
字号:
<?php//$lang checkeddefined('WikyBlog') or die("Not an entry point...");global $pageOwner,$dbObject,$lang;$page->displayTitle = $lang['keyword_search']; //'Keyword Search';$dbObject->links['?'] = 'Keyword_Search';includeFile('search/all.php');	class queryKeywords extends query{	var $classes;	var $label;	var $space;		function queryKeywords(){		global $page,$dbInfo,$pageOwner,$lang,$dbObject,$wbTables;		$page->css2 =true;		$this->rowLimit = 25;				$this->searchUrl = '/Special/'.$pageOwner['username'].'/'.$dbObject->title;				//$this->fields[--shown to user--] = --database column--		$this->fields[$lang['posted']] = 'posted';		$this->fields[$lang['modified']] = 'modified';		$this->fields[$lang['created']] = $wbTables['all_files'].'.`file_id`';				//Space			if( isset($_GET['space']) && isset($dbInfo[$_GET['space']]['dbTable']) ){				$this->space = $dbInfo[$_GET['space']]['class'];		//!! finish getting rid of $this->space by using $this->useTables instead				$this->useTables[$_GET['space']] = true;				$this->fields[$lang['created']] = $dbInfo[$_GET['space']]['dbTable'].'.`file_id`';			}							//New			$this->queryAllFiles();			$this->query .= ' AND !FIND_IN_SET("hidden", '.$wbTables['all_files'].'.`flags`) ';			$this->query .= ' AND !FIND_IN_SET("deleted", '.$wbTables['all_files'].'.`flags`) ';				//owner			if( isset($_GET['owner']) && $_GET['owner'] === 'false' ){				//no owner			}else{				$this->query .= ' AND '.$wbTables['all_files'].'.owner_id = "'.$pageOwner['user_id'].'" ';			}						// Keyword Search			if( !empty($_GET['key']) ){								//prepare $key and $_GET['key] so that multiple tabs aren't created for a single (case different) key				//	we get the $key as it's stored in $pageOwner because files may have the same key typed with different cases in multiple files								$key = $_GET['key'];				if( ':' === substr($key,-1) ){					$key = substr($key,0,-1);				}				$_GET['key'] = str_replace('&','%26',$_GET['key']);				$_GET['key'] = trim($_GET['key']);								$key = getUserKeyword($key);				$this->label = wbUcwords($key);				$page->displayTitle .= ' > '.wbUcwords($key);								//first case... find exact				$pos= strpos($_GET['key'],':');				if(($pos === false)||($pos+1) == strlen($_GET['key'])){					//Get all with a loose query					$_GET['key'] = $key.':';					$this->query .= ' AND (';					$this->query .= ' (FIND_IN_SET("'.wbDB::escape(htmlspecialchars($key)).'", '.$wbTables['all_files'].'.`keywords` )>0) ';					$this->query .= ' OR ('.$wbTables['all_files'].'.`keywords` LIKE "'.wbDB::like(htmlspecialchars($_GET['key'])).'%") ';					$this->query .= ' OR ('.$wbTables['all_files'].'.`keywords` LIKE "%,'.wbDB::like(htmlspecialchars($_GET['key'])).'%") ';					$this->query .= ')';				}else{					$this->query .= ' AND (FIND_IN_SET("'.wbDB::escape(htmlspecialchars($_GET['key'])).'", '.$wbTables['all_files'].'.`keywords` )>0) ';				}							}elseif( !isset($_GET['key']) ){								if( !empty($this->space) ){					$this->label = $lang['browse'].' '.$lang[$this->space];				}else{					$this->label = $lang['browse'].' '.$lang['all'];				}				$page->displayTitle = $this->label;							}else{								$whereA[] = ' IF( LENGTH(keywords)>0 ,0,1) ';				$this->label = $lang['non_tagged_files'];				$page->displayTitle = $lang['non_tagged_files'];			}				$this->orderBy();		browseSearch3($this,$this->label);	}		function mysqlFetch(&$result){		return mysql_fetch_row($result);	}	function displayPre(){}		function displayEmpty(){		parent::displayEmpty();		return true;	}	function displayPost(&$prev,&$pages,&$next){		global $pageOwner,$dbInfo,$lang;		$more = '';		///	Owner			if( isset($_GET['owner']) && $_GET['owner'] === 'false' ){				$overWrite['owner'] = false;				$more .= '<li>'.$lang['search_from'];				$more .= wbLinks::local($this->searchUrl.'?'.$this->browseString($overWrite),$lang['user'].': '.$pageOwner['username']);				$more .= ' &nbsp; <b>'.$lang['all_users'].'</b> </li>';			}else{				$overWrite['owner'] = 'false';				$more .= '<li>'.$lang['search_from'];				$more .= ' <b>'.$lang['user'].': '.$pageOwner['username'].'</b> &nbsp; ';				$more .= wbLinks::local($this->searchUrl.'?'.$this->browseString($overWrite),$lang['all_users']).'</li>';			}			unset($overWrite);						/// Space			$more .= '<li> '.$lang['from_file_type'];			if( !isset($_GET['space']) || !isset($dbInfo[$_GET['space']]['dbTable']) ){				$more .= ' <b>'.$lang['all'].'</b> &nbsp; ';			}else{				$overWrite['space'] = false;								$temp = $this->browseString($overWrite);				$more .= browseLink2($this->searchUrl,$this->searchUrlLow,0,$temp,$lang['all']).' &nbsp; ';			}			foreach($dbInfo as $space => $array){				if( !isset($array['dbTable']) ){					continue;				}								if( isset($_GET['space']) && $_GET['space'] == $space){					$more .= ' <b>'.$lang[$array['class']].'</b> &nbsp; ';					continue;				}								$overWrite['space'] = $space;				$temp = $this->browseString($overWrite);				$label = wbLang::text($array['class']);				$more .= browseLink2($this->searchUrl,$this->searchUrlLow,0,$temp,$label).' &nbsp; ';			}			$more .= '</li>';				parent::displayPost($prev,$pages,$next,$more);	}	}new queryKeywords();///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////		Supp Functions//function getUserKeyword($arg){	global $pageOwner;		if( !is_array($pageOwner['keywords']) ){		return $arg;	}		foreach($pageOwner['keywords'] as $key => $num){		if(strcasecmp($arg,$key) === 0){			return $key;		}	}	return $arg;}

⌨️ 快捷键说明

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