3 function friendica_init(App &$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'=> App::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");
27 if (dbm::is_result($r))
29 $visible_plugins[] = $rr['name'];
32 load_config('feature_lock');
33 $locked_features = array();
34 if(is_array($a->config['feature_lock']) && count($a->config['feature_lock'])) {
35 foreach($a->config['feature_lock'] as $k => $v) {
36 if($k === 'config_loaded')
38 $locked_features[$k] = intval($v);
43 'version' => FRIENDICA_VERSION,
45 'plugins' => $visible_plugins,
46 'locked_features' => $locked_features,
47 'register_policy' => $register_policy[$a->config['register_policy']],
49 'site_name' => $a->config['sitename'],
50 'platform' => FRIENDICA_PLATFORM,
51 'info' => ((x($a->config,'info')) ? $a->config['info'] : ''),
52 'no_scrape_url' => App::get_baseurl().'/noscrape'
55 echo json_encode($data);
62 function friendica_content(App &$a) {
65 $o .= '<h3>Friendica</h3>';
70 $o .= t('This is Friendica, version') . ' ' . FRIENDICA_VERSION . ' ';
71 $o .= t('running at web location') . ' ' . z_root() . '</p><p>';
73 $o .= t('Please visit <a href="http://friendica.com">Friendica.com</a> to learn more about the Friendica project.') . '</p><p>';
75 $o .= t('Bug reports and issues: please visit') . ' ' . '<a href="https://github.com/friendica/friendica/issues?state=open">'.t('the bugtracker at github').'</a></p><p>';
76 $o .= t('Suggestions, praise, donations, etc. - please email "Info" at Friendica - dot com') . '</p>';
80 $visible_plugins = array();
81 if(is_array($a->plugins) && count($a->plugins)) {
82 $r = q("select * from addon where hidden = 0");
83 if (dbm::is_result($r))
85 $visible_plugins[] = $rr['name'];
89 if(count($visible_plugins)) {
90 $o .= '<p>' . t('Installed plugins/addons/apps:') . '</p>';
91 $sorted = $visible_plugins;
94 foreach($sorted as $p) {
96 if(strlen($s)) $s .= ', ';
100 $o .= '<div style="margin-left: 25px; margin-right: 25px;">' . $s . '</div>';
103 $o .= '<p>' . t('No installed plugins/addons/apps') . '</p>';
105 call_hooks('about_hook', $o);