[Plugin] Advanced Search

« HitCounter :: Most Popular Posts from all blog IDs and others »
Author Message
sam2kb
Posted: Tue May 20, 2008 16:19     Topic subject: [Plugin] Advanced Search

[url=http://b2evo.sonorth.com/show.php/advanced-search-widget]Read in Russian / Русская страница плагина[/url]

Replace a standard search widget with Advanced Search and you will be able to filter results by blog, category, post author and date. Search in all public blogs at the same time.
You can also remove any/all radio buttons from search form, display results in google-like style with highlighted keywords and customize almost everything. Smart search filters out false positive results present in default search function.

[url=http://www.sonorth.com/travel/download/TTG1T1WBXC]Download v1.7.0[/url] for b2evo v4.1 and newer
[url=http://www.sonorth.com/travel/download/JU271ELYHR]Download v1.6[/url] legacy version for b2evo < 4.1

[url=http://b2evo.sonorth.com/show.php?s=blog+post&sentence=OR]Demo[/url]

Read the README.html before posting your questions!

http://b2evo.sonorth.com/media/images/6.JPG

http://b2evo.sonorth.com/media/images/5.JPG

Back to top
 
afwas
Posted: Tue May 20, 2008 16:56

Very good widget.

May I suggest one thing?
You may want to expand it a little if you add a widget setting to include other blogs, like all blogs from this owner or some defined public blogs or something.

Do subscribe it to BOPIT (contact ¥åßßå for that), add yourself to Sourceforge evocms-plugins (contact blueyed for that).

Thanks

Back to top
 
tilqicom
Posted: Tue May 20, 2008 17:00

additional options are just great! (: the default search widget must also include those instead of hacking..as those 'any' 'any or' etc words doesn't look nice,

Back to top
 
sam2kb
Posted: Tue May 20, 2008 17:06

Thanks

I'll try to add an option to include other blogs.
I already have BOPIT access, will ask about Sourceforge later today.

Back to top
 
yabba
Posted: Tue May 20, 2008 18:22

That reminds me, I must upload the audio player plugin, complete with russian locale ( thanks ;) ), and amend BOPIT ;)

¥

*edit*
Assuming your checkboxes == "hide this option", if you uncheck all 3 then evo will default o .... whatever it defaults to ..... you might like to change that to "if only 1 ticked then hide them all and add the ticked option as a hidden input", then users can select there own "default" action ;)

Back to top
 
sam2kb
Posted: Tue May 20, 2008 23:38

you might like to change that to "if only 1 ticked then hide them all and add the ticked option as a hidden input", then users can select there own "default" action

In TODO list ;)

Back to top
 
tilqicom
Posted: Wed May 21, 2008 08:58

it's getting better and better (:, just a small detail; it'd be good if you could add an indicator like a + and - for main and child categories, or arrange the font size a bit

Back to top
 
sam2kb
Posted: Wed May 21, 2008 10:39

Why don't you like a double space padding ;) ?

I'm now trying to figure out how to include posts from other blogs. And I also want to add a date field.

Back to top
 
tilqicom
Posted: Wed May 21, 2008 10:52

sam2kb wrote:

Why don't you like a double space padding ;) ?

I'm now trying to figure out how to include posts from other blogs. And I also want to add a date field.

double space is also fine, it can be modified easily, i suppose, i didnt try.. but + - is better trust me : P
yea that would be good, i dont have such a problem since i have an aggregated one : P, but the date field idea is just great.. afaik, search between dates function always put some heavy weight on the servers in common it would be very cool though ;)

Back to top
 
sam2kb
Posted: Wed May 21, 2008 11:00

Do you mean something like this?

Code

+ Main
  - Sub
  - Sub
  + Main Sub
    - Sub Sub

It takes a lot of space, but I'll try it after/if I make a search by blog thing.

Back to top
 
tilqicom
Posted: Wed May 21, 2008 11:11

sam2kb wrote:

Do you mean something like this?

Code

+ Main
  - Sub
  - Sub
  + Main Sub
    - Sub Sub

yep that's it, it's cool this way too, no worries ;)

Back to top
 
sam2kb
Posted: Wed May 21, 2008 13:03

Updated again :)

Back to top
 
edb
Posted: Fri May 23, 2008 17:20

Wonderful! I was going to start hacking all the widgets that (a) are lame and (b) are self contained but now even if search widget meets these criteria (and it certainly meets the first!) I don't have to touch it.

Hooray for smart search options!

Back to top
 
tilqicom
Posted: Sun May 25, 2008 01:09

this is very cool, i can now simply add a search area consisting of only search button and text field ;) i am looking forward to date search func.

