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'],
22 'version' => FRIENDICA_VERSION,
24 'plugins' => $a->plugins,
25 'register_policy' => $register_policy[$a->config['register_policy']],
27 'site_name' => $a->config['sitename'],
28 'platform' => FRIENDICA_PLATFORM,
29 'info' => ((x($a->config,'info')) ? $a->config['info'] : '')
32 echo json_encode($data);
39 function friendica_content(&$a) {
42 $o .= '<h3>Friendica</h3>';
47 $o .= t('This is Friendica, version') . ' ' . FRIENDICA_VERSION . ' ';
48 $o .= t('running at web location') . ' ' . z_root() . '</p><p>';
50 $o .= t('Please visit <a href="http://friendica.com">Friendica.com</a> to learn more about the Friendica project.') . '</p><p>';
52 $o .= t('Bug reports and issues: please visit') . ' ' . '<a href="http://bugs.friendica.com">Bugs.Friendica.com</a></p><p>';
53 $o .= t('Suggestions, praise, donations, etc. - please email "Info" at Friendica - dot com') . '</p>';
57 if(count($a->plugins)) {
58 $o .= '<p>' . t('Installed plugins/addons/apps:') . '</p>';
59 $sorted = $a->plugins;
62 foreach($sorted as $p) {
64 if(strlen($s)) $s .= ', ';
68 $o .= '<div style="margin-left: 25px; margin-right: 25px;">' . $s . '</div>';
71 $o .= '<p>' . t('No installed plugins/addons/apps') . '</p>';
73 call_hooks('about_hook', $o);