3 if(! function_exists('friendica_init')) {
4 function friendica_init(&$a) {
5 if ($a->argv[1]=="json"){
6 $register_policy = Array('REGISTER_CLOSED', 'REGISTER_APPROVE', 'REGISTER_OPEN');
9 if(x($a->config,'admin_nickname')) {
10 $sql_extra = sprintf(" AND nickname = '%s' ",dbesc($a->config['admin_nickname']));
12 if (isset($a->config['admin_email']) && $a->config['admin_email']!=''){
13 $adminlist = explode(",", str_replace(" ", "", $a->config['admin_email']));
15 //$r = q("SELECT username, nickname FROM user WHERE email='%s' $sql_extra", dbesc($a->config['admin_email']));
16 $r = q("SELECT username, nickname FROM user WHERE email='%s' $sql_extra", dbesc($adminlist[0]));
18 'name' => $r[0]['username'],
19 'profile'=> $a->get_baseurl().'/profile/'.$r[0]['nickname'],
25 $visible_plugins = array();
26 if(is_array($a->plugins) && count($a->plugins)) {
27 $r = q("select * from addon where hidden = 0");
30 $visible_plugins[] = $rr['name'];
33 load_config('feature_lock');
34 $locked_features = array();
35 if(is_array($a->config['feature_lock']) && count($a->config['feature_lock'])) {
36 foreach($a->config['feature_lock'] as $k => $v) {
37 if($k === 'config_loaded')
39 $locked_features[$k] = intval($v);
44 'version' => FRIENDICA_VERSION,
46 'plugins' => $visible_plugins,
47 'locked_features' => $locked_features,
48 'register_policy' => $register_policy[$a->config['register_policy']],
50 'site_name' => $a->config['sitename'],
51 'platform' => FRIENDICA_PLATFORM,
52 'info' => ((x($a->config,'info')) ? $a->config['info'] : ''),
53 'no_scrape_url' => $a->get_baseurl().'/noscrape'
56 echo json_encode($data);
62 if(! function_exists('friendica_content')) {
63 function friendica_content(&$a) {
66 $o .= '<h3>Friendica</h3>';
71 $o .= t('This is Friendica, version') . ' ' . FRIENDICA_VERSION . ' ';
72 $o .= t('running at web location') . ' ' . z_root() . '</p><p>';
74 $o .= t('Please visit <a href="http://friendica.com">Friendica.com</a> to learn more about the Friendica project.') . '</p><p>';
76 $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>';
77 $o .= t('Suggestions, praise, donations, etc. - please email "Info" at Friendica - dot com') . '</p>';
81 $visible_plugins = array();
82 if(is_array($a->plugins) && count($a->plugins)) {
83 $r = q("select * from addon where hidden = 0");
86 $visible_plugins[] = $rr['name'];
90 if(count($visible_plugins)) {
91 $o .= '<p>' . t('Installed plugins/addons/apps:') . '</p>';
92 $sorted = $visible_plugins;
95 foreach($sorted as $p) {
97 if(strlen($s)) $s .= ', ';
101 $o .= '<div style="margin-left: 25px; margin-right: 25px;">' . $s . '</div>';
104 $o .= '<p>' . t('No installed plugins/addons/apps') . '</p>';
106 call_hooks('about_hook', $o);