3 use \Friendica\Core\Config;
5 function friendica_init(App $a) {
6 if ($a->argv[1]=="json"){
7 $register_policy = Array('REGISTER_CLOSED', 'REGISTER_APPROVE', 'REGISTER_OPEN');
10 if(x($a->config,'admin_nickname')) {
11 $sql_extra = sprintf(" AND nickname = '%s' ",dbesc($a->config['admin_nickname']));
13 if (isset($a->config['admin_email']) && $a->config['admin_email']!=''){
14 $adminlist = explode(",", str_replace(" ", "", $a->config['admin_email']));
16 //$r = q("SELECT username, nickname FROM user WHERE email='%s' $sql_extra", dbesc($a->config['admin_email']));
17 $r = q("SELECT username, nickname FROM user WHERE email='%s' $sql_extra", dbesc($adminlist[0]));
19 'name' => $r[0]['username'],
20 'profile'=> App::get_baseurl().'/profile/'.$r[0]['nickname'],
26 $visible_plugins = array();
27 if(is_array($a->plugins) && count($a->plugins)) {
28 $r = q("select * from addon where hidden = 0");
29 if (dbm::is_result($r))
31 $visible_plugins[] = $rr['name'];
34 Config::load('feature_lock');
35 $locked_features = array();
36 if(is_array($a->config['feature_lock']) && count($a->config['feature_lock'])) {
37 foreach($a->config['feature_lock'] as $k => $v) {
38 if($k === 'config_loaded')
40 $locked_features[$k] = intval($v);
45 'version' => FRIENDICA_VERSION,
47 'plugins' => $visible_plugins,
48 'locked_features' => $locked_features,
49 'register_policy' => $register_policy[$a->config['register_policy']],
51 'site_name' => $a->config['sitename'],
52 'platform' => FRIENDICA_PLATFORM,
53 'info' => ((x($a->config,'info')) ? $a->config['info'] : ''),
54 'no_scrape_url' => App::get_baseurl().'/noscrape'
57 echo json_encode($data);
64 function friendica_content(App $a) {
67 $o .= '<h3>Friendica</h3>';
72 $o .= t('This is Friendica, version') . ' ' . FRIENDICA_VERSION . ' ';
73 $o .= t('running at web location') . ' ' . z_root() . '</p><p>';
75 $o .= t('Please visit <a href="http://friendica.com">Friendica.com</a> to learn more about the Friendica project.') . '</p><p>';
77 $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>';
78 $o .= t('Suggestions, praise, donations, etc. - please email "Info" at Friendica - dot com') . '</p>';
82 $visible_plugins = array();
83 if(is_array($a->plugins) && count($a->plugins)) {
84 $r = q("select * from addon where hidden = 0");
85 if (dbm::is_result($r))
87 $visible_plugins[] = $rr['name'];
91 if(count($visible_plugins)) {
92 $o .= '<p>' . t('Installed plugins/addons/apps:') . '</p>';
93 $sorted = $visible_plugins;
96 foreach($sorted as $p) {
98 if(strlen($s)) $s .= ', ';
102 $o .= '<div style="margin-left: 25px; margin-right: 25px;">' . $s . '</div>';
105 $o .= '<p>' . t('No installed plugins/addons/apps') . '</p>';
107 call_hooks('about_hook', $o);