<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>don-benjamin.co.uk&#187; custom fields</title>
	<atom:link href="http://www.don-benjamin.co.uk/tag/custom-fields/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.don-benjamin.co.uk</link>
	<description>Web Development - CMS/PHP/Ajax Freelancer - Brighton UK</description>
	<lastBuildDate>Wed, 27 Jan 2010 12:38:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Wordpress Custom Fields Search 0.3.15</title>
		<link>http://www.don-benjamin.co.uk/projects/foss/wordpress-custom-fields-search-0-3-15/</link>
		<comments>http://www.don-benjamin.co.uk/projects/foss/wordpress-custom-fields-search-0-3-15/#comments</comments>
		<pubDate>Tue, 11 Aug 2009 09:45:49 +0000</pubDate>
		<dc:creator>don</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Wordpress Plugins]]></category>
		<category><![CDATA[custom fields]]></category>
		<category><![CDATA[custom search]]></category>
		<category><![CDATA[wordpress plugin]]></category>

		<guid isPermaLink="false">http://www.don-benjamin.co.uk/?p=83</guid>
		<description><![CDATA[Apologies to everyone who installed yesterday&#8217;s release (0.3.14), this mornings release (0.3.15) should bring back the custom fields functionality.  I was obviously a little premature in marking that one stable.  Thanks to Vytautas for pointing out the issue.
Also, the previous release fixed some problems with the method of including search forms in posts and pages.  [...]]]></description>
			<content:encoded><![CDATA[<p><a id='post-start-83'></a>Apologies to everyone who installed yesterday&#8217;s release (0.3.14), this mornings release (0.3.15) should bring back the custom fields functionality.  I was obviously a little premature in marking that one stable.  Thanks to Vytautas for pointing out the issue.</p>
<p><span id="more-83"></span>Also, the previous release fixed some problems with the method of including search forms in posts and pages.  To fix this bug though I have had to change the syntax for including presets in posts, please check the &#8220;settings/wp custom fields search&#8221; section of the site to see the new syntax.  The old method is now deprecated (meaning it works for now so that everyone has a chance to update, but I will remove it soon.)</p>
<p>Basically what was:</p>
<pre>[<!--DONTPARSE-->wp-custom-fields-search 1]</pre>
<p>Is now:</p>
<pre>[<!--DONTPARSE--> wp-custom-fields-search preset="1"]</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.don-benjamin.co.uk/projects/foss/wordpress-custom-fields-search-0-3-15/feed/</wfw:commentRss>
		<slash:comments>158</slash:comments>
		</item>
		<item>
		<title>Wordpress Custom Fields Search 0.3.13</title>
		<link>http://www.don-benjamin.co.uk/projects/foss/wp-plugins/wordpress-custom-fields-search-0313/</link>
		<comments>http://www.don-benjamin.co.uk/projects/foss/wp-plugins/wordpress-custom-fields-search-0313/#comments</comments>
		<pubDate>Fri, 10 Jul 2009 11:59:16 +0000</pubDate>
		<dc:creator>don</dc:creator>
				<category><![CDATA[Wordpress Plugins]]></category>
		<category><![CDATA[custom fields]]></category>
		<category><![CDATA[custom search]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpress plugin]]></category>

		<guid isPermaLink="false">http://www.don-benjamin.co.uk/wordpress/?p=73</guid>
		<description><![CDATA[This is a relatively minor release including a few small fixes.
There is one relatively major change to the way categories and tags work, it&#8217;s a technical detail really that I won&#8217;t bore you with the details of, but this change will allow the categories/tags functionality to work on some sites which couldn&#8217;t previously use it.  [...]]]></description>
			<content:encoded><![CDATA[<p><a id='post-start-73'></a>This is a relatively minor release including a few small fixes.</p>
<p>There is one relatively major change to the way categories and tags work, it&#8217;s a technical detail really that I won&#8217;t bore you with the details of, but this change will allow the categories/tags functionality to work on some sites which couldn&#8217;t previously use it.  However there is a chance that this will break the same functionality on other sites, so please post comments here if this causes issues for you and I will consider switching back to the old method.</p>
<p><span id="more-73"></span></p>
<p>I haven&#8217;t posted about a release for a while so a quick summary of some of the other changes over the last few releases:</p>
<ul>
<li>Various bug fixes</li>
<li>New hidden constant field type allows forms to be built with pre-specified search parameters</li>
<li>Wordpress 2.8 compatibility (although there have still been some complaints about this, please let me know if anyone has a site with problems that I can test on)</li>
<li>French translations (thanks to Pierre)</li>
<li>Ability to search different post types (use this with the hidden constant field to set up page search)</li>
</ul>
<p>You may also notice I&#8217;ve added in a paypal donate link, basically the reason that recent development has been a little slow is because I&#8217;ve been too busy working on paid projects.  If you like my work and you&#8217;d like to help me make a living from (and therefore spend more time) producing open source software then please consider donating.</p>
<p>There is more complete (although slightly out of date) <a href="http://www.don-benjamin.co.uk/wordpress/projects/foss/wp-plugins/wp-custom-fields-search-03/#post-41" rel='nofollow'>documentation for the plugin here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.don-benjamin.co.uk/projects/foss/wp-plugins/wordpress-custom-fields-search-0313/feed/</wfw:commentRss>
		<slash:comments>39</slash:comments>
		</item>
		<item>
		<title>WP Custom Fields Search 0.3.4</title>
		<link>http://www.don-benjamin.co.uk/projects/foss/wp-plugins/wp-custom-fields-search-034/</link>
		<comments>http://www.don-benjamin.co.uk/projects/foss/wp-plugins/wp-custom-fields-search-034/#comments</comments>
		<pubDate>Thu, 26 Mar 2009 16:13:53 +0000</pubDate>
		<dc:creator>don</dc:creator>
				<category><![CDATA[Wordpress Plugins]]></category>
		<category><![CDATA[custom fields]]></category>
		<category><![CDATA[custom search]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpress plugin]]></category>

		<guid isPermaLink="false">http://www.don-benjamin.co.uk/wordpress/?p=54</guid>
		<description><![CDATA[This version doesn&#8217;t add much new functionality but does fix a bug whereby files could not be edited in the theme/plugin editors while the plugin was installed.  Thanks go to Florent for pointing that one out.
I strongly advise all users to upgrade as soon as possible.
This also includes the functionality to place searchforms in page [...]]]></description>
			<content:encoded><![CDATA[<p><a id='post-start-54'></a>This version doesn&#8217;t add much new functionality but does fix a bug whereby files could not be edited in the theme/plugin editors while the plugin was installed.  Thanks go to <a href="http://www.oumangeramidi.com/" rel='nofollow'>Florent</a> for pointing that one out.</p>
<p>I strongly advise all users to upgrade as soon as possible.</p>
<p>This also includes the functionality to place searchforms in page and post content.  See the presets section (Settings &gt; WP Custom Fields Search) for an example tag.  Thanks go to Ibrahim for the suggestion.</p>
<p>For instructions on using the plugin please see the <a href="/wordpress/projects/foss/wp-plugins/wp-custom-fields-search-03/" rel='nofollow'>0.3 release notes</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.don-benjamin.co.uk/projects/foss/wp-plugins/wp-custom-fields-search-034/feed/</wfw:commentRss>
		<slash:comments>66</slash:comments>
		</item>
		<item>
		<title>Now On wordpress.org</title>
		<link>http://www.don-benjamin.co.uk/projects/foss/wp-plugins/now-on-wordpress-org/</link>
		<comments>http://www.don-benjamin.co.uk/projects/foss/wp-plugins/now-on-wordpress-org/#comments</comments>
		<pubDate>Tue, 24 Mar 2009 17:05:27 +0000</pubDate>
		<dc:creator>don</dc:creator>
				<category><![CDATA[Wordpress Plugins]]></category>
		<category><![CDATA[custom fields]]></category>
		<category><![CDATA[custom search]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpress plugin]]></category>

		<guid isPermaLink="false">http://www.don-benjamin.co.uk/wordpress/?p=49</guid>
		<description><![CDATA[My custom fields search plugin has now been accepted  in the wordpress plugin repository. If you like it, please give it a rating there to encourage more people to use it.
]]></description>
			<content:encoded><![CDATA[<p><a id='post-start-49'></a>My <a href="http://wordpress.org/extend/plugins/wp-custom-fields-search/" rel='nofollow'>custom fields search plugin</a> has now been accepted  in the wordpress plugin repository. If you like it, please give it a rating <a href="http://wordpress.org/extend/plugins/wp-custom-fields-search/" rel='nofollow'>there</a> to encourage more people to use it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.don-benjamin.co.uk/projects/foss/wp-plugins/now-on-wordpress-org/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>WP Custom Fields Search 0.3</title>
		<link>http://www.don-benjamin.co.uk/projects/foss/wp-plugins/wp-custom-fields-search-03/</link>
		<comments>http://www.don-benjamin.co.uk/projects/foss/wp-plugins/wp-custom-fields-search-03/#comments</comments>
		<pubDate>Mon, 23 Mar 2009 11:13:47 +0000</pubDate>
		<dc:creator>don</dc:creator>
				<category><![CDATA[Wordpress Plugins]]></category>
		<category><![CDATA[custom fields]]></category>
		<category><![CDATA[custom search]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpress plugin]]></category>

		<guid isPermaLink="false">http://www.don-benjamin.co.uk/wordpress/?p=41</guid>
		<description><![CDATA[This is my search plugin for wordpress, designed to filter posts in a more structured way than the default wordpress search. Specifically it allows multiple form inputs to be configured to search different aspects of a post, i.e. one term could search the post content, one the post title and one could search a custom [...]]]></description>
			<content:encoded><![CDATA[<p><a id='post-start-41'></a><img style="float: left" src="/wordpress/wp-content/uploads/2009/03/screenshot-frontend.png" alt="Front End Screenshot" />This is my <a title="Download Configurable Search" href="/wordpress-plugins/wp-custom-search.zip" rel='nofollow'>search plugin</a> for wordpress, designed to filter posts in a more structured way than the default wordpress search. Specifically it allows multiple form inputs to be configured to search different aspects of a post, i.e. one term could search the post content, one the post title and one could search a custom field associated with the post.</p>
<p>The blog admin is able to build a customised search form. It allows you to search by the standard post information and by custom fields and to choose what HTML form elements should be presented for each search field.</p>
<p><span id="more-41"></span></p>
<p>I originally developed this plugin for a client project. Basically the problem they had was that they were storing real estate data as wordpress posts with associated custom fields and they wanted to search for entries based on price, location and features which was not possible with the default wordpress search.</p>
<p>The plugin is now at point where I think it could be useful to other people although I&#8217;m aware that there are a lot of improvements that could be made. Please <a href="/wordpress/contact" rel='nofollow'>let me know</a> if you have any suggestions or complaints and I will do my best to get them resolved.</p>
<p>You can <a title="Download Configurable Search" href="/wordpress-plugins/wp-custom-search.zip" rel='nofollow'>download the plugin</a> here.</p>
<div class='toc-top-link'><a class='toc-top-link' id='toc-system-requirements' href='#content'>&uarr; Back To Top</a></div>
<h3 ><strong>System Requirements</strong></h3>
<p>I have tested with the following software versions, other versions may or may not work.</p>
<ul>
<li>PHP Versions 4.4.9 and 5.2.6</li>
<li>Wordpress 2.5, 2.7 and 2.7 MU</li>
</ul>
<div class='toc-top-link'><a class='toc-top-link' id='toc-quick-start-guide' href='#content'>&uarr; Back To Top</a></div>
<h3 ><strong>Quick Start Guide</strong></h3>
<p>I will try to put more complete documentation together at some point but for now this is a quick start guide to building a search form.</p>
<ol>
<li>Install the plugin.  <a title="Download Configurable Search" href="/wordpress-plugins/wp-custom-search.zip" rel='nofollow'>Download it here</a> unzip it in your wp-content/plugins folder, then activate it in the plugins &gt; installed page of your wordpress admin site.</li>
</ol>
<p>Method 1: Add the search as a sidebar widget</p>
<ol>
<li>Add the widget to the sidebar on which you want it to appear. Go to the appearance &gt; widgets section of the admin page, in the list on the left find the widget &#8220;Custom Fields Search&#8221; and click the add button next to it. It should appear in the list on the right. Click save changes</li>
<li>You should now have a basic search form on the front of your site, to customise this further read on to see how to reconfigure your fields.</li>
</ol>
<p>Method 2: Add the search code directly into your template</p>
<ol>
<li>Go to the custom fields config page in your admin section, Settings &gt; WP Custom Fields Search</li>
<li>Copy the example PHP code from this page into your template file.</li>
<li>You should now have a basic search form on the front of your site, to customise this further follow the instructions below for setting up fields.</li>
</ol>
<div class='toc-top-link'><a class='toc-top-link' id='toc-setting-up-the-fields' href='#content'>&uarr; Back To Top</a></div>
<h3 ><strong>Setting up the fields</strong></h3>
<div id="attachment_34" class="wp-caption alignleft" style="width: 475px"><img class="size-full wp-image-34" title="screenshot-trimmed1" src="http://www.don-benjamin.co.uk/wordpress/wp-content/uploads/2009/03/screenshot-trimmed1.png" alt="Admin Screenshot" width="465" height="417" /><p class="wp-caption-text">Admin Screenshot</p></div>
<p>Each field has a number of settings which control the way the input appears to the user and the way the search is performed. Most of the settings are hidden when you first go to edit the widget and you will need to click the show/hide config button to get access to many of the parameters.</p>
<p><strong>Label</strong> sets the label displayed next to the field, you can set this to whatever you want.</p>
<p><strong>Data Type</strong> controls what type of data is being searched (i.e. what database table is being used). The standard options are &#8220;Post Field&#8221; for data such as post title and post content, from the standard wordpress post data, &#8220;Custom Field&#8221; for data from the custom fields, and &#8220;Category&#8221; to search on the categories a post is in.</p>
<p><strong>Data Field</strong> makes a more specific selection from the data available. The drop down list should give some sensible options, or if you know the name of the database field you want to query you can type this in manually.</p>
<p><strong>Widget</strong> controls what type of HTML input is created for the front end of the site.  It should be fairly obvious what these do.</p>
<p>Some widgets will require extra options in the <strong>Widget Options</strong> field. At the moment this is just the drop down and radio button widgets which allow you to specify a list of values for the user to choose from. If you leave the options blank then they will be automatically populated with a list of all values currently in the database, this can be useful for fields like categories and tags, but is less useful for fields like title which would just generate an entry for every post in the blog. If you want to specify the values manually you can specify this as a comma separated list of values, &#8216;a,b,c&#8217; for three options with values &#8216;a&#8217;, &#8216;b&#8217; and &#8216;c&#8217; respectively, or if you want to give &#8216;friendly&#8217; labels to the user you can separate the value from the label using a colon as follows &#8216;a:Group A,b:Group B,c:Group C&#8217;.</p>
<p>The <strong>Compare</strong> field controls the way that the user input is compared to the data in the database. I would expect the most commonly used of these to be &#8220;equals&#8221; which requires an exact match between the user data and the database field (useful for category searches) and the &#8220;Words in&#8221; or &#8220;Phrase In&#8221; types which will search to see if the user input is a part of the data, rather than a full match, this is useful for things like searching the text of a post. The difference between &#8216;words&#8217; and &#8216;phrase&#8217; is that &#8216;words&#8217; splits the input into a series of words and searches for these individually whereas &#8216;Phrase&#8217; searches for all the words in sequence.</p>
<p>The &#8220;Less Than&#8221; and &#8220;More Than&#8221; comparisons ensure that the data is less than or more than the user input respectively. This is probably only relevant for numeric input but it can be used for strings as well and will search alphabetically. For numeric input it can help to also tick the &#8220;Numeric&#8221; checkbox as sometimes the database will be set up to compare numbers alphabetically (so that 10 is less than 2).</p>
<p>The &#8220;Range&#8221; comparison is a little more complicated and requires the user input to be of the form A-B to return results that are between A and B. This is primarily intended to be used for Drop-downs and radio buttons where the values can be set by the site administrator. If you specify the values for the dropdown like the following: &#8220;-10:Less Than 10,10-20:Between 10 and 20,20-:More than 20&#8243;, then the user will be presented with the options &#8220;Less Than 10&#8243;, &#8220;Betwen 10 and 20&#8243; and &#8220;More than 20&#8243; but the search will be done with the values &#8220;-10&#8243;,&#8221;10-20&#8243; and &#8220;20-&#8221;. Again the numeric checkbox should be used for numeric data.</p>
<p>I hope that helps, please let me know if you have any trouble (or joy) with the plugin or if any of my instructions don&#8217;t make sense.</p>
<div class='toc-top-link'><a class='toc-top-link' id='toc-using-presets' href='#content'>&uarr; Back To Top</a></div>
<h3 ><strong><strong>Using Presets</strong></strong></h3>
<p>Presets are a new feature in version 0.3, they allow search forms to be configured separately from the sidebar widgets, the configured form doesn&#8217;t directly appear on the site but can be included in two ways.</p>
<p>Firstly, by copying and pasting the php code from the preset config page into a template file you can place a search form anywhere you want in your template.</p>
<p>Secondly, by using a preset as the basis for another search form.  When setting up a search form you have the option of selecting one of the presets from a dropdown list.  Selecting one will include all of the fields from this preset in your form.</p>
<p>Presets are configured in exactly the same way as the sidebar widget, you can find the presets in the &#8220;Settings &gt; WP Custom Fields Search&#8221; section of your admin site.</p>
<div class='toc-top-link'><a class='toc-top-link' id='toc-extending-custom-search' href='#content'>&uarr; Back To Top</a></div>
<h3 ><strong>Extending Custom Search<br />
</strong></h3>
<p>For developers, I&#8217;ve tried to build this in a modular way to allow extensions to be added, I will try to document this at some point in the future but if you can&#8217;t wait then the best places to get started would be to look at the filter &#8216;custom_search_get_classes&#8217; in custom-search/custom-search.php and the <a href="http://www.rogertheriault.com/agents/plugins/great-real-estate-plugin/" target="_blank" rel='nofollow'>Great Real Estate</a> bridging code in custom-search/bridges/greatrealestate.php.</p>
<p>This plugin is at quite an early stage in development though so it is likely that future versions may not be compatible with the same extension interface and it is likely that any extensions will need altering when new versions are released..</p>
<div class='toc-top-link'><a class='toc-top-link' id='toc-changelog' href='#content'>&uarr; Back To Top</a></div>
<h3 ><strong>Changelog</strong></h3>
<p>Since 0.2</p>
<ul>
<li>Various bug fixes</li>
<li>Wordpress 2.5 compatibility</li>
<li>Added in <a href="#toc-using-presets" rel='nofollow'>preset functionality</a></li>
</ul>
<p>Since 0.1</p>
<ul>
<li>I&#8217;ve reworked the UI and added some more sensible default values, hopefully this should make it less daunting for new users.</li>
<li>Fixed a few bugs.</li>
<li>Added in textual descriptions of the search parameters (for themes which support this)</li>
</ul>
<div class='toc-top-link'><a class='toc-top-link' id='toc-end' href='#content'>&uarr; Back To Top</a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.don-benjamin.co.uk/projects/foss/wp-plugins/wp-custom-fields-search-03/feed/</wfw:commentRss>
		<slash:comments>70</slash:comments>
		</item>
		<item>
		<title>WP Custom Fields Search v 0.2 beta</title>
		<link>http://www.don-benjamin.co.uk/projects/foss/wp-plugins/wp-custom-search-v-02-beta/</link>
		<comments>http://www.don-benjamin.co.uk/projects/foss/wp-plugins/wp-custom-search-v-02-beta/#comments</comments>
		<pubDate>Tue, 17 Mar 2009 17:33:07 +0000</pubDate>
		<dc:creator>don</dc:creator>
				<category><![CDATA[Wordpress Plugins]]></category>
		<category><![CDATA[custom fields]]></category>
		<category><![CDATA[custom search]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpress plugin]]></category>

		<guid isPermaLink="false">http://www.don-benjamin.co.uk/wordpress/?p=31</guid>
		<description><![CDATA[This is my search plugin for wordpress, designed to filter posts in a more structured way than the default wordpress search.  Specifically it allows multiple form inputs to be configured to search different aspects of a post, i.e. one term could search the post content, one the post title and one could search a custom [...]]]></description>
			<content:encoded><![CDATA[<p><a id='post-start-31'></a><img style="float: left" src="/wordpress/wp-content/uploads/2009/03/screenshot-frontend.png" alt="Front End Screenshot" />This is my <a title="Download Configurable Search" href="/wordpress-plugins/wp-custom-search.zip" rel='nofollow'>search plugin</a> for wordpress, designed to filter posts in a more structured way than the default wordpress search.  Specifically it allows multiple form inputs to be configured to search different aspects of a post, i.e. one term could search the post content, one the post title and one could search a custom field associated with the post.</p>
<p>The blog admin is able to build a customised search form.  It allows you to search by the standard post information and by custom fields and to choose what HTML form elements should be presented for each search field.</p>
<p><span id="more-31"></span></p>
<p>I originally developed this plugin for a client project.  Basically the problem they had was that they were storing real estate data as wordpress posts with associated custom fields and they wanted to search for entries based on price, location and features which was not possible with the default wordpress search.</p>
<p>The plugin is now at point where I think it could be useful to other people although I&#8217;m aware that there are a lot of improvements that could be made.  Please <a href="/wordpress/contact" rel='nofollow'>let me know</a> if you have any suggestions or complaints and I will do my best to get them resolved.</p>
<p>You can <a title="Download Configurable Search" href="/wordpress-plugins/wp-custom-search.zip" rel='nofollow'>download the plugin</a> here.</p>
<div class='toc-top-link'><a class='toc-top-link' id='toc-system-requirements' href='#content'>&uarr; Back To Top</a></div>
<h3 ><strong>System Requirements</strong></h3>
<p>I have tested with the following software versions, other versions may or may not work.</p>
<ul>
<li>PHP Versions 4.4.9 and 5.2.6</li>
<li>Wordpress 2.7</li>
</ul>
<div class='toc-top-link'><a class='toc-top-link' id='toc-quick-start-guide' href='#content'>&uarr; Back To Top</a></div>
<h3 ><strong>Quick Start Guide</strong></h3>
<p>I will try to put more complete documentation together at some point but for now this is a quick start guide to building a search form.</p>
<ol>
<li>Install the plugin.  <a title="Download Configurable Search" href="/wordpress-plugins/wp-custom-search.zip" rel='nofollow'>Download it here</a> unzip it in your wp-content/plugins folder, then activate it in the plugins &gt; installed page of your wordpress admin site.</li>
<li>Add the widget to the sidebar on which you want it to appear. Go to the appearance &gt; widgets section of the admin page, in the list on the left find the widget &#8220;Custom Fields Search&#8221; and click the add button next to it.  It should appear in the list on the right.  Click save changes</li>
<li>You should now have a basic search from on the front of your site, to customise this further read on to see how to reconfigure your fields.</li>
</ol>
<div class='toc-top-link'><a class='toc-top-link' id='toc-setting-up-the-fields' href='#content'>&uarr; Back To Top</a></div>
<h3 ><strong>Setting up the fields</strong></h3>
<div id="attachment_34" class="wp-caption alignleft" style="width: 475px"><img class="size-full wp-image-34" title="screenshot-trimmed1" src="http://www.don-benjamin.co.uk/wordpress/wp-content/uploads/2009/03/screenshot-trimmed1.png" alt="Admin Screenshot" width="465" height="417" /><p class="wp-caption-text">Admin Screenshot</p></div>
<p>Each field has a number of settings which control the way the input appears to the user and the way the search is performed.  Most of the settings are hidden when you first go to edit the widget and you will need to click the show/hide config button to get access to many of the parameters.</p>
<p><strong>Label</strong> sets the label displayed next to the field, you can set this to whatever you want.</p>
<p><strong>Data Type</strong> controls what type of data is being searched (i.e. what database table is being used).  The standard options are &#8220;Post Field&#8221; for data such as post title and post content, from the standard wordpress post data,  &#8220;Custom Field&#8221; for data from the custom fields, and &#8220;Category&#8221; to search on the categories a post is in.</p>
<p><strong>Data Field</strong> makes a more specific selection from the data available.  The drop down list should give some sensible options, or if you know the name of the database field you want to query you can type this in manually.</p>
<p><strong>Widget</strong> controls what type of HTML input is created for the front end of the site.  It should be fairly obvious what these do.</p>
<p>Some widgets will require extra options in the <strong>Widget Options</strong> field.  At the moment this is just the drop down and radio button widgets which allow you to specify a list of values for the user to choose from.  If you leave the options blank then they will be automatically populated with a list of all values currently in the database, this can be useful for fields like categories and tags, but is less useful for fields like title which would just generate an entry for every post in the blog.  If you want to specify the values manually you can specify this as a comma separated list of values, &#8216;a,b,c&#8217; for three options with values &#8216;a&#8217;, &#8216;b&#8217; and &#8216;c&#8217; respectively, or if you want to give &#8216;friendly&#8217; labels to the user you can separate the value from the label using a colon as follows &#8216;a:Group A,b:Group B,c:Group C&#8217;.</p>
<p>The <strong>Compare</strong> field controls the way that the user input is compared to the data in the database.  I would expect the most commonly used of these to be &#8220;equals&#8221; which requires an exact match between the user data and the database field (useful for category searches) and the &#8220;Words in&#8221; or &#8220;Phrase In&#8221; types which will search to see if the user input is a part of the data, rather than a full match, this is useful for things like searching the text of a post.  The difference between &#8216;words&#8217; and &#8216;phrase&#8217; is that &#8216;words&#8217; splits the input into a series of words and searches for these individually whereas &#8216;Phrase&#8217; searches for all the words in sequence.</p>
<p>The &#8220;Less Than&#8221; and &#8220;More Than&#8221; comparisons ensure that the data is less than or more than the user input respectively.  This is probably only relevant for numeric input but it can be used for strings as well and will search alphabetically.  For numeric input it can help to also tick the &#8220;Numeric&#8221; checkbox as sometimes the database will be set up to compare numbers alphabetically (so that 10 is less than 2).</p>
<p>The &#8220;Range&#8221; comparison is a little more complicated and requires the user input to be of the form A-B to return results that are between A and B.  This is primarily intended to be used for Drop-downs and radio buttons where the values can be set by the site administrator.  If you specify the values for the dropdown like the following: &#8220;-10:Less Than 10,10-20:Between 10 and 20,20-:More than 20&#8243;, then the user will be presented with the options &#8220;Less Than 10&#8243;, &#8220;Betwen 10 and 20&#8243; and &#8220;More than 20&#8243; but the search will be done with the values &#8220;-10&#8243;,&#8221;10-20&#8243; and &#8220;20-&#8221;.  Again the numeric checkbox should be used for numeric data.</p>
<p>I hope that helps, please let me know if you have any trouble (or joy) with the plugin or if any of my instructions don&#8217;t make sense.</p>
<div class='toc-top-link'><a class='toc-top-link' id='toc-extending-custom-search' href='#content'>&uarr; Back To Top</a></div>
<h3 ><strong>Extending Custom Search<br />
</strong></h3>
<p>For developers, I&#8217;ve tried to build this in a modular way to allow extensions to be added, I will try to document this at some point in the future but if you can&#8217;t wait then the best places to get started would be to look at the filter &#8216;custom_search_get_classes&#8217; in custom-search/custom-search.php and the <a href="http://www.rogertheriault.com/agents/plugins/great-real-estate-plugin/" target="_blank" rel='nofollow'>Great Real Estate</a> bridging code in custom-search/bridges/greatrealestate.php.</p>
<p>This plugin is at quite an early stage in development though so it is likely that future versions may not be compatible with the same extension interface and it is likely that any extensions will need altering when new versions are released..</p>
<div class='toc-top-link'><a class='toc-top-link' id='toc-changes-since-v0-1' href='#content'>&uarr; Back To Top</a></div>
<h3 ><strong>Changes since v0.1</strong></h3>
<ul>
<li>I&#8217;ve reworked the UI and added some more sensible default values, hopefully this should make it less daunting for new users.</li>
<li>Fixed a few bugs.</li>
<li>Added in textual descriptions of the search parameters (for themes which support this)</li>
</ul>
<div class='toc-top-link'><a class='toc-top-link' id='toc-end' href='#content'>&uarr; Back To Top</a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.don-benjamin.co.uk/projects/foss/wp-plugins/wp-custom-search-v-02-beta/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Wordpress Custom Search Plugin 0.1 beta</title>
		<link>http://www.don-benjamin.co.uk/projects/foss/wp-plugins/wordpress-custom-search-plugin-01-beta/</link>
		<comments>http://www.don-benjamin.co.uk/projects/foss/wp-plugins/wordpress-custom-search-plugin-01-beta/#comments</comments>
		<pubDate>Thu, 12 Mar 2009 14:14:32 +0000</pubDate>
		<dc:creator>don</dc:creator>
				<category><![CDATA[Wordpress Plugins]]></category>
		<category><![CDATA[custom fields]]></category>
		<category><![CDATA[custom search]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpress plugin]]></category>

		<guid isPermaLink="false">http://www.donb.local/wordpress/?p=8</guid>
		<description><![CDATA[This is a search plugin I developed for a client project which I've attempted to generalise to the point that other people may find it useful.  Basically the problem they had was that they were storing structured meaningful data (real estate properties) but the default wordpress search didn't allow them to search it in a structured way (by price and location).  The plugin I've built allows you to configure multiple search input fields, configure the behaviour of each field (eg what options appear in a dropdown) and configure what database fields each input corresponds to (eg post title, post content, a custom field called price).]]></description>
			<content:encoded><![CDATA[<p><a id='post-start-8'></a><img style="float: left" src="/wordpress/wp-content/uploads/2009/03/screenshot-frontend.png" alt="Front End Screenshot" />This is a search plugin with which you can build a customised search form.  It allows you to search custom fields, choose multiple search parameters and choose HTML form elements to represent them.</p>
<p>I originally developed this plugin for a client project.  Basically the problem they had was that they were storing structured data (real estate properties) but the default wordpress search didn&#8217;t allow them to search it in a structured way (by price and location).  The plugin I&#8217;ve built allows you to configure multiple search input fields, configure the behaviour of each field (eg what options appear in a dropdown) and configure what database fields each input corresponds to (eg post title, post content, a custom field called price).<span id="more-8"></span></p>
<p>The plugin is now at point where I think it could be useful to other people although I&#8217;m aware that there are a lot of improvements that could be made.  Please let me know if you have any suggestions or complaints and I will do my best to get them resolved.</p>
<p>You can <a title="Download Configurable Search" href="/files/custom-search-0.1.zip" rel='nofollow'>download the plugin</a> here.</p>
<div class='toc-top-link'><a class='toc-top-link' id='toc-system-requirements' href='#content'>&uarr; Back To Top</a></div>
<h3 ><strong>System Requirements</strong></h3>
<p>Tested with:</p>
<ul>
<li>PHP Versions 4.4.9 and 5.2.6</li>
<li>Wordpress 2.7</li>
</ul>
<div class='toc-top-link'><a class='toc-top-link' id='toc-quick-start-guide' href='#content'>&uarr; Back To Top</a></div>
<h3 ><strong>Quick Start Guide</strong></h3>
<p>I will try to put more complete documentation together at some point but for now this is a quick start guide to building a search form.</p>
<ol>
<li>Install the plugin.  <a title="Download Configurable Search" href="/files/custom-search-0.1.zip" rel='nofollow'>Download it here</a> unzip it in your wp-content/plugins folder, then activate it in the plugins page of your wordpress admin site.</li>
<li>Add the widget to the sidebar on which you want it to appear.</li>
<li>Click edit and set-up the fields for your form. (More Info Below)</li>
</ol>
<div class='toc-top-link'><a class='toc-top-link' id='toc-setting-up-the-fields' href='#content'>&uarr; Back To Top</a></div>
<h3 ><strong>Setting up the fields</strong></h3>
<p>Each field has a number of settings which control the way the input appears to the user and the way the search is performed.</p>
<p><img style="float: left" src="/wordpress/wp-content/uploads/2009/03/screenshot-trimmed.png" alt="Back End Screenshot" /></p>
<p><strong>Label</strong> sets the label displayed next to the field, you can set this to whatever you want.</p>
<p><strong>Data Type</strong> controls what type of data is being searched (i.e. what database table is being used).  The standard options are &#8220;Post Field&#8221; for data such as post title and post content, from the standard wordpress post data,  &#8220;Custom Field&#8221; for data from the custom fields, and &#8220;Category&#8221; to search on the categories a post is in.</p>
<p><strong>Data Field</strong> makes a more specific selection from the data available.  The drop down list should give some sensible options, or if you know the name of the database field you want to query you can type this in manually.</p>
<p><strong>Widget</strong> controls what type of HTML input is created for the front end of the site.  It should be fairly obvious what these do.  The inputs called &#8220;Auto Values&#8221; will automatically create options based on what is in the database.</p>
<p>Some widgets will require extra options in the <strong>Widget Options</strong> field.  At the moment this is just the drop down and radio button widgets (not the auto values ones) which require you to specify a list of values for the user to choose from.  You can specify this as a comma separated list of values, &#8216;a,b,c&#8217; for three options with values &#8216;a&#8217;, &#8216;b&#8217; and &#8216;c&#8217; respectively, or if you want to give &#8216;friendly&#8217; labels to the user you can separate the value from the label using a colon as follows &#8216;a:Group A,b:Group B,c:Group C&#8217;.</p>
<p>The <strong>Compare</strong> field controls the way that the user input is compared to the data in the database.  I would expect the most commonly used of these to be &#8220;equals&#8221; which requires an exact match between the user data and the database field (useful for category searches) and the &#8220;Words in&#8221; or &#8220;Phrase In&#8221; types which will search to see if the user input is a part of the data, rather than a full match, this is useful for things like searching the text of a post.  The difference between &#8216;words&#8217; and &#8216;phrase&#8217; is that &#8216;words&#8217; splits the input into a series of words and searches for these individually whereas &#8216;Phrase&#8217; searches for all the words in sequence.</p>
<p>The &#8220;Less Than&#8221; and &#8220;More Than&#8221; comparisons ensure that the data is less than or more than the user input respectively.  This is probably only relevant for numeric input but it can be used for strings as well and will search alphabetically.  For numeric input it can help to also tick the &#8220;Numeric&#8221; checkbox as sometimes the database will be set up to compare numbers alphabetically (so that 10 is less than 2).</p>
<p>The &#8220;Range&#8221; comparison is a little more complicated and requires the user input to be of the form A-B to return results that are between A and B.  This is primarily intended to be used for Drop-downs and radio buttons where the values can be set by the site administrator.  If you specify the values for the dropdown like the following: &#8220;-10:Less Than 10,10-20:Between 10 and 20,20-:More than 20&#8243;, then the user will be presented with the options &#8220;Less Than 10&#8243;, &#8220;Betwen 10 and 20&#8243; and &#8220;More than 20&#8243; but the search will be done with the values &#8220;-10&#8243;,&#8221;10-20&#8243; and &#8220;20-&#8221;.  Again the numeric checkbox should be used for numeric data.</p>
<p>I hope that helps, please let me know if you have any trouble (or joy) with the plugin or if any of my instructions don&#8217;t make sense.</p>
<div class='toc-top-link'><a class='toc-top-link' id='toc-further-development' href='#content'>&uarr; Back To Top</a></div>
<h3 ><strong>Further Development</strong></h3>
<p>For developers, I&#8217;ve tried to build this in a modular way to allow extensions to be added, I will try to document this at some point in the future but if you can&#8217;t wait then the best places to get started would be to look at the filter &#8216;custom_search_get_classes&#8217; in custom-search/custom-search.php and the <a href="http://www.rogertheriault.com/agents/plugins/great-real-estate-plugin/" target="_blank" rel='nofollow'>Great Real Estate</a> bridging code in custom-search/bridges/greatrealestate.php.</p>
<div class='toc-top-link'><a class='toc-top-link' id='toc-end' href='#content'>&uarr; Back To Top</a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.don-benjamin.co.uk/projects/foss/wp-plugins/wordpress-custom-search-plugin-01-beta/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
	</channel>
</rss>

