2011-01-24, 05:23:33
I put this code in the component search
Code:
<form action="<?php echo find_url('search', null); ?>">
<div class="tags"><?php get_i18n_tags(60,250); ?></div>
<input type="hidden" name="tags" value="<?php echo htmlspecialchars(@$_REQUEST['tags'])?>"/>
<input type="text" name="words" value="<?php echo htmlspecialchars(@$_REQUEST['words'])?>"/>
<input type="submit" name="search" value="Go" />
</form>
<script type="text/javascript">
$(function() {
$('.tags .tag').click(function(e) {
$(e.target).toggleClass('selected');
var tags = ''
$('.tags .tag.selected').each(function() { tags += ' '+$(this).text(); });
$('[name=tags]').val(tags);
});
var tags = $('[name=tags]').val().split(' ');
$('.tags .tag').each(function() {
if ($.inArray($(this).text(),tags) >= 0) $(this).addClass('selected');
});
})
</script>
<br />
<?php
if (isset($_REQUEST['search'])) {
?>
<h2>Search Results</h2>
<?php
get_i18n_search_results($tags=null, $words=null,
$notfoundtext='No results found!', $dateformat='l, F jS, Y - g:i A',
$max=10, $excerptlength=30)
}
?>