]> git.mxchange.org Git - friendica-addons.git/blobdiff - communityhome/communityhome.php
Merge pull request #88 from fermionic/20121222-support-smarty3-template-engine
[friendica-addons.git] / communityhome / communityhome.php
index 14c40328e0b3613f5b1db5318503c020e211db5e..8b831888a330852c7f64c84318082704e42c51cc 100755 (executable)
@@ -47,7 +47,8 @@ function communityhome_home(&$a, &$o){
                0,
                12
        );
-       $tpl = file_get_contents( dirname(__file__).'/directory_item.tpl');
+#      $tpl = file_get_contents( dirname(__file__).'/directory_item.tpl');
+       $tpl = get_markup_template( 'directory_item.tpl', 'addon/communityhome/' );
        if(count($r)) {
                $photo = 'thumb';
                foreach($r as $rr) {
@@ -55,7 +56,7 @@ function communityhome_home(&$a, &$o){
                        $entry = replace_macros($tpl,array(
                                '$id' => $rr['id'],
                                '$profile-link' => $profile_link,
-                               '$photo' => $rr[$photo],
+                               '$photo' => $a->get_cached_avatar_image($rr[$photo]),
                                '$alt-text' => $rr['name'],
                        ));
                        $aside['$lastusers_items'][] = $entry;
@@ -105,6 +106,7 @@ function communityhome_home(&$a, &$o){
                                `user` 
                                WHERE `user`.`uid` = `photo`.`uid`
                                AND `user`.`blockwall`=0
+                               AND `user`.`hidewall` = 0
                                ORDER BY `photo`.`edited` DESC
                                LIMIT 0, 12",
                                dbesc(t('Contact Photos')),
@@ -113,7 +115,8 @@ function communityhome_home(&$a, &$o){
 
                
        if(count($r)) {
-               $tpl = file_get_contents( dirname(__file__).'/directory_item.tpl');
+#              $tpl = file_get_contents( dirname(__file__).'/directory_item.tpl');
+               $tpl = get_markup_template( 'directory_item.tpl', 'addon/communityhome/' );
                foreach($r as $rr) {
                        $photo_page = $a->get_baseurl() . '/photos/' . $rr['nickname'] . '/image/' . $rr['resource-id'];
                        $photo_url = $a->get_baseurl() . '/photo/' .  $rr['resource-id'] . '-' . $rr['scale'] .'.jpg';
@@ -173,7 +176,8 @@ function communityhome_home(&$a, &$o){
                
        }
        
-       $tpl = file_get_contents(dirname(__file__).'/communityhome.tpl');
+#      $tpl = file_get_contents(dirname(__file__).'/communityhome.tpl');
+       $tpl = get_markup_template('communityhome.tpl', 'addon/communityhome/');
        $a->page['aside'] = replace_macros($tpl, $aside);
        
        $o = '<h1>' . ((x($a->config,'sitename')) ? sprintf( t("Welcome to %s") ,$a->config['sitename']) : "" ) . '</h1>';