diff options
author | Paolo Tacconi <p.tacconi@giunti.it> | 2014-09-15 10:01:25 +0200 |
---|---|---|
committer | Paolo Tacconi <p.tacconi@giunti.it> | 2014-09-15 10:01:25 +0200 |
commit | 4f793069bf4aafcfe77d50e47690173104ef23c7 (patch) | |
tree | 7fe1bfcb18672300bf14967338690ea4fa51e640 /mod/home.php | |
parent | ed7f3001c1c1deec5076ae12114e5c42865b6251 (diff) | |
parent | 58aad83e5cb0edaf1ccc543147030e782c5e7ba9 (diff) | |
download | volse-hubzilla-4f793069bf4aafcfe77d50e47690173104ef23c7.tar.gz volse-hubzilla-4f793069bf4aafcfe77d50e47690173104ef23c7.tar.bz2 volse-hubzilla-4f793069bf4aafcfe77d50e47690173104ef23c7.zip |
Merge branch 'master' of https://github.com/friendica/red
Diffstat (limited to 'mod/home.php')
-rw-r--r-- | mod/home.php | 47 |
1 files changed, 27 insertions, 20 deletions
diff --git a/mod/home.php b/mod/home.php index bc352976d..576213e06 100644 --- a/mod/home.php +++ b/mod/home.php @@ -39,10 +39,29 @@ function home_content(&$a) { if(x($_SESSION,'mobile_theme')) unset($_SESSION['mobile_theme']); - $channel_address = get_config("system", "site_channel" ); - if ($channel_address){ - // We can do better, but until we figure out auto-linkification, let's keep things simple + if(get_config('system','projecthome')) { + $o .= file_get_contents('assets/home.html'); + $a->page['template'] = 'full'; + $a->page['title'] = t('Red Matrix - "The Network"'); + return $o; + } + + +// Deprecated + $channel_address = get_config("system", "site_channel" ); + +// See if the sys channel set a homepage + if (! $channel_address) { + $u = get_sys_channel(); + if ($u) { + $u = array($u); + // change to channel_id when below deprecated and skip the $u=... + $channel_address = $u[0]['channel_address']; + } + } + + if ($channel_address){ $page_id = 'home'; @@ -50,11 +69,6 @@ function home_content(&$a) { dbesc($channel_address) ); - if(! $u) { - notice( t('Channel not found.') . EOL); - return; - } - $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", @@ -63,31 +77,24 @@ function home_content(&$a) { intval(ITEM_WEBPAGE) ); - if(! $r) { - notice( t('Item not found.') . EOL); - return; - } - + if($r) { xchan_query($r); $r = fetch_post_tags($r,true); $a->profile = array('profile_uid' => $u[0]['channel_id']); $o .= prepare_page($r[0]); return $o; - } + } - if(get_config('system','projecthome')) { - $o .= file_get_contents('assets/home.html'); - $a->page['template'] = 'full'; - $a->page['title'] = t('Red Matrix - "The Network"'); - return $o; } +// Nope, we didn't find an item. Let's see if there's any html + 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 nothing special happening, just spit out a login box $sitename = get_config('system','sitename'); if($sitename) |