📄 index.php
字号:
$this->tableHead("Title"), $this->tableHead("Size"), $this->tableHead("Words"), $this->tableHead("mtime"), $this->tableHead("Indexed"), $this->tableHead("Updated"), $this->tableHead("Parsetime"), $this->tableHead("#sec/gr/full"), $this->tableHead("#sub"), $this->tableHead("Lang"), $this->tableHead("cHash"), $this->tableHead("phash") ); // TYPO3 pages, unique $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*) AS pcount,index_phash.*', 'index_phash', 'data_page_id!=0', 'phash_grouping,phash,cHashParams,data_filename,data_page_id,data_page_reg1,data_page_type,data_page_mp,gr_list,item_type,item_title,item_description,item_mtime,tstamp,item_size,contentHash,crdate,parsetime,sys_language_uid,item_crdate,externalUrl,recordUid,freeIndexUid', 'data_page_id'); while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { $cHash = count(unserialize($row["cHashParams"])) ? $this->formatCHash(unserialize($row["cHashParams"])) : ""; $grListRec = $this->getGrlistRecord($row["phash"]); $recList[] = array( $row["data_page_id"].($row["data_page_type"]?"/".$row["data_page_type"]:""), t3lib_div::fixed_lgd($row["item_title"],30), t3lib_div::formatSize($row["item_size"]), $this->getNumberOfWords($row["phash"]), t3lib_BEfunc::datetime($row["item_mtime"]), t3lib_BEfunc::datetime($row["crdate"]), ($row["tstamp"]!=$row["crdate"] ? t3lib_BEfunc::datetime($row["tstamp"]) : ""), $row["parsetime"], $this->getNumberOfSections($row["phash"])."/".$grListRec[0]["pcount"]."/".$this->getNumberOfFulltext($row["phash"]), $row["pcount"]."/".$this->formatFeGroup($grListRec), $row["sys_language_uid"], $cHash, $row["phash"] ); if ($row["pcount"]>1) { $res2 = $GLOBALS['TYPO3_DB']->exec_SELECTquery('index_phash.*', 'index_phash', 'phash_grouping='.intval($row['phash_grouping']).' AND phash!='.intval($row['phash'])); while($row2 = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res2)) { $grListRec = $this->getGrlistRecord($row2["phash"]); $recList[] = array( "", "", t3lib_div::formatSize($row2["item_size"]), $this->getNumberOfWords($row2["phash"]), t3lib_BEfunc::datetime($row2["item_mtime"]), t3lib_BEfunc::datetime($row2["crdate"]), ($row2["tstamp"]!=$row2["crdate"] ? t3lib_BEfunc::datetime($row2["tstamp"]) : ""), $row2["parsetime"], $this->getNumberOfSections($row2["phash"])."/".$grListRec[0]["pcount"]."/".$this->getNumberOfFulltext($row2["phash"]), "-/".$this->formatFeGroup($grListRec), "", "", $row2["phash"] ); } } } return $recList; } /** * [Describe function...] * * @return [type] ... */ function getPhashExternalDocs() { $recList[]=array( $this->tableHead("Filename"), $this->tableHead("Size"), $this->tableHead("Words"), $this->tableHead("mtime"), $this->tableHead("Indexed"), $this->tableHead("Updated"), $this->tableHead("Parsetime"), $this->tableHead("#sec/gr/full"), $this->tableHead("#sub"), $this->tableHead("cHash"), $this->tableHead("phash"), $this->tableHead("Path") ); // TYPO3 pages, unique $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*) AS pcount,index_phash.*', 'index_phash', 'item_type>0', 'phash_grouping,phash,cHashParams,data_filename,data_page_id,data_page_reg1,data_page_type,data_page_mp,gr_list,item_type,item_title,item_description,item_mtime,tstamp,item_size,contentHash,crdate,parsetime,sys_language_uid,item_crdate,externalUrl,recordUid,freeIndexUid', 'item_type'); while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { $cHash = count(unserialize($row["cHashParams"])) ? $this->formatCHash(unserialize($row["cHashParams"])) : ""; $grListRec = $this->getGrlistRecord($row["phash"]); $recList[]=array( t3lib_div::fixed_lgd($row["item_title"],30), t3lib_div::formatSize($row["item_size"]), $this->getNumberOfWords($row["phash"]), t3lib_BEfunc::datetime($row["item_mtime"]), t3lib_BEfunc::datetime($row["crdate"]), ($row["tstamp"]!=$row["crdate"] ? t3lib_BEfunc::datetime($row["tstamp"]) : ""), $row["parsetime"], $this->getNumberOfSections($row["phash"])."/".$grListRec[0]["pcount"]."/".$this->getNumberOfFulltext($row["phash"]), $row["pcount"], $cHash, $row["phash"], t3lib_div::fixed_lgd($row["data_filename"],100) ); if ($row["pcount"]>1) { $res2 = $GLOBALS['TYPO3_DB']->exec_SELECTquery('index_phash.*', 'index_phash', 'phash_grouping='.intval($row['phash_grouping']).' AND phash!='.intval($row['phash'])); while($row2 = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res2)) { $cHash = count(unserialize($row2["cHashParams"])) ? $this->formatCHash(unserialize($row2["cHashParams"])) : ""; $grListRec = $this->getGrlistRecord($row2["phash"]); $recList[]=array( "", "", $this->getNumberOfWords($row2["phash"]), "", t3lib_BEfunc::datetime($row2["crdate"]), ($row2["tstamp"]!=$row2["crdate"] ? t3lib_BEfunc::datetime($row2["tstamp"]) : ""), $row2["parsetime"], $this->getNumberOfSections($row2["phash"])."/".$grListRec[0]["pcount"]."/".$this->getNumberOfFulltext($row2["phash"]), "", $cHash, $row2["phash"], "" ); } } // debug($row); } return $recList; } /** * [Describe function...] * * @param [type] $fegroup_recs: ... * @return [type] ... */ function formatFeGroup($fegroup_recs) { reset($fegroup_recs); $str = array(); while(list(,$row)=each($fegroup_recs)) { $str[] = $row["gr_list"]=="0,-1" ? "NL" : $row["gr_list"]; } arsort($str); return implode("|",$str); } /** * [Describe function...] * * @param [type] $arr: ... * @return [type] ... */ function formatCHash($arr) { reset($arr); $list=array(); while(list($k,$v)=each($arr)) { $list[]=$k."=".$v; } return implode("<BR>",$list); } /** * [Describe function...] * * @param [type] $phash: ... * @return [type] ... */ function getNumberOfSections($phash) { $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*)', 'index_section', 'phash='.intval($phash)); $row = $GLOBALS['TYPO3_DB']->sql_fetch_row($res); return $row[0]; } /** * [Describe function...] * * @param [type] $phash: ... * @return [type] ... */ function getNumberOfWords($phash) { $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*)', 'index_rel', 'phash='.intval($phash)); $row = $GLOBALS['TYPO3_DB']->sql_fetch_row($res); return $row[0]; } /** * [Describe function...] * * @param [type] $phash: ... * @return [type] ... */ function getGrlistRecord($phash) { $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('index_grlist.*', 'index_grlist', 'phash='.intval($phash)); $allRows = array(); while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { $row["pcount"] = $GLOBALS['TYPO3_DB']->sql_num_rows($res); $allRows[] = $row; } return $allRows; } /** * [Describe function...] * * @param [type] $phash: ... * @return [type] ... */ function getNumberOfFulltext($phash) { $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*)', 'index_fulltext', 'phash='.intval($phash)); $row = $GLOBALS['TYPO3_DB']->sql_fetch_row($res); return $row[0]; } /** * [Describe function...] * * @return [type] ... */ function getPhashTypes() { $recList=array(); // Types: $Itypes = array( "html" => 1, "htm" => 1, "pdf" => 2, "doc" => 3, "txt" => 4 ); $revTypes=array_flip($Itypes); $revTypes[0]="TYPO3 page"; $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*),item_type', 'index_phash', '', 'item_type', 'item_type'); while($row = $GLOBALS['TYPO3_DB']->sql_fetch_row($res)) { $iT = $row[1]; $recList[] = array($this->tableHead($revTypes[$iT]." ($iT)"), $this->countUniqueTypes($iT)."/".$row[0]); } return $recList; } /** * [Describe function...] * * @param [type] $item_type: ... * @return [type] ... */ function countUniqueTypes($item_type) { // TYPO3 pages, unique $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*)', 'index_phash', 'item_type='.intval($item_type), 'phash_grouping'); $items = array(); while($row = $GLOBALS['TYPO3_DB']->sql_fetch_row($res)) { $items[] = $row; } return count($items); }}// Include extension?if (defined("TYPO3_MODE") && $TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/indexed_search/mod/index.php"]) { include_once($TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/indexed_search/mod/index.php"]);}// Make instance:$SOBE = t3lib_div::makeInstance("SC_mod_tools_isearch_index");$SOBE->init();$SOBE->main();$SOBE->printContent();?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -