Home » Forum
NoNumber!

Joomla!® Websites & Extensions
development  -  support  -  consultancy

I try to respond within 48 hours (excluding weekends).
If I haven't responded by then, feel free to post a reminder or bug me via email.

My last reply was: 4 Hours, 10 Minutes ago.

Welcome, Guest
Please Login or Register.    Lost Password?

Fix to prevent codes in search results (core hack)
(1 viewing) (1) Guest
Go to bottomPage: 1
TOPIC: Fix to prevent codes in search results (core hack)
*
#6887
Fix to prevent codes in search results (core hack) 2 Years ago  
To prevent code appearing in the searh results, you need to do a little core hack.
Not pretty... I know!
But it can't be done through a plugin (as far as I know).

So add a piece of code to this file:
/components/com_search/models/search.php
The code should end up like this, starting at line 148:
$this->_total = count($rows);
if($this->getState('limit') > 0) {
$this->_data    = array_splice($rows, $this->getState('limitstart'), $this->getState('limit'));
} else {
$this->_data = $rows;
}

/* >>> ADDED: Run content plugins over results */
$data = 'search';
foreach( $this->_data as $i => $item ) {
if ( $item->text != '' ) {
$results = $dispatcher->trigger( 'onPrepareContent', array ( &$item, &$data, 0 ) );
$item->title = strip_tags( $item->title );
}
}
/* <<< */
}
return $this->_data;
}
Peter van Westen
Admin
Posts: 9169
User OfflineClick here to see the profile of this user
Last Edit: 2010/04/29 12:15 By peter.
The topic has been locked.
Need to contact me directly? Go to my contact page.
If you use any NoNumber! extensions, please post a rating and a review at the Joomla! Extensions Directory.
Are you happy with the support? Please consider buying a License Code to help me to continue development and support.
 
Go to topPage: 1
Moderators: Peter van Westen
Open Source Training | Online Joomla! Training and Support
MaxCDN | Content Delivery Network | Accelerate your site to the max
hosting joomla