and Ed hey, if you want to update a lame widget, i d like to see a better online list too (: like online members, staff or showing user groups and how many user online on each group etc..

Back to top
 
ferevo
Posted: Thu Jun 19, 2008 10:27

I would like to know if I can use this plugin 'advanced search' with pagination and how.

Many thanks

Back to top
 
tilqicom
Posted: Thu Jun 19, 2008 17:40

ferevo wrote:

I would like to know if I can use this plugin 'advanced search' with pagination and how.

Many thanks

what do you mean pagination ? in every page of a post , or in every page of the blog ?

in both case, you will simply have to add a container where you want the widget to be displayed and insert the widget in that container

Back to top
 
ferevo
Posted: Sat Jun 21, 2008 17:36

What I mean about pagination is that this version(0.4) displays the first 50 posts only because it cannot follow page links. is there any way to solve this problem? I would like to show the first 10 posts and the use page links for the rest .

Back to top
 
sam2kb
Posted: Sat Jun 21, 2008 19:41

You can change 50 to 10 if you want so, but it won't follow page links anyway.

is there any way to solve this problem?

Not in this version of plugin :(

Back to top
 
sam2kb
Posted: Sun Jun 29, 2008 07:40

Plugin updated. No new features added, only bug fixes.

Back to top
 
topanga
Posted: Sun Jun 29, 2008 13:53

a nice feature would be : don't display all the 'options' in the front, just 'do them' as the admin choose in the backoffice
that way you can have a very clean searchbox with 1 button 'go' (a css desingable button offcourse)

Back to top
 
tilqicom
Posted: Sun Jun 29, 2008 14:29

Topanga wrote:

a nice feature would be : don't display all the 'options' in the front, just 'do them' as the admin choose in the backoffice
that way you can have a very clean searchbox with 1 button 'go' (a css desingable button offcourse)

tilqicom wrote:

this is very cool, i can now simply add a search area consisting of only search button and text field

;)

Back to top
 
sam2kb
Posted: Sun Jun 29, 2008 20:32

that way you can have a very clean searchbox with 1 button 'go' (a css desingable button offcourse)

This is how it works, just untick all "display" boxes and you'll get a searchbox with 1 button 'go'.

Back to top
 
yellowlightman
Posted: Sat Aug 16, 2008 13:15

Is there a way to display this widget outside of a widget array?

Also, is it possible to replace the Search button with a graphic or something instead?

Back to top
 
sam2kb
Posted: Sat Aug 16, 2008 15:24

You can use this code in skin

PHP

// --------------------------------- START OF SEARCH FORM --------------------------------
// Call the coll_search_form widget:
    $Plugins->call_by_code'advanced_search'array(    // Params follow:
        'block_start'        => '<div class="bSideItem widget_plugin_advanced_search">',
        'block_end'            => '</div>',
        'block_title_start' => '<h3 class="sideItemTitle">',
        'block_title_end'    => '</h3>',
        'search_title'        => T_('Search'),
        'search_button'        => T_('Search'),
        'in_category'        => T_('In category'),
        'by_author'            => T_('Author'),
        'in_blogs'            => NULL,
        'category_exclude'    => NULL,
        'search_cat'        => true,
        'search_author'        => true,
        'search_all'        => true,
        'search_some'        => true,
        'search_phrase'        => true,        
    ) );
// ---------------------------------- END OF SEARCH FORM ---------------------------------
Back to top
 
sam2kb
Posted: Sat Aug 16, 2008 15:34

Add this class to styles.css to show the button background image

Code

.widget_plugin_advanced_search input.search_submit
{ background: url(img/my_image.gif) no-repeat top left; padding:3px 20px }
Back to top
 
yabba
Posted: Sat Aug 16, 2008 18:02

I may be bollocks wrong, but I seem to recall that you can also do

PHP

SkinWidgetwidget_codeparam array );

¥

Back to top
 
sam2kb
Posted: Sun Aug 17, 2008 01:01

This code doesn't work, it returns "Invalid widget code provided"

PHP

skin_widgetarray(
    // CODE for the widget:
    'widget'        => 'advanced_search',
));
Back to top
 
tilqicom
Posted: Fri Aug 22, 2008 08:24

hi sam2kb, would you think of implementing sth like [url=http://b2evo.astonishme.co.uk/plugins.php?s=am_search]Search Highlight II v. 2.3 by ¥åßßå [/url] into this plugin, and oh btw, i remember you mentioning search between dates thing, is it doable yet

Back to top
 
sam2kb
Posted: Fri Aug 22, 2008 15:57

Search Highlight doesn't work with Russian text, it was reported to ¥åßßå some time ago ;)

I'm working on search by year/month thing now.

Back to top
 
yabba
Posted: Fri Aug 22, 2008 16:55

sam2kb wrote:

Search Highlight doesn't work with Russian text, it was reported to ¥åßßå some time ago ;)

Bugger, I keep forgettin' to try and fix that :p

¥

Back to top
 
sam2kb
Posted: Fri Aug 22, 2008 20:57

Plugin updated :)
Added search by month/year option.

Back to top
 
sam2kb
Posted: Fri Aug 29, 2008 06:43

Plugin updated
New million-dollar features ;)

Results displayed in google-like style
Paginate results
Highlight keywords

