Elgg  Version 1.9
tag.php
Go to the documentation of this file.
1 <?php
12 if (empty($vars['value']) && $vars['value'] !== 0 && $vars['value'] !== '0') {
13  return;
14 }
15 
16 $query_params = array();
17 
18 $query_params["q"] = $vars['value'];
19 $query_params["search_type"] = "tags";
20 
21 if (!empty($vars['type'])) {
22  $query_params["type"] = $vars['type'];
23 }
24 
25 if (!empty($vars['subtype'])) {
26  $query_params["subtype"] = $vars['subtype'];
27 }
28 
29 if (!empty($vars['base_url'])) {
30  $url = $vars['base_url'];
31 } else {
32  $url = elgg_get_site_url() . "search";
33 }
34 
35 $http_query = http_build_query($query_params);
37  $url .= "?" . $http_query;
38 }
39 
40 echo elgg_view('output/url', array(
41  'href' => $url,
42  'text' => $vars['value'],
43  'encode_text' => true,
44  'rel' => 'tag',
45 ));
if(empty($vars['value'])&&$vars['value']!==0 &&$vars['value']!== '0') $query_params
Elgg single tag output.
Definition: tag.php:16
$url
Definition: exceptions.php:24
$http_query
Definition: tag.php:35
elgg echo
Translates a string.
Definition: languages.js:43
$vars
Definition: tag.php:23
elgg_get_site_url($site_guid=0)
Get the URL for the current (or specified) site.
elgg_view($view, $vars=array(), $bypass=false, $ignored=false, $viewtype= '')
Return a parsed view.
Definition: views.php:354