aboutsummaryrefslogtreecommitdiffstats
path: root/mod/siteinfo.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/siteinfo.php')
-rw-r--r--mod/siteinfo.php24
1 files changed, 20 insertions, 4 deletions
diff --git a/mod/siteinfo.php b/mod/siteinfo.php
index a64b5df20..37cba02ec 100644
--- a/mod/siteinfo.php
+++ b/mod/siteinfo.php
@@ -27,8 +27,14 @@ function siteinfo_init(&$a) {
$visible_plugins[] = $rr['name'];
}
+ if(@is_dir('.git') && function_exists('shell_exec'))
+ $commit = @shell_exec('git log -1 --format="%h"');
+ if(! isset($commit) || strlen($commit) > 16)
+ $commit = '';
+
$data = Array(
'version' => RED_VERSION,
+ 'commit' => $commit,
'url' => z_root(),
'plugins' => $visible_plugins,
'register_policy' => $register_policy[$a->config['system']['register_policy']],
@@ -47,11 +53,16 @@ function siteinfo_init(&$a) {
function siteinfo_content(&$a) {
- if(! get_config('system','hidden_version_siteinfo'))
+ if(! get_config('system','hidden_version_siteinfo')) {
$version = sprintf( t('Version %s'), RED_VERSION );
- else
- $version = "";
-
+ if(@is_dir('.git') && function_exists('shell_exec'))
+ $commit = @shell_exec('git log -1 --format="%h"');
+ if(! isset($commit) || strlen($commit) > 16)
+ $commit = '';
+ }
+ else {
+ $version = $commit = '';
+ }
$visible_plugins = array();
if(is_array($a->plugins) && count($a->plugins)) {
$r = q("select * from addon where hidden = 0");
@@ -77,16 +88,21 @@ function siteinfo_content(&$a) {
else
$plugins_text = t('No installed plugins/addons/apps');
+ $admininfo = bbcode(get_config('system','admininfo'));
+
$o = replace_macros(get_markup_template('siteinfo.tpl'), array(
'$title' => t('Red'),
'$description' => t('This is a hub of the Red Matrix - a global cooperative network of decentralised privacy enhanced websites.'),
'$version' => $version,
+ '$commit' => $commit,
'$web_location' => t('Running at web location') . ' ' . z_root(),
'$visit' => t('Please visit <a href="http://getzot.com">GetZot.com</a> to learn more about the Red Matrix.'),
'$bug_text' => t('Bug reports and issues: please visit'),
'$bug_link_url' => 'https://github.com/friendica/red/issues',
'$bug_link_text' => 'redmatrix issues',
'$contact' => t('Suggestions, praise, donations, etc. - please email "redmatrix" at librelist - dot com'),
+ '$adminlabel' => t('Site Administrators'),
+ '$admininfo' => $admininfo,
'$plugins_text' => $plugins_text,
'$plugins_list' => $plugins_list
));