[url=http://ru.b2evo.net/show.php?s=%D0%BF%D0%BB%D0%B0%D0%B3%D0%B8%D0%BD&sentence=sentence]Demo[/url]

Back to top
 
sam2kb
Posted: Sun Nov 2, 2008 01:15

Plugin updated

Highlight keywords in full posts mode (b2evo default)
Code cleanup

Back to top
 
tilqicom
Posted: Sun Nov 2, 2008 03:49

sam2kb wrote:

Plugin updated

Highlight keywords in full posts mode (b2evo default)
Code cleanup

thanks for the update.. but after updating the search still does not highlight the retrieved results ..give it a shot [url=http://www.tilqi.com/anasayfa.php?s=hitler]here[/url] did i have to do anything further else than updating the plugin ?

Back to top
 
sam2kb
Posted: Sun Nov 2, 2008 04:11

Go to plugin settings and click "Restore defaults"

The plugin didn't use rendering functions before, but now it does and you have to manually set Apply rendering to "stealth" or simply Restore defaults.

Back to top
 
tilqicom
Posted: Sun Nov 2, 2008 04:34

sam2kb wrote:

The plugin didn't use rendering functions before, but now it does and you have to manually set Apply rendering to "stealth" or simply Restore defaults.

i did. nothing changed :/

Back to top
 
sam2kb
Posted: Sun Nov 2, 2008 04:39

Well... it works, but not exactly how it supposed to :( http://www.tilqi.com/anasayfa.php?s=hitler&highlight=sabotaj

Let me check it...

Back to top
 
sam2kb
Posted: Sun Nov 2, 2008 04:42

It works good, but it doesn't highlight post titles http://www.tilqi.com/anasayfa.php?s=budur.

I'm now fixing it

Back to top
 
sam2kb
Posted: Sun Nov 2, 2008 05:36

There's no way to highlight post title.

Back to top
 
tilqicom
Posted: Sun Nov 2, 2008 14:41

sam2kb wrote:

There's no way to highlight post title.

it does not highlight the post content either it seems

Back to top
 
sam2kb
Posted: Sun Nov 2, 2008 18:48

Check this link http://www.tilqi.com/anasayfa.php?s=i%C3%A7in

Your posts have 2-3 pages, if you don't see highlighted text on some posts it means the word(s) is on the other page.

BTW why don't you want to display results in google-like style, this is the main plugin's feature which you don't use :)

Back to top
 
tilqicom
Posted: Sun Nov 2, 2008 19:37

sam2kb wrote:

Check this link http://www.tilqi.com/anasayfa.php?s=i%C3%A7in

Your posts have 2-3 pages, if you don't see highlighted text on some posts it means the word(s) is on the other page.

BTW why don't you want to display results in google-like style, this is the main plugin's feature which you don't use :)

aah i see, i kept trying keywords in the titles.. it'd be better if it could highlight titles and tags, i mean almost anywhere, wherever the term was used..
¥åßßå's plugin is very cool actually and does not clash with yours, it d be great if it didnt have that special character problem..

Back to top
 
sam2kb
Posted: Sun Nov 2, 2008 19:59

aah i see, i kept trying keywords in the titles.. it'd be better if it could highlight titles and tags, i mean almost anywhere, wherever the term was used..

- It highlights titles when displaying in "compact" mode (you don't use it).
- It's not possible to highlight titles in "full posts" mode without hacking skin files
- It doesn't search/highlight tags and it's not possible without hacking core files or rewriting search functions.

Back to top
 
blogmeister
Posted: Sun Nov 16, 2008 07:26

Hello.

I just installed this plugin as it looks really neat.

How can I restrict certain authors from being searched, starting with demouser? :?:

Thanks.

Back to top
 
sam2kb
Posted: Sun Nov 16, 2008 07:36

Edit the following on line 370, list user IDs.

PHP

foreach( $UserCache->cache as $loop_Obj )
{
    switch( $loop_Obj->ID )
    {
        case 2:
        case 14:
        case 23:
            continue;
            break;
    }
Back to top
 
blogmeister
Posted: Sun Nov 16, 2008 08:05

Thanks for your reply, sam2kb.

I just did a search for 'templates' as an example whereby the only public blogs are demo Blog A and Blog B.

I noticed the URL (not live) at the end of the one result found, that due to its length, it overlapped the right column in FF 2.0.x but not in IE 6 nor IE 7.

Is there a way to force word-wrapping at a certain# of characters? :?:

Thanks again in advance.

Back to top
 
blogmeister
Posted: Sun Nov 16, 2008 08:48

sam2kb wrote:

Edit the following on line 370, list user IDs.

PHP

foreach( $UserCache->cache as $loop_Obj )
{
    switch( $loop_Obj->ID )
    {
        case 2:
        case 14:
        case 23:
            continue;
            break;
    }

Hi again.

While awaiting your reply from my last post, I tried the code for excluding users (authors). I haven't gotten it to work. :?:

As a test, I added 'case 1' so no admin posts would be found. They were still found. This is the code I used:

PHP

foreach( $UserCache->cache as $loop_Obj )
                    {
// case 2 (demouser)
            switch( $loop_Obj->ID )
            {
                case 1:
                    continue;
                    break;
            }
                        echo '<option value="'.$loop_Obj->ID.'">';
 
 
etc...

Also, I'd like to exclude that author from being shown in the dropdown box (list). Will the code revision accomplish that, too? :?:

Thanks again in advance.

Back to top
 
sam2kb
Posted: Sun Nov 16, 2008 17:47

I didn't test it yet, but the code I wrote above should exclude the author from dropdown menu.
I'm gonna work on it today.

Back to top
 
sam2kb
Posted: Mon Nov 17, 2008 04:29

Plugin updated
New: Exclude post authors

@blogmeister
To wrap the link open plugins/advanced_search_plugin/inc/_adv_search.disp.php on line 47 and change the number of characters from 250 to whatever you need.
You can also try to play with CSS in plugins/advanced_search_plugin/adv_search.css

Good luck

Back to top
 
blogmeister
Posted: Tue Nov 18, 2008 10:12

Thanks for your reply and the update, sam2kb.

I should (hopefully) install this tonight.

One thing I thought of after my last reply was that I plan on having multiple blogs and multiple bloggers.

If, from time to time, any of the bloggers want to exclude an author(s) from their blog's 'Advanced Search,' I'd really prefer it be done via the Admin interface versus them contacting me to modify the code for each instance.

Granted, I am not sure how you updated the plugin; I assume it is via adding a new 'case' or similar via editing the code as you mentioned previously.

I'll check out what you have tonight.

Thanks again as this is an nice plugin.

Back to top
 
blogmeister
Posted: Wed Nov 19, 2008 05:34

blogmeister wrote:

Thanks for your reply and the update, sam2kb.

I should (hopefully) install this tonight.

One thing I thought of after my last reply was that I plan on having multiple blogs and multiple bloggers.

If, from time to time, any of the bloggers want to exclude an author(s) from their blog's 'Advanced Search,' I'd really prefer it be done via the Admin interface versus them contacting me to modify the code for each instance.

Granted, I am not sure how you updated the plugin; I assume it is via adding a new 'case' or similar via editing the code as you mentioned previously.

I'll check out what you have tonight.

Thanks again as this is an nice plugin.

Wow, sam2kb - you're pro-active and/or psychic!

It is so convenient now to designate the authors to exclude via the Admin interface! Thanks for that.

One thing though - even though the author is excluded from the dropdown list, searching authors with 'All' still shows the excluded author's posts in the results listing.

I'm still in the Demo mode so I excluded the 'admin' or user ID#1 in the plugin's params. The 'admin' was excluded from the dropdown list so I kept the default 'All' for the authors, but all of the admin's posts were found in the results.

It's getting there, though. I like it.

Thanks.

Back to top
 
sam2kb
Posted: Wed Nov 19, 2008 06:24

There's no easy way to exclude some authors when search within "All" without hacking the core.
I'll probably rewrite the search function some day.

Back to top
 
blogmeister
Posted: Wed Nov 19, 2008 06:40

Thanks.

When you rewrite it, I'll try to be one of the first in line for it.

Take care.

Back to top
 
blogmeister
Posted: Thu Jan 29, 2009 03:54

Hello.

I'm using this plugin and just noticed that upon performing a search, when the results are displayed, in addition to the current blog's highlighted post dates, the calendar also then highlights a date on the calendar not belonging to the blog the search is performed in, but from one of the other public blogs.

When clicking on that highlighted date, the results say, 'Sorry, there is nothing to display...'. This behavior is also seen even when the blog results includes a post from that other blog posted on that day.

What might be the purpose of this? :?:

Thanks in advance.

Back to top
 
sam2kb
Posted: Thu Jan 29, 2009 04:19

Can you please give a link, it's hard to me to figure it out.

Back to top
 
blogmeister
Posted: Thu Jan 29, 2009 06:02

Thanks for your reply, sam2kb.

I'll PM it to you as it is not yet 'Live'.

Back to top
 
blogmeister
Posted: Tue Feb 17, 2009 03:10

Hello sam2kb.

I created a 'FAQ' and plan to create more 'Page' post types.

How can the search incorporate 'pages'?

Thanks.

Back to top
 
sam2kb
Posted: Tue Feb 17, 2009 03:21

Edit the following in inc/items/model/_item.funcs.php #58

PHP

if( $disp == 'page' )
{    // Get  pages:
    $MainList->set_default_filtersarray(
            'types' => '1000',        // pages
        ) );
}
 
if( $disp == 'posts' && param's''string' ) )
{
    $MainList->set_default_filtersarray(
            'types' => NULL,        // All types
        ) );
}

Good luck

Back to top
 
blogmeister
Posted: Tue Feb 17, 2009 03:56

Thanks!

Back to top
 
bobzarzal
Posted: Fri Apr 24, 2009 00:49

i just installed this plugin, looks great, thanks!

with it placed within my sidebar, the drop down fields run off the sidebar and disappear.... is there any way to make the drop downs shorter in width? is this what blogmeister was referring to with word-wrapping?

Is there a way to force word-wrapping at a certain# of characters?
Thanks again in advance.

@blogmeister
To wrap the link open plugins/advanced_search_plugin/inc/_adv_search.disp.php on line 47 and change the number of characters from 250 to whatever you need.
You can also try to play with CSS in plugins/advanced_search_plugin/adv_search.css

Good luck

i adjusted this, and changed 250 to 25, but it doesn't seem to have had any effect.

also, is there a way to change the text "root site" to categories or something else?

here's a [url=http://shitledger.com]link[/url]

Back to top
 
afwas
Posted: Fri Apr 24, 2009 03:32

in /skins/miami_blue/style.css add:

PHP

#cat {
width180px;
}
.input select{
width180 px;
}

The first one will work, pray for the second one.
@sam2kb: pls add an id at <select name="author">

Good luck

Back to top
 
bobzarzal
Posted: Sat Apr 25, 2009 01:48

i couldn't find the #cat any where in the file, but what i did find was this:

.bSideBar {
margin: 0;
padding: 57px 0 0 0;
width: 204px;
float: right;
overflow: visible;
background-image: url(img/right_col.gif);
background-repeat: no-repeat;
background-position: right top;

i changed the width from 204 to 259 and the entire sidebar disappeared! then i tried changing overflow from hidden to visible, which also caused the sidebar to disappear. any ideas?

also, anyone know how to get rid of the text, "root site" in the category drop down?

Back to top
 
afwas
Posted: Sun Apr 26, 2009 15:09

Hi bobzarzal,

You need to add #cat ;)

Good luck

Back to top
 
sam2kb
Posted: Sun Apr 26, 2009 17:49

also, is there a way to change the text "root site" to categories or something else?

There's no easy way to change it :( but you can remove this option by changing 'true' to 'false' in the following code around the line 300

PHP

/*
 * Categories:
 */
if( $params['search_cat'] )
{
    $ChapterCache = & get_Cache'ChapterCache' );
    
    $Form->select_input_options(
            'cat',
            $ChapterCache->recurse_selectNULL$Blog->IDfalseNULL1$category_exclude ),
            $params['in_category']
        );
}
Back to top
 
sam2kb
Posted: Sun Apr 26, 2009 17:59

You should better create a standalone search page and put the widget there.
I don't think you can cut categories or authors names, you can probably change the font size but this is not a good idea.

Back to top
 
frsurfer
Posted: Fri May 8, 2009 12:48

My b2evolution Version: Not Entered

Hi,

B2 2.4.6

I've set my blog to display 1 page at a time, full posts no excerpts.

Now, I would like the search function to only display a clickable list of results, not the full posts or pages one by one.

Any clue?

Back to top
 
sam2kb
Posted: Fri May 8, 2009 13:32
Back to top
 
frsurfer
Posted: Fri May 8, 2009 14:19

Thanks!

But this plugin isn't flawless...

If the searched word appear in an <IMG SRC="....THE_WORD..." /> tag, then the picture isn't displayed, plus the source name is partially displayed up to the "/>"

If the search word appears in a menu item, the menu css is destroyed too.

And finally, the full post is displayed, not a list.
And if more than 1 post, then a seamingly endless page is displayed!

Too bad!

Suggestion: To display the page title (clickable to go to the full post), plus say 50 words before and after the 1st occurence of searched word.

Back to top
 
sam2kb
Posted: Fri May 8, 2009 14:29

If the searched word appear in an <IMG SRC="....THE_WORD..." /> tag, then the picture isn't displayed, plus the source name is partially displayed up to the "/>"

This is how it's implemented in b2evo core. The development plugin version searches rendered content (no html tags). I'm still working on it.

If the search word appears in a menu item, the menu css is destroyed too.

What menu are you talking about? It only searches posts.

And finally, the full post is displayed, not a list.
And if more than 1 post, then a seamingly endless page is displayed!

Read the readme.html

Suggestion: To display the page title (clickable to go to the full post), plus say 50 words before and after the 1st occurence of searched word.

Read the readme.html

Back to top
 
frsurfer
Posted: Fri May 8, 2009 14:42

...Rendered content...
That would be nice. Put me on your beta testers please :-)

Quote: "What menu..."

Not a B2 menu, but a <UL><LI> list of mine that my css renders as an extra horizontal menu...

Not that display is also destroyed, alas.

Back to top
 
frsurfer
Posted: Fri May 8, 2009 14:48

Full post displayed...

My bad, sorry! I just forgot to edit the post_main.php.

Now its fine and there are no pictures displayed within the list.

You are just GREAT man :-)

