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'] : ''),
44 if(!get_config('system','disable_noscrape'))
45 $data['no_scrape_url'] = $a->get_baseurl().'/noscrape';
47 echo json_encode($data);
54 function friendica_content(&$a) {
57 $o .= '<h3>Friendica</h3>';
62 $o .= t('This is Friendica, version') . ' ' . FRIENDICA_VERSION . ' ';
63 $o .= t('running at web location') . ' ' . z_root() . '</p><p>';
65 $o .= t('Please visit <a href="http://friendica.com">Friendica.com</a> to learn more about the Friendica project.') . '</p><p>';
67 $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>';
68 $o .= t('Suggestions, praise, donations, etc. - please email "Info" at Friendica - dot com') . '</p>';
72 $visible_plugins = array();
73 if(is_array($a->plugins) && count($a->plugins)) {
74 $r = q("select * from addon where hidden = 0");
77 $visible_plugins[] = $rr['name'];
81 if(count($visible_plugins)) {
82 $o .= '<p>' . t('Installed plugins/addons/apps:') . '</p>';
83 $sorted = $visible_plugins;
86 foreach($sorted as $p) {
88 if(strlen($s)) $s .= ', ';
92 $o .= '<div style="margin-left: 25px; margin-right: 25px;">' . $s . '</div>';
95 $o .= '<p>' . t('No installed plugins/addons/apps') . '</p>';
97 call_hooks('about_hook', $o);