Combine pisearch with Ajax highlight function

Do something cool with CMS? Show us ...
This board is for 'Answers', and the discussion of answers... Not for questions.
Post Reply
benn

Combine pisearch with Ajax highlight function

Post by benn »

How to used pisearch but add the Ajax highlight function to it.

Here's what to do:

Install
pisearch 1.71
ajax plugin: function.content_highlight.php (into plugins folder)

Then edit pisearch in the content menu
Form:

Code: Select all

<!-- Start PisearchForm -->
<form action="http://www.webber-design.com/RCPCH/index.php?page=Pisearch" method="post">
<table summary="Pisearchtable">
  <tr>
  <td>
<label for="Inputfeld for words to search"><h4>Search</h4></label>
</td>
  </tr>
  <tr>
    <td><input type="text" value="Words to search ..." maxlength="255" size="25" name="pisearch" id="searching" /></td>
  </tr>
  <tr>
  <td><select name="special" size="1">
<option value="0">Standard</option>
<option value="1">Soundex</option>
<option value="2">Levenshtein</option>
<option value="3">Similar Text</option>
</select>
</td>
  </tr>
  <tr>
  <td>
<select name="textlength" size="1">
<option value="100">100 Length of text  </option>
<option value="200">200 Length of text  </option>
<option value="300">300 Length of text  </option>
<option value="400">400 Length of text  </option>
</select>
</td>
  </tr>

  <tr>
  <td>
<input type="submit" value="{$searchbutton}" id="buttonSearch" />
  <input type="hidden" name="action" value="showresults" />
  </td>
  </tr>
</table>
</form>
<!-- End ModPisearchForm -->
Results

Code: Select all

{if $pisearchtotal eq 0}
{if $pisearchwordcount >1}
<div class="pisearchresultheader">{$noresult_many_a} ->{$pisearchwords}<- {$noresults_many_b}.</div>
{else}
<div class="pisearchresultheader">{$noresult_one_a} ->{$pisearchwords}<- {$noresult_one_b}.</div>
{/if}
{else}
{if $pisearchtotal > 1}
<div class="pisearchresultheader">{$results_many_a}{$pisearchtotal} {$results_many_b} ->{$pisearchwords}<-.</div><br />
{else}
<div class="pisearchresultheader">{$results_one_a}{$pisearchtotal} {$results_one_b} ->{$pisearchwords}<-.</div><br />
{/if}
{/if}
{$searchmode}: 
{if $pispecial eq 0}
{$standard}
{elseif $pispecial eq 1 }
{$soundex}
{elseif $pispecial eq 2 }
{$levenshtein}
{elseif $pispecial eq 3 }
{$similartext}
{/if}<br /> <br />
{foreach from=$pisearchresults item=entry}
<a class="pisearchlink" href="{$entry->url}&mots={$pisearchwords}">{$entry->menutext}</a> <br /><br />
<div class="pisearchdetails">{$entry->details}</div><br />
{/foreach}
Hope this helps
OlafNoehring
Forum Members
Forum Members
Posts: 78
Joined: Mon Oct 23, 2006 4:43 pm

Re: Combine pisearch with Ajax highlight function

Post by OlafNoehring »

Hi

reading this I want to bring out a warning. I have had problems with the feedback form (specifically with mail) - this error is based on the ajax search plugin.
Read more here (german): http://forum.cmsmadesimple.org/index.ph ... 40581.html

Olaf
benn

Re: Combine pisearch with Ajax highlight function

Post by benn »

Hi Olaf

Thanks for letting me know as I was about to use the plugin again for a new site. Tried to read the post you linked to but can't read German very well. Is the problem with the smarty {content_highlight highlight="true"} or the plugin?

Benn
OlafNoehring
Forum Members
Forum Members
Posts: 78
Joined: Mon Oct 23, 2006 4:43 pm

Re: Combine pisearch with Ajax highlight function

Post by OlafNoehring »

Hi

I am sorry I can not tell you for sure. I removed the ajax part from my site (now using pisearch). Afterwards the error was gone - so I am not sure if it's smarty or the plugin. Nevertheless as you might have noticed already, the ajax search is quite undocumented. Afaik there has not been (much) development lately.

Olaf
Post Reply

Return to “Tips and Tricks”