Back to top
 
sam2kb
Posted: Fri May 8, 2009 15:09

frsurfer wrote:

Not a B2 menu, but a <UL><LI> list of mine that my css renders as an extra horizontal menu...

Not that display is also destroyed, alas.

The plugin highlights and destroys html tags.

If you search for "green" the following code

Code

<li class="green">text</li>

becomes

Code

<li class="<span class="highlited_words">green</span>">text</li>

Put me on your beta testers please :-)

It still has some bloats, just watch the plugin's topic, I post updates there. BTW you can try a dev version [url=http://www.sonorth.com/travel/tours/?types=&s=garden&locale=en-US]here[/url]

Back to top
 
frsurfer
Posted: Fri May 8, 2009 15:13

Search submit button display:

I've not found any line in the .css file to fine-tune how the submit button should be displayed.

I mean I want it with a border, grey background, cursor "hand" for example.

Can you tell me the way please?

Back to top
 
frsurfer
Posted: Fri May 8, 2009 15:16

Besides, can you give a date for the finam version, that won't search the links or picture titles?

Back to top
 
edb
Posted: Fri May 8, 2009 15:22

scuse me, but could y'all please move plugin-associated discussion to the plugin's thread?

Back to top
 
sam2kb
Posted: Fri May 8, 2009 15:23

