aboutsummaryrefslogtreecommitdiff
path: root/views/default/output/tags.php
blob: 39cee3280762231c97b556ab8386dec77d4f1301 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
    if (!empty($vars['tags'])) {
        
        $string = "";
        if (!is_array($vars['tags']))
        	$vars['tags'] = array($vars['tags']);

        foreach($vars['tags'] as $tag) {
            if (!empty($tagstr)) {
                $tagstr .= ", ";
            }
           if (!empty($vars['type'])) {
               $type = "&type={$vars['type']}";
           } else {
               $type = "";
           }
           if (is_string($tag)) {
               $tagstr .= "<a href=\"{$vars['url']}search/?tag=".urlencode($tag) . "{$type}\">{$tag}</a>";
           } else {
               $tagstr .= "<a href=\"{$vars['url']}search/?tag=".urlencode($tag->value) . "{$type}\">{$tag->value}</a>";
           }
        }
        echo $tagstr;
        
    }
?>