From 731ab80ac2ea78f595730ecb8f4d62d7b468d084 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 15 Dec 2013 15:37:51 -0800 Subject: set system.projecthome to 1 if you want the project page for a home page. There was a bit of re-org of mod/home, which might alter the behaviour for some existing sites. Basically we're not showing a login box at all if you've got home.html - there should be a login link in th nav bar. If you haven't defined anything at all we'll fall back to the old behaviour but still allow the home contents to be set via plugin. --- mod/home.php | 92 ++++++++++++++++++++++++++++++++---------------------------- 1 file changed, 49 insertions(+), 43 deletions(-) (limited to 'mod/home.php') diff --git a/mod/home.php b/mod/home.php index 2b8e83c30..05626dcb5 100644 --- a/mod/home.php +++ b/mod/home.php @@ -1,6 +1,9 @@ profile = array('profile_uid' => $u[0]['channel_id']); + $o .= prepare_page($r[0]); + return $o; } - $r = q("select item.* from item left join item_id on item.id = item_id.iid - where item.uid = %d and sid = '%s' and service = 'WEBPAGE' and - item_restrict = %d limit 1", - intval($u[0]['channel_id']), - dbesc($page_id), - intval(ITEM_WEBPAGE) - ); - - if(! $r) { - notice( t('Item not found.') . EOL); - return; + if(get_config('system','projecthome')) { + $o .= file_get_contents('assets/home.html'); + $a->page['template'] = 'full'; + return $o; } - xchan_query($r); - $r = fetch_post_tags($r,true); - $a->profile = array('profile_uid' => $u[0]['channel_id']); - $o .= prepare_page($r[0]); + if(file_exists('home.html')) { + $o .= file_get_contents('home.html'); + } + else { -} + // If there's no site channel or home contents configured, fallback to the old behaviour -// If there's no site channel specified, fallback to the old behaviour - else { $o .= '

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

'; - if(file_exists('home.html')) { - $o .= file_get_contents('home.html'); - $a->page['template'] = 'full'; - } + $sitename = get_config('system','sitename'); + if($sitename) + $o .= '

' . sprintf( t("Welcome to %s") ,$sitename) . '

'; + if (! $a->config['system']['no_login_on_homepage']) + $o .= login(($a->config['system']['register_policy'] == REGISTER_CLOSED) ? 0 : 1); } - - if (!$a->config['system']['no_login_on_homepage']) - $o .= login(($a->config['system']['register_policy'] == REGISTER_CLOSED) ? 0 : 1); - - call_hooks("home_content",$o); - return $o; -} + call_hooks('home_content',$o); + return $o; } -- cgit v1.2.3