Fixing a small css issue in the user class.
[elgg.git] / units / search / search_suggest_tags.php
blob5454ba82005ec3f6af2421d0c958aec83f76db75
1 <?php
2 global $CFG,$USER;
3 global $db;
5 if (isset($parameter)) {
7 if ($CFG->dbtype == 'mysql') {
8 $dbtag = $db->qstr($parameter);
9 $searchline = "SELECT DISTINCT tag, MATCH(tag) AGAINST (" . $dbtag . ") AS score
10 FROM ".$CFG->prefix."tags
11 WHERE (" . run("users:access_level_sql_where",$USER->ident) . ")
12 AND (MATCH(tag) AGAINST(" . $dbtag . ") > 0) LIMIT 10";
13 } else {
14 $dbtag = $db->qstr("%" . $parameter . "%");
15 $searchline = "SELECT DISTINCT tag,1
16 FROM ".$CFG->prefix."tags
17 WHERE (" . run("users:access_level_sql_where",$USER->ident) . ")
18 AND (tag LIKE " . $dbtag . ") LIMIT 10";
21 if (($results = get_records_sql($searchline)) && count($results) > 1) {
22 $run_result .= "<h2>" . __gettext("Automatic tag suggestion:") . "</h2><p>";
23 foreach($results as $returned_tag) {
24 if ($returned_tag->tag != $parameter) {
25 $run_result .= "<a href=\"".url."tag/".urlencode($returned_tag->tag)."\">" . htmlspecialchars($returned_tag->tag) . "</a> <br />";
28 $run_result .= "</p>";