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 $adminlist = explode(",", str_replace(" ", "", $a->config['admin_email']));
14 //$r = q("SELECT username, nickname FROM user WHERE email='%s' $sql_extra", dbesc($a->config['admin_email']));
15 $r = q("SELECT username, nickname FROM user WHERE email='%s' $sql_extra", dbesc($adminlist[0]));
17 'name' => $r[0]['username'],
18 'profile'=> $a->get_baseurl().'/profile/'.$r[0]['nickname'],
24 $visible_plugins = array();
25 if(is_array($a->plugins) && count($a->plugins)) {
26 $r = q("select * from addon where hidden = 0");
29 $visible_plugins[] = $rr['name'];
33 'version' => FRIENDICA_VERSION,
35 'plugins' => $visible_plugins,
36 'register_policy' => $register_policy[$a->config['register_policy']],
38 'site_name' => $a->config['sitename'],
39 'platform' => FRIENDICA_PLATFORM,
40 'info' => ((x($a->config,'info')) ? $a->config['info'] : ''),
41 'no_scrape_url' => $a->get_baseurl().'/noscrape'
44 echo json_encode($data);
51 function friendica_content(&$a) {
54 $o .= '<h3>Friendica</h3>';
59 $o .= t('This is Friendica, version') . ' ' . FRIENDICA_VERSION . ' ';
60 $o .= t('running at web location') . ' ' . z_root() . '</p><p>';
62 $o .= t('Please visit <a href="http://friendica.com">Friendica.com</a> to learn more about the Friendica project.') . '</p><p>';
64 $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>';
65 $o .= t('Suggestions, praise, donations, etc. - please email "Info" at Friendica - dot com') . '</p>';
69 $visible_plugins = array();
70 if(is_array($a->plugins) && count($a->plugins)) {
71 $r = q("select * from addon where hidden = 0");
74 $visible_plugins[] = $rr['name'];
78 if(count($visible_plugins)) {
79 $o .= '<p>' . t('Installed plugins/addons/apps:') . '</p>';
80 $sorted = $visible_plugins;
83 foreach($sorted as $p) {
85 if(strlen($s)) $s .= ', ';
89 $o .= '<div style="margin-left: 25px; margin-right: 25px;">' . $s . '</div>';
92 $o .= '<p>' . t('No installed plugins/addons/apps') . '</p>';
94 call_hooks('about_hook', $o);