Browse Source

[svn r16203] Added limit to maximum 3 search terms at the same time

Yannick Warnier 16 years ago
parent
commit
9c80fcf83f
1 changed files with 6 additions and 1 deletions
  1. 6 1
      main/inc/lib/search/search_widget.php

+ 6 - 1
main/inc/lib/search/search_widget.php

@@ -88,6 +88,7 @@ method="get">
         foreach ($dktags as $tag)
         {
             $tag = trim($tag['name'], 'T ');
+            $tag = str_replace(' ', '_', $tag);
             $color = "";
             if ($filter) {
                 if (array_search($tag, $post_tags) !== FALSE)
@@ -98,7 +99,11 @@ method="get">
                 <?php echo $tag ?></span>
             <script type="text/javascript">
                 $('#<?php echo $tag ?>').click(function waaa (e) {
-                    $('#<?php echo $tag ?>').toggleClass('lighttagcolor');
+                    if ( $('.lighttagcolor').size() < 3) {
+                        $('#<?php echo $tag ?>').toggleClass('lighttagcolor');
+                    } else {
+                        $('#<?php echo $tag ?>').removeClass('lighttagcolor');
+                    }
                 });
             </script>
             <?php