3 function friendica_init(&$a) {
4 if ($a->argv[1]=="json"){
5 $register_policy = Array('REGISTER_CLOSED', 'REGISTER_APPROVE', 'REGISTER_OPEN');
8 if(x($a->config,'admin_nickname')) {
9 $sql_extra = sprintf(" AND nickname = '%s' ",dbesc($a->config['admin_nickname']));
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']));
14 'name' => $r[0]['username'],
15 'profile'=> $a->get_baseurl().'/profile/'.$r[0]['nickname'],
21 $visible_plugins = array();
22 if(is_array($a->plugins) && count($a->plugins)) {
23 $r = q("select * from addon where hidden = 0");
26 $visible_plugins[] = $rr['name'];
30 'version' => FRIENDICA_VERSION,
32 'plugins' => $visible_plugins,
33 'register_policy' => $register_policy[$a->config['register_policy']],
35 'site_name' => $a->config['sitename'],
36 'platform' => FRIENDICA_PLATFORM,
37 'info' => ((x($a->config,'info')) ? $a->config['info'] : '')
40 echo json_encode($data);
47 function friendica_content(&$a) {
50 $o .= '<h3>Friendica</h3>';
55 $o .= t('This is Friendica, version') . ' ' . FRIENDICA_VERSION . ' ';
56 $o .= t('running at web location') . ' ' . z_root() . '</p><p>';
58 $o .= t('Please visit <a href="http://friendica.com">Friendica.com</a> to learn more about the Friendica project.') . '</p><p>';
60 $o .= t('Bug reports and issues: please visit') . ' ' . '<a href="http://bugs.friendica.com">Bugs.Friendica.com</a></p><p>';
61 $o .= t('Suggestions, praise, donations, etc. - please email "Info" at Friendica - dot com') . '</p>';
65 $visible_plugins = array();
66 if(is_array($a->plugins) && count($a->plugins)) {
67 $r = q("select * from addon where hidden = 0");
70 $visible_plugins[] = $rr['name'];
74 if(count($visible_plugins)) {
75 $o .= '<p>' . t('Installed plugins/addons/apps:') . '</p>';
76 $sorted = $visible_plugins;
79 foreach($sorted as $p) {
81 if(strlen($s)) $s .= ', ';
85 $o .= '<div style="margin-left: 25px; margin-right: 25px;">' . $s . '</div>';
88 $o .= '<p>' . t('No installed plugins/addons/apps') . '</p>';
90 call_hooks('about_hook', $o);