I've not found any line in the .css file to fine-tune how the submit button should be displayed.

Add the following in adv_search.css

Code

.widget_plugin_advanced_search .search_submit { border:2px #099 solid }

Besides, can you give a date for the final version, that won't search the links or picture titles?

Some day B)
I'm currently working on another 2 huge plugins and don't have time for this one.

Back to top
 
frsurfer
Posted: Fri May 8, 2009 15:42

Thanks.

I've tryed .input:submit, also tried several other combinations, but couldn't "invent" that very one .search_submit ! LOL

Back to top
 
esanchez
Posted: Thu Jul 9, 2009 06:03

are there any updates on this plugin? I'd like to give it a try. Google XHTML and Dynamic thing is crappy.

Back to top
 
sam2kb
Posted: Thu Jul 9, 2009 07:01

The current version works pretty well.

Back to top
 
esanchez
Posted: Sat Jul 11, 2009 06:20

Great stuff. I enabled it on our blog.

By the default - I would suggest having the single search box (like google).

i love the highlighting of the searched terms.

I would also add the class statements on the actual inputs so it's easier to find them in the css or rename them to match your own.

I also switched the search text box to be inline with the search button.

Thanks. <this should be the default search engine in b2evo 3.2..

Back to top
 
sam2kb
Posted: Sat Jul 11, 2009 06:39

Thanks for the feedback.
You still don't use the main feature "google-like styled results".

this should be the default search engine in b2evo 3.2

Well, it's still far from what I'd like it to be.

Back to top
 
esanchez
Posted: Sat Jul 11, 2009 06:58

You still don't use the main feature "google-like styled results".

I just saw that in your blog. Yeah those google like results look great. how do I enable them?

I'm reading the thread here in the meantime... the readme.html file seems a bit out of date or my skin doesn't have the " MESSAGES GENERATED FROM ACTIONS" section.

Back to top
 
sam2kb
Posted: Sat Jul 11, 2009 07:06

I'm reading the thread here in the meantime... the readme.html file seems a bit out of date or my skin doesn't have the " MESSAGES GENERATED FROM ACTIONS" section.

Any skin must have this code. It's between the lines 92-97 in original integral skin.

EDIT: I guess you already figured it out...

Back to top
 
esanchez
Posted: Sat Jul 11, 2009 07:09

yeah, sorry - I forgot I got fancy and separated my skin main.index into a couple of 'php' files.

i have the results looking like google now - except that when I click on them i get an error.

Seems like the link is constructed as:
?blog=6?highlight=st.+augustine and the question mark before highlight is throwing it off.

http://www.thechristianalert.org/index.php/2005/10/15/were_the_u_s_founding_fathers_christian_7?blog=6?highlight=st.+augustine

So that you know - I'm actually not using it as a widget. I enabled the widget and then cut the HTML and hard coded that into my skin. Perhaps this is throwing it off

EDIT: I fixed this error by going to Blog Settings and Choosing the :
"Extra path Option" so it shows index.php/BlogName instead of index.php?blog=5

