X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=communityhome%2Fcommunityhome.php;h=8b831888a330852c7f64c84318082704e42c51cc;hb=75f47b74d2295f82fa28abe06a3d18662cc42c5f;hp=8f0aa867509998266029d40ac05c4c4aa3e7a9f8;hpb=bbb8a4537f4e8972d71de6b4a5f3d1a582a9959d;p=friendica-addons.git diff --git a/communityhome/communityhome.php b/communityhome/communityhome.php old mode 100644 new mode 100755 index 8f0aa867..8b831888 --- a/communityhome/communityhome.php +++ b/communityhome/communityhome.php @@ -35,7 +35,7 @@ function communityhome_home(&$a, &$o){ $aside['$login_form'] = login(($a->config['register_policy'] == REGISTER_CLOSED) ? false : true); // last 12 users - $aside['$lastusers_title'] = t('Last users'); + $aside['$lastusers_title'] = t('Latest users'); $aside['$lastusers_items'] = array(); $sql_extra = ""; $publish = (get_config('system','publish_all') ? '' : " AND `publish` = 1 " ); @@ -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; @@ -95,7 +96,7 @@ function communityhome_home(&$a, &$o){ } // last 12 photos - $aside['$photos_title'] = t('Last photos'); + $aside['$photos_title'] = t('Latest photos'); $aside['$photos_items'] = array(); $r = q("SELECT `photo`.`id`, `photo`.`resource-id`, `photo`.`scale`, `photo`.`desc`, `user`.`nickname`, `user`.`username` FROM (SELECT `resource-id`, MAX(`scale`) as maxscale FROM `photo` @@ -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'; @@ -130,7 +133,7 @@ function communityhome_home(&$a, &$o){ } // last 10 liked items - $aside['$like_title'] = t('Last likes'); + $aside['$like_title'] = t('Latest likes'); $aside['$like_items'] = array(); $r = q("SELECT `T1`.`created`, `T1`.`liker`, `T1`.`liker-link`, `item`.* FROM (SELECT `parent-uri`, `created`, `author-name` AS `liker`,`author-link` AS `liker-link` @@ -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 = '

' . ((x($a->config,'sitename')) ? sprintf( t("Welcome to %s") ,$a->config['sitename']) : "" ) . '

';