Stay Informed
Suggested Site

▸ Simple to add and manage gift lists for yourself, your kids, or your business

▸ Secret gift coordination

▸ Duplicate gift protection


www.FAMIGR.com
Click to see a demo
Click to see a demo
How can I help you?
Contact Jeremy

Jsearch2 Setup and Configuration

If you want to use Jsearch on your site, download it here:

Installation

Once downloaded, follow these instructions:

  1. Unzip the plugin to your plugins/jsearch folder like this:
    Just like every other plugin really...
    Just like every other plugin really...
  2. Copy the jsearch_template.php file to your current theme's directory so it's available to your theme to be selected as a page template.
  3. Create a new page and select the Jsearch template from the Template drop-down list. This newly created page will be your search landing page.
  4. Click on the "Jsearch Config" link in the tools or plugins area on the left menu in the WordPress dashboard. Once there, select the page you just created in the drop-down list (so the plugin knows which page is using the template) and click "SAVE" at the bottom of the settings page.
  5. Mess with the other settings if you wish, but you're basically done (if you do change something, remember to click "SAVE" at the bottom to save the changes).
  6. (Optional but recommended) Replace the normal search widget in your sidebar with the Jsearch equivalent. This customized search box will feed directly to the Jsearch page and contains an "Advanced Search" link that will go directly to the search page without having to enter any terms first (it's with all the other widgets on the widgets page).

This is probably not the most elegant and awesome way possible to make this all work, but it's all I could figure out.

Options

The Jsearch control panel in the WordPress dashboard
The Jsearch control panel in the WordPress dashboard

By default, the behavior of Jsearch is determined by what I thought was best. If you want to change that, you can do so in the Jsearch options screen. Besides changing the defaults, you can hide certain controls from your users if you don't want them to make changes or think that it would only confuse them (or take up space that's not needed).

Customizable Results

There are 2 default listing styles (Jsearch default and WordPress default) and 3 custom templates that can be configured as needed.

Jsearch default
Jsearch default
Wordpress default
WordPress default

This allows you to style and customize your results just like you would for any WordPress template. You can also have multiple views in the same WordPress installation depending on the need. For example, for normal results on my City of Heroes fan page, I like the results to be the Jsearch Default, but then I used the Custom1 template and customized it to show a thumbnailed list when browsing the image gallery.

Using the custom templates to do a thumbnail search (example only)
Using the custom templates to do a thumbnail search (example only)

Note that the custom template I used to make the thumbnails is included as Custom1 as a sample, but will not work on your page since I use another custom plugin that you don't have in it. It is only included so you can see how the code can be done (if you want to see it working, go here: Jordan's Town Gallery).

Full URL Customization

Every aspect of the jsearch control (and a few others) can be set via the URL. For example, the thumbnail search I just mentioned is triggered by loading the search page with the following variables in the URL string:

http://www.jordans-town.com/jsearch/?paged=295&cat_all=106&ppp=24 &results_type=custom1&order=asc

Using this method, I can have the standard defaults as set in my administration panel, but create tailored views on the fly using nothing more than a link with some variables.

Jsearch Widgets and Inputs

There are a variety of controls that can be used to launch the Jsearch page:

Google-like Jsearch Box

The Jsearch box when undisturbed and then with data being entered. Hit ENTER to submit the entered terms
The Jsearch box when undisturbed and then with data being entered. Hit ENTER to submit the entered terms

This specifically was excluded from the widgets of Jsearch because google-like search boxes generally don't appear in sidebars or have standard sidebar headers and footers. So using this requires that you find a place in your template you'd like the box to appear and entering this line:

<?php jsearch_gbox(150); ?>

The 150 is the width I wanted the box to be. You can also set the height by adding it after the width like this jsearch_gbox(150,20). If you leave both blank, it defaults to 100 pixels wide by 17 tall.

This box uses the same code to parse terms as the term input on the jsearch page itself. You can use +, – or quotes just like you can there. Just like a Google box, you hit the ENTER key when done. The page will then open the jsearch page and begin the search.

Multiple Category Checkbox Selector

The very first ever jsearch function makes a return! Use the following code anywhere:

