Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Search Plugin
#1
Hey there,

I'm just creating a simple Search Plugin (view screenshot):

I'm currently cleaning out the code and stuff and will release it once its clean and stable.
Any suggestions add-ons anyone wants to see?

[Image: gs_search.jpg]

EDIT:
Version 0.1 added
Reply
#2
nice work dude, looking forward to its release... Smile
Reply
#3
Well done. How is server load during search?
What about searching 60 pages? Is it a cpu consumer?
Clients always want to be able to change the content of their pages, but they are unwilling to do so.

Have you ever coded in your underwear before?
Reply
#4
Hey there,

Load performance seems to be a breeze. I tested it with a bunch of files with over 10.000 words each (60KB XML's)....

Time consumed:
This page was created in 0.0155098438263 seconds

Currently I got 2 implementation going. One based on SimpleXML and another once using pure regex....and so far the "cleaner" SimpleXML solution seems to be faster.

For a quick and dirty search this seems to be OK...there are no indexes generated etc. but I figure if it really does get to big, one should slap Lucene in there.
Reply
#5
Hi nexflo,

Would like to share this plug in ? Can I try ?

Regards..

Ugur Onur
Reply
#6
а где собственно сам плагин?
Reply
#7
As a few people have asked for it..im releasing the current version of the search plugin.

To install create a new template (preferably the template.php) and name it serp.php (For Search-Engine-results-Page)...just below the "get_page_content" tag add.

Code:
<?php search_show(true); ?>

This is were the search-results are going to be displayed...
Also create a page in the backend using this template and entitle it serp.

Create a compontent entitled "search" which includes the search field:
Code:
<form action="#" id="frm_search" method="get">
<input type="hidden" id="frm_txt_search" name="id" value="serp" /></span>

<div>
<label for="frm_txt_search">Search:</label>
<input type="text" id="frm_txt_search" name="s" value="" /></span>
<input type="submit" class="submit"  id="button" value="Search" />
</div>
</form>

This compontent you can add anywhere..preferable in the sidebar or top-right in your header

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

Thats it!

Its very rough but should work for simple things, file is attached in first post and kept up-to-date there.

Test and do give feedback.


Future functions might include:

- Templating for serp
- Choosing type of search. Right now uses PHP-Native function stripos. Regex support (tested and was slower). Lucene support.
- Cachable results
Reply
#8
whether it is possible to create all the files and write more precisely where and what to post?
I do not understand in PHP
Reply
#9
Works a treat - thanks for the upload & sharing Smile
Reply
#10
installed, it works, thanks
Reply
#11
why there are now searching for such things? translation of Google
�
Reply
#12
Make sure all files are UTF-8
Reply
#13
fails, the entire character set has changed, sometimes all the same appears at the end and beginning of the line
Reply
#14
not quite sure what u're trying to say...maybe copy+paste youre error here?
Reply
#15
perhaps because it does not always appear
Reply
#16
thanx alot .......
Reply
#17
Is there a way to alter the size of the search box?

Thanks.

homershines
Reply
#18
For russian

Плагин для поиска для cms get-simple gs_search.php

1. Распаковываем архив в папку plugins в корне сайта
2. создаем в папке theme новый шаблон под названием serp.php (лучше всего копируем и переименовываем старый)
в шаблоне ниже <?php get_page_content(); ?>
добавляем <?php search_show(true); ?>

3. Теперь заходим в админку и создаем страницу под названием Поиск на сайте с постоянной ссылкой serp основанную на созданном только что шаблоне, не забываем, что шаблон serp.php

4. переходим в админке шаблоны и создаем компонент search со следующим текстом

<form action="#" id="frm_search" method="get">
<input type="hidden" id="frm_txt_search" name="id" value="serp" /></span>

<div>
<label for="frm_txt_search">Поиск на сайте:</label>
<input type="text" id="frm_txt_search" name="s" value="" /></span>
<input type="submit" class="submit" id="button" value="Искать" />
</div>
</form>

5. осталось нажать редактировать тему и вставить в текущий шаблон в нужное место <?php get_component('search'); ?>

Примечание: пока выдает квадратики в тексте, буду разбираться почему.
Пример сайта: Змея.ру
Reply
#19
квадратики в тексте я так и не смог убрать поэтому сделал маскировку

точно также пришлось сделать и с плагином сухарей
можешь скачать все русифицированные плагины

а вообще-то здесь принято общаться на английском, переводи гуглем - фразы попроще делай
Reply
#20
for friendly URL need
Code:
$outputlist .= '<li><a href="'.$SITEURL.'/index.php?id='.$data->url.'" />'.$data->title.'</a><br />'.$resbev.'<span class="hilite"> '.$needle . ' </span>'.$resaft.'... <br /><br /></li>';
Replace
Code:
$outputlist .= '<li><a href="'.$SITEURL.$data->url.'" />'.$data->title.'</a><br />'.$resbev.'<span class="hilite"> '.$needle . ' </span>'.$resaft.'... <br /><br /></li>';
Cut .'/index.php?id='
good plugin collection

Олег, просто плагин поиска необходим, а если писать на английском не все найдут. Спасибо за подборку, буду разбираться.
Кстати ссылки поиск формирует не верные, чпу не получается, чтобы индексация была верной, если вдруг страницы попадут в поиск нужно
Строку в плагине
Code:
$outputlist .= '<li><a href="'.$SITEURL.'/index.php?id='.$data->url.'" />'.$data->title.'</a><br />'.$resbev.'<span class="hilite"> '.$needle . ' </span>'.$resaft.'... <br /><br /></li>';
Заменить на
Code:
$outputlist .= '<li><a href="'.$SITEURL.$data->url.'" />'.$data->title.'</a><br />'.$resbev.'<span class="hilite"> '.$needle . ' </span>'.$resaft.'... <br /><br /></li>';
Вырезали .'/index.php?id='
Reply
#21
да, действительно, а я как-то и внимание не обратил, наверное потому, что там по умолчанию не стоит Fancy URLs, спасибо
Reply
#22
This plugin works well. Thanks!
Clients always want to be able to change the content of their pages, but they are unwilling to do so.

Have you ever coded in your underwear before?
Reply
#23
Oleg06 Wrote:why there are now searching for such things? translation of Google
�
Modifed plugin by n-professor & seo
New:
1) Valid Search for other languages (utf-8)
2) remove �
3) сorrect backlighting

Demo: змея.ру
Reply
#24
пару раз все-таки вылезло нечто - t;p>, и что-то еще
Reply
#25
Oleg06 Wrote:пару раз все-таки вылезло нечто - t;p>, и что-то еще
Если включаем обработку, скорость падает в разы, а так из-за картинок происходит.

now This page was created in 0.00542998313904 seconds
If processing reduces the speed of the script
This page will be created in 0.02 seconds

При тестировании определено, что максимум поиск предназначен для 500-600 страниц, при большем количестве нагрузка не сервер становится очень большой, скорость генерации страницы более секунды, загрузка процессора при одном запросе до 3 процентов, 3 мб памяти.

This plugin may be search maximum in 500-600 pages, if more pages might critical for hosting plan (search more than 1 seconds, 3% processor time, 3 mb memory)
Reply




Users browsing this thread: 1 Guest(s)