|
Revision 2, 0.7 kB
(checked in by sven, 3 years ago)
|
importing elgg-0.1.1a
|
| 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>Automatic tag suggestion:</h2><p>"; |
|---|
| 16 |
foreach($results as $returned_tag) { |
|---|
| 17 |
if ($returned_tag->tag != $tag) { |
|---|
| 18 |
$run_result .= "<a href=\"/tag/".stripslashes($returned_tag->tag)."\">" . stripslashes($returned_tag->tag) . "</a> <br />"; |
|---|
| 19 |
} |
|---|
| 20 |
} |
|---|
| 21 |
$run_result .= "</p>"; |
|---|
| 22 |
|
|---|
| 23 |
} |
|---|
| 24 |
|
|---|
| 25 |
} |
|---|
| 26 |
|
|---|
| 27 |
?> |
|---|