]> git.mxchange.org Git - friendica.git/blob - mod/home.php
home_init hook
[friendica.git] / mod / home.php
1 <?php
2
3 if(! function_exists('home_init')) {
4 function home_init(&$a) {
5
6         call_hooks('home_init',array());
7
8         if(local_user() && ($a->user['nickname']))
9                 goaway( $a->get_baseurl() . "/profile/" . $a->user['nickname'] );
10
11         if(strlen(get_config('system','singleuser')))
12                 goaway( $a->get_baseurl() . "/profile/" . get_config('system','singleuser'));
13
14 }}
15
16
17 if(! function_exists('home_content')) {
18 function home_content(&$a) {
19
20         $o = '';
21
22         if(x($_SESSION,'theme'))
23                 unset($_SESSION['theme']);
24
25         $o .= '<h1>' . ((x($a->config,'sitename')) ? sprintf( t("Welcome to %s") ,$a->config['sitename']) : "" ) . '</h1>';
26         if(file_exists('home.html'))
27                 $o .= file_get_contents('home.html');
28
29         $o .= login(($a->config['register_policy'] == REGISTER_CLOSED) ? 0 : 1);
30         
31         call_hooks("home_content",$o);
32         
33         return $o;
34
35         
36 }}