]> git.mxchange.org Git - friendica.git/blobdiff - mod/directory.php
don't use load_view_file() except in email templates and install of htconfig - to...
[friendica.git] / mod / directory.php
index 72c30fb3178da115b97d58b968c00fd74bdf6c02..a83eae3f0be957cb6f065b316c7490bfc54a79fc 100644 (file)
@@ -13,6 +13,12 @@ function directory_post(&$a) {
 
 
 function directory_content(&$a) {
+
+       if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) {
+               notice( t('Public access denied.') . EOL);
+               return;
+       }
+
        $o = '';
        $o .= '<script> $(document).ready(function() { $(\'#nav-directory-link\').addClass(\'nav-selected\'); });</script>';
        if(x($_SESSION,'theme'))
@@ -23,7 +29,7 @@ function directory_content(&$a) {
        else
                $search = ((x($_GET,'search')) ? notags(trim(rawurldecode($_GET['search']))) : '');
 
-       $tpl = load_view_file('view/directory_header.tpl');
+       $tpl = file_get_contents('view/directory_header.tpl');
 
        $globaldir = '';
        $gdirpath = dirname(get_config('system','directory_submit_url'));
@@ -35,7 +41,9 @@ function directory_content(&$a) {
        $o .= replace_macros($tpl, array(
                '$search' => $search,
                '$globaldir' => $globaldir,
-               '$finding' => (strlen($search) ? '<h4>' . t('Finding: ') . "'" . $search . "'" . '</h4>' : "")
+               '$finding' => (strlen($search) ? '<h4>' . t('Finding: ') . "'" . $search . "'" . '</h4>' : ""),
+               '$sitedir' => t('Site Directory'),
+               '$submit' => t('Find')
        ));
 
        if($search)
@@ -57,7 +65,7 @@ function directory_content(&$a) {
        );
        if(count($r)) {
 
-               $tpl = load_view_file('view/directory_item.tpl');
+               $tpl = file_get_contents('view/directory_item.tpl');
 
                if(in_array('small', $a->argv))
                        $photo = 'thumb';