Difference between revisions of "Search Functions"

From GeeklogWiki
Jump to: navigation, search
Line 1: Line 1:
If you want your plugin to be searchable, implement these functions.</p>
+
'''Note:''' This page describes the old search API. As of Geeklog 1.6.0, plugin authors are encouraged to use the new search API, described here: [[Using Geeklog's Improved Search Engine]]
 +
 
 +
 
 +
If you want your plugin to be searchable, implement these functions.
  
 
       <table cellpadding="2" cellspacing="2" border="1" width="90%" align="Center">
 
       <table cellpadding="2" cellspacing="2" border="1" width="90%" align="Center">
Line 8: Line 11:
 
           </tr>
 
           </tr>
 
           <tr>
 
           <tr>
             <td valign="top" class="codeheader">plugin_getsearchtypes_&lt;plugin  
+
             <td valign="top" class="codeheader">plugin_getsearchtypes_&lt;plugin name&gt;</td>
    name&gt;</td>
 
 
             <td valign="top" class="code">You will probably want to add a
 
             <td valign="top" class="code">You will probably want to add a
     new type in the Type drop down on search.php.&nbsp; This function prints
+
     new type in the Type drop down on search.php.&nbsp; This function prints the option tags needed. make sure that the value tag is &lt;plugin name&gt;</td>
    the option tags needed. make sure that the value tag is &lt;plugin name&gt;</td>
 
 
           </tr>
 
           </tr>
 
           <tr>
 
           <tr>
             <td valign="top" class="codeheader">plugin_dopluginsearch_&lt;plugin  
+
             <td valign="top" class="codeheader">plugin_dopluginsearch_&lt;plugin name&gt;</td>
    name&gt;</td>
+
             <td valign="top" class="code">Takes the search criteria and lets you build search results for your plugin.&nbsp; This returns a string
             <td valign="top" class="code">Takes the search criteria and lets
+
  array of table rows, one row for each record returned by your search.</td>
    you build search results for your plugin.&nbsp; This returns a string
 
  array   of table rows, one row for each record returned by your search.</td>
 
 
           </tr>
 
           </tr>
 
       </table>
 
       </table>
 +
  
 
[[Category:Plugin Development]]
 
[[Category:Plugin Development]]

Revision as of 07:45, 6 May 2009

Note: This page describes the old search API. As of Geeklog 1.6.0, plugin authors are encouraged to use the new search API, described here: Using Geeklog's Improved Search Engine


If you want your plugin to be searchable, implement these functions.

Table 3. Search functions
Function Description of Function
plugin_getsearchtypes_<plugin name> You will probably want to add a new type in the Type drop down on search.php.  This function prints the option tags needed. make sure that the value tag is <plugin name>
plugin_dopluginsearch_<plugin name> Takes the search criteria and lets you build search results for your plugin.  This returns a string array of table rows, one row for each record returned by your search.