From 5aad4a19f83a7e7de4ec9a7c819b9b5f7b4f1b3c Mon Sep 17 00:00:00 2001 From: Paolo Tacconi Date: Fri, 20 Feb 2015 10:09:59 +0100 Subject: Added version tag to siteinfo/json --- mod/siteinfo.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/mod/siteinfo.php b/mod/siteinfo.php index 1f3cd4479..b73dca5b1 100644 --- a/mod/siteinfo.php +++ b/mod/siteinfo.php @@ -50,6 +50,18 @@ function siteinfo_init(&$a) { $site_info = get_config('system','info'); $site_name = get_config('system','sitename'); + if(! get_config('system','hidden_version_siteinfo')) { + $version = sprintf( t('Version %s'), RED_VERSION ); + if(@is_dir('.git') && function_exists('shell_exec')) { + $commit = @shell_exec('git log -1 --format="%h"'); + $tag = @shell_exec('git describe --tags --abbrev=0'); + } + if(! isset($commit) || strlen($commit) > 16) + $commit = ''; + } + else { + $version = $commit = ''; + } //Statistics $channels_total_stat = intval(get_config('system','channels_total_stat')); @@ -59,7 +71,8 @@ function siteinfo_init(&$a) { $hide_in_statistics = intval(get_config('system','hide_in_statistics')); $data = Array( - 'version' => RED_VERSION, + 'version' => $version, + 'version_tag' => $tag, 'commit' => $commit, 'url' => z_root(), 'plugins' => $visible_plugins, -- cgit v1.2.3 From 2765500844d7c85a6921f26cc708af8d967c9125 Mon Sep 17 00:00:00 2001 From: Paolo Tacconi Date: Fri, 20 Feb 2015 10:29:33 +0100 Subject: Fixes to version tag in siteinfo/json --- mod/siteinfo.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mod/siteinfo.php b/mod/siteinfo.php index b73dca5b1..e6798ce50 100644 --- a/mod/siteinfo.php +++ b/mod/siteinfo.php @@ -51,10 +51,10 @@ function siteinfo_init(&$a) { $site_info = get_config('system','info'); $site_name = get_config('system','sitename'); if(! get_config('system','hidden_version_siteinfo')) { - $version = sprintf( t('Version %s'), RED_VERSION ); + $version = RED_VERSION; if(@is_dir('.git') && function_exists('shell_exec')) { - $commit = @shell_exec('git log -1 --format="%h"'); - $tag = @shell_exec('git describe --tags --abbrev=0'); + $commit = trim( @shell_exec('git log -1 --format="%h"')); + $tag = trim( @shell_exec('git describe --tags --abbrev=0')); } if(! isset($commit) || strlen($commit) > 16) $commit = ''; -- cgit v1.2.3 From 2c7e8bea88abd4e835645996849e16ecd62dfa35 Mon Sep 17 00:00:00 2001 From: zottel Date: Fri, 20 Feb 2015 14:07:56 +0100 Subject: show item title in channel/mid and display pages --- mod/channel.php | 5 ++++- mod/display.php | 3 +++ view/js/main.js | 11 ++++++++++- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/mod/channel.php b/mod/channel.php index 788bacf70..109c9a596 100644 --- a/mod/channel.php +++ b/mod/channel.php @@ -329,8 +329,11 @@ function channel_content(&$a, $update = 0, $load = false) { $o .= conversation($a,$items,'channel',$update,'traditional'); } - if((! $update) || ($_COOKIE['jsAvailable'] != 1)) + if((! $update) || ($_COOKIE['jsAvailable'] != 1)) { $o .= alt_pager($a,count($items)); + if ($mid && $items[0]['title']) + $a->page['title'] = $items[0]['title'] . " - " . $a->page['title']; + } if($mid) $o .= '
'; diff --git a/mod/display.php b/mod/display.php index c2e5c2426..d06f1e66f 100644 --- a/mod/display.php +++ b/mod/display.php @@ -228,6 +228,9 @@ function display_content(&$a, $update = 0, $load = false) { $o .= conversation($a, $items, 'display', $update, 'client'); } else { $o .= conversation($a, $items, 'display', $update, 'traditional'); + if ($items[0]['title']) + $a->page['title'] = $items[0]['title'] . " - " . $a->page['title']; + } if($updateable) { diff --git a/view/js/main.js b/view/js/main.js index 18004726e..a10e91449 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -563,10 +563,19 @@ function updateConvItems(mode,data) { } prev = ident; }); - + if(loadingPage) { loadingPage = false; } + + if (window.location.search.indexOf("mid=") != -1 || window.location.pathname.indexOf("display") != -1) { + var title = $(".wall-item-title").text(); + title.replace(/^\s+/, ''); + title.replace(/\s+$/, ''); + if (title) + document.title = title + " - " + document.title; + } + } $('.like-rotator').spin(false); -- cgit v1.2.3 From 48080d4103f19c6f2382be8f7ea66ca9b2f29d20 Mon Sep 17 00:00:00 2001 From: zottel Date: Fri, 20 Feb 2015 14:11:28 +0100 Subject: correct indent --- mod/display.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mod/display.php b/mod/display.php index d06f1e66f..d4a1acc5d 100644 --- a/mod/display.php +++ b/mod/display.php @@ -228,8 +228,8 @@ function display_content(&$a, $update = 0, $load = false) { $o .= conversation($a, $items, 'display', $update, 'client'); } else { $o .= conversation($a, $items, 'display', $update, 'traditional'); - if ($items[0]['title']) - $a->page['title'] = $items[0]['title'] . " - " . $a->page['title']; + if ($items[0]['title']) + $a->page['title'] = $items[0]['title'] . " - " . $a->page['title']; } -- cgit v1.2.3