X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=view%2Ftheme%2Fvier%2Ftheme.php;h=a35afa719bd5cd3207cef574f26ab8a756147c59;hb=be7041c3e06ee5a799851ac3612849dde55a8198;hp=c2669f5a931ae8030d88ba603d596b243ec894b9;hpb=0c67c89715df801e0c887be50c9739db3bae7ca3;p=friendica.git diff --git a/view/theme/vier/theme.php b/view/theme/vier/theme.php index c2669f5a93..a35afa719b 100644 --- a/view/theme/vier/theme.php +++ b/view/theme/vier/theme.php @@ -13,16 +13,12 @@ require_once("include/plugin.php"); require_once("include/socgraph.php"); require_once("mod/proxy.php"); -function vier_init(&$a) { +function vier_init(App $a) { $a->theme_events_in_profile = false; set_template_engine($a, 'smarty3'); - $baseurl = $a->get_baseurl(); - - $a->theme_info = array(); - if ($a->argv[0].$a->argv[1] === "profile".$a->user['nickname'] or $a->argv[0] === "network" && local_user()) { vier_community_info(); @@ -33,44 +29,43 @@ function vier_init(&$a) { $a->page['htmlhead'] .= ''."\n"; $a->page['htmlhead'] .= ''."\n"; } - // deactivated since it doesn't work with desktop browsers at the moment (To-Do) - //$a->page['htmlhead'] .= ''."\n"; + /// @todo deactivated since it doesn't work with desktop browsers at the moment + //$a->page['htmlhead'] .= ''."\n"; -$a->page['htmlhead'] .= <<< EOT + $a->page['htmlhead'] .= <<< EOT EOT; - -if ($a->is_mobile || $a->is_tablet){ - $a->page['htmlhead'] .= <<< EOT + if ($a->is_mobile || $a->is_tablet){ + $a->page['htmlhead'] .= <<< EOT EOT; -} - + } // Hide the left menu bar if (($a->page['aside'] == "") AND in_array($a->argv[0], array("community", "events", "help", "manage", "notifications", - "probe", "webfinger", "login", "invite", "credits"))) + "probe", "webfinger", "login", "invite", "credits"))) { $a->page['htmlhead'] .= ""; + } } function get_vier_config($key, $default = false, $admin = false) { @@ -142,25 +132,25 @@ function vier_community_info() { $show_lastusers = get_vier_config("show_lastusers", 1); //get_baseurl - $url = $a->get_baseurl($ssl_state); + $url = App::get_baseurl($ssl_state); $aside['$url'] = $url; // comunity_profiles - if($show_profiles) { + if ($show_profiles) { $r = suggestion_query(local_user(), 0, 9); $tpl = get_markup_template('ch_directory_item.tpl'); - if(count($r)) { + if (dbm::is_result($r)) { $aside['$comunity_profiles_title'] = t('Community Profiles'); $aside['$comunity_profiles_items'] = array(); - foreach($r as $rr) { + foreach ($r as $rr) { $entry = replace_macros($tpl,array( '$id' => $rr['id'], //'$profile_link' => zrl($rr['url']), - '$profile_link' => $a->get_baseurl().'/follow/?url='.urlencode($rr['url']), + '$profile_link' => 'follow/?url='.urlencode($rr['url']), '$photo' => proxy_url($rr['photo'], false, PROXY_SIZE_MICRO), '$alt_text' => $rr['name'], )); @@ -170,27 +160,28 @@ function vier_community_info() { } // last 9 users - if($show_lastusers) { + if ($show_lastusers) { $publish = (get_config('system','publish_all') ? '' : " AND `publish` = 1 "); $order = " ORDER BY `register_date` DESC "; + $tpl = get_markup_template('ch_directory_item.tpl'); + $r = q("SELECT `profile`.*, `profile`.`uid` AS `profile_uid`, `user`.`nickname` FROM `profile` LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid` WHERE `is-default` = 1 $publish AND `user`.`blocked` = 0 $order LIMIT %d , %d ", 0, 9); - $tpl = get_markup_template('ch_directory_item.tpl'); - if(count($r)) { + if (dbm::is_result($r)) { $aside['$lastusers_title'] = t('Last users'); $aside['$lastusers_items'] = array(); - foreach($r as $rr) { - $profile_link = $a->get_baseurl() . '/profile/' . ((strlen($rr['nickname'])) ? $rr['nickname'] : $rr['profile_uid']); + foreach ($r as $rr) { + $profile_link = 'profile/' . ((strlen($rr['nickname'])) ? $rr['nickname'] : $rr['profile_uid']); $entry = replace_macros($tpl,array( '$id' => $rr['id'], '$profile_link' => $profile_link, - '$photo' => $a->get_cached_avatar_image($rr['thumb']), + '$photo' => $a->remove_baseurl($rr['thumb']), '$alt_text' => $rr['name'])); $aside['$lastusers_items'][] = $entry; } @@ -207,7 +198,7 @@ function vier_community_info() { $nv['suggest'] = Array('suggest', t('Friend Suggestions'), "", ""); $nv['invite'] = Array('invite', t('Invite Friends'), "", ""); - $nv['search'] = '