<?php include_once '../doc-typo3-funcs.php'; $doxygen_vars = array( "title" => "TYPO3 4.0.1: typo3_src-4.0.1/typo3/sysext/indexed_search/modfunc1/class.tx_indexedsearch_modfunc1.php Source File", "datetime" => "Sat Dec 2 19:22:32 2006", "date" => "2 Dec 2006", "doxygenversion" => "1.4.6", "projectname" => "TYPO3 4.0.1", "projectnumber" => "4.0.1" ); get_header($doxygen_vars); ?> <!-- Generated by Doxygen 1.4.6 --> <div class="tabs"> <ul> <li><a href="main.html"><span>Main Page</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="classes.html"><span>Classes</span></a></li> <li id="current"><a href="files.html"><span>Files</span></a></li> <li><a href="dirs.html"><span>Directories</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="examples.html"><span>Examples</span></a></li> <li> <form action="search.php" method="get"> <table cellspacing="0" cellpadding="0" border="0"> <tr> <td><label> <u>S</u>earch for </label></td> <td><input type="text" name="query" value="" size="20" accesskey="s"/></td> </tr> </table> </form> </li> </ul></div> <div class="nav"> <a class="el" href="dir_c8daf1ad746050abf985cc546c89e248.html">typo3_src-4.0.1</a> » <a class="el" href="dir_18071ae4545d8b3e0364d30c0659c74a.html">typo3</a> » <a class="el" href="dir_57bf1ed8249c1fd5b014486d01bcb27a.html">sysext</a> » <a class="el" href="dir_1144f7dd65e866e7cd4aa66020137172.html">indexed_search</a> » <a class="el" href="dir_8471925ab5b2f4d2c6dfc897f0222b01.html">modfunc1</a></div> <h1>class.tx_indexedsearch_modfunc1.php</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <?php <a name="l00002"></a>00002 <span class="comment">/***************************************************************</span> <a name="l00003"></a>00003 <span class="comment">* Copyright notice</span> <a name="l00004"></a>00004 <span class="comment">*</span> <a name="l00005"></a>00005 <span class="comment">* (c) 2001-2005 Kasper Skaarhoj (kasperYYYY@typo3.com)</span> <a name="l00006"></a>00006 <span class="comment">* All rights reserved</span> <a name="l00007"></a>00007 <span class="comment">*</span> <a name="l00008"></a>00008 <span class="comment">* This script is part of the TYPO3 project. The TYPO3 project is</span> <a name="l00009"></a>00009 <span class="comment">* free software; you can redistribute it and/or modify</span> <a name="l00010"></a>00010 <span class="comment">* it under the terms of the GNU General Public License as published by</span> <a name="l00011"></a>00011 <span class="comment">* the Free Software Foundation; either version 2 of the License, or</span> <a name="l00012"></a>00012 <span class="comment">* (at your option) any later version.</span> <a name="l00013"></a>00013 <span class="comment">*</span> <a name="l00014"></a>00014 <span class="comment">* The GNU General Public License can be found at</span> <a name="l00015"></a>00015 <span class="comment">* http://www.gnu.org/copyleft/gpl.html.</span> <a name="l00016"></a>00016 <span class="comment">*</span> <a name="l00017"></a>00017 <span class="comment">* This script is distributed in the hope that it will be useful,</span> <a name="l00018"></a>00018 <span class="comment">* but WITHOUT ANY WARRANTY; without even the implied warranty of</span> <a name="l00019"></a>00019 <span class="comment">* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span> <a name="l00020"></a>00020 <span class="comment">* GNU General Public License for more details.</span> <a name="l00021"></a>00021 <span class="comment">*</span> <a name="l00022"></a>00022 <span class="comment">* This copyright notice MUST APPEAR in all copies of the script!</span> <a name="l00023"></a>00023 <span class="comment">***************************************************************/</span> <a name="l00084"></a>00084 require_once(PATH_t3lib.'<span class="keyword">class</span>.t3lib_pagetree.php'); <a name="l00085"></a>00085 require_once(PATH_t3lib.'<span class="keyword">class</span>.t3lib_extobjbase.php'); <a name="l00086"></a>00086 require_once(<a class="code" href="classt3lib__extMgm.html#f395b211d97293002bbf92c3802392f5">t3lib_extMgm::extPath</a>('indexed_search').'<span class="keyword">class</span>.indexer.php'); <a name="l00087"></a>00087 <a name="l00088"></a>00088 <a name="l00089"></a>00089 <span class="comment">// ... all for the rootline!</span> <a name="l00090"></a>00090 require_once (PATH_t3lib.<span class="stringliteral">"class.t3lib_page.php"</span>); <a name="l00091"></a>00091 require_once (PATH_t3lib.<span class="stringliteral">"class.t3lib_tstemplate.php"</span>); <a name="l00092"></a>00092 require_once (PATH_t3lib.<span class="stringliteral">"class.t3lib_tsparser_ext.php"</span>); <a name="l00093"></a>00093 <a name="l00094"></a>00094 <span class="comment">// Keywords mgm:</span> <a name="l00095"></a>00095 require_once (PATH_t3lib.<span class="stringliteral">"class.t3lib_tcemain.php"</span>); <a name="l00096"></a>00096 <a name="l00097"></a>00097 <a name="l00098"></a>00098 <a name="l00106"></a><a class="code" href="classtx__indexedsearch__modfunc1.html">00106</a> <span class="keyword">class </span><a class="code" href="classtx__indexedsearch__modfunc1.html">tx_indexedsearch_modfunc1</a> <span class="keyword">extends</span> <a class="code" href="classt3lib__extobjbase.html">t3lib_extobjbase</a> { <a name="l00107"></a>00107 <a name="l00108"></a>00108 <span class="comment">// Internal, dynamic:</span> <a name="l00109"></a><a class="code" href="classtx__indexedsearch__modfunc1.html#33e40e760e8f53685fdb64c63fe2b0b5">00109</a> var <a class="code" href="classtx__indexedsearch__modfunc1.html#33e40e760e8f53685fdb64c63fe2b0b5">$allPhashListed</a> = array(); <span class="comment">// phash values accumulations for link to clear all</span> <a name="l00110"></a><a class="code" href="classtx__indexedsearch__modfunc1.html#0598d2102f062f96f4c968da4cdc8646">00110</a> var <a class="code" href="classtx__indexedsearch__modfunc1.html#0598d2102f062f96f4c968da4cdc8646">$external_parsers</a> = array(); <span class="comment">// External content parsers - objects set here with file extensions as keys.</span> <a name="l00111"></a><a class="code" href="classtx__indexedsearch__modfunc1.html#f81b7127bfe056d0a10c5857743cf03f">00111</a> var <a class="code" href="classtx__indexedsearch__modfunc1.html#f81b7127bfe056d0a10c5857743cf03f">$iconFileNameCache</a> = array(); <span class="comment">// File extensions - icon map/cache.</span> <a name="l00112"></a><a class="code" href="classtx__indexedsearch__modfunc1.html#325921b878f393301db33a3b54167b34">00112</a> var <a class="code" href="classtx__indexedsearch__modfunc1.html#325921b878f393301db33a3b54167b34">$indexerObj</a>; <span class="comment">// Indexer object</span> <a name="l00113"></a>00113 <a name="l00114"></a>00114 <a name="l00120"></a><a class="code" href="classtx__indexedsearch__modfunc1.html#47154caf732446eb7820648a52374788">00120</a> function <a class="code" href="classtx__indexedsearch__modfunc1.html#47154caf732446eb7820648a52374788">modMenu</a>() { <a name="l00121"></a>00121 global $LANG; <a name="l00122"></a>00122 <a name="l00123"></a>00123 <span class="keywordflow">return</span> array ( <a name="l00124"></a>00124 'depth' => array( <a name="l00125"></a>00125 0 => $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.depth_0'), <a name="l00126"></a>00126 1 => $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.depth_1'), <a name="l00127"></a>00127 2 => $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.depth_2'), <a name="l00128"></a>00128 3 => $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.depth_3'), <a name="l00129"></a>00129 999 => $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.depth_infi'), <a name="l00130"></a>00130 ), <a name="l00131"></a>00131 'type' => array( <a name="l00132"></a>00132 0 => 'Overview', <a name="l00133"></a>00133 1 => 'Technical Details', <a name="l00134"></a>00134 2 => 'Words and content', <a name="l00135"></a>00135 ) <a name="l00136"></a>00136 ); <a name="l00137"></a>00137 } <a name="l00138"></a>00138 <a name="l00144"></a><a class="code" href="classtx__indexedsearch__modfunc1.html#a1c3acb0f972825b2525ce89579fe29a">00144</a> function <a class="code" href="classtx__indexedsearch__modfunc1.html#a1c3acb0f972825b2525ce89579fe29a">main</a>() { <a name="l00145"></a>00145 <span class="comment">// Initializes the module. Done in this function because we may need to re-initialize if data is submitted!</span> <a name="l00146"></a>00146 global $LANG,$TYPO3_CONF_VARS; <a name="l00147"></a>00147 <a name="l00148"></a>00148 <span class="comment">// Return if no page id:</span> <a name="l00149"></a>00149 <span class="keywordflow">if</span> ($this->pObj->id<=0) <span class="keywordflow">return</span>; <a name="l00150"></a>00150 <a name="l00151"></a>00151 <span class="comment">// Initialize max-list items</span> <a name="l00152"></a>00152 $this->maxListPerPage = <a class="code" href="classt3lib__div.html#016d2190758279b2dbb953826c690118">t3lib_div::_GP</a>('listALL') ? 100000 : 100; <a name="l00153"></a>00153 <a name="l00154"></a>00154 <span class="comment">// Processing deletion of phash rows:</span> <a name="l00155"></a>00155 <span class="keywordflow">if</span> (<a class="code" href="classt3lib__div.html#016d2190758279b2dbb953826c690118">t3lib_div::_GP</a>('deletePhash')) { <a name="l00156"></a>00156 $this-><a class="code" href="classtx__indexedsearch__modfunc1.html#a1586a552fdcbd447409c573ba42d542">removeIndexedPhashRow</a>(<a class="code" href="classt3lib__div.html#016d2190758279b2dbb953826c690118">t3lib_div::_GP</a>('deletePhash')); <a name="l00157"></a>00157 } <a name="l00158"></a>00158 <a name="l00159"></a>00159 <span class="comment">// Processing stop-words:</span> <a name="l00160"></a>00160 <span class="keywordflow">if</span> (<a class="code" href="classt3lib__div.html#7df88440d0445f5a582c01b7dfba0146">t3lib_div::_POST</a>('_stopwords')) { <a name="l00161"></a>00161 $this-><a class="code" href="classtx__indexedsearch__modfunc1.html#f38140960ca251daa3e269cf9d16c0df">processStopWords</a>(<a class="code" href="classt3lib__div.html#7df88440d0445f5a582c01b7dfba0146">t3lib_div::_POST</a>('stopWord')); <a name="l00162"></a>00162 } <a name="l00163"></a>00163 <a name="l00164"></a>00164 <span class="comment">// Processing stop-words:</span> <a name="l00165"></a>00165 <span class="keywordflow">if</span> (<a class="code" href="classt3lib__div.html#7df88440d0445f5a582c01b7dfba0146">t3lib_div::_POST</a>('_pageKeywords')) { <a name="l00166"></a>00166 $this-><a class="code" href="classtx__indexedsearch__modfunc1.html#4a23a9c555bb19fb3ddac756bd4d86ef">processPageKeywords</a>(<a class="code" href="classt3lib__div.html#7df88440d0445f5a582c01b7dfba0146">t3lib_div::_POST</a>('pageKeyword'), <a class="code" href="classt3lib__div.html#7df88440d0445f5a582c01b7dfba0146">t3lib_div::_POST</a>('pageKeyword_pageUid')); <a name="l00167"></a>00167 } <a name="l00168"></a>00168 <a name="l00169"></a>00169 <span class="comment">// Initialize external document parsers:</span> <a name="l00170"></a>00170 <span class="comment">// Example configuration, see ext_localconf.php of this file!</span> <a name="l00171"></a>00171 <span class="keywordflow">if</span> (is_array($TYPO3_CONF_VARS['EXTCONF']['indexed_search']['external_parsers'])) { <a name="l00172"></a>00172 foreach($TYPO3_CONF_VARS['EXTCONF']['indexed_search']['external_parsers'] as $extension => $_objRef) { <a name="l00173"></a>00173 $this->external_parsers[$extension] = &<a class="code" href="classt3lib__div.html#ebd81edfc92886dc4c625fc9fe53595f">t3lib_div::getUserObj</a>($_objRef); <a name="l00174"></a>00174 <a name="l00175"></a>00175 <span class="comment">// Init parser and if it returns false, unset its entry again:</span> <a name="l00176"></a>00176 <span class="keywordflow">if</span> (!$this->external_parsers[$extension]->softInit($extension)) { <a name="l00177"></a>00177 unset($this->external_parsers[$extension]); <a name="l00178"></a>00178 } <a name="l00179"></a>00179 } <a name="l00180"></a>00180 } <a name="l00181"></a>00181 <a name="l00182"></a>00182 <span class="comment">// Initialize indexer if we need it (metaphone display does...)</span> <a name="l00183"></a>00183 $this->indexerObj = &<a class="code" href="classt3lib__div.html#b47f8a8e8be44b79a0b8064dcd427bc1">t3lib_div::makeInstance</a>('<a class="code" href="classtx__indexedsearch__indexer.html">tx_indexedsearch_indexer</a>'); <a name="l00184"></a>00184 <a name="l00185"></a>00185 <span class="comment">// Set CSS styles specific for this document:</span> <a name="l00186"></a>00186 $this->pObj->content = str_replace('<span class="comment">/*###POSTCSSMARKER###*/</span><span class="charliteral">','</span> <a name="l00187"></a>00187 TABLE.c-list TR TD { white-space: nowrap; vertical-align: top; } <a name="l00188"></a>00188 ',$this->pObj->content); <a name="l00189"></a>00189 <a name="l00190"></a>00190 <a name="l00191"></a>00191 <span class="comment">// Check if details for a phash record should be shown:</span> <a name="l00192"></a>00192 <span class="keywordflow">if</span> (<a class="code" href="classt3lib__div.html#df47c9f4e9980aa832b6516b774aeb33">t3lib_div::_GET</a>('phash')) { <a name="l00193"></a>00193 <a name="l00194"></a>00194 <span class="comment">// Show title / function menu:</span> <a name="l00195"></a>00195 $theOutput.=$this->pObj->doc->spacer(5); <a name="l00196"></a>00196 $theOutput.=$this->pObj->doc->section('Details <span class="keywordflow">for</span> a single result row:',$this-><a class="code" href="classtx__indexedsearch__modfunc1.html#919d65c9d390058442b6c14c87f4e392">showDetailsForPhash</a>(<a class="code" href="classt3lib__div.html#df47c9f4e9980aa832b6516b774aeb33">t3lib_div::_GET</a>('phash')),0,1); <a name="l00197"></a>00197 } elseif (<a class="code" href="classt3lib__div.html#df47c9f4e9980aa832b6516b774aeb33">t3lib_div::_GET</a>('wid')) { <a name="l00198"></a>00198 <a name="l00199"></a>00199 <span class="comment">// Show title / function menu:</span> <a name="l00200"></a>00200 $theOutput.=$this->pObj->doc->spacer(5); <a name="l00201"></a>00201 $theOutput.=$this->pObj->doc->section('Details <span class="keywordflow">for</span> a word:',$this->showDetailsForWord(<a class="code" href="classt3lib__div.html#df47c9f4e9980aa832b6516b774aeb33">t3lib_div::_GET</a>('wid')),0,1); <a name="l00202"></a>00202 } elseif (<a class="code" href="classt3lib__div.html#df47c9f4e9980aa832b6516b774aeb33">t3lib_div::_GET</a>('metaphone')) { <a name="l00203"></a>00203 <a name="l00204"></a>00204 <span class="comment">// Show title / function menu:</span> <a name="l00205"></a>00205 $theOutput.=$this->pObj->doc->spacer(5); <a name="l00206"></a>00206 $theOutput.=$this->pObj->doc->section('Details <span class="keywordflow">for</span> metaphone value:',$this->showDetailsForMetaphone(<a class="code" href="classt3lib__div.html#df47c9f4e9980aa832b6516b774aeb33">t3lib_div::_GET</a>('metaphone')),0,1); <a name="l00207"></a>00207 } elseif (<a class="code" href="classt3lib__div.html#df47c9f4e9980aa832b6516b774aeb33">t3lib_div::_GET</a>('reindex')) { <a name="l00208"></a>00208 <a name="l00209"></a>00209 <span class="comment">// Show title / function menu:</span> <a name="l00210"></a>00210 $theOutput.=$this->pObj->doc->spacer(5); <a name="l00211"></a>00211 $theOutput.=$this->pObj->doc->section('Reindexing...',$this->reindexPhash(<a class="code" href="classt3lib__div.html#df47c9f4e9980aa832b6516b774aeb33">t3lib_div::_GET</a>('reindex'),<a class="code" href="classt3lib__div.html#df47c9f4e9980aa832b6516b774aeb33">t3lib_div::_GET</a>('reindex_id')),0,1); <a name="l00212"></a>00212 } <span class="keywordflow">else</span> { <span class="comment">// Detail listings:</span> <a name="l00213"></a>00213 <span class="comment">// Depth function menu:</span> <a name="l00214"></a>00214 $h_func = <a class="code" href="classt3lib__BEfunc.html#832c7b3d00fe067d463cb12ce1a77091">t3lib_BEfunc::getFuncMenu</a>($this->pObj->id,'SET[type]',$this->pObj->MOD_SETTINGS['type'],$this->pObj->MOD_MENU['type'],'index.php'); <a name="l00215"></a>00215 $h_func.= <a class="code" href="classt3lib__BEfunc.html#832c7b3d00fe067d463cb12ce1a77091">t3lib_BEfunc::getFuncMenu</a>($this->pObj->id,'SET[depth]',$this->pObj->MOD_SETTINGS['depth'],$this->pObj->MOD_MENU['depth'],'index.php'); <a name="l00216"></a>00216 <a name="l00217"></a>00217 <span class="comment">// Show title / function menu:</span> <a name="l00218"></a>00218 $theOutput.=$this->pObj->doc->spacer(5); <a name="l00219"></a>00219 $theOutput.=$this->pObj->doc->section($LANG->getLL('title'),$h_func,0,1); <a name="l00220"></a>00220 <a name="l00221"></a>00221 $theOutput.=$this->drawTableOfIndexedPages(); <a name="l00222"></a>00222 } <a name="l00223"></a>00223 <a name="l00224"></a>00224 <span class="keywordflow">return</span> $theOutput; <a name="l00225"></a>00225 } <a name="l00226"></a>00226 <a name="l00227"></a>00227 <a name="l00228"></a>00228 <a name="l00229"></a>00229 <a name="l00230"></a>00230 <a name="l00231"></a>00231 <a name="l00232"></a>00232 <a name="l00233"></a>00233 <a name="l00234"></a>00234 <a name="l00235"></a>00235 <a name="l00236"></a>00236 <a name="l00237"></a>00237 <span class="comment">/*******************************</span> <a name="l00238"></a>00238 <span class="comment"> *</span> <a name="l00239"></a>00239 <span class="comment"> * Drawing table of indexed pages</span> <a name="l00240"></a>00240 <span class="comment"> *</span> <a name="l00241"></a>00241 <span class="comment"> ******************************/</span> <a name="l00242"></a>00242 <a name="l00248"></a><a class="code" href="classtx__indexedsearch__modfunc1.html#de41c32c42f0d44a47dacf4a5695cb5e">00248</a> function drawTableOfIndexedPages() { <a name="l00249"></a>00249 global $BACK_PATH; <a name="l00250"></a>00250 <a name="l00251"></a>00251 <span class="comment">// Drawing tree:</span> <a name="l00252"></a>00252 $tree = <a class="code" href="classt3lib__div.html#b47f8a8e8be44b79a0b8064dcd427bc1">t3lib_div::makeInstance</a>('<a class="code" href="classt3lib__pageTree.html">t3lib_pageTree</a>'); <a name="l00253"></a>00253 $perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1); <a name="l00254"></a>00254 $tree->init('AND '.$perms_clause); <a name="l00255"></a>00255 <a name="l00256"></a>00256 $HTML = '<img src=<span class="stringliteral">"'.$BACK_PATH.t3lib_iconWorks::getIcon('pages',$this->pObj->pageinfo).'"</span> width=<span class="stringliteral">"18"</span> height=<span class="stringliteral">"16"</span> align=<span class="stringliteral">"top"</span> alt=<span class="stringliteral">""</span> />'; <a name="l00257"></a>00257 $tree->tree[] = Array( <a name="l00258"></a>00258 'row' => $this->pObj->pageinfo, <a name="l00259"></a>00259 'HTML' => $HTML <a name="l00260"></a>00260 ); <a name="l00261"></a>00261 <a name="l00262"></a>00262 <span class="keywordflow">if</span> ($this->pObj->MOD_SETTINGS['depth']) { <a name="l00263"></a>00263 $tree->getTree($this->pObj->id, $this->pObj->MOD_SETTINGS['depth'], ''); <a name="l00264"></a>00264 } <a name="l00265"></a>00265 <a name="l00266"></a>00266 <span class="comment">// Traverse page tree:</span> <a name="l00267"></a>00267 $code = ''; <a name="l00268"></a>00268 foreach($tree->tree as $data) { <a name="l00269"></a>00269 $code.= $this->indexed_info( <a name="l00270"></a>00270 $data['row'], <a name="l00271"></a>00271 $data['HTML']. <a name="l00272"></a>00272 $this->showPageDetails(<a class="code" href="classt3lib__div.html#6c2adca01abbf533fd2b06d61608fd27">t3lib_div::fixed_lgd</a>($data['row']['title'], 20),$data['row']['uid']) <a name="l00273"></a>00273 ); <a name="l00274"></a>00274 } <a name="l00275"></a>00275 <a name="l00276"></a>00276 <span class="keywordflow">if</span> ($code) { <a name="l00277"></a>00277 $code = '<br/><br/> <a name="l00278"></a>00278 <table border=<span class="stringliteral">"0"</span> cellspacing=<span class="stringliteral">"1"</span> cellpadding=<span class="stringliteral">"2"</span> <span class="keyword">class</span>=<span class="stringliteral">"c-list"</span>>'. <a name="l00279"></a>00279 $this->printPhashRowHeader(). <a name="l00280"></a>00280 $code. <a name="l00281"></a>00281 '</table>'; <a name="l00282"></a>00282 <a name="l00283"></a>00283 <span class="comment">// Create section to output:</span> <a name="l00284"></a>00284 $theOutput.=$this->pObj->doc->section('',$code,0,1); <a name="l00285"></a>00285 } <span class="keywordflow">else</span> { <a name="l00286"></a>00286 $theOutput.=$this->pObj->doc->section('<span class="charliteral">','</span><br/><br/>'.$this->pObj->doc->icons(1).'There were no indexed pages found in the tree.<br/><br/>',0,1); <a name="l00287"></a>00287 } <a name="l00288"></a>00288 <a name="l00289"></a>00289 <span class="keywordflow">return</span> $theOutput; <a name="l00290"></a>00290 } <a name="l00291"></a>00291 <a name="l00299"></a><a class="code" href="classtx__indexedsearch__modfunc1.html#56da53d1eaa87f08f19544dd257d087a">00299</a> function indexed_info($data, $firstColContent) { <a name="l00300"></a>00300 <a name="l00301"></a>00301 <span class="comment">// Query:</span> <a name="l00302"></a>00302 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery( <a name="l00303"></a>00303 'ISEC.*, IP.*, count(*) AS count_val', <a name="l00304"></a>00304 'index_phash IP, index_section ISEC', <a name="l00305"></a>00305 'IP.phash = ISEC.phash AND ISEC.page_id = '.intval($data['uid']), <a name="l00306"></a>00306 'IP.phash,IP.phash_grouping,IP.cHashParams,IP.data_filename,IP.data_page_id,IP.data_page_reg1,IP.data_page_type,IP.data_page_mp,IP.gr_list,IP.item_type,IP.item_title,IP.item_description,IP.item_mtime,IP.tstamp,IP.item_size,IP.contentHash,IP.crdate,IP.parsetime,IP.sys_language_uid,IP.item_crdate,ISEC.phash,ISEC.phash_t3,ISEC.rl0,ISEC.rl1,ISEC.rl2,ISEC.page_id,ISEC.uniqid,IP.externalUrl,IP.recordUid,IP.freeIndexUid,IP.freeIndexSetId', <a name="l00307"></a>00307 'IP.item_type, IP.tstamp', <a name="l00308"></a>00308 ($this->maxListPerPage+1) <a name="l00309"></a>00309 ); <a name="l00310"></a>00310 <a name="l00311"></a>00311 <span class="comment">// Initialize variables:</span> <a name="l00312"></a>00312 $rowCount = 0; <a name="l00313"></a>00313 $lines = array(); <span class="comment">// Collecting HTML rows here.</span> <a name="l00314"></a>00314 $phashAcc = array(); <span class="comment">// Collecting phash values (to remove local indexing for)</span> <a name="l00315"></a>00315 $phashAcc[] = 0; <a name="l00316"></a>00316 <a name="l00317"></a>00317 <span class="comment">// Traverse the result set of phash rows selected:</span> <a name="l00318"></a>00318 <span class="keywordflow">while</span>($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { <a name="l00319"></a>00319 <span class="keywordflow">if</span> ($rowCount == $this->maxListPerPage) { <a name="l00320"></a>00320 $rowCount++; <span class="comment">// Increase to the extra warning row will appear as well.</span> <a name="l00321"></a>00321 <span class="keywordflow">break</span>; <a name="l00322"></a>00322 } <a name="l00323"></a>00323 <a name="l00324"></a>00324 <span class="comment">// Adds a display row:</span> <a name="l00325"></a>00325 $lines[$row['phash_grouping']][] = $this->printPhashRow( <a name="l00326"></a>00326 $row, <a name="l00327"></a>00327 isset($lines[$row['phash_grouping']]), <a name="l00328"></a>00328 $this->getGrListEntriesForPhash($row['phash'], $row['gr_list']) <a name="l00329"></a>00329 ); <a name="l00330"></a>00330 $rowCount++; <a name="l00331"></a>00331 $phashAcc[] = $row['phash']; <a name="l00332"></a>00332 $this->allPhashListed[] = $row['phash']; <span class="comment">// For removing all shown phash rows.</span> <a name="l00333"></a>00333 } <a name="l00334"></a>00334 <a name="l00335"></a>00335 <span class="comment">// Compile rows into the table:</span> <a name="l00336"></a>00336 $out = ''; <a name="l00337"></a>00337 $cellAttrib = ($data['_CSSCLASS'] ? ' <span class="keyword">class</span>=<span class="stringliteral">"'.$data['_CSSCLASS'].'"</span>' : ''); <a name="l00338"></a>00338 <span class="keywordflow">if</span> (count($lines)) { <a name="l00339"></a>00339 $firstColContent = '<td rowspan=<span class="stringliteral">"'.$rowCount.'"</span>'.$cellAttrib.<span class="charliteral">'>'</span>.$firstColContent.'</td>'; <a name="l00340"></a>00340 foreach($lines as $rowSet) { <a name="l00341"></a>00341 foreach($rowSet as $rows) { <a name="l00342"></a>00342 $out.=' <a name="l00343"></a>00343 <tr <span class="keyword">class</span>=<span class="stringliteral">"bgColor-20"</span>>'.$firstColContent.implode('',$rows).'</tr>'; <a name="l00344"></a>00344 <a name="l00345"></a>00345 $firstColContent = ''; <a name="l00346"></a>00346 } <a name="l00347"></a>00347 } <a name="l00348"></a>00348 <a name="l00349"></a>00349 <span class="keywordflow">if</span> ($rowCount > $this->maxListPerPage) { <span class="comment">// Now checking greater than, because we increased $rowCount before...</span> <a name="l00350"></a>00350 $out.=' <a name="l00351"></a>00351 <tr <span class="keyword">class</span>=<span class="stringliteral">"bgColor-20"</span>> <a name="l00352"></a>00352 <td>&nbsp;</td> <a name="l00353"></a>00353 <td colspan=<span class="stringliteral">"'.($this->returnNumberOfColumns()-1).'"</span>>'.$this->pObj->doc->icons(3).'<span <span class="keyword">class</span>=<span class="stringliteral">""</span>>There were more than '.$this->maxListPerPage.' rows. <a href=<span class="stringliteral">"'.htmlspecialchars('index.php?id='.$this->pObj->id.'&listALL=1').'"</span>>Click here to list them ALL!</a></span></td> <a name="l00354"></a>00354 </tr>'; <a name="l00355"></a>00355 } <a name="l00356"></a>00356 } <span class="keywordflow">else</span> { <a name="l00357"></a>00357 $out.=' <a name="l00358"></a>00358 <tr <span class="keyword">class</span>=<span class="stringliteral">"bgColor-20"</span>> <a name="l00359"></a>00359 <td'.$cellAttrib.<span class="charliteral">'>'</span>.$firstColContent.'</td> <a name="l00360"></a>00360 <td colspan=<span class="stringliteral">"'.($this->returnNumberOfColumns()-1).'"</span>><em>Not indexed</em></td> <a name="l00361"></a>00361 </tr>'; <a name="l00362"></a>00362 } <a name="l00363"></a>00363 <a name="l00364"></a>00364 <span class="comment">// Checking for phash-rows which are NOT joined with the section table:</span> <a name="l00365"></a>00365 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('IP.*', 'index_phash IP', 'IP.data_page_id = '.intval($data['uid']).' AND IP.phash NOT IN ('.implode(<span class="charliteral">','</span>,$phashAcc).<span class="charliteral">')'</span>); <a name="l00366"></a>00366 <span class="keywordflow">while</span>($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { <a name="l00367"></a>00367 $out.=' <a name="l00368"></a>00368 <tr <span class="keyword">class</span>=<span class="stringliteral">"typo3-red"</span>> <a name="l00369"></a>00369 <td colspan=<span class="stringliteral">"'.$this->returnNumberOfColumns().'"</span>><b>Warning:</b> phash-row <span class="stringliteral">"'.$row['phash'].'"</span> didn\'t have a representation in the index_section table!</td> <a name="l00370"></a>00370 </tr>'; <a name="l00371"></a>00371 $this->allPhashListed[] = $row['phash']; <a name="l00372"></a>00372 } <a name="l00373"></a>00373 <a name="l00374"></a>00374 <span class="keywordflow">return</span> $out; <a name="l00375"></a>00375 } <a name="l00376"></a>00376 <a name="l00386"></a><a class="code" href="classtx__indexedsearch__modfunc1.html#493cb1210f02b9af526790d50a1b5ba9">00386</a> function printPhashRow($row,$grouping=0,$extraGrListRows) { <a name="l00387"></a>00387 $lines = array(); <a name="l00388"></a>00388 <a name="l00389"></a>00389 <span class="comment">// Title cell attributes will highlight TYPO3 pages with a slightly darker color (bgColor4) than attached medias. Also IF there are more than one section record for a phash row it will be red as a warning that something is wrong!</span> <a name="l00390"></a>00390 $titleCellAttribs = $row['count_val']!=1?' bgcolor=<span class="stringliteral">"red"</span>':($row['item_type']===<span class="charliteral">'0'</span> ? ' <span class="keyword">class</span>=<span class="stringliteral">"bgColor4"</span>' : ''); <a name="l00391"></a>00391 <a name="l00392"></a>00392 <span class="keywordflow">if</span> ($row['item_type']) { <a name="l00393"></a>00393 $arr = unserialize($row['cHashParams']); <a name="l00394"></a>00394 $page = $arr['key'] ? ' ['.$arr['key'].<span class="charliteral">']'</span> : ''; <a name="l00395"></a>00395 } <span class="keywordflow">else</span> $page = ''; <a name="l00396"></a>00396 $elTitle = $this->linkDetails($row['item_title'] ? htmlspecialchars(<a class="code" href="classt3lib__div.html#93c658c7682e99d76960c3d670e073e8">t3lib_div::fixed_lgd_cs</a>($this->utf8_to_currentCharset($row['item_title']), 20).$page) : '<em>[No Title]</em>',$row['phash']); <a name="l00397"></a>00397 $cmdLinks = $this->printRemoveIndexed($row['phash'],'Clear phash-row').$this->printReindex($row,'Re-index element'); <a name="l00398"></a>00398 <a name="l00399"></a>00399 <span class="keywordflow">switch</span>($this->pObj->MOD_SETTINGS['type']) { <a name="l00400"></a>00400 <span class="keywordflow">case</span> 1: <span class="comment">// Technical details:</span> <a name="l00401"></a>00401 <span class="comment">// Display icon:</span> <a name="l00402"></a>00402 <span class="keywordflow">if</span> (!$grouping) { <a name="l00403"></a>00403 $lines[] = '<td>'.$this->makeItemTypeIcon($row['item_type'], $row['data_filename'] ? $row['data_filename'] : $row['item_title']).'</td>'; <a name="l00404"></a>00404 } <span class="keywordflow">else</span> { <a name="l00405"></a>00405 $lines[] = '<td>&nbsp;</td>'; <a name="l00406"></a>00406 } <a name="l00407"></a>00407 <a name="l00408"></a>00408 <span class="comment">// Title displayed:</span> <a name="l00409"></a>00409 $lines[] = '<td'.$titleCellAttribs.<span class="charliteral">'>'</span>.$elTitle.'</td>'; <a name="l00410"></a>00410 <a name="l00411"></a>00411 <span class="comment">// Remove-indexing-link:</span> <a name="l00412"></a>00412 $lines[] = '<td>'.$cmdLinks.'</td>'; <a name="l00413"></a>00413 <a name="l00414"></a>00414 <span class="comment">// Various data:</span> <a name="l00415"></a>00415 $lines[] = '<td>'.$row['phash'].'</td>'; <a name="l00416"></a>00416 $lines[] = '<td>'.$row['contentHash'].'</td>'; <a name="l00417"></a>00417 <a name="l00418"></a>00418 <span class="keywordflow">if</span> ($row['item_type']===<span class="charliteral">'0'</span>) { <a name="l00419"></a>00419 $lines[] = '<td>'.($row['data_page_id'] ? $row['data_page_id'] : '&nbsp;').'</td>'; <a name="l00420"></a>00420 $lines[] = '<td>'.($row['data_page_type'] ? $row['data_page_type'] : '&nbsp;').'</td>'; <a name="l00421"></a>00421 $lines[] = '<td>'.($row['sys_language_uid'] ? $row['sys_language_uid'] : '&nbsp;').'</td>'; <a name="l00422"></a>00422 $lines[] = '<td>'.($row['data_page_mp'] ? $row['data_page_mp'] : '&nbsp;').'</td>'; <a name="l00423"></a>00423 } <span class="keywordflow">else</span> { <a name="l00424"></a>00424 $lines[] = '<td colspan=<span class="stringliteral">"4"</span>>'.htmlspecialchars($row['data_filename']).'</td>'; <a name="l00425"></a>00425 } <a name="l00426"></a>00426 $lines[] = '<td>'.$row['gr_list'].$this->printExtraGrListRows($extraGrListRows).'</td>'; <a name="l00427"></a>00427 $lines[] = '<td>'.$this->printRootlineInfo($row).'</td>'; <a name="l00428"></a>00428 $lines[] = '<td>'.($row['page_id'] ? $row['page_id'] : '&nbsp;').'</td>'; <a name="l00429"></a>00429 $lines[] = '<td>'.($row['phash_t3']!=$row['phash'] ? $row['phash_t3'] : '&nbsp;').'</td>'; <a name="l00430"></a>00430 $lines[] = '<td>'.($row['freeIndexUid'] ? $row['freeIndexUid'].($row['freeIndexSetId']?<span class="charliteral">'/'</span>.$row['freeIndexSetId']:'') : '&nbsp;').'</td>'; <a name="l00431"></a>00431 $lines[] = '<td>'.($row['recordUid'] ? $row['recordUid'] : '&nbsp;').'</td>'; <a name="l00432"></a>00432 <a name="l00433"></a>00433 <a name="l00434"></a>00434 <a name="l00435"></a>00435 <span class="comment">// cHash parameters:</span> <a name="l00436"></a>00436 $arr = unserialize($row['cHashParams']); <a name="l00437"></a>00437 <span class="keywordflow">if</span> (is_array($arr)) { <a name="l00438"></a>00438 $theCHash = $arr['cHash']; <a name="l00439"></a>00439 unset($arr['cHash']); <a name="l00440"></a>00440 } <a name="l00441"></a>00441 <a name="l00442"></a>00442 <span class="keywordflow">if</span> ($row['item_type']) { <span class="comment">// pdf...</span> <a name="l00443"></a>00443 $lines[] = '<td>'.($arr['key'] ? 'Page '.$arr['key'] : '').'&nbsp;</td>'; <a name="l00444"></a>00444 } elseif ($row['item_type']==0) { <a name="l00445"></a>00445 $lines[] = '<td>'.htmlspecialchars(<a class="code" href="classt3lib__div.html#7874ca6bd93d402c193542e864bb67f3">t3lib_div::implodeArrayForUrl</a>('',$arr)).'&nbsp;</td>'; <a name="l00446"></a>00446 } <span class="keywordflow">else</span> { <a name="l00447"></a>00447 $lines[] = '<td <span class="keyword">class</span>=<span class="stringliteral">"bgColor"</span>>&nbsp;</td>'; <a name="l00448"></a>00448 } <a name="l00449"></a>00449 <a name="l00450"></a>00450 $lines[] = '<td>'.$theCHash.'</td>'; <a name="l00451"></a>00451 <span class="keywordflow">break</span>; <a name="l00452"></a>00452 <span class="keywordflow">case</span> 2: <span class="comment">// Words and content:</span> <a name="l00453"></a>00453 <span class="comment">// Display icon:</span> <a name="l00454"></a>00454 <span class="keywordflow">if</span> (!$grouping) { <a name="l00455"></a>00455 $lines[] = '<td>'.$this->makeItemTypeIcon($row['item_type'], $row['data_filename'] ? $row['data_filename'] : $row['item_title']).'</td>'; <a name="l00456"></a>00456 } <span class="keywordflow">else</span> { <a name="l00457"></a>00457 $lines[] = '<td>&nbsp;</td>'; <a name="l00458"></a>00458 } <a name="l00459"></a>00459 <a name="l00460"></a>00460 <span class="comment">// Title displayed:</span> <a name="l00461"></a>00461 $lines[] = '<td'.$titleCellAttribs.<span class="charliteral">'>'</span>.$elTitle.'</td>'; <a name="l00462"></a>00462 <a name="l00463"></a>00463 <span class="comment">// Remove-indexing-link:</span> <a name="l00464"></a>00464 $lines[] = '<td>'.$cmdLinks.'</td>'; <a name="l00465"></a>00465 <a name="l00466"></a>00466 <span class="comment">// Query:</span> <a name="l00467"></a>00467 $ftrows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows( <a name="l00468"></a>00468 <span class="charliteral">'*'</span>, <a name="l00469"></a>00469 'index_fulltext', <a name="l00470"></a>00470 'phash = '.intval($row['phash']) <a name="l00471"></a>00471 ); <a name="l00472"></a>00472 $lines[] = '<td style=<span class="stringliteral">"white-space: normal;"</span>>'. <a name="l00473"></a>00473 htmlspecialchars(<a class="code" href="classt3lib__div.html#93c658c7682e99d76960c3d670e073e8">t3lib_div::fixed_lgd_cs</a>($this->utf8_to_currentCharset($ftrows[0]['fulltextdata']),3000)). <a name="l00474"></a>00474 '<hr/><em>Size: '.strlen($ftrows[0]['fulltextdata']).'</em>'. <a name="l00475"></a>00475 '</td>'; <a name="l00476"></a>00476 <a name="l00477"></a>00477 <span class="comment">// Query:</span> <a name="l00478"></a>00478 $ftrows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows( <a name="l00479"></a>00479 'index_words.baseword, index_rel.*', <a name="l00480"></a>00480 'index_rel, index_words', <a name="l00481"></a>00481 'index_rel.phash = '.intval($row['phash']). <a name="l00482"></a>00482 ' AND index_words.wid = index_rel.wid', <a name="l00483"></a>00483 '', <a name="l00484"></a>00484 '', <a name="l00485"></a>00485 '', <a name="l00486"></a>00486 'baseword' <a name="l00487"></a>00487 ); <a name="l00488"></a>00488 <a name="l00489"></a>00489 $wordList = ''; <a name="l00490"></a>00490 <span class="keywordflow">if</span> (is_array($ftrows)) { <a name="l00491"></a>00491 $indexed_words = array_keys($ftrows); <a name="l00492"></a>00492 sort($indexed_words); <a name="l00493"></a>00493 $wordList = htmlspecialchars($this->utf8_to_currentCharset(implode(<span class="charliteral">' '</span>,$indexed_words))); <a name="l00494"></a>00494 $wordList.='<hr/><em>Count: '.count($indexed_words).'</em>'; <a name="l00495"></a>00495 } <a name="l00496"></a>00496 <a name="l00497"></a>00497 $lines[] = '<td style=<span class="stringliteral">"white-space: normal;"</span>>'.$wordList.'</td>'; <a name="l00498"></a>00498 <span class="keywordflow">break</span>; <a name="l00499"></a>00499 <span class="keywordflow">default</span>: <span class="comment">// Overview</span> <a name="l00500"></a>00500 <span class="comment">// Display icon:</span> <a name="l00501"></a>00501 <span class="keywordflow">if</span> (!$grouping) { <a name="l00502"></a>00502 $lines[] = '<td>'.$this->makeItemTypeIcon($row['item_type'], $row['data_filename'] ? $row['data_filename'] : $row['item_title']).'</td>'; <a name="l00503"></a>00503 } <span class="keywordflow">else</span> { <a name="l00504"></a>00504 $lines[] = '<td>&nbsp;</td>'; <a name="l00505"></a>00505 } <a name="l00506"></a>00506 <a name="l00507"></a>00507 <span class="comment">// Title displayed:</span> <a name="l00508"></a>00508 $lines[] = '<td'.$titleCellAttribs.<span class="charliteral">'>'</span>.$elTitle.'</td>'; <a name="l00509"></a>00509 <a name="l00510"></a>00510 <span class="comment">// Remove-indexing-link:</span> <a name="l00511"></a>00511 $lines[] = '<td>'.$cmdLinks.'</td>'; <a name="l00512"></a>00512 <a name="l00513"></a>00513 $lines[] = '<td style=<span class="stringliteral">"white-space: normal;"</span>>'.htmlspecialchars($this->utf8_to_currentCharset($row['item_description'])).'...</td>'; <a name="l00514"></a>00514 $lines[] = '<td>'.t3lib_div::formatSize($row['item_size']).'</td>'; <a name="l00515"></a>00515 $lines[] = '<td>'.t3lib_BEfunc::dateTimeAge($row['tstamp']).'</td>'; <a name="l00516"></a>00516 <span class="keywordflow">break</span>; <a name="l00517"></a>00517 } <a name="l00518"></a>00518 <a name="l00519"></a>00519 <span class="keywordflow">return</span> $lines; <a name="l00520"></a>00520 } <a name="l00521"></a>00521 <a name="l00527"></a><a class="code" href="classtx__indexedsearch__modfunc1.html#c2ef1af01faa5eecea3eba2c056fb663">00527</a> function printPhashRowHeader() { <a name="l00528"></a>00528 $lines = array(); <a name="l00529"></a>00529 <a name="l00530"></a>00530 <span class="keywordflow">switch</span>($this->pObj->MOD_SETTINGS['type']) { <a name="l00531"></a>00531 <span class="keywordflow">case</span> 1: <a name="l00532"></a>00532 $lines[] = '<td>&nbsp;</td>'; <a name="l00533"></a>00533 $lines[] = '<td>&nbsp;</td>'; <a name="l00534"></a>00534 $lines[] = '<td>Title</td>'; <a name="l00535"></a>00535 $lines[] = '<td bgcolor=<span class="stringliteral">"red"</span>>'.$this->printRemoveIndexed('ALL<span class="charliteral">','</span>Clear ALL phash-rows below!').'</td>'; <a name="l00536"></a>00536 <a name="l00537"></a>00537 $lines[] = '<td>pHash</td>'; <a name="l00538"></a>00538 $lines[] = '<td>cHash</td>'; <a name="l00539"></a>00539 $lines[] = '<td>&amp;<span class="keywordtype">id</span></td>'; <a name="l00540"></a>00540 $lines[] = '<td>&amp;type</td>'; <a name="l00541"></a>00541 $lines[] = '<td>&amp;L</td>'; <a name="l00542"></a>00542 $lines[] = '<td>&amp;MP</td>'; <a name="l00543"></a>00543 $lines[] = '<td>grlist</td>'; <a name="l00544"></a>00544 $lines[] = '<td>Rootline</td>'; <a name="l00545"></a>00545 $lines[] = '<td>page_id</td>'; <a name="l00546"></a>00546 $lines[] = '<td>phash_t3</td>'; <a name="l00547"></a>00547 $lines[] = '<td>CfgUid</td>'; <a name="l00548"></a>00548 $lines[] = '<td>RecUid</td>'; <a name="l00549"></a>00549 $lines[] = '<td>GET-parameters</td>'; <a name="l00550"></a>00550 $lines[] = '<td>&amp;cHash</td>'; <a name="l00551"></a>00551 <span class="keywordflow">break</span>; <a name="l00552"></a>00552 <span class="keywordflow">case</span> 2: <a name="l00553"></a>00553 $lines[] = '<td>&nbsp;</td>'; <a name="l00554"></a>00554 $lines[] = '<td>&nbsp;</td>'; <a name="l00555"></a>00555 $lines[] = '<td>Title</td>'; <a name="l00556"></a>00556 $lines[] = '<td bgcolor=<span class="stringliteral">"red"</span>>'.$this->printRemoveIndexed('ALL<span class="charliteral">','</span>Clear ALL phash-rows below!').'</td>'; <a name="l00557"></a>00557 $lines[] = '<td>Content<br/> <a name="l00558"></a>00558 <img src=<span class="stringliteral">"clear.gif"</span> width=<span class="stringliteral">"300"</span> height=<span class="stringliteral">"1"</span> alt=<span class="stringliteral">""</span> /></td>'; <a name="l00559"></a>00559 $lines[] = '<td>Words<br/> <a name="l00560"></a>00560 <img src=<span class="stringliteral">"clear.gif"</span> width=<span class="stringliteral">"300"</span> height=<span class="stringliteral">"1"</span> alt=<span class="stringliteral">""</span> /></td>'; <a name="l00561"></a>00561 <span class="keywordflow">break</span>; <a name="l00562"></a>00562 <span class="keywordflow">default</span>: <a name="l00563"></a>00563 $lines[] = '<td>&nbsp;</td>'; <a name="l00564"></a>00564 $lines[] = '<td>&nbsp;</td>'; <a name="l00565"></a>00565 $lines[] = '<td>Title</td>'; <a name="l00566"></a>00566 $lines[] = '<td bgcolor=<span class="stringliteral">"red"</span>>'.$this->printRemoveIndexed('ALL<span class="charliteral">','</span>Clear ALL phash-rows below!').'</td>'; <a name="l00567"></a>00567 $lines[] = '<td>Description</td>'; <a name="l00568"></a>00568 $lines[] = '<td>Size</td>'; <a name="l00569"></a>00569 $lines[] = '<td>Indexed:</td>'; <a name="l00570"></a>00570 <span class="keywordflow">break</span>; <a name="l00571"></a>00571 } <a name="l00572"></a>00572 <a name="l00573"></a>00573 $out = '<tr <span class="keyword">class</span>=<span class="stringliteral">"tableheader bgColor5"</span>>'.implode('',$lines).'</tr>'; <a name="l00574"></a>00574 <span class="keywordflow">return</span> $out; <a name="l00575"></a>00575 } <a name="l00576"></a>00576 <a name="l00582"></a><a class="code" href="classtx__indexedsearch__modfunc1.html#eaef42f9e8f89a06dbc47ac4a1a3e34b">00582</a> function returnNumberOfColumns() { <a name="l00583"></a>00583 <span class="keywordflow">switch</span>($this->pObj->MOD_SETTINGS['type']) { <a name="l00584"></a>00584 <span class="keywordflow">case</span> 1: <a name="l00585"></a>00585 <span class="keywordflow">return</span> 18; <a name="l00586"></a>00586 <span class="keywordflow">break</span>; <a name="l00587"></a>00587 <span class="keywordflow">case</span> 2: <a name="l00588"></a>00588 <span class="keywordflow">return</span> 6; <a name="l00589"></a>00589 <span class="keywordflow">break</span>; <a name="l00590"></a>00590 <span class="keywordflow">default</span>: <a name="l00591"></a>00591 <span class="keywordflow">return</span> 7; <a name="l00592"></a>00592 <span class="keywordflow">break</span>; <a name="l00593"></a>00593 } <a name="l00594"></a>00594 } <a name="l00595"></a>00595 <a name="l00596"></a>00596 <a name="l00597"></a>00597 <a name="l00598"></a>00598 <a name="l00599"></a>00599 <a name="l00600"></a>00600 <a name="l00601"></a>00601 <a name="l00602"></a>00602 <a name="l00603"></a>00603 <a name="l00604"></a>00604 <a name="l00605"></a>00605 <a name="l00606"></a>00606 <span class="comment">/*******************************</span> <a name="l00607"></a>00607 <span class="comment"> *</span> <a name="l00608"></a>00608 <span class="comment"> * Details display, phash row</span> <a name="l00609"></a>00609 <span class="comment"> *</span> <a name="l00610"></a>00610 <span class="comment"> *******************************/</span> <a name="l00611"></a>00611 <a name="l00618"></a><a class="code" href="classtx__indexedsearch__modfunc1.html#919d65c9d390058442b6c14c87f4e392">00618</a> function showDetailsForPhash($phash) { <a name="l00619"></a>00619 <a name="l00620"></a>00620 $content = ''; <a name="l00621"></a>00621 <a name="l00622"></a>00622 <span class="comment">// Selects the result row:</span> <a name="l00623"></a>00623 $ftrows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows( <a name="l00624"></a>00624 <span class="charliteral">'*'</span>, <a name="l00625"></a>00625 'index_phash', <a name="l00626"></a>00626 'phash = '.intval($phash) <a name="l00627"></a>00627 ); <a name="l00628"></a>00628 $phashRecord = $ftrows[0]; <a name="l00629"></a>00629 <a name="l00630"></a>00630 <span class="comment">// If found, display:</span> <a name="l00631"></a>00631 <span class="keywordflow">if</span> (is_array($phashRecord)) { <a name="l00632"></a>00632 $content.= '<h4>phash row content:</h4>'. <a name="l00633"></a>00633 $this->utf8_to_currentCharset(<a class="code" href="classt3lib__div.html#c4b85a2c21410edfc814e936ca4bc591">t3lib_div::view_array</a>($phashRecord)); <a name="l00634"></a>00634 <a name="l00635"></a>00635 <span class="comment">// Getting debug information if any:</span> <a name="l00636"></a>00636 $ftrows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows( <a name="l00637"></a>00637 <span class="charliteral">'*'</span>, <a name="l00638"></a>00638 'index_debug', <a name="l00639"></a>00639 'phash = '.intval($phash) <a name="l00640"></a>00640 ); <a name="l00641"></a>00641 <span class="keywordflow">if</span> (is_array($ftrows)) { <a name="l00642"></a>00642 $debugInfo = unserialize($ftrows[0]['debuginfo']); <a name="l00643"></a>00643 $lexer = $debugInfo['lexer']; <a name="l00644"></a>00644 unset($debugInfo['lexer']); <a name="l00645"></a>00645 <a name="l00646"></a>00646 $content.= '<h3>Debug information:</h3>'. <a name="l00647"></a>00647 $this->utf8_to_currentCharset(<a class="code" href="classt3lib__div.html#c4b85a2c21410edfc814e936ca4bc591">t3lib_div::view_array</a>($debugInfo)); <a name="l00648"></a>00648 <a name="l00649"></a>00649 $content.= '<h4>Debug information / lexer splitting:</h4>'. <a name="l00650"></a>00650 '<hr/><b>'. <a name="l00651"></a>00651 $this->utf8_to_currentCharset($lexer). <a name="l00652"></a>00652 '</b><hr/>'; <a name="l00653"></a>00653 } <a name="l00654"></a>00654 <a name="l00655"></a>00655 <a name="l00656"></a>00656 <a name="l00657"></a>00657 $content.='<h3>Word statistics</h3>'; <a name="l00658"></a>00658 <a name="l00659"></a>00659 <span class="comment">// Finding all words for this phash:</span> <a name="l00660"></a>00660 $ftrows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows( <a name="l00661"></a>00661 'index_words.*, index_rel.*', <a name="l00662"></a>00662 'index_rel, index_words', <a name="l00663"></a>00663 'index_rel.phash = '.intval($phash). <a name="l00664"></a>00664 ' AND index_words.wid = index_rel.wid', <a name="l00665"></a>00665 '', <a name="l00666"></a>00666 'index_words.baseword', <a name="l00667"></a>00667 '' <a name="l00668"></a>00668 ); <a name="l00669"></a>00669 $pageRec = <a class="code" href="classt3lib__BEfunc.html#c0a110679ba0fac9af0d66f34026f378">t3lib_BEfunc::getRecord</a>('pages', $phashRecord['data_page_id']); <a name="l00670"></a>00670 $showStopWordCheckBox = $GLOBALS['BE_USER']->isAdmin(); <a name="l00671"></a>00671 $content.= $this->listWords($ftrows, 'All words found on page ('.count($ftrows).'):', $showStopWordCheckBox, $pageRec); <a name="l00672"></a>00672 <a name="l00673"></a>00673 <span class="comment">// Group metaphone hash:</span> <a name="l00674"></a>00674 $metaphone = array(); <a name="l00675"></a>00675 foreach($ftrows as $row) { <a name="l00676"></a>00676 $metaphone[$row['metaphone']][] = $row['baseword']; <a name="l00677"></a>00677 } <a name="l00678"></a>00678 $content.= $this->listMetaphoneStat($metaphone, 'Metaphone stats:'); <a name="l00679"></a>00679 <a name="l00680"></a>00680 <span class="comment">// Finding top-20 on frequency for this phash:</span> <a name="l00681"></a>00681 $ftrows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows( <a name="l00682"></a>00682 'index_words.baseword, index_words.metaphone, index_rel.*', <a name="l00683"></a>00683 'index_rel, index_words', <a name="l00684"></a>00684 'index_rel.phash = '.intval($phash). <a name="l00685"></a>00685 ' AND index_words.wid = index_rel.wid <a name="l00686"></a>00686 AND index_words.is_stopword=0', <a name="l00687"></a>00687 '', <a name="l00688"></a>00688 'index_rel.freq DESC', <a name="l00689"></a>00689 '20' <a name="l00690"></a>00690 ); <a name="l00691"></a>00691 $content.= $this->listWords($ftrows, 'Top-20 words by frequency:', 2); <a name="l00692"></a>00692 <a name="l00693"></a>00693 <span class="comment">// Finding top-20 on count for this phash:</span> <a name="l00694"></a>00694 $ftrows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows( <a name="l00695"></a>00695 'index_words.baseword, index_words.metaphone, index_rel.*', <a name="l00696"></a>00696 'index_rel, index_words', <a name="l00697"></a>00697 'index_rel.phash = '.intval($phash). <a name="l00698"></a>00698 ' AND index_words.wid = index_rel.wid <a name="l00699"></a>00699 AND index_words.is_stopword=0', <a name="l00700"></a>00700 '', <a name="l00701"></a>00701 'index_rel.count DESC', <a name="l00702"></a>00702 '20' <a name="l00703"></a>00703 ); <a name="l00704"></a>00704 $content.= $this->listWords($ftrows, 'Top-20 words by count:', 2); <a name="l00705"></a>00705 <a name="l00706"></a>00706 <a name="l00707"></a>00707 $content.='<h3>Section records <span class="keywordflow">for</span> <span class="keyword">this</span> phash</h3>'; <a name="l00708"></a>00708 <a name="l00709"></a>00709 <span class="comment">// Finding sections for this record:</span> <a name="l00710"></a>00710 $ftrows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows( <a name="l00711"></a>00711 <span class="charliteral">'*'</span>, <a name="l00712"></a>00712 'index_section', <a name="l00713"></a>00713 'index_section.phash = '.intval($phash), <a name="l00714"></a>00714 '', <a name="l00715"></a>00715 '', <a name="l00716"></a>00716 '' <a name="l00717"></a>00717 ); <a name="l00718"></a>00718 $content.= <a class="code" href="classt3lib__div.html#c4b85a2c21410edfc814e936ca4bc591">t3lib_div::view_array</a>($ftrows); <a name="l00719"></a>00719 <a name="l00720"></a>00720 <span class="comment">// Add go-back link:</span> <a name="l00721"></a>00721 $content = $this->linkList().$content.$this->linkList(); <a name="l00722"></a>00722 <a name="l00723"></a>00723 } <span class="keywordflow">else</span> $content.= 'Error: No phash row found'; <a name="l00724"></a>00724 <a name="l00725"></a>00725 <span class="keywordflow">return</span> $content; <a name="l00726"></a>00726 } <a name="l00727"></a>00727 <a name="l00737"></a><a class="code" href="classtx__indexedsearch__modfunc1.html#46d5f6aadd10794b05d934d67e10129f">00737</a> function listWords($ftrows,$header, $stopWordBoxes=FALSE, $page='') { <a name="l00738"></a>00738 <a name="l00739"></a>00739 <span class="comment">// Prepare keywords:</span> <a name="l00740"></a>00740 $keywords = is_array($page) ? array_flip(<a class="code" href="classt3lib__div.html#cfb87d585b85e9b32841bde40beaa96c">t3lib_div::trimExplode</a>(<span class="charliteral">','</span>,$page['keywords'], 1)) : ''; <a name="l00741"></a>00741 <a name="l00742"></a>00742 <span class="comment">// Render list:</span> <a name="l00743"></a>00743 $trows = ''; <a name="l00744"></a>00744 $trows.= ' <a name="l00745"></a>00745 <tr <span class="keyword">class</span>=<span class="stringliteral">"tableheader bgColor5"</span>> <a name="l00746"></a>00746 '.($stopWordBoxes ? '<td>'.htmlspecialchars('Stopword:').'</td>' : '').' <a name="l00747"></a>00747 <td>'.htmlspecialchars('Word:').'</td> <a name="l00748"></a>00748 <td>'.htmlspecialchars('Count:').'</td> <a name="l00749"></a>00749 <td>'.htmlspecialchars('First:').'</td> <a name="l00750"></a>00750 <td>'.htmlspecialchars('Frequency:').'</td> <a name="l00751"></a>00751 <td>'.htmlspecialchars('Flags:').'</td> <a name="l00752"></a>00752 '.(is_array($keywords) ? '<td>'.htmlspecialchars('Page keyword:').'</td>' : '').' <a name="l00753"></a>00753 </tr> <a name="l00754"></a>00754 '; <a name="l00755"></a>00755 foreach($ftrows as $row) { <a name="l00756"></a>00756 $hiddenField = $stopWordBoxes!=2 ? '<input type=<span class="stringliteral">"hidden"</span> name=<span class="stringliteral">"stopWord['.$row['wid'].']"</span> value=<span class="stringliteral">"0"</span> />' : ''; <a name="l00757"></a>00757 $trows.= ' <a name="l00758"></a>00758 <tr <span class="keyword">class</span>=<span class="stringliteral">"'.($row['is_stopword'] ? 'bgColor' : 'bgColor4').'"</span>> <a name="l00759"></a>00759 '.($stopWordBoxes ? '<td align=<span class="stringliteral">"center"</span>'.($row['is_stopword'] ? ' style=<span class="stringliteral">"background-color:red;"</span>' : '').<span class="charliteral">'>'</span>.$hiddenField.'<input type=<span class="stringliteral">"checkbox"</span> name=<span class="stringliteral">"stopWord['.$row['wid'].']"</span> value=<span class="stringliteral">"1"</span>'.($row['is_stopword']?'checked=<span class="stringliteral">"checked"</span><span class="charliteral">':'</span>').' /></td>' : '').' <a name="l00760"></a>00760 <td>'.$this->linkWordDetails(htmlspecialchars($this->utf8_to_currentCharset($row['baseword'])), $row['wid']).'</td> <a name="l00761"></a>00761 <td>'.htmlspecialchars($row['count']).'</td> <a name="l00762"></a>00762 <td>'.htmlspecialchars($row['first']).'</td> <a name="l00763"></a>00763 <td>'.htmlspecialchars($row['freq']).'</td> <a name="l00764"></a>00764 <td>'.htmlspecialchars($this->flagsMsg($row['flags'])).'</td> <a name="l00765"></a>00765 '.(is_array($keywords) ? '<td align=<span class="stringliteral">"center"</span>'.(isset($keywords[$row['baseword']]) ? ' <span class="keyword">class</span>=<span class="stringliteral">"bgColor2"</span>' : '').'><input type=<span class="stringliteral">"hidden"</span> name=<span class="stringliteral">"pageKeyword['.$row['baseword'].']"</span> value=<span class="stringliteral">"0"</span> /><input type=<span class="stringliteral">"checkbox"</span> name=<span class="stringliteral">"pageKeyword['.$row['baseword'].']"</span> value=<span class="stringliteral">"1"</span>'.(isset($keywords[$row['baseword']])?'checked=<span class="stringliteral">"checked"</span><span class="charliteral">':'</span>').' /></td>' : '').' <a name="l00766"></a>00766 </tr> <a name="l00767"></a>00767 '; <a name="l00768"></a>00768 } <a name="l00769"></a>00769 <a name="l00770"></a>00770 <span class="keywordflow">return</span> '<h4>'.htmlspecialchars($header).'</h4>'. <a name="l00771"></a>00771 ' <a name="l00772"></a>00772 <table border=<span class="stringliteral">"0"</span> cellspacing=<span class="stringliteral">"1"</span> cellpadding=<span class="stringliteral">"2"</span> <span class="keyword">class</span>=<span class="stringliteral">"c-list"</span>> <a name="l00773"></a>00773 '.$trows.' <a name="l00774"></a>00774 </table>'. <a name="l00775"></a>00775 ($stopWordBoxes ? '<input type=<span class="stringliteral">"submit"</span> value=<span class="stringliteral">"Change stop-word settings"</span> name=<span class="stringliteral">"_stopwords"</span> onclick=<span class="stringliteral">"document.webinfoForm.action=\''.htmlspecialchars(t3lib_div::getIndpEnv('REQUEST_URI')).'\';"</span> />' : ''). <a name="l00776"></a>00776 (is_array($keywords) ? '<input type=<span class="stringliteral">"submit"</span> value=<span class="stringliteral">"Set page keywords"</span> name=<span class="stringliteral">"_pageKeywords"</span> onclick=<span class="stringliteral">"document.webinfoForm.action=\''.htmlspecialchars(t3lib_div::getIndpEnv('REQUEST_URI')).'\';"</span> /><input type=<span class="stringliteral">"hidden"</span> name=<span class="stringliteral">"pageKeyword_pageUid"</span> value=<span class="stringliteral">"'.$page['uid'].'"</span> />'. <a name="l00777"></a>00777 '<br/>Current keywords are: <em>'.htmlspecialchars(implode(', ',array_keys($keywords))).'</em>' : ''); <a name="l00778"></a>00778 } <a name="l00779"></a>00779 <a name="l00787"></a><a class="code" href="classtx__indexedsearch__modfunc1.html#6c830baa13de4aed0806df5f369d2d60">00787</a> function listMetaphoneStat($ftrows,$header) { <a name="l00788"></a>00788 <a name="l00789"></a>00789 $trows = ''; <a name="l00790"></a>00790 $trows.= ' <a name="l00791"></a>00791 <tr <span class="keyword">class</span>=<span class="stringliteral">"tableheader bgColor5"</span>> <a name="l00792"></a>00792 <td>'.htmlspecialchars('Metaphone:').'</td> <a name="l00793"></a>00793 <td>'.htmlspecialchars('Hash:').'</td> <a name="l00794"></a>00794 <td>'.htmlspecialchars('Count:').'</td> <a name="l00795"></a>00795 <td>'.htmlspecialchars('Words:').'</td> <a name="l00796"></a>00796 </tr> <a name="l00797"></a>00797 '; <a name="l00798"></a>00798 foreach($ftrows as $metaphone => $words) { <a name="l00799"></a>00799 <span class="keywordflow">if</span> (count($words)>1) { <a name="l00800"></a>00800 $trows.= ' <a name="l00801"></a>00801 <tr <span class="keyword">class</span>=<span class="stringliteral">"bgColor4"</span>> <a name="l00802"></a>00802 <td>'.$this->linkMetaPhoneDetails($this->indexerObj->metaphone($words[0],1),$metaphone).'</td> <a name="l00803"></a>00803 <td>'.htmlspecialchars($metaphone).'</td> <a name="l00804"></a>00804 <td>'.htmlspecialchars(count($words)).'</td> <a name="l00805"></a>00805 <td style=<span class="stringliteral">"white-space: normal;"</span>>'.htmlspecialchars($this->utf8_to_currentCharset(implode(', ',$words))).'</td> <a name="l00806"></a>00806 </tr> <a name="l00807"></a>00807 '; <a name="l00808"></a>00808 } <a name="l00809"></a>00809 } <a name="l00810"></a>00810 <a name="l00811"></a>00811 <span class="keywordflow">return</span> '<h4>'.htmlspecialchars($header).'</h4>'. <a name="l00812"></a>00812 '<table border=<span class="stringliteral">"0"</span> cellspacing=<span class="stringliteral">"1"</span> cellpadding=<span class="stringliteral">"2"</span> <span class="keyword">class</span>=<span class="stringliteral">"c-list"</span>> <a name="l00813"></a>00813 '.$trows.' <a name="l00814"></a>00814 </table>'; <a name="l00815"></a>00815 } <a name="l00816"></a>00816 <a name="l00824"></a><a class="code" href="classtx__indexedsearch__modfunc1.html#59b27b87ec133698627645e5fe8a733f">00824</a> function linkWordDetails($string,$wid) { <a name="l00825"></a>00825 <span class="keywordflow">return</span> '<a href=<span class="stringliteral">"'.htmlspecialchars(t3lib_div::linkThisScript(array('wid'=>$wid,'phash'=>''))).'"</span>>'.$string.'</a>'; <a name="l00826"></a>00826 } <a name="l00827"></a>00827 <a name="l00828"></a>00828 <a name="l00836"></a><a class="code" href="classtx__indexedsearch__modfunc1.html#9f2816b23772f7999f33f24a75055148">00836</a> function linkMetaPhoneDetails($string,$metaphone) { <a name="l00837"></a>00837 <span class="keywordflow">return</span> '<a href=<span class="stringliteral">"'.htmlspecialchars(t3lib_div::linkThisScript(array('metaphone'=>$metaphone,'wid'=>'','phash'=>''))).'"</span>>'.$string.'</a>'; <a name="l00838"></a>00838 } <a name="l00839"></a>00839 <a name="l00846"></a><a class="code" href="classtx__indexedsearch__modfunc1.html#0de62f8d47bd43e785a462668d450c10">00846</a> function flagsMsg($flags) { <a name="l00847"></a>00847 <span class="keywordflow">if</span> ($flags > 0) { <a name="l00848"></a>00848 <span class="keywordflow">return</span> <a name="l00849"></a>00849 ($flags & 128 ? '<title>' : ''). <span class="comment">// pow(2,7)</span> <a name="l00850"></a>00850 ($flags & 64 ? '<meta/keywords>' : ''). <span class="comment">// pow(2,6)</span> <a name="l00851"></a>00851 ($flags & 32 ? '<meta/description>' : ''). <span class="comment">// pow(2,5)</span> <a name="l00852"></a>00852 ' ('.$flags.<span class="charliteral">')'</span>; <a name="l00853"></a>00853 } <a name="l00854"></a>00854 } <a name="l00855"></a>00855 <a name="l00856"></a>00856 <a name="l00857"></a>00857 <a name="l00858"></a>00858 <a name="l00859"></a>00859 <a name="l00860"></a>00860 <a name="l00861"></a>00861 <a name="l00862"></a>00862 <a name="l00863"></a>00863 <a name="l00864"></a>00864 <a name="l00865"></a>00865 <span class="comment">/*******************************</span> <a name="l00866"></a>00866 <span class="comment"> *</span> <a name="l00867"></a>00867 <span class="comment"> * Details display, words / metaphone</span> <a name="l00868"></a>00868 <span class="comment"> *</span> <a name="l00869"></a>00869 <span class="comment"> *******************************/</span> <a name="l00870"></a>00870 <a name="l00877"></a><a class="code" href="classtx__indexedsearch__modfunc1.html#641fcd05c9039e2d423c475562cb1dd3">00877</a> function showDetailsForWord($wid) { <a name="l00878"></a>00878 <a name="l00879"></a>00879 <span class="comment">// Select references to this word</span> <a name="l00880"></a>00880 $ftrows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows( <a name="l00881"></a>00881 'index_phash.*, index_section.*, index_rel.*', <a name="l00882"></a>00882 'index_rel, index_section, index_phash', <a name="l00883"></a>00883 'index_rel.wid = '.intval($wid). <a name="l00884"></a>00884 ' AND index_rel.phash = index_section.phash'. <a name="l00885"></a>00885 ' AND index_section.phash = index_phash.phash', <a name="l00886"></a>00886 '', <a name="l00887"></a>00887 'index_rel.freq DESC', <a name="l00888"></a>00888 '' <a name="l00889"></a>00889 ); <a name="l00890"></a>00890 <a name="l00891"></a>00891 <span class="comment">// Headers:</span> <a name="l00892"></a>00892 $content.=' <a name="l00893"></a>00893 <tr <span class="keyword">class</span>=<span class="stringliteral">"tableheader bgColor5"</span>> <a name="l00894"></a>00894 <td>phash</td> <a name="l00895"></a>00895 <td>page_id</td> <a name="l00896"></a>00896 <td>data_filename</td> <a name="l00897"></a>00897 <td>count</td> <a name="l00898"></a>00898 <td>first</td> <a name="l00899"></a>00899 <td>freq</td> <a name="l00900"></a>00900 <td>flags</td> <a name="l00901"></a>00901 </tr>'; <a name="l00902"></a>00902 <a name="l00903"></a>00903 <span class="keywordflow">if</span> (is_array($ftrows)) { <a name="l00904"></a>00904 foreach($ftrows as $wDat) { <a name="l00905"></a>00905 $content.=' <a name="l00906"></a>00906 <tr <span class="keyword">class</span>=<span class="stringliteral">"bgColor4"</span>> <a name="l00907"></a>00907 <td>'.$this->linkDetails(htmlspecialchars($wDat['phash']),$wDat['phash']).'</td> <a name="l00908"></a>00908 <td>'.htmlspecialchars($wDat['page_id']).'</td> <a name="l00909"></a>00909 <td>'.htmlspecialchars($wDat['data_filename']).'</td> <a name="l00910"></a>00910 <td>'.htmlspecialchars($wDat['count']).'</td> <a name="l00911"></a>00911 <td>'.htmlspecialchars($wDat['first']).'</td> <a name="l00912"></a>00912 <td>'.htmlspecialchars($wDat['freq']).'</td> <a name="l00913"></a>00913 <td>'.htmlspecialchars($wDat['flags']).'</td> <a name="l00914"></a>00914 </tr>'; <a name="l00915"></a>00915 } <a name="l00916"></a>00916 } <a name="l00917"></a>00917 <a name="l00918"></a>00918 <span class="comment">// Compile table:</span> <a name="l00919"></a>00919 $content = ' <a name="l00920"></a>00920 <table border=<span class="stringliteral">"0"</span> cellspacing=<span class="stringliteral">"1"</span> cellpadding=<span class="stringliteral">"2"</span> <span class="keyword">class</span>=<span class="stringliteral">"c-list"</span>>'. <a name="l00921"></a>00921 $content.' <a name="l00922"></a>00922 </table>'; <a name="l00923"></a>00923 <a name="l00924"></a>00924 <span class="comment">// Add go-back link:</span> <a name="l00925"></a>00925 $content = $content.$this->linkList(); <a name="l00926"></a>00926 <a name="l00927"></a>00927 <span class="keywordflow">return</span> $content; <a name="l00928"></a>00928 } <a name="l00929"></a>00929 <a name="l00936"></a><a class="code" href="classtx__indexedsearch__modfunc1.html#45171c276bbc954a05ff155fe3d4dd50">00936</a> function showDetailsForMetaphone($metaphone) { <a name="l00937"></a>00937 <a name="l00938"></a>00938 <span class="comment">// Finding top-20 on frequency for this phash:</span> <a name="l00939"></a>00939 $ftrows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows( <a name="l00940"></a>00940 'index_words.*', <a name="l00941"></a>00941 'index_words', <a name="l00942"></a>00942 'index_words.metaphone = '.intval($metaphone), <a name="l00943"></a>00943 '', <a name="l00944"></a>00944 'index_words.baseword', <a name="l00945"></a>00945 '' <a name="l00946"></a>00946 ); <a name="l00947"></a>00947 <a name="l00948"></a>00948 <span class="keywordflow">if</span> (count($ftrows)) { <a name="l00949"></a>00949 $content.='<h4>Metaphone: '.$this->indexerObj->metaphone($ftrows[0]['baseword'],1).'</h4>'; <a name="l00950"></a>00950 <a name="l00951"></a>00951 $content.=' <a name="l00952"></a>00952 <tr <span class="keyword">class</span>=<span class="stringliteral">"tableheader bgColor5"</span>> <a name="l00953"></a>00953 <td>Word</td> <a name="l00954"></a>00954 <td>Is stopword?</td> <a name="l00955"></a>00955 </tr>'; <a name="l00956"></a>00956 <a name="l00957"></a>00957 <span class="keywordflow">if</span> (is_array($ftrows)) { <a name="l00958"></a>00958 foreach($ftrows as $wDat) { <a name="l00959"></a>00959 $content.=' <a name="l00960"></a>00960 <tr <span class="keyword">class</span>=<span class="stringliteral">"bgColor4"</span>> <a name="l00961"></a>00961 <td>'.$this->linkWordDetails(htmlspecialchars($wDat['baseword']),$wDat['wid']).'</td> <a name="l00962"></a>00962 <td>'.htmlspecialchars($wDat['is_stopword'] ? 'YES' : 'No').'</td> <a name="l00963"></a>00963 </tr>'; <a name="l00964"></a>00964 } <a name="l00965"></a>00965 } <a name="l00966"></a>00966 <a name="l00967"></a>00967 $content = ' <a name="l00968"></a>00968 <table border=<span class="stringliteral">"0"</span> cellspacing=<span class="stringliteral">"1"</span> cellpadding=<span class="stringliteral">"2"</span> <span class="keyword">class</span>=<span class="stringliteral">"c-list"</span>>'. <a name="l00969"></a>00969 $content.' <a name="l00970"></a>00970 </table>'; <a name="l00971"></a>00971 <a name="l00972"></a>00972 <span class="keywordflow">if</span> ($this->indexerObj->metaphone($ftrows[0]['baseword'])!=$metaphone) { <a name="l00973"></a>00973 $content.='ERROR: Metaphone string and hash did not match <span class="keywordflow">for</span> some reason!?'; <a name="l00974"></a>00974 } <a name="l00975"></a>00975 <a name="l00976"></a>00976 <span class="comment">// Add go-back link:</span> <a name="l00977"></a>00977 $content = $content.$this->linkList(); <a name="l00978"></a>00978 } <a name="l00979"></a>00979 <a name="l00980"></a>00980 <span class="keywordflow">return</span> $content; <a name="l00981"></a>00981 } <a name="l00982"></a>00982 <a name="l00983"></a>00983 <a name="l00984"></a>00984 <a name="l00985"></a>00985 <a name="l00986"></a>00986 <a name="l00987"></a>00987 <a name="l00988"></a>00988 <a name="l00989"></a>00989 <a name="l00990"></a>00990 <a name="l00991"></a>00991 <a name="l00992"></a>00992 <a name="l00993"></a>00993 <a name="l00994"></a>00994 <span class="comment">/*******************************</span> <a name="l00995"></a>00995 <span class="comment"> *</span> <a name="l00996"></a>00996 <span class="comment"> * Helper functions</span> <a name="l00997"></a>00997 <span class="comment"> *</span> <a name="l00998"></a>00998 <span class="comment"> *******************************/</span> <a name="l00999"></a>00999 <a name="l01007"></a><a class="code" href="classtx__indexedsearch__modfunc1.html#092f1ad8b29cf1c0059b3f13bc713e21">01007</a> function printRemoveIndexed($phash,$alt) { <a name="l01008"></a>01008 <span class="keywordflow">return</span> '<a href=<span class="stringliteral">"'.htmlspecialchars(t3lib_div::linkThisScript(array('deletePhash'=>$phash))).'"</span>>'. <a name="l01009"></a>01009 '<img src=<span class="stringliteral">"'.$GLOBALS['BACK_PATH'].'gfx/garbage.gif"</span> width=<span class="stringliteral">"11"</span> hspace=<span class="stringliteral">"1"</span> vspace=<span class="stringliteral">"2"</span> height=<span class="stringliteral">"12"</span> border=<span class="stringliteral">"0"</span> title=<span class="stringliteral">"'.htmlspecialchars($alt).'"</span> alt=<span class="stringliteral">""</span> />'. <a name="l01010"></a>01010 '</a>'; <a name="l01011"></a>01011 } <a name="l01012"></a>01012 <a name="l01020"></a><a class="code" href="classtx__indexedsearch__modfunc1.html#531417220988c7f822f39a9c85970acf">01020</a> function printReindex($resultRow,$alt) { <a name="l01021"></a>01021 <span class="keywordflow">if</span> ($resultRow['item_type'] && $resultRow['item_type']!==<span class="charliteral">'0'</span>) { <a name="l01022"></a>01022 <span class="keywordflow">return</span> '<a href=<span class="stringliteral">"'.htmlspecialchars(t3lib_div::linkThisScript(array('reindex'=>$resultRow['phash'],'reindex_id'=>$resultRow['page_id']))).'"</span>>'. <a name="l01023"></a>01023 '<img src=<span class="stringliteral">"'.$GLOBALS['BACK_PATH'].'gfx/refresh_n.gif"</span> width=<span class="stringliteral">"14"</span> hspace=<span class="stringliteral">"1"</span> vspace=<span class="stringliteral">"2"</span> height=<span class="stringliteral">"14"</span> border=<span class="stringliteral">"0"</span> title=<span class="stringliteral">"'.htmlspecialchars($alt).'"</span> alt=<span class="stringliteral">""</span> />'. <a name="l01024"></a>01024 '</a>'; <a name="l01025"></a>01025 } <a name="l01026"></a>01026 } <a name="l01027"></a>01027 <a name="l01035"></a><a class="code" href="classtx__indexedsearch__modfunc1.html#0dc7dd37b7a651d61de60d7ae2f249c9">01035</a> function linkDetails($string,$phash) { <a name="l01036"></a>01036 <span class="keywordflow">return</span> '<a href=<span class="stringliteral">"'.htmlspecialchars(t3lib_div::linkThisScript(array('phash'=>$phash))).'"</span>>'.$string.'</a>'; <a name="l01037"></a>01037 } <a name="l01038"></a>01038 <a name="l01044"></a><a class="code" href="classtx__indexedsearch__modfunc1.html#69a049ef66678a8333a73c54742bd926">01044</a> function linkList() { <a name="l01045"></a>01045 <span class="keywordflow">return</span> '<br/><a href=<span class="stringliteral">"index.php?id='.$this->pObj->id.'"</span>>Back to list.</a><br/>'; <a name="l01046"></a>01046 } <a name="l01047"></a>01047 <a name="l01055"></a><a class="code" href="classtx__indexedsearch__modfunc1.html#72149d4dbb3e6eb7ad3aa5a640dd8e4e">01055</a> function showPageDetails($string,$id) { <a name="l01056"></a>01056 <span class="keywordflow">return</span> '<a href=<span class="stringliteral">"'.htmlspecialchars('index.php?id='.$id.'&SET[depth]=0&SET[type]=1').'"</span>>'.$string.'</a>'; <a name="l01057"></a>01057 } <a name="l01058"></a>01058 <a name="l01065"></a><a class="code" href="classtx__indexedsearch__modfunc1.html#a3b8664dd39767764ff5e28225354dcf">01065</a> function printExtraGrListRows($extraGrListRows) { <a name="l01066"></a>01066 <span class="keywordflow">if</span> (count($extraGrListRows)) { <a name="l01067"></a>01067 reset($extraGrListRows); <a name="l01068"></a>01068 $lines=array(); <a name="l01069"></a>01069 <span class="keywordflow">while</span>(list(,$r)=each($extraGrListRows)) { <a name="l01070"></a>01070 $lines[] = $r['gr_list']; <a name="l01071"></a>01071 } <a name="l01072"></a>01072 <span class="keywordflow">return</span> <span class="stringliteral">"<br/>"</span>.$GLOBALS['TBE_TEMPLATE']->dfw(implode('<br/>',$lines)); <a name="l01073"></a>01073 } <a name="l01074"></a>01074 } <a name="l01075"></a>01075 <a name="l01082"></a><a class="code" href="classtx__indexedsearch__modfunc1.html#42f461c36f3e7e2526c4d3cd50ea7ed3">01082</a> function printRootlineInfo($row) { <a name="l01083"></a>01083 $uidCollection = array(); <a name="l01084"></a>01084 <a name="l01085"></a>01085 <span class="keywordflow">if</span> ($row['rl0']) { <a name="l01086"></a>01086 $uidCollection[0] = $row['rl0']; <a name="l01087"></a>01087 <span class="keywordflow">if</span> ($row['rl1']) { <a name="l01088"></a>01088 $uidCollection[1] = $row['rl1']; <a name="l01089"></a>01089 <span class="keywordflow">if</span> ($row['rl2']) { <a name="l01090"></a>01090 $uidCollection[2] = $row['rl2']; <a name="l01091"></a>01091 <a name="l01092"></a>01092 <span class="comment">// Additional levels:</span> <a name="l01093"></a>01093 <span class="keywordflow">if</span> (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['addRootLineFields'])) { <a name="l01094"></a>01094 foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['addRootLineFields'] as $fieldName => $rootLineLevel) { <a name="l01095"></a>01095 <span class="keywordflow">if</span> ($row[$fieldName]) { <a name="l01096"></a>01096 $uidCollection[$rootLineLevel] = $row[$fieldName]; <a name="l01097"></a>01097 } <a name="l01098"></a>01098 } <a name="l01099"></a>01099 } <a name="l01100"></a>01100 } <a name="l01101"></a>01101 } <a name="l01102"></a>01102 } <a name="l01103"></a>01103 <a name="l01104"></a>01104 <span class="comment">// Return root line.</span> <a name="l01105"></a>01105 ksort($uidCollection); <a name="l01106"></a>01106 <span class="keywordflow">return</span> implode(<span class="charliteral">'/'</span>,$uidCollection); <a name="l01107"></a>01107 } <a name="l01108"></a>01108 <a name="l01116"></a><a class="code" href="classtx__indexedsearch__modfunc1.html#469a2627d9c118eecfedbc27ac71b3db">01116</a> function makeItemTypeIcon($it,$alt='') { <a name="l01117"></a>01117 <span class="keywordflow">if</span> (!isset($this->iconFileNameCache[$it])) { <a name="l01118"></a>01118 <span class="keywordflow">if</span> ($it===<span class="charliteral">'0'</span>) { <a name="l01119"></a>01119 $icon = 'EXT:indexed_search/pi/res/pages.gif'; <a name="l01120"></a>01120 } elseif ($this->external_parsers[$it]) { <a name="l01121"></a>01121 $icon = $this->external_parsers[$it]->getIcon($it); <a name="l01122"></a>01122 } <a name="l01123"></a>01123 <a name="l01124"></a>01124 $fullPath = <a class="code" href="classt3lib__div.html#ad5d27aeabb41e7f5ed6ddaf760de42a">t3lib_div::getFileAbsFileName</a>($icon); <a name="l01125"></a>01125 <a name="l01126"></a>01126 <span class="keywordflow">if</span> ($fullPath) { <a name="l01127"></a>01127 $info = @getimagesize($fullPath); <a name="l01128"></a>01128 $iconPath = $GLOBALS['BACK_PATH'].'../'.substr($fullPath,strlen(PATH_site)); <a name="l01129"></a>01129 $this->iconFileNameCache[$it] = is_array($info) ? '<img src=<span class="stringliteral">"'.$iconPath.'"</span> '.$info[3].' title=<span class="stringliteral">"###TITLE_ATTRIBUTE###"</span> alt=<span class="stringliteral">""</span> />' : ''; <a name="l01130"></a>01130 } <a name="l01131"></a>01131 } <a name="l01132"></a>01132 <span class="keywordflow">return</span> str_replace('###TITLE_ATTRIBUTE###',htmlspecialchars($it.': '.$alt),$this->iconFileNameCache[$it]); <a name="l01133"></a>01133 } <a name="l01134"></a>01134 <a name="l01141"></a><a class="code" href="classtx__indexedsearch__modfunc1.html#2258e4df14ffb35120af1b26ccd90725">01141</a> function utf8_to_currentCharset($string) { <a name="l01142"></a>01142 global $LANG; <a name="l01143"></a>01143 <span class="keywordflow">if</span> ($LANG->charSet != 'utf-8') { <a name="l01144"></a>01144 $string = $LANG->csConvObj->utf8_decode($string, $LANG->charSet, TRUE); <a name="l01145"></a>01145 } <a name="l01146"></a>01146 <span class="keywordflow">return</span> $string; <a name="l01147"></a>01147 } <a name="l01148"></a>01148 <a name="l01149"></a>01149 <a name="l01150"></a>01150 <a name="l01151"></a>01151 <a name="l01152"></a>01152 <a name="l01153"></a>01153 <a name="l01154"></a>01154 <a name="l01155"></a>01155 <a name="l01156"></a>01156 <a name="l01157"></a>01157 <a name="l01158"></a>01158 <a name="l01159"></a>01159 <a name="l01160"></a>01160 <span class="comment">/********************************</span> <a name="l01161"></a>01161 <span class="comment"> *</span> <a name="l01162"></a>01162 <span class="comment"> * Reindexing</span> <a name="l01163"></a>01163 <span class="comment"> *</span> <a name="l01164"></a>01164 <span class="comment"> *******************************/</span> <a name="l01165"></a>01165 <a name="l01173"></a><a class="code" href="classtx__indexedsearch__modfunc1.html#38c47b9232a5851336283c50da9ea2af">01173</a> function reindexPhash($phash, $pageId) { <a name="l01174"></a>01174 <a name="l01175"></a>01175 <span class="comment">// Query:</span> <a name="l01176"></a>01176 list($resultRow) = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows( <a name="l01177"></a>01177 'ISEC.*, IP.*', <a name="l01178"></a>01178 'index_phash IP, index_section ISEC', <a name="l01179"></a>01179 'IP.phash = ISEC.phash <a name="l01180"></a>01180 AND IP.phash = '.intval($phash).' <a name="l01181"></a>01181 AND ISEC.page_id = '.intval($pageId) <a name="l01182"></a>01182 ); <a name="l01183"></a>01183 <a name="l01184"></a>01184 $content = ''; <a name="l01185"></a>01185 <span class="keywordflow">if</span> (is_array($resultRow)) { <a name="l01186"></a>01186 <span class="keywordflow">if</span> ($resultRow['item_type'] && $resultRow['item_type']!==<span class="charliteral">'0'</span>) { <a name="l01187"></a>01187 <a name="l01188"></a>01188 <span class="comment">// (Re)-Indexing file on page.</span> <a name="l01189"></a>01189 $indexerObj = &<a class="code" href="classt3lib__div.html#b47f8a8e8be44b79a0b8064dcd427bc1">t3lib_div::makeInstance</a>('<a class="code" href="classtx__indexedsearch__indexer.html">tx_indexedsearch_indexer</a>'); <a name="l01190"></a>01190 $indexerObj->backend_initIndexer($pageId, 0, 0, '', $this->getUidRootLineForClosestTemplate($pageId)); <a name="l01191"></a>01191 <a name="l01192"></a>01192 <span class="comment">// URL or local file:</span> <a name="l01193"></a>01193 <span class="keywordflow">if</span> ($resultRow['externalUrl']) { <a name="l01194"></a>01194 $indexerObj->indexExternalUrl($resultRow['data_filename']); <a name="l01195"></a>01195 } <span class="keywordflow">else</span> { <a name="l01196"></a>01196 $indexerObj->indexRegularDocument($resultRow['data_filename'], TRUE); <a name="l01197"></a>01197 } <a name="l01198"></a>01198 <a name="l01199"></a>01199 <span class="keywordflow">if</span> ($indexerObj->file_phash_arr['phash'] != $resultRow['phash']) { <a name="l01200"></a>01200 $content.= 'ERROR: phash ('.$indexerObj->file_phash_arr['phash'].') did NOT match '.$resultRow['phash'].' <span class="keywordflow">for</span> strange reasons!'; <a name="l01201"></a>01201 } <a name="l01202"></a>01202 <a name="l01203"></a>01203 $content.='<h4>Log <span class="keywordflow">for</span> re-indexing of <span class="stringliteral">"'.htmlspecialchars($resultRow['data_filename']).'"</span>:</h4>'; <a name="l01204"></a>01204 $content.=<a class="code" href="classt3lib__div.html#c4b85a2c21410edfc814e936ca4bc591">t3lib_div::view_array</a>($indexerObj->internal_log); <a name="l01205"></a>01205 <a name="l01206"></a>01206 $content.='<h4>Hash-array, page:</h4>'; <a name="l01207"></a>01207 $content.=<a class="code" href="classt3lib__div.html#c4b85a2c21410edfc814e936ca4bc591">t3lib_div::view_array</a>($indexerObj->hash); <a name="l01208"></a>01208 <a name="l01209"></a>01209 $content.='<h4>Hash-array, file:</h4>'; <a name="l01210"></a>01210 $content.=<a class="code" href="classt3lib__div.html#c4b85a2c21410edfc814e936ca4bc591">t3lib_div::view_array</a>($indexerObj->file_phash_arr); <a name="l01211"></a>01211 } <a name="l01212"></a>01212 } <a name="l01213"></a>01213 <a name="l01214"></a>01214 <span class="comment">// Link back to list.</span> <a name="l01215"></a>01215 $content.= $this->linkList(); <a name="l01216"></a>01216 <a name="l01217"></a>01217 <span class="keywordflow">return</span> $content; <a name="l01218"></a>01218 } <a name="l01219"></a>01219 <a name="l01227"></a><a class="code" href="classtx__indexedsearch__modfunc1.html#938edde13434227dc330b2c052366dd5">01227</a> function getUidRootLineForClosestTemplate($id) { <a name="l01228"></a>01228 $tmpl = <a class="code" href="classt3lib__div.html#b47f8a8e8be44b79a0b8064dcd427bc1">t3lib_div::makeInstance</a>('<a class="code" href="classt3lib__tsparser__ext.html">t3lib_tsparser_ext</a>'); <span class="comment">// Defined global here!</span> <a name="l01229"></a>01229 $tmpl->tt_track = 0; <span class="comment">// Do not log time-performance information</span> <a name="l01230"></a>01230 $tmpl->init(); <a name="l01231"></a>01231 <a name="l01232"></a>01232 <span class="comment">// Gets the rootLine</span> <a name="l01233"></a>01233 $sys_page = <a class="code" href="classt3lib__div.html#b47f8a8e8be44b79a0b8064dcd427bc1">t3lib_div::makeInstance</a>('<a class="code" href="classt3lib__pageSelect.html">t3lib_pageSelect</a>'); <a name="l01234"></a>01234 $rootLine = $sys_page->getRootLine($id); <a name="l01235"></a>01235 $tmpl->runThroughTemplates($rootLine,0); <span class="comment">// This generates the constants/config + hierarchy info for the template.</span> <a name="l01236"></a>01236 <a name="l01237"></a>01237 <span class="comment">// Root line uids</span> <a name="l01238"></a>01238 $rootline_uids = array(); <a name="l01239"></a>01239 foreach($tmpl->rootLine as $rlkey => $rldat) { <a name="l01240"></a>01240 $rootline_uids[$rlkey] = $rldat['uid']; <a name="l01241"></a>01241 } <a name="l01242"></a>01242 <a name="l01243"></a>01243 <span class="keywordflow">return</span> $rootline_uids; <a name="l01244"></a>01244 } <a name="l01245"></a>01245 <a name="l01246"></a>01246 <a name="l01247"></a>01247 <a name="l01248"></a>01248 <a name="l01249"></a>01249 <a name="l01250"></a>01250 <a name="l01251"></a>01251 <a name="l01252"></a>01252 <a name="l01253"></a>01253 <a name="l01254"></a>01254 <a name="l01255"></a>01255 <a name="l01256"></a>01256 <a name="l01257"></a>01257 <span class="comment">/********************************</span> <a name="l01258"></a>01258 <span class="comment"> *</span> <a name="l01259"></a>01259 <span class="comment"> * SQL functions</span> <a name="l01260"></a>01260 <span class="comment"> *</span> <a name="l01261"></a>01261 <span class="comment"> *******************************/</span> <a name="l01262"></a>01262 <a name="l01270"></a><a class="code" href="classtx__indexedsearch__modfunc1.html#a1586a552fdcbd447409c573ba42d542">01270</a> function removeIndexedPhashRow($phashList,$clearPageCache=1) { <a name="l01271"></a>01271 <span class="comment">// FIXME: This is only a workaround</span> <a name="l01272"></a>01272 <span class="keywordflow">if</span> ($phashList=='ALL') { <a name="l01273"></a>01273 $this->drawTableOfIndexedPages(); <a name="l01274"></a>01274 $phashRows = $this->allPhashListed; <a name="l01275"></a>01275 $this->allPhashListed = array(); <span class="comment">// Reset it because it will be filled again later...</span> <a name="l01276"></a>01276 } <span class="keywordflow">else</span> { <a name="l01277"></a>01277 $phashRows = <a class="code" href="classt3lib__div.html#cfb87d585b85e9b32841bde40beaa96c">t3lib_div::trimExplode</a>(<span class="charliteral">','</span>,$phashList,1); <a name="l01278"></a>01278 } <a name="l01279"></a>01279 <a name="l01280"></a>01280 foreach($phashRows as $phash) { <a name="l01281"></a>01281 $phash = intval($phash); <a name="l01282"></a>01282 <span class="keywordflow">if</span> ($phash>0) { <a name="l01283"></a>01283 <a name="l01284"></a>01284 <span class="keywordflow">if</span> ($clearPageCache) { <a name="l01285"></a>01285 <span class="comment">// Clearing page cache:</span> <a name="l01286"></a>01286 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('page_id', 'index_section', 'phash='.intval($phash)); <a name="l01287"></a>01287 <span class="keywordflow">if</span> ($GLOBALS['TYPO3_DB']->sql_num_rows($res)) { <a name="l01288"></a>01288 $idList = array(); <a name="l01289"></a>01289 <span class="keywordflow">while</span>($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { <a name="l01290"></a>01290 $idList[] = $row['page_id']; <a name="l01291"></a>01291 } <a name="l01292"></a>01292 $GLOBALS['TYPO3_DB']->exec_DELETEquery('cache_pages', 'page_id IN ('.implode(<span class="charliteral">','</span>,$GLOBALS['TYPO3_DB']->cleanIntArray($idList)).<span class="charliteral">')'</span>); <a name="l01293"></a>01293 } <a name="l01294"></a>01294 } <a name="l01295"></a>01295 <a name="l01296"></a>01296 <span class="comment">// Removing old registrations for all tables.</span> <a name="l01297"></a>01297 $tableArr = explode(<span class="charliteral">','</span>,'index_phash,index_rel,index_section,index_grlist,index_fulltext,index_debug'); <a name="l01298"></a>01298 foreach($tableArr as $table) { <a name="l01299"></a>01299 $GLOBALS['TYPO3_DB']->exec_DELETEquery($table, 'phash='.intval($phash)); <a name="l01300"></a>01300 } <a name="l01301"></a>01301 <a name="l01302"></a>01302 <span class="comment">// Did not remove any index_section records for external files where phash_t3 points to this hash!</span> <a name="l01303"></a>01303 } <a name="l01304"></a>01304 } <a name="l01305"></a>01305 } <a name="l01306"></a>01306 <a name="l01314"></a><a class="code" href="classtx__indexedsearch__modfunc1.html#44cc85061cc6f92efc1188515c759409">01314</a> function getGrListEntriesForPhash($phash,$gr_list) { <a name="l01315"></a>01315 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(<span class="charliteral">'*'</span>, 'index_grlist', 'phash='.intval($phash)); <a name="l01316"></a>01316 $lines = array(); <a name="l01317"></a>01317 $isRemoved = 0; <a name="l01318"></a>01318 <span class="keywordflow">while</span>($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { <a name="l01319"></a>01319 <span class="keywordflow">if</span> (!$isRemoved && !strcmp($row['gr_list'],$gr_list)) { <a name="l01320"></a>01320 $isRemoved = 1; <a name="l01321"></a>01321 } <span class="keywordflow">else</span> { <a name="l01322"></a>01322 $lines[] = $row; <a name="l01323"></a>01323 } <a name="l01324"></a>01324 } <a name="l01325"></a>01325 <span class="keywordflow">return</span> $lines; <a name="l01326"></a>01326 } <a name="l01327"></a>01327 <a name="l01334"></a><a class="code" href="classtx__indexedsearch__modfunc1.html#f38140960ca251daa3e269cf9d16c0df">01334</a> function processStopWords($stopWords) { <a name="l01335"></a>01335 <a name="l01336"></a>01336 <span class="keywordflow">if</span> ($GLOBALS['BE_USER']->isAdmin()) { <a name="l01337"></a>01337 <span class="comment">// Traverse words</span> <a name="l01338"></a>01338 foreach($stopWords as $wid => $state) { <a name="l01339"></a>01339 $fieldArray = array( <a name="l01340"></a>01340 'is_stopword' => $state <a name="l01341"></a>01341 ); <a name="l01342"></a>01342 $GLOBALS['TYPO3_DB']->exec_UPDATEquery('index_words', 'wid='.$wid, $fieldArray); <a name="l01343"></a>01343 } <a name="l01344"></a>01344 } <a name="l01345"></a>01345 } <a name="l01346"></a>01346 <a name="l01354"></a><a class="code" href="classtx__indexedsearch__modfunc1.html#4a23a9c555bb19fb3ddac756bd4d86ef">01354</a> function processPageKeywords($pageKeywords, $pageUid) { <a name="l01355"></a>01355 <a name="l01356"></a>01356 <span class="comment">// Get pages current keywords</span> <a name="l01357"></a>01357 $pageRec = <a class="code" href="classt3lib__BEfunc.html#c0a110679ba0fac9af0d66f34026f378">t3lib_BEfunc::getRecord</a>('pages', $pageUid); <a name="l01358"></a>01358 $keywords = array_flip(<a class="code" href="classt3lib__div.html#cfb87d585b85e9b32841bde40beaa96c">t3lib_div::trimExplode</a>(<span class="charliteral">','</span>, $pageRec['keywords'], 1)); <a name="l01359"></a>01359 <a name="l01360"></a>01360 <span class="comment">// Merge keywords:</span> <a name="l01361"></a>01361 foreach($pageKeywords as $key => $v) { <a name="l01362"></a>01362 <span class="keywordflow">if</span> ($v) { <a name="l01363"></a>01363 $keywords[$key]=1; <a name="l01364"></a>01364 } <span class="keywordflow">else</span> { <a name="l01365"></a>01365 unset($keywords[$key]); <a name="l01366"></a>01366 } <a name="l01367"></a>01367 } <a name="l01368"></a>01368 <a name="l01369"></a>01369 <span class="comment">// Compile new list:</span> <a name="l01370"></a>01370 $data = array(); <a name="l01371"></a>01371 $data['pages'][$pageUid]['keywords'] = implode(', ',array_keys($keywords)); <a name="l01372"></a>01372 <a name="l01373"></a>01373 $tce = <a class="code" href="classt3lib__div.html#b47f8a8e8be44b79a0b8064dcd427bc1">t3lib_div::makeInstance</a>('<a class="code" href="classt3lib__TCEmain.html">t3lib_TCEmain</a>'); <a name="l01374"></a>01374 $tce->stripslashes_values = 0; <a name="l01375"></a>01375 $tce->start($data,array()); <a name="l01376"></a>01376 $tce->process_datamap(); <a name="l01377"></a>01377 } <a name="l01378"></a>01378 } <a name="l01379"></a>01379 <a name="l01380"></a>01380 <a name="l01381"></a>01381 <a name="l01382"></a>01382 <span class="keywordflow">if</span> (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/indexed_search/modfunc1/<span class="keyword">class</span>.<a class="code" href="classtx__indexedsearch__modfunc1.html">tx_indexedsearch_modfunc1</a>.php']) { <a name="l01383"></a>01383 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/indexed_search/modfunc1/<span class="keyword">class</span>.<a class="code" href="classtx__indexedsearch__modfunc1.html">tx_indexedsearch_modfunc1</a>.php']); <a name="l01384"></a>01384 } <a name="l01385"></a>01385 <a name="l01386"></a>01386 ?> </pre></div><?php include_once '../doc-typo3-funcs.php'; get_footer(); ?>