]> git.mxchange.org Git - friendica.git/blob - mod/friendica.php
we use the bugtracker on github now
[friendica.git] / mod / friendica.php
1 <?php
2
3 function friendica_init(&$a) {
4         if ($a->argv[1]=="json"){
5                 $register_policy = Array('REGISTER_CLOSED', 'REGISTER_APPROVE', 'REGISTER_OPEN');
6
7                 $sql_extra = '';
8                 if(x($a->config,'admin_nickname')) {
9                         $sql_extra = sprintf(" AND nickname = '%s' ",dbesc($a->config['admin_nickname']));
10                 }
11                 if (isset($a->config['admin_email']) && $a->config['admin_email']!=''){
12                         $r = q("SELECT username, nickname FROM user WHERE email='%s' $sql_extra", dbesc($a->config['admin_email']));
13                         $admin = array(
14                                 'name' => $r[0]['username'],
15                                 'profile'=> $a->get_baseurl().'/profile/'.$r[0]['nickname'],
16                         );
17                 } else {
18                         $admin = false;
19                 }
20
21                 $visible_plugins = array();
22                 if(is_array($a->plugins) && count($a->plugins)) {
23                         $r = q("select * from addon where hidden = 0");
24                         if(count($r))
25                                 foreach($r as $rr)
26                                         $visible_plugins[] = $rr['name'];
27                 }
28
29                 $data = Array(
30                         'version' => FRIENDICA_VERSION,
31                         'url' => z_root(),
32                         'plugins' => $visible_plugins,
33                         'register_policy' =>  $register_policy[$a->config['register_policy']],
34                         'admin' => $admin,
35                         'site_name' => $a->config['sitename'],
36                         'platform' => FRIENDICA_PLATFORM,
37                         'info' => ((x($a->config,'info')) ? $a->config['info'] : '')                    
38                 );
39
40                 echo json_encode($data);
41                 killme();
42         }
43 }
44
45
46
47 function friendica_content(&$a) {
48
49         $o = '';
50         $o .= '<h3>Friendica</h3>';
51
52
53         $o .= '<p></p><p>';
54
55         $o .= t('This is Friendica, version') . ' ' . FRIENDICA_VERSION . ' ';
56         $o .= t('running at web location') . ' ' . z_root() . '</p><p>';
57
58         $o .= t('Please visit <a href="http://friendica.com">Friendica.com</a> to learn more about the Friendica project.') . '</p><p>';        
59
60         $o .= t('Bug reports and issues: please visit') . ' ' . '<a href="https://github.com/friendica/friendica/issues?state=open">the bucktracker at github</a></p><p>';
61         $o .= t('Suggestions, praise, donations, etc. - please email "Info" at Friendica - dot com') . '</p>';
62
63         $o .= '<p></p>';
64
65         $visible_plugins = array();
66         if(is_array($a->plugins) && count($a->plugins)) {
67                 $r = q("select * from addon where hidden = 0");
68                 if(count($r))
69                         foreach($r as $rr)
70                                 $visible_plugins[] = $rr['name'];
71         }
72
73
74         if(count($visible_plugins)) {
75                 $o .= '<p>' . t('Installed plugins/addons/apps:') . '</p>';
76                 $sorted = $visible_plugins;
77                 $s = '';
78                 sort($sorted);
79                 foreach($sorted as $p) {
80                         if(strlen($p)) {
81                                 if(strlen($s)) $s .= ', ';
82                                 $s .= $p;
83                         }
84                 }
85                 $o .= '<div style="margin-left: 25px; margin-right: 25px;">' . $s . '</div>';
86         }
87         else
88                 $o .= '<p>' . t('No installed plugins/addons/apps') . '</p>';
89
90         call_hooks('about_hook', $o);   
91
92         return $o;
93
94 }