Now I'm in business. thanks.

Back to top
 
edb
Posted: Sat Jul 11, 2009 07:18

Must have that bit? Seems totally optional to me because I really don't care if a visitor ever sees a comment saying they submitted a comment, and I tend to know if I just edited a post or not.

Oh wait a minute ... Searching would be an action, so of course it needs a place to put a message from that action. Too bad. Does the core search feature do it that way? I've no idea of how the guts of this thing or core search works, but in my mind a unique disp value would be way better. Except that probably takes modifying files. Unless advanced search replaces core search :) Not many plugins exist that should move from hooks to the core. This is most certainly one of 'em :D

Back to top
 
sam2kb
Posted: Sat Jul 11, 2009 07:43

@esanchez

Cool, you found a bug ;) To fix it replace the following in advanced_search_plugin/inc/_adv_search.disp.php

PHP

echo '<a href="'.$Item->get_permanent_url().'?highlight='.urlencode($s).'" rel="nofollow">'.$title.'</a>';

with

PHP

echo '<a href="'.url_add_param$Item->get_permanent_url(), 'highlight='.urlencode($s) ).'" rel="nofollow">'.$title.'</a>';

Oh wait a minute ... Searching would be an action, so of course it needs a place to put a message from that action. Too bad. Does the core search feature do it that way?

It doesn't rely on "actions", it's just a marker for users, since the messages code is included in all submitted skins.

Unless advanced search replaces core search Smile Not many plugins exist that should move from hooks to the core. This is most certainly one of 'em

Thanks, but first I have to finish the version which searches in [u]rendered[/u] content.

Back to top
 
edb
Posted: Sat Jul 11, 2009 07:51

Wow that'd be neat - searching through rendered stuff.

Hey not to go too far off topic in a six-page thread, but I can't for the life of me think of another plugin that would be good to replace core features. The new core avatars is junk and should be removed because it is a trinket that should only be a plugin. BOPIT should be core but doesn't replace something. All the various bits like Yahoo and the like should be removed and replaced with a profile hook. But what plugin other than this replaces a core function that (a) should be a core feature and (b) does it way better than the core?

Back to top
 
sam2kb
Posted: Sun Jul 12, 2009 09:34

Plugin updated to v1.1

Lots of bug fixes, now doesn't highlight/break HTML tags

Back to top
 
esanchez
Posted: Tue Jul 14, 2009 03:42

thanks. I got mine updated. like I said before. this should come standard w/ b2evo 3.x. It's a beautiful piece of code.

Back to top
 
sam2kb
Posted: Tue Jul 14, 2009 04:26

Plugin updated to v1.5 ;)

New: Precise search (optional). If enabled, the plugin will search through [u]rendered[/u] content, and [u]outside[/u] of HTML tags only. This means that a lot of false positive results will be filtered out.
New: Search by post type (Post, Page, Podcast etc.)
Fixed: Widget "remembers" selected search params
Fixed: Works in b2evo 3.x

Back to top
 
chrissie1
Posted: Fri Jul 24, 2009 23:39

I found a bug in the paging of this plugin and a fix.

in the disp file change

Code

$adv_MainList->page_links( array(
        'block_start' => '<div class="BlUeBaR">'.$this->T_('Pages:').' ',
        'block_end'   => '</div>',
      ) );

to

Code

$adv_MainList->page_links( array(
        'block_start' => '<div class="BlUeBaR">'.$this->T_('Pages:').' ',
        'block_end'   => '</div>',
        'page_url' => url_add_param( $url, 'highlight='.urlencode($this->search_terms).'&amp;sentence='.$this->search_mode ),
      ) );
Back to top
 
sam2kb
Posted: Sat Jul 25, 2009 07:40

And then all pages will link to the latest displayed post ;)

We don't need to specify custom 'page_url', default $ReqHost.$ReqPath works perfect.

Didn't it work in your case?

Back to top
 
chrissie1
Posted: Sat Jul 25, 2009 08:43

nope it didn't work in my case. it gave a page cannot be found message when clicked on the pages.

With the previous method I got this url after searching.

index.php/All/?s=sql+dates&advm=&advy=&author=&sentence=AND

this brought me to the first page and gives 3 pages

when clicking on the page 2 link I get the Sorry, there is nothing to display...
with this url

/index.php/All/?blog=7&s=sql dates&paged=2

now with this little change (no longer the url of the last displayed post ;-), oops)

Code

global $Blog;
    
    $adv_MainList->page_links( array(
        'block_start' => '<div class="BlUeBaR">'.$this->T_('Pages:').' ',
        'block_end'   => '</div>',
        'page_url' => url_add_param( $Blog->get('url'), 'highlight='.urlencode($this->search_terms).'&amp;sentence='.$this->search_mode ),
      ) );

it does work corerctly

with this as the url.

index.php/All/?highlight=sql+dates&sentence=AND&blog=7&s=sql dates&paged=2

something must be causing this because on my dev server I don't have this problem only on prod.

I tried and if the sentence=AND is missing from the url than that is the cause not sure why it is missing when leaving out the page_url.

Back to top
 
sam2kb
Posted: Sat Jul 25, 2009 09:02

Try this, you don't need to add any params to URL

PHP

'page_url' => $Blog->gen_blogurl(),

Also I got an error saying "Fatal error: Allowed memory size of 16777216 bytes exhausted" which means you should increase PHP memory limit to at least 32M

Back to top
 
chrissie1
Posted: Sat Jul 25, 2009 09:13

nope that doesn't work. you can check it out I will leave it like that for half an hour. try sql date and all words.

not sure when you got the php error I never got that but I will increase.

Back to top
 
sam2kb
Posted: Sat Jul 25, 2009 09:27

