]> git.mxchange.org Git - friendica.git/blob - mod/friendika.php
Merge branch 'dispy' of github.com:fabrixxm/friendika into dispy
[friendica.git] / mod / friendika.php
1 <?php
2
3 function friendika_init(&$a) {
4         if ($a->argv[1]=="json"){
5                 $register_policy = Array('REGISTER_CLOSED', 'REGISTER_APPROVE', 'REGISTER_OPEN');
6
7                 if (isset($a->config['admin_email']) && $a->config['admin_email']!=''){
8                         $r = q("SELECT username, nickname FROM user WHERE email='%s'", $a->config['admin_email']);
9                         $admin = array(
10                                 'name' => $r[0]['username'],
11                                 'profile'=> $a->get_baseurl().'/profile/'.$r[0]['nickname'],
12                         );
13                 } else {
14                         $admin = false;
15                 }
16
17                 $data = Array(
18                         'version' => FRIENDIKA_VERSION,
19                         'url' => $a->get_baseurl(),
20                         'plugins' => $a->plugins,
21                         'register_policy' =>  $register_policy[$a->config['register_policy']],
22                         'admin' => $admin,
23                         'site_name' => $a->config['sitename'],
24                         'info' => ((x($a->config,'info')) ? $a->config['info'] : '')                    
25                 );
26
27                 echo json_encode($data);
28                 killme();
29         }
30 }
31
32
33
34 function friendika_content(&$a) {
35
36         $o = '';
37         $o .= '<h3>Friendika</h3>';
38
39
40         $o .= '<p></p><p>';
41
42         $o .= 'View <a href="LICENSE">License</a>' . '<br /><br />';
43         $o .= t('This is Friendika version') . ' ' . FRIENDIKA_VERSION . ' ';
44         $o .= t('running at web location') . ' ' . $a->get_baseurl() . '</p><p>';
45
46         $o .= t('Shared content within the Friendika network is provided under the <a href="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0 license</a>') . '</p><p>';
47
48         $o .= t('Please visit <a href="http://project.friendika.com">Project.Friendika.com</a> to learn more about the Friendika project.') . '</p><p>';        
49
50         $o .= t('Bug reports and issues: please visit') . ' ' . '<a href="http://bugs.friendika.com">Bugs.Friendika.com</a></p><p>';
51         $o .= t('Suggestions, praise, donations, etc. - please email "Info" at Friendika - dot com') . '</p>';
52
53         $o .= '<p></p>';
54
55         if(count($a->plugins)) {
56                 $o .= '<p>' . t('Installed plugins/addons/apps') . '</p>';
57                 $o .= '<ul>';
58                 foreach($a->plugins as $p)
59                         if(strlen($p))
60                                 $o .= '<li>' . $p . '</li>';
61                 $o .= '</ul>';
62         }
63         else
64                 $o .= '<p>' . t('No installed plugins/addons/apps');
65
66         call_hooks('about_hook', $o);   
67
68         return $o;
69
70 }