]> git.mxchange.org Git - friendica.git/blobdiff - mod/directory.php
highlight any messages on page newer than 12 hours
[friendica.git] / mod / directory.php
index dd80ef2b8ab994d2e2e2783a583ae0fc1a89e547..703c08ce1bec37bfdd1add92c130fd5b812f05e4 100644 (file)
@@ -4,14 +4,24 @@ function directory_init(&$a) {
 }
 
 function directory_content(&$a) {
+       $o = '';
+       $o .= '<script> $(document).ready(function() { $(\'#nav-directory-link\').addClass(\'nav-selected\'); });</script>';
 
        $search = ((x($_GET,'search')) ? notags(trim($_GET['search'])) : '');
 
-       $tpl .= file_get_contents('view/directory_header.tpl');
+       $tpl = load_view_file('view/directory_header.tpl');
+
+       $globaldir = '';
+       $gdirpath = dirname(get_config('system','directory_submit_url'));
+       if(strlen($gdirpath)) {
+               $globaldir = '<ul><li><div id="global-directory-link"><a href="'
+               . $gdirpath . '">' . t('Global Directory') . '</a></div></li></ul>';
+       }
 
        $o .= replace_macros($tpl, array(
                '$search' => $search,
-               '$finding' => (strlen($search) ? "<h4>Finding: '$search'</h4>" : "")
+               '$globaldir' => $globaldir,
+               '$finding' => (strlen($search) ? '<h4>' . t('Finding: ') . "'" . $search . "'" . '</h4>' : "")
        ));
 
        if($search)
@@ -31,7 +41,7 @@ function directory_content(&$a) {
        );
        if(count($r)) {
 
-               $tpl = file_get_contents('view/directory_item.tpl');
+               $tpl = load_view_file('view/directory_item.tpl');
 
                if(in_array('small', $a->argv))
                        $photo = 'thumb';