To get the error (blank page) search for "a b c d" and select "some words"

Yeah, I see now, the 'sentence' param is not memorized for some reason.

Edit the line 256 in plugin file and see if it fixes the problem.

PHP

$this->search_mode param'sentence''string' );

to

PHP

$this->search_mode param'sentence''string'''true );

EDIT: this is weird, no params are memorized, actually!

Back to top
 
chrissie1
Posted: Sat Jul 25, 2009 09:35

thanks I got the error. Will fix soon.

nope the param(s) is still not memorized. they are memorized on the dev server which should be similar but apparently not the same. Oh joy.

Back to top
 
chrissie1
Posted: Sat Jul 25, 2009 09:36

thanks for all the help BTW.

Back to top
 
sam2kb
Posted: Sat Jul 25, 2009 09:41

chrissie1 wrote:

thanks for all the help BTW.

No problem.

Try this for now

PHP

global $m;
$adv_MainList->page_linksarray(
        'block_start' => '<div class="BlUeBaR">'.$this->T_('Pages:').' ',
        'block_end'   => '</div>',
        'page_url' => url_add_param$Blog->gen_blogurl(), 'sentence='.$this->search_mode.'&amp;m='.$m ),
    ) );

It's 3.30 am now, I'll be back in the morning ;)

Back to top
 
chrissie1
Posted: Sat Jul 25, 2009 09:46

that works.

Back to top
 
sam2kb
Posted: Sat Jul 25, 2009 17:17

I'm back :)

And this to the disp file

PHP

$url_params '';
$params array();
 
if( $this->search_mode )
{
    $params[] = 'sentence='.$this->search_mode;
}
if( $this->in_blogs )
{
    $params[] = 'in_blogs='.$this->in_blogs;
}
if( $this->month )
{
    $params[] = 'm='.$this->month;
}
if( $this->types )
{
    $params[] = 'adv_types='.$this->types;
}
 
if( !empty($params) )
{
    $url_params implode'&amp;'$params );
}
 
$adv_MainList->page_linksarray(
        'block_start' => '<div class="BlUeBaR">'.$this->T_('Pages:').' ',
        'block_end'   => '</div>',
        'page_url' => url_add_param$Blog->gen_blogurl(), $url_params ),
    ) );
Back to top
 
topanga
Posted: Tue Aug 25, 2009 18:52

Sam,
Have you tried that plugin in a 3,3,1 (latest release) version ?
because it's like 'something' is conflickitng with item_light.
It's not working with my custom skin, nor with a 'out of the box' skin

Try this, and you'll see the result
http://www.tenderfeelings.be/dagelijks.php?s=pit&sentence=AND

and when I try it on a brand new installation (no update' then it works fine... I'll be damned...

ok, even more finetuning :
I had to change back my tables to myISAM, instead of INNODB, and then the itemlight does not work. Does that makes any sence ?

Back to top
 
sam2kb
Posted: Tue Aug 25, 2009 22:00

Can you try the SVN version, I fixed this and some other bugs?

You should update both files
_adv_search.disp.php
_advanced_search.plugin.php

Back to top
 
topanga
Posted: Tue Aug 25, 2009 22:10

and where can I find the svn version ?

Back to top
 
sam2kb
Posted: Tue Aug 25, 2009 22:21
Back to top
 
topanga
Posted: Tue Aug 25, 2009 22:23

YES YES YES
thank you so mutch!!!!

Back to top
 
sam2kb
Posted: Tue Aug 25, 2009 22:30

Do you know why it doesn't highlight the keywords in your blog?

Back to top
 
sam2kb
Posted: Tue Aug 25, 2009 22:35

Make sure the rendering is set to stealth in plugin settings

Back to top
 
topanga
Posted: Tue Aug 25, 2009 23:08

I only discovered today that I can highlight the keywords ;)

Back to top
 
sam2kb
Posted: Tue Aug 25, 2009 23:22

Do you also know that it can display results much nicer than default b2evo search ?
http://ru.b2evo.net/show.php?s=blog+post&sentence=OR

Back to top
 
topanga
Posted: Tue Aug 25, 2009 23:30

No I did not know...
this plugin has a lot for me to discover
I suppose I'll find the guides to make sush a show.php somewhere in the readme ?

Back to top
 
sam2kb
Posted: Tue Aug 25, 2009 23:31

yeah, in readme.html

Back to top
 
topanga
Posted: Tue Aug 25, 2009 23:56

the only thing I could find in the readme.html was

Code

// Display search results
global $ASearch_plugin;
if( is_object($ASearch_plugin) )
{
  $ASearch_plugin->display_results();
}

How I jump from the searchbox to this, is a complete other story;)
complete mistified ;)

Back to top
 
sam2kb
Posted: Wed Aug 26, 2009 00:07

Everything you need to get it working is written in that readme.html

Just copy the above code in skin file after the messages code.

Back to top
 
topanga
Posted: Wed Aug 26, 2009 00:14

I must be very stupid
You mean this

Code

<?php // ------------------------- MESSAGES GENERATED FROM ACTIONS -------------------------
    messages( array(
    'block_start' => '<div class="action_messages">',
    'block_end'   => '</div>',
    ) );
// --------------------------------- END OF MESSAGES ---------------------------------
                ?>
                
<?php // Display search results
    global $ASearch_plugin;
    if( is_object($ASearch_plugin) )
        {
        $ASearch_plugin->display_results();
        }
?>
Back to top
 
sam2kb
Posted: Wed Aug 26, 2009 00:17

Right, just add the new code

Back to top
 
topanga
Posted: Wed Aug 26, 2009 00:18

ok, I did, and nothing is happening
I'm not completely surprised, since my skin is very very custom made

Back to top
 
topanga
Posted: Wed Aug 26, 2009 00:21

