]> git.mxchange.org Git - friendica.git/blob - mod/home.php
Merge pull request #1084 from annando/master
[friendica.git] / mod / home.php
1 <?php
2
3 if(! function_exists('home_init')) {
4 function home_init(&$a) {
5
6         $ret = array();
7         call_hooks('home_init',$ret);
8
9         if(local_user() && ($a->user['nickname']))
10                 goaway($a->get_baseurl()."/network");
11                 //goaway($a->get_baseurl()."/profile/".$a->user['nickname']);
12
13         if(strlen(get_config('system','singleuser')))
14                 goaway($a->get_baseurl()."/profile/" . get_config('system','singleuser'));
15
16 }}
17
18
19 if(! function_exists('home_content')) {
20 function home_content(&$a) {
21
22         $o = '';
23
24         if(x($_SESSION,'theme'))
25                 unset($_SESSION['theme']);
26         if(x($_SESSION,'mobile-theme'))
27                 unset($_SESSION['mobile-theme']);
28
29         if(file_exists('home.html')){
30                 if(file_exists('home.css')){
31                           $a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="'.$a->get_baseurl().'/home.css'.'" media="all" />';}
32
33                 $o .= file_get_contents('home.html');}
34
35         else    $o .= '<h1>'.((x($a->config,'sitename')) ? sprintf(t("Welcome to %s"), $a->config['sitename']) : "").'</h1>';
36
37
38         $o .= login(($a->config['register_policy'] == REGISTER_CLOSED) ? 0 : 1);
39
40         call_hooks("home_content",$o);
41
42         return $o;
43
44
45 }}