allow somebody to access the "home page content" (whatever that may be) even after logging in by including a home/splash argument. It appears that nothing else is required to provide 'sys' channel webpage contents except a link in the admin page to create them. There *may* be an issue with comanche theme selection but we'll cross that bridge when we come to it. Also thinking that we might want to map /home/foo to /page/sys/foo in the longer term scheme of things.

This commit is contained in:
friendica 2014-11-16 22:46:52 -08:00
parent cd404f5710
commit b11ed7f88e

View File

@ -9,9 +9,10 @@ function home_init(&$a) {
$ret = array(); $ret = array();
call_hooks('home_init',$ret); call_hooks('home_init',$ret);
$channel = $a->get_channel(); $splash = ((argc() > 1 && argv(1) === 'splash') ? true : false);
if(local_user() && $channel && $channel['xchan_url']) { $channel = $a->get_channel();
if(local_user() && $channel && $channel['xchan_url'] && ! $splash) {
$dest = $channel['channel_startpage']; $dest = $channel['channel_startpage'];
if(! $dest) if(! $dest)
$dest = get_pconfig(local_user(),'system','startpage'); $dest = get_pconfig(local_user(),'system','startpage');
@ -23,7 +24,7 @@ function home_init(&$a) {
goaway($dest); goaway($dest);
} }
if(get_account_id()) { if(get_account_id() && ! $splash) {
goaway(z_root() . '/new_channel'); goaway(z_root() . '/new_channel');
} }
@ -39,6 +40,7 @@ function home_content(&$a) {
if(x($_SESSION,'mobile_theme')) if(x($_SESSION,'mobile_theme'))
unset($_SESSION['mobile_theme']); unset($_SESSION['mobile_theme']);
$splash = ((argc() > 1 && argv(1) === 'splash') ? true : false);
if(get_config('system','projecthome')) { if(get_config('system','projecthome')) {
$o .= file_get_contents('assets/home.html'); $o .= file_get_contents('assets/home.html');
@ -81,10 +83,10 @@ function home_content(&$a) {
xchan_query($r); xchan_query($r);
$r = fetch_post_tags($r,true); $r = fetch_post_tags($r,true);
$a->profile = array('profile_uid' => $u[0]['channel_id']); $a->profile = array('profile_uid' => $u[0]['channel_id']);
$a->profile_uid = $u[0]['channel_id'];
$o .= prepare_page($r[0]); $o .= prepare_page($r[0]);
return $o; return $o;
} }
} }
// Nope, we didn't find an item. Let's see if there's any html // Nope, we didn't find an item. Let's see if there's any html