its allways PICNIC

Thank you very mutch!
after the 5th time I read the 10 lines in the readme.html, I finaly understood what was written there ;)

Back to top
 
sam2kb
Posted: Wed Aug 26, 2009 04:51

I fixed another bug, please update both files again.

Back to top
 
ion_rey
Posted: Thu Aug 27, 2009 10:24

My b2evolution Version: 2.4.7 and 3.3.1

Hi! Maybe is nothing, but in my blogs, when I tried to "search" something usin the normal search plugin, as a result the blog disappeared and the only part that I could see was the header part.
And I don´t know the reason, but I got rid of the advanced search plugin and the search function worked again. And in other blogs that I have advanced search plugin 0.3 everything is ok.

Back to top
 
ion_rey
Posted: Thu Aug 27, 2009 10:38

I just realized that I have two similar plugins: advance_search version 0.3 and advanced_search version 1.5 This last one is the ultimate update of the plugin and got the error I quoted in the previous message. Is the same plugin?
Anyway, the error disappeared when I remove the advanced_search 1.5

Back to top
 
sam2kb
Posted: Thu Aug 27, 2009 15:43

Please remove both plugins completely, including files. Then install v1.5 from the first post, and then update 2 files from here http://evocms-plugins.svn.sourceforge.net/viewvc/evocms-plugins/advanced_search_plugin/trunk/
_adv_search.disp/php
_advanced_search.plugin.php

Can you also link to to your blog where the plugin is installed?

Back to top
 
ion_rey
Posted: Thu Aug 27, 2009 16:13

Ok! I think I did exactly as you explained (I don´t understand what you mean with "install from the first post", so I installed the plugin as usual). And things changes a little: Apart from de menu, the blogs is trying to show an article and stops.
You will see in this: http://irati.pnte.cfnavarra.es/iturrpro/aldizkaria/blogs/index.php?blog=19&s=abentura&sentence=AND&submit=Bilatu

Back to top
 
sam2kb
Posted: Thu Aug 27, 2009 16:18

You should either enable PHP errors or look at Apache error log.
It's hard to guess what exactly caused the page to die.

Back to top
 
ion_rey
Posted: Thu Aug 27, 2009 16:53

Ok! I see...
That´s a pity! Thank you anyway!

Back to top
 
sam2kb
Posted: Thu Aug 27, 2009 16:56

Just add this to your php.ini

display_errors On

Back to top
 
sam2kb
Posted: Thu Aug 27, 2009 16:59

BTW you can most likely solve the problem by increasing PHP memory limit to 64M or 128M in /conf/_advanced.php

Back to top
 
sam2kb
Posted: Fri Sep 4, 2009 03:13

Plugin updated to v1.6

Fixed all known bugs

Back to top
 
sam2kb
Posted: Sun May 29, 2011 00:57

The plugin is tested to work in b2evo 4

Back to top
 
sam2kb
Posted: Sun Mar 25, 2012 00:16

New version released: 1.7.0

A new "search in blog" panel is displayed if there are less than 7 public blogs in the system
[u]Compatible with b2evolution v4.1 and newer.[/u]

Note that older versions of b2evolutions are not supported since v1.7.0 of this plugin

Back to top
 
tilqicom
Posted: Sun Mar 25, 2012 01:11

nice (:

Back to top
 
siri
Posted: Wed Jun 20, 2012 17:07

Not search in Page. Only in Post... bad

Back to top
 
warrock
Posted: Sat Oct 6, 2012 10:25

Thank you very mutch!

Can you also link to to your blog where the plugin is installed?

Back to top
 
sam2kb
Posted: Sat Oct 6, 2012 12:54

Here you can see the plugin in action
http://b2evo.sonorth.com/show.php?s=blog+post&sentence=OR

Back to top
 
fredsy
Posted: Mon Jul 28, 2014 16:39

Is there a way to customise the 'nothing to display' message? So far I've tried editing the code placed in the skin file, the search.disp file, and the plugin file. I see that by editing \inc\_core\ui\results\_results.class.php I can actually change the message, but I really don't want to hack the core as I will need to use a different styling for search on other blog pages.

Back to top
 
mgsolipa
Posted: Mon Jul 28, 2014 18:18

Hello @fredsy,

My answer has two parts:

1) I have made a little addition in the Advanced Search Plugin (look it is v1.7.1 now), just for a better support of locales. So, you will need to update your site with the new code, and follow the instructions of the original README.txt file, which implies a little code addition in your current skin. This is meant to use the display_results method given by the plugin. Otherwise, you will use the standard method for empty results, and it will be more difficult to override the message as you need. Note: this way you will get a google-fashioned results list as well.

2) I don't know if your site is currently using en_US locale, however check the file advanced_search_plugin-en_US.zip attached to this comment, and take it as a base to replicate and modify accordingly if you want to use a different locale. You only need to put the en_US folder contained in the zip file inside the folder /plugins/advanced_search_plugin/locales, just next to the folder ru_RU which is shipped in the plugin package. That way you will override the default message hardcoded in the plugin.

If you want to read more about localizing plugins, please take a look of this page: http://b2evolution.net/man/localizing-plugins. There are several things that you should skip, but in general, the information may be useful.

Regards!


Attachments:
Back to top
 
fredsy
Posted: Tue Jul 29, 2014 03:41

Thanks - turns out all I needed to do was upgrade the plugin and then edit the msg_nothing within the disp file. I really should remember to do that instead of using old copies on new sites... :P

Back to top
 
mgsolipa
Posted: Tue Jul 29, 2014 06:36

Excellent @fredsy,

Actually, the update in the plugin was done due to your report. Just remember that by editing the hardcoded message in the disp file will make locales fail. However, if you won't use different locales at all, then your solution is good enough.

Regards!

Back to top