How to have DirectPHP commands processed in Joomla search (for Joomla 1.0.x)? |
| Written by kksou | ||
| Monday, 04 August 2008 | ||
|
Suppose you have installed the DirectPHP plguin, which allows you to embed PHP commands right inside your Joomla content item.. In standard Joomla 1.0.x search, the DirectPHP commands will be visible in the search result. This is both undesirable and confusing to the users. This article shows you how to have the DirectPHP commands processed in Joomla search. Note: the steps below works for Joomla 1.0.x only. For Joomla 1.5.x, please refer to How to have DirectPHP commands processed in Joomla search (for Joomla 1.5.x)?. SolutionAll you need is to add 4 lines to have the DirectPHP commands processed by Joomla search.
$totalRows = count( $rows );
for ($i=0; $i < $totalRows; $i++) {
$text = &$rows[$i]->text;
global $_MAMBOTS;
$params2 = new stdClass();
$_MAMBOTS->loadBotGroup( 'content' );
$results = $_MAMBOTS->trigger( 'onPrepareContent',
array( 1, &$rows[$i], &$params2) );
if ($searchphrase == 'exact') {
$searchwords = array($searchword);
$needle = $searchword;
} else {
$searchwords = explode(' ', $searchword);
$needle = $searchwords[0];
}
That's it! Your DirectPHP commands should now be processed even within Joomla search! |
||
| < Prev | Next > |
|---|