<?php jsearch_catlist();>

And you'll get a list of categories just like the one in WordPress except there will be checkboxes next to them that will let you select multiple categories.

Other types of input are planned for the future, but that's all I could manage for now
Guide Navigation
prev: Jsearch2 Help|INDEX|next: Jsearch Version 1

The Newest Version

About Jsearch Version 2 - Leaner interface, custom-built query that handles all the hard searches that WP doesn't.
Jsearch Tutorial - For site visitors and users of Jsearch to learn (very quickly) how to USE the Jsearch interface.
Jsearch Setup - Download and learn how to install and customize Jsearch here. For site administrators who want to use Jsearch on their site.

Older Versions (for historical purposes)

Version 1 - Jquery enabled and functional, but awkward to use in some ways.

66 Comments to “Jsearch2 Setup and Configuration”

» Comments RSS Feed

I’ve tried to follow your installations instructions but frankly I have no idea how the plugin shows up on the site so users can select categories, etc. and where the results appear. Also I can’t find jsearch_template.php anywhere.

Any help appreciated.

    How stupid of me. I’ve updated the download to include the template and I think that’s your main problem. Once you have the file and put it into your theme folder, just follow the rest of the directions above.

Hi Jeremy,
I followed the instructions. I made the page template, edited the jsearch options. I don’t see anything on my new page I made. I also put the multiple category list on my sidebar. I see it, but when I hit submit, it does nothing.
Any thoughts?

Thanks
Will

    Check to make sure the jsearch options stuck. Go back and make sure the template page is selected in the dropdown. Go back and make sure the page you made is actually using the template. Let me know how that turns out.

      Thanks for your response Jeremy. I got it to work by changing the folder name to just “jsearch”. I still have a few questions on the results page.
      I have the checkbox cat list on the sidebar for the search. You hit go and it brings you to the page I made with the jsearch template. I am using the custom2 results page. I have tweaked it a little bit to match my styling. How can I order the results by most recent article? Right now it is the oldest to newest. I can’t see where this is defined. Also the results aren’t showing in pages. If I have it to display 10 per page, it only shows 10..there is no way to get to the second page. Any thoughts?

      Thanks
      Will

      I looked at the paging issue and I think I got it fixed. Use the link above to download jsearch_2.001.zip for the fix. As for the ordering, it’s not defined, but you can just put order=asc or order=desc in the url string and it will work.

Ok thanks. Now when I go to the page created with the JSearch template, I get the following errors:

Warning: require_once(wp-content/plugins/jsearch/jsearch_control.php) [function.require-once]: failed to open stream: No such file or directory in /home4/nanowisd/public_html/nwblog/wp-content/plugins/jsearch_2_beta/jsearch.php on line 500

Fatal error: require_once() [function.require]: Failed opening required ‘wp-content/plugins/jsearch/jsearch_control.php’ (include_path=’.:/usr/lib64/php:/usr/lib/php’) in /home4/nanowisd/public_html/nwblog/wp-content/plugins/jsearch_2_beta/jsearch.php on line 500

    You have to use wp-content/plugins/jsearch not jsearch_2_beta. I know it unzips that way, but you have to rename the folder or nothing will work right πŸ˜›

This plugin is what I’m looking for, but as it is new there are some things to be fixed:
– no pagination when “Results display type” is set to “WordPress Default”
– when “Pages vs Posts Selector” is set to “Search Post Only” with display in Dual List it shows both pages and posts boxes (Page Results No pages in this range.) insted of only post box.

Hope this helps

    Ok thanks. More stuff to mess with πŸ˜›

    I didn’t imagine that people would want only one of the two on the dual-list view, but there’s really no reason not to allow you to control it so I fixed it for you. The download link above goes to jsearch_2.001.zip which has the update.

    I didn’t think I had the time, but the fix for the pagination wasn’t too hard so I took care of that too.

Hi Jeremy.
First of all, thanks for the plugin, itΒ΄s great and make things easier for many of us.
IΒ΄ve been trying around and could only get to work pagination in Dual List default mode.
Any idea?

    Yeah, it looks like there’s a paging problem with it. I’m going to have to look into it and see if I can fix the problem.

    I took a look at the pagination issue in the WP Default listing and I found the error (so far). Check out the newest download by clicking the link at the top of the page (jsearch_2.001.zip).

