root/devel-backup/units/search/search_suggest_tags.php

Revision 45, 0.7 kB (checked in by sven, 3 years ago)

dos2unix to clean line endings, set svn property eol-style native, some whitespace homogenisation

  • Property svn:eol-style set to native
Line 
1 <?php
2
3     if (isset($parameter)) {
4         
5         $tag = addslashes($parameter);
6         
7         $searchline = "select distinct tag, match(tag) against ('".$tag."') as score from tags where ";
8         $searchline .= "(" . run("users:access_level_sql_where",$_SESSION['userid']) . ")";
9         $searchline .= " and (match(tag) against ('".$tag."') > 0) limit 10";
10         
11         $results = db_query($searchline);
12         
13         if (sizeof($results) > 1) {
14             
15             $run_result .= "<h2>" . gettext("Automatic tag suggestion:") . "</h2><p>";
16             foreach($results as $returned_tag) {
17                 if ($returned_tag->tag != $tag) {
18                     $run_result .= "<a href=\"".url."tag/".urlencode(stripslashes($returned_tag->tag))."\">" . stripslashes($returned_tag->tag) . "</a> <br />";
19                 }
20             }
21             $run_result .= "</p>";
22             
23         }
24         
25     }
26
27 ?>
Note: See TracBrowser for help on using the browser.