Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Keyword Search
#1
A search plugin for GetSimple. It is similar to nexfo's plugin, with the main difference that it allows searching for multiple keywords (in different parts of the text). A slightly modified version for the GetSimple News Manager plugin can bee seen here.

Installation instructions:

Download the plugin here, extract its contents (keyword_search.php) and move it to your plugins folder. Create the following component and call it "Search Form":

Code:
<form id="search_form" action="index.php?id=search" method="post">
  <input type="text" class="text" name="keywords" />
  <input type="submit" class="submit" value="Search" />
</form>

Place this component on your site by inserting:

Code:
<?php get_component('search-form'); ?>

anywhere in your (default) template.

You will also have to create a new page and template to print the search results. To create the template you should copy the default template.php to search.php and place:

Code:
<?php get_search_results(); ?>

right beneath or instead of

Code:
<?php get_page_content(); ?>

Then create a new page to display the search results. Name it Search (title) and let it use the new search.php template and everything should be working fine.

Note: of course you can use different names, but make sure to be consistent then.
Reply
#2
Works nice !
Thanks
Reply
#3
Using,thx
Reply
#4
Большое вам спасибо за плагин
Reply
#5
How can i make it work for foreign letters? Like UTF8?
Reply
#6
is it possible to somehow make search for text within the news and blogs?
Reply
#7
kist Wrote:How can i make it work for foreign letters? Like UTF8?

I could fix it to show html special chars in the result pages:

Code:
$content = preg_replace('/&#?[a-z0-9]+&{2,8};/i', '', stripslashes(strip_tags(html_entity_decode($data->content, ENT_QUOTES, 'UTF-8'))));

i just added a +& to show the html chars. But i can't make it work when i type a foreign letter in the search box, it shows no results. It works when i type the html code for that letter.
Reply
#8
do you encode the special char into entity before you forward the string to search function ?
Addons: blue business theme, Online Visitors, Notepad
Reply
#9
Oleg, I have already solved this thing and deleted my posting here. But anyway thank you very much! Smile
Reply
#10
But it does not search the News page ...
Reply
#11
arthur_a_keen Wrote:But it does not search the news page…
This plugin reads through the XML files used for pages. Anything outside of those files will not be searched by it. (News and blog plugins use their own XML files to store the information.)
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply
#12
Zegnåt Wrote:
arthur_a_keen Wrote:But it does not search the news page…
This plugin reads through the XML files used for pages. Anything outside of those files will not be searched by it. (News and blog plugins use their own XML files to store the information.)

I understand. But this is a noncence. Smile
Reply
#13
Hi all, I try to add this search option to my website, but can not get it to work.
I've downloaded the "search.php" file and placed it in the plugins dir.
Created the new component and call it "Search"
Added the code
Code:
<?php get_component('search'); ?>
to the template.php
Copied the file "template.php" and named it "search.php" placed it in the template folder I'am using
Added the code
Code:
<?php get_search_results(); ?>
to search.php
And ...

... Oops! Page not found!

So what am I doing wrong?
I hope someone can help me with this, greetings.
Reply
#14
Did you make a seperate page (also named "Search") that uses the search.php template?
Reply
#15
Hi Roog, yes I copied "template.php" en named it "search.php". Added the required code "<?php get_search_results(); ?>" and placed next to "template.php".

I'am not sure if it uses the search.php. I did move the downloaded "search.php" into the plugin dir assume thats the idea.


thx, Tom.
Reply
#16
Donuts Wrote:I'am not sure if it uses the search.php

That's what I mean: did you create a new page (via the "Pages" tab in the admin section of your getsimple installation) that uses this search.php template?
Reply
#17
You have solved my puzzle. And it works perfectly.

Thank you, Tom
Reply
#18
You might also want to look at the I18N Search plugin (http://get-simple.info/extend/plugin/i18n-search/82/).
See http://get-simple.info/forum/topic/1361/...ugin-i18n/ for more information.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#19
This plugin can be easily modified to not display search results, but rather a category or group of related pages:

For example, the below link is just a development (test) site, but you will see how it is displaying a certain type of page, in this case, pages with the parent page of vacation.

http://tinyurl.com/linkknillinkknil
Reply
#20
Thanks i will try it. Alan
Reply
#21
Hi,

I can't seem to get the search results to display. It does accept the search form and go to the designated search page but it only displays. " Sorry, your search returned no hits."

Any help is appreciated.

Is it a problem that I have the search form inside of a template that is not the default template and therefore not the site root?

the search form is here:
blueplanetbump.com/jobs.html

and the search results page is here:
blueplanetbump.com/search.html

Thanks so much

Patrice
Reply
#22
Cannot get it work.
Made all like in first post

but i'm getting -

Code:
Search
Search (button)

Without any fields.
Why is that?

Thanks

Update
Sorry, my bad. there were problem with styles.css
Now it's working well
Thanks a lot.
Reply
#23
You are on the year of the first post look
Reply
#24
A small and very flexible plugin. Works good.
My website made with GetSimple CMS is

Arte & Società
www.artesocieta.eu

An indipendent website about Italian Contemporary Visual Arts
Reply
#25
A small tip for the "search-form" component in HTML5 version.

PHP Code:
<form id="search_form" action="?id=search" method="post">
  <
input type="text" class="text" name="keywords" placeholder="Search...">
  <
input type="submit" class="submit" value="Search">
</
form
My website made with GetSimple CMS is

Arte & Società
www.artesocieta.eu

An indipendent website about Italian Contemporary Visual Arts
Reply




Users browsing this thread: 1 Guest(s)