Works well so far. But how do I create a left margin on the results page?

    I know I need to use CSS, and when I use Firebug, I can see the “page” ID (#page). I can even use Firebug to temporarily change the margin. But I can’t find the file where the #page is located to change it permanently.

    The jsearch_results_dual_list file uses “jsearch_results_div” as the container for results. You should be able to put your margin onto that (which can be set in the jsearch.css file).

    If you’re using jsearch_results_wp_default, the container is either “post” or “entry” (which are found in your theme’s css file I would think.

Really good plugin but I was curious if it was possible to have the search to be ‘any’ with the checkboxes as at present if you click a few different sub categories the results will only show if all sub-categories are selected on the post.

Hope that makes sense,

Thanks

    It sounds like you’re saying you only want posts to show up if they’re in ALL the categories you select. If that’s the case, that’s what the AND behavior is and can be done by clicking the + on all the categories instead of the O

Thank for the help with the left margin. I have jsearch installed on two sites. On the one, I get a constant message that “Jsearch is loading, please wait…” On the other, the date delimiter and pages/posts delimiter don’t have any effect.

    Fixed the date issue (use the regular download link above). I don’t know what you mean by pages/posts delimeter though. Also, if you get “loading please wait” there might be a javascript error of some kind. It could be a name collision which I’ve been careful about, but it wouldn’t be the first time I messed up. Can you check for errors and let me know what your browser is saying?

Hi,

I am using your search on http://www.bigmba.com/search, however I am unable to use the date filter.

Is the date filter still an issue?

I however get WHICH FFFFpagesWHICH FFFFposts at the top of my search results?

    I left some diagnostic code in there. It’s gone now so re-download or you can manually remove the line in jsearch_functions.php where it prints FFFF (do a word search and you’ll find it pretty fast).

Looks like jsearch_template.php has disappeared again. I could not find it in the folder I downloaded today.

I downloaded the plugin today and it was missing the page template so I downloaded the older version and used that template. Just thought I should let you know it wasn’t there;)

Hi,

There was one case where I had to search a document for 13th March 2011, so in the date fields I entered from 13th march 2011 to 13th March 2011, however this did not display anything. However when I entered 12th march 2011 to 14th March 2011 than it displayed the document I was searching for, is there anyway we can have the search to display results for the date query as in the first instance.

FYI ALL! I’m working on a semi-major update to the user interface as well as many of the suggestions people have said here. I will be posting the new 2.5 version soon. Note that this design incorporates something I’ve been wanting to do for a while anyway (that I’m finally getting around to).

Ed Kearney says:

Thank you so much for this. I’m using jsearch across our wordpress site due to it’s ability to get results matching multiple categories. I would be lost without this feature.
However, I have just discovered that only one instance of jsearch can be run per page. You can, for example, include the categories widget in a sidebar and go to a search page. The categories are not displayed but the main search results are.

Also if you place the ‘jsearch_help_pop’ and ‘jsearch_control_area’ divs inside another div, you get incorrect positioning of the popups.

Thanks you so much Jeremy πŸ™‚

    Ed Kearney says:

    A few bug fixes:

    jsearch_control.php: bug – search form resets keyword search options

    if ($onoff) echo “checked”;

    change to

    if ($onoff) echo “checked=checked”;

    jsearch.php: bug – options won’t remember setting for show/hide results type

    option value=1 ‘.($hide_results_type?’selected=”selected”‘:”).’>Hidden’.

    change to

    option value=1 ‘.(!$hide_results_type?’selected=”selected”‘:”).’>Hidden’.

    jsearch_functions.php: bug – plugin url incorrect

    $GLOBALS[‘jsearch_plugin_url’] = $jsearch_plugin_url = get_bloginfo(‘url’).’/wp-content/plugins/jsearch/’;

    change to

    $GLOBALS[‘jsearch_plugin_url’] = $jsearch_plugin_url = get_bloginfo(‘url’).’/wp-content/plugins/jsearch_2.001/’;

    jsearch_functions.php: bug – doesn’t default to desc order as described in comments

    else if (strtolower($_REQUEST[‘order’]) == “desc”)
    $this->jquery[‘order’] = “desc”;

    change to

    else if (strtolower($_REQUEST[‘order’]) == “desc”)
    $this->jquery[‘order’] = “desc”;
    else
    $this->jquery[‘order’] = “desc”;

    jsearch_functions.js: bug/feature? – help button should close help as well as open

    $jsq(‘#jsearch_help_button’).click( function() {
    $jsq(‘#jsearch_help_area’).show();
    });
    $jsq(‘#jsearch_help_closer_button’).click( function() {
    $jsq(‘#jsearch_help_area’).hide();
    });

    change to

    $jsq(‘#jsearch_help_button’).click( function() {
    $jsq(‘#jsearch_help_area’).toggle();
    });
    $jsq(‘#jsearch_help_closer_button’).click( function() {
    $jsq(‘#jsearch_help_area’).toggle();
    });

Ed Kearney says:

Fix for popup displacement:
jsearch_functions.js: bug – popups don’t display in correct place

temp = $jsq(“#jsearch_term_column”).offset();
and
temp = $jsq(“#jsearch_cat_column”).offset();
and
temp = $jsq(“#jsearch_tag_column”).offset();

change for

temp = $jsq(“#jsearch_term_column”).position();
and
temp = $jsq(“#jsearch_cat_column”).position();
and
temp = $jsq(“#jsearch_tag_column”).position();

I also recommend moving function jsearch_array_to_object($array = array()) from the search results php into jsearch_functions.php to avoid duplication

    Sorry for being lazy, but I just massively changed the interface and I think it will have fixed a lot of the issues you brought up. Check it out and let me know what you think πŸ™‚

Hello everybody! I just released version 2.5 which includes not only the feature I’ve been most wanting to get to (keyword search that filters categories and tags), but a smoother and better looking interface for all functions.

Let me know what you think πŸ™‚

Could you tell us how to do a thumbnail template?

    The custom1.php file has the code I used. The only sneaky part is the jtag function which I wrote (another custom plugin) that uses the jtag html to make a function call using the rest of the values as variables. It loads an image from a known path is all. Posts that are supposed to show just a thumbnail have a code in their excerpts that says to load an image instead (which my custom1 template reads and translates).

    Does that help?

Is there a SVN repository I can download from?

I wonder if I can hire you to design a special CSS of your plugin to fit my site (NSFW) design? if so contact me ty ^^

    I looked at your site and your search involves sorting by rating and a few other things I hadn’t thought to include. Is that what you mean by customizing or do you really only mean CSS (i.e. color scheme)?

      only CSS of your own plugin.

        Well, it’s hard to say, but let me know what you had in mind. If you could put together a photoshopped mockup of what you want it to look like that would be even better. What you’re asking may not take much time at all.

I’ve launched the search successfully.
Looks like an interesting tool, the thing is that I want to use exactly the “Category Checkbox” function.

I’ve tried to integrate “jsearch_catlist();” on numerous places.
Also tried ” jsearch_catlist(); ” with “?” before the second “>”.

No result yet. Any hints πŸ™‚

M.

    Sadly, I only implemented it as a PHP call and not the [replace this] kind of thing most plugins do. Laziness on my part I suppose πŸ™

    Somewhere in your template files (not in the text of a post), type this: < ?php jsearch_catlist(); ?>

    It should work.

you are the best!!

WordPress not in root directory

I like this plugin. I’m testing it on a site in which WordPress is not installed in the root directory. I ran into a bug that you acknowledge in a php comment but seems to have a simple fix. In jsearch_functions.php change the following the get_bloginfo(‘url’) to get_bloginfo(‘wpurl’) so it reads like this:

$GLOBALS[‘jsearch_plugin_url’] = $jsearch_plugin_url = get_bloginfo(‘wpurl’).’/wp-content/plugins/jsearch/’;

    Awesome. I haven’t messed with the plugin in a while so I’m glad you figured it out instead of me having to see if I can remember how it all worked!

Is there a way to embed the plugin into somewhere but not in the page or widget?
I wan to put it directly into the container.

    I’m not quite sure what you mean.

      It is very possible, that hiuyu is referring to the idea of a template tag – something that can be called directly in php anywhere in the theme. This can be done using the do_shortcode() function.

      Hiuyu, if you are indeed modifying your theme and need more info on that let us know.

In dire need of help says:

Hello Jeremy! I think followed the instructions correctly, and I have tried both version 1.5 and version 2.5, but none of them is working. I get some results, but they are completely broken.

Here’s a picture of what it looks like: http://imgur.com/ddc0Z

Do you have any suggestions on how to solve this?

    No longer in dire need of help says:

    Nevermind, solved it. Using a web inspector I found out that the problem was a “403 (forbidden)” error, and when I set the permissions for the jsearch folder to 755 it worked.

Hey there, I’m trying to use the “jsearch_catlist()” function to get checkboxes but I get this message:

Fatal error: Call to undefined function jsearch_catlist() in /–domain-name-here–/jsearch-check.php on line 22

Any ideas?

Thanks

Hi, I was do everything, but when i create jsearch template page, also choice that page in jsearch option, and load the page, I got:

Warning: require_once(wp-content/plugins/jsearch/jsearch_control.php) [function.require-once]: failed to open stream: No such file or directory in /home/bloxxxx/public_html/veljko.info/wp-content/plugins/jsearch_2.5/jsearch.php on line 552

Fatal error: require_once() [function.require]: Failed opening required ‘wp-content/plugins/jsearch/jsearch_control.php’ (include_path=’.:/usr/lib/php:/usr/local/lib/php’) in /home/bloxxx/public_html/veljko.info/wp-content/plugins/jsearch_2.5/jsearch.php on line 552

Thank You

    It sounds like you installed it to wp-content/plugins/jsearch_2.5/ when it’s expecting wp-content/plugins/jsearch/

    I’m not a very talented plugin designer so I couldn’t figure out how to account for different install directories. You’ll need to just call it “jsearch” for now I think.

    I have been considering writing a version 3 however… we’ll have to see if I have the time.

      Thank You for replay.

      I improved, repeated from the beginning and now work.

      But I will be more happy, in the case that there is a plugin,
      very clean πŸ™‚

      Just, choose Category and Tag, you want in the form, and front-and page, where visitor can multiple checks (checkbox) Cat and Tag from which they wants to show items.

      I hope, the next one version, have the option πŸ™‚

I have used the latest plugin v2.5 bt still if i configure the settings of jquery so as to get the resulting post in ascending order I don’t get so. I have changed the settings of ” Result Order” from ascending to descending bt still it provides the same output as before..

Plz help on this,………..

    Yes, that’s right. I found an error in the script and fixed it on my end. I should upload that πŸ™

    I’ve been recently considering updating the search from scratch (again). I decided that even now it’s too complex and I need to simplify it again.

Hiii,
I hve been using ur plugin for number of my apps
Bt nw having a problem stated below which provides no result output although the document is there.

While clicking on the update search result i get the problem:


No Results

Wha? Hey! Why isn’t there anything here?

It turn out that I couldn’t find anything with the parameters you used. Let me try describing the search you made in plain English as I understood it:
Base on how your search is configured ”

Kindly help me ASAP…

Thanks in advance

    I’m sorry to say that I’m no longer supporting this plugin. I’ve toyed with the idea of rewriting it, but I just have too many other commitments.

IDENTITY THEFT
How to Steal Identities - Why It's So Easy
Credit Freeze
Data Defense
Credit Monitoring
Id Theft Insurance
The Identity Theft Victim's Mini-Guide to Recovery
PRIVACY
The Geek Privacy Principle
Nothing to Hide
Data Abuse
RFID - Radio Frequency IDentification
Privacy Alias/Persona
Data Defense
INTERNET SAFETY
Online Addiction
The Consequences of Posting Online
Photo Safety
Tricks and Scams
Account Hijacking
Trusting Companies
PASSWORDS
Bad Passwords
Password Tips and Tricks
Password Protection
Password Mugging
Computer Security
E-mail Safety
Kids and Computers
Shopping Online
Retailers
All About Warranties