Joomla! Discussion Forums



It is currently Wed Nov 25, 2009 2:15 pm (All times are UTC )

 


Forum rules

Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.



Post new topic Reply to topic  [ 6 posts ] 
Author Message
Posted: Fri Feb 08, 2008 9:51 pm 
Joomla! Intern
Joomla! Intern
Offline

Joined: Tue Aug 23, 2005 8:07 am
Posts: 57
I know how to and successfully have extended the amount of characters one enters when searching to increase it from 20 to something higher as 20 characters isn't a lot at all.

But I also needed to restrict the sections which can be searched and only the "Content Search Extended" mambot seems to do this so I installed it and unpublished the content search mambot whilst publishing the extended one. But, I can't see where in the php file to increase the numbers of characters one can use when searching to above 20?

Does anyone know if it's possible to increase the number of characters when searching with the "Content Search Extended" mambot and, if so, how please?

TIA


Top
   
 
Posted: Thu Aug 21, 2008 5:14 am 
Joomla! Fledgling
Joomla! Fledgling
Offline

Joined: Thu Aug 21, 2008 5:06 am
Posts: 3
starlight wrote:
I know how to and successfully have extended the amount of characters one enters when searching to increase it from 20 to something higher as 20 characters isn't a lot at all.


Hi starlight - would you mind sharing how you did this? Did it cause any performance issues?

Thanks, -Seth


Top
  E-mail  
 
Posted: Thu Aug 21, 2008 10:51 am 
Joomla! Intern
Joomla! Intern
Offline

Joined: Tue Aug 23, 2005 8:07 am
Posts: 57
This is for Joomla 1.0.x and is for the default search, not for the "Content Search Extended" mambot as I never found how or where to edit it for the extension mambot.

You need to edit two files.

1- In components/com_search/search.php

Find in around line 78

Code:
   // limit searchword to 20 characters   
        if ( strlen( $searchword ) > 20 ) {
      $searchword    = substr( $searchword, 0, 19 );

I changed the character limit of 20 to 50, and added 30 to the 19 (50-20=30) so that the code looks like this:

Code:
   // limit searchword to 20 characters   
        if ( strlen( $searchword ) > 50 ) {
      $searchword    = substr( $searchword, 0, 49 );


2 - In components/com_search/search.html.php

Find in around line 48

Code:
<input type="text" name="searchword" id="search_searchword" size="30" maxlength="20" value="<?php echo stripslashes($searchword);?>" class="inputbox" />
            </td>

change the "maxlength" to the same figure as you changed it in the search.php file.

Code:
<input type="text" name="searchword" id="search_searchword" size="30" maxlength="50" value="<?php echo stripslashes($searchword);?>" class="inputbox" />


I hope this helps :)


Top
   
 
Posted: Thu Aug 21, 2008 10:53 am 
Joomla! Intern
Joomla! Intern
Offline

Joined: Tue Aug 23, 2005 8:07 am
Posts: 57
Sorry, forgot your other question. I'm not aware of it causing any performance issues.


Top
   
 
Posted: Sat Aug 23, 2008 9:55 pm 
Joomla! Fledgling
Joomla! Fledgling
Offline

Joined: Thu Aug 21, 2008 5:06 am
Posts: 3
Hmm... I tried poking around but can't find anything that is that similar. I found: components/com_search/search.php But the only part that contains the phrase "searchword" looks like this.

Code:
// Set the search parameters
      $keyword      = urldecode(JRequest::getString('searchword'));
      $match         = JRequest::getWord('searchphrase', 'all');
      $ordering      = JRequest::getWord('ordering', 'newest');
      $this->setSearch($keyword, $match, $ordering);


There don't seem to be any numbers to adjust. :(
Anyway, thanks again.

- Seth


Top
  E-mail  
 
Posted: Tue Nov 03, 2009 2:53 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Thu May 14, 2009 8:03 pm
Posts: 8
Yea, the other place that has to be changed is under admin components search. you will find it there. then the actual search logic will accept the number you want..

_________________
Knowledge is the price for freedom!
www.1215.org

Have a great day, its your choice!


Top
  E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

Quick reply

 



Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group