Renderer::setActiveTemplateEngine('smarty3');
- if (!empty($a->argv[0]) && ($a->argv[0] . ($a->argv[1] ?? '')) === ('profile' . ($a->user['nickname'] ?? '')) || $a->argv[0] === 'network' && local_user()) {
+ $args = DI::args();
+
+ if ($args->get(0) === 'profile' && $args->get(1) === ($a->user['nickname'] ?? '') || $args->get(0) === 'network' && local_user()
+ ) {
vier_community_info();
DI::page()['htmlhead'] .= "<link rel='stylesheet' type='text/css' href='view/theme/vier/wide.css' media='screen and (min-width: 1300px)'/>\n";
// Hide the left menu bar
/// @TODO maybe move this static array out where it should belong?
- if (empty(DI::page()['aside']) && in_array($a->argv[0], ["community", "events", "help", "delegation", "notifications",
+ if (empty(DI::page()['aside']) && in_array($args->get(0), ["community", "events", "help", "delegation", "notifications",
"probe", "webfinger", "login", "invite", "credits"])) {
DI::page()['htmlhead'] .= "<link rel='stylesheet' href='view/theme/vier/hide.css' />";
}
function vier_community_info()
{
- $a = DI::app();
-
$show_pages = get_vier_config("show_pages", 1);
$show_profiles = get_vier_config("show_profiles", 1);
$show_helpers = get_vier_config("show_helpers", 1);
// comunity_profiles
if ($show_profiles) {
- $contacts = Contact::getSuggestions(local_user(), 0, 9);
+ $contacts = Contact\Relation::getSuggestions(local_user(), 0, 9);
$tpl = Renderer::getMarkupTemplate('ch_directory_item.tpl');
if (DBA::isResult($contacts)) {
//Community_Pages at right_aside
if ($show_pages && local_user()) {
- $cid = $_GET['cid'] ?? null;
-
- //sort by last updated item
- $lastitem = true;
-
- $contacts = ForumManager::getList($a->user['uid'], $lastitem, true, true);
- $total = count($contacts);
- $visible_forums = 10;
-
- if (count($contacts)) {
- $id = 0;
-
- foreach ($contacts as $contact) {
- $selected = (($cid == $contact['id']) ? ' forum-selected' : '');
-
- $entry = [
- 'url' => 'network?contactid=' . $contact['id'],
- 'external_url' => Contact::magicLink($contact['url']),
- 'name' => $contact['name'],
- 'cid' => $contact['id'],
- 'selected' => $selected,
- 'micro' => Contact::getMicro($contact),
- 'id' => ++$id,
- ];
- $entries[] = $entry;
- }
-
-
- $tpl = Renderer::getMarkupTemplate('widget_forumlist_right.tpl');
-
- $page = Renderer::replaceMacros(
- $tpl,
- [
- '$title' => DI::l10n()->t('Forums'),
- '$forums' => $entries,
- '$link_desc' => DI::l10n()->t('External link to forum'),
- '$total' => $total,
- '$visible_forums' => $visible_forums,
- '$showmore' => DI::l10n()->t('show more')]
- );
-
- $aside['$page'] = $page;
- }
+ $aside['$page'] = ForumManager::widget('network/forum', local_user());;
}
// END Community Page