Forum Index
RegisterSearchFAQMemberlistUsergroupsLog in
Some improvement to search.php wanted

 
Reply to topic    Forum Index » Suggestions View previous topic
View next topic
Some improvement to search.php wanted
Author Message
Saszoo



Joined: 07 Jun 2006
Posts: 410
Location: Norway

Post Some improvement to search.php wanted Reply with quote
1. Ability to search in comments.

2. Display number of found results.

3. Not cache the highlighted text string, cause it's confusing when making a search #2 and finding same words highlighted instead of what you searched for.

4. FI-DD's wonderful hack to have search adresses such as domain.tld/search/searchword as standard.

5. A way to remove the codes from searchresult. Say one of the articles which contains the given searchword has a <img class="something" title="something" alt="something" src="img/img.jpg" />. If you're unfortunate the the extract form your news may start somewhere like ething" alt="something" src="img/img.jpg" /> This code will then be displayed instead of the image.

6. Searchcloud, maybe based on the search history hack?

7. Text if searchword recieves no hits.

_________________
My cute.ru site
Mon Jan 15, 2007 7:06 pm View user's profile Send private message Visit poster's website
Guest








Please login to hide the ads.

scottdallas



Joined: 04 May 2006
Posts: 1943
Location: US

Post Reply with quote
Very nice feature list, I have to agree with all of it. I wish I could even get the highlight feature to work Razz I take it out completely cause it always ruins my search results. I also wouldn't mind seeing the search form integrated into the admin panel so it could be edited like the templates. As far as I can see the actual search section in search.php is plain HTMl, so why not make it editable like the templates for n00bs to edit it easier (and lazy people like me).

_________________
www.scottdizzle.com uses cnr Smile
last update: 07-22-08: 8:30 pm
Tue Jan 16, 2007 9:01 am View user's profile Send private message Visit poster's website AIM Address
Saszoo



Joined: 07 Jun 2006
Posts: 410
Location: Norway

Post Reply with quote
Quick solution to #5.



I'm not yet a php-coder, but I think I make some progress, well based on the fact that I made a solution that I'm happy with.

To the solution:

Open search.php find

Code:
return $result;


Add above:

Code:
$result = strip_tags($result);




Wow, extreme isn't it? Nah, not really but it works.



Pros: Removes tag-fractions that might break your code, layout and what not, simple, also a way of removing images from search-result.

Cons: Removes all tags, not only the fraction-ones, meaning that there will be no working tags like <span> and <img> in your search-result.

_________________
My cute.ru site
Thu Jan 18, 2007 7:00 pm View user's profile Send private message Visit poster's website
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2801
Location: Germany

Post Reply with quote
Saszoo wrote:
Cons: Removes all tags, not only the fraction-ones, meaning that there will be no working tags like <span> and <img> in your search-result.




Resource #1 for every php-coder: www.php.net Cool



You will find the following example when searching for the strip_tags function:

Code:
// Allow <p>

echo strip_tags($text, '<p>');




So this should solve your problem:

Code:
$result = strip_tags($result, '<span><img>');

Thu Jan 18, 2007 8:28 pm View user's profile Send private message
Saszoo



Joined: 07 Jun 2006
Posts: 410
Location: Norway

Post Reply with quote
Ah, yes I know, and I've already tried it.

Only problem is that the bugger with tag-fraction still occurs. So if span or img is at the extraction-end you'll have code break which might mess up your layout.



And you're right. www.php.net is definatly a place I'll dig into. The manual is a great resource Cool

_________________
My cute.ru site
Thu Jan 18, 2007 10:44 pm View user's profile Send private message Visit poster's website
Torstein



Joined: 03 Aug 2006
Posts: 106

Post Reply with quote
So i've been trying to get my search results to look somewhat nice, but I'm having some major problems with the search results looking like a mess.



So, is there some way to simply show the whole {short-story} instead of the area with highlights, etc.?
Sat Mar 31, 2007 11:48 pm View user's profile Send private message
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2801
Location: Germany

Post Reply with quote
In search.php change this:

Code:
add_filter('news-entry-content', 'Highlight_Search', 999);




to this:

Code:
//add_filter('news-entry-content', 'Highlight_Search', 999);

Mon Apr 02, 2007 3:39 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    Forum Index » Suggestions All times are GMT + 1 Hour
Page 1 of 1

 
Jump to: 
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 vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum



Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Music Lyrics.