diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/taxonomy.php | 19 | ||||
-rw-r--r-- | include/widgets.php | 19 |
2 files changed, 30 insertions, 8 deletions
diff --git a/include/taxonomy.php b/include/taxonomy.php index 65d082bb0..7887f7687 100644 --- a/include/taxonomy.php +++ b/include/taxonomy.php @@ -217,16 +217,19 @@ function tagblock($link,$uid,$count = 0,$authors = '',$flags = 0,$restrict = 0,$ } function dir_tagblock($link,$r) { - $o = ''; - $tab = 0; + $o = ''; + $tab = 0; - if($r) { - $o = '<div class="dirtagblock widget"><h3>' . t('Keywords') . '</h3><div class="tags" align="center">'; - foreach($r as $rr) { - $o .= '<a href="'.$link .'/' . '?f=&keywords=' . urlencode($rr['term']).'" class="tag'.$rr['normalise'].'" rel="nofollow" >'.$rr['term'].'</a> ' . "\r\n"; + if(! $r) + $r = get_app()->data['directory_keywords']; + + if($r) { + $o = '<div class="dirtagblock widget"><h3>' . t('Keywords') . '</h3><div class="tags" align="center">'; + foreach($r as $rr) { + $o .= '<a href="'.$link .'/' . '?f=&keywords=' . urlencode($rr['term']).'" class="tag'.$rr['normalise'].'" rel="nofollow" >'.$rr['term'].'</a> ' . "\r\n"; + } + $o .= '</div></div>'; } - $o .= '</div></div>'; - } return $o; } diff --git a/include/widgets.php b/include/widgets.php index 2591a9d09..5e2285de7 100644 --- a/include/widgets.php +++ b/include/widgets.php @@ -1,5 +1,8 @@ <?php /** @file */ +require_once('include/dir_fns.php'); +require_once('include/contact_widgets.php'); + function widget_profile($args) { $a = get_app(); @@ -549,3 +552,19 @@ function widget_vcard($arr) { return vcard_from_xchan('',get_app()->get_observer()); } + +/** + * The following directory widgets are only useful on the directory page + */ + +function widget_dirsafemode($arr) { + return dir_safe_mode(); +} + +function widget_dirsort($arr) { + return dir_sort_links(); +} + +function widget_dirtags($arr) { + return dir_tagblock(z_root() . '/directory',null); +}
\ No newline at end of file |