Browse Source

Merge pull request #1270 from Arantor/release-2.1

Stuff
Arantor 10 years ago
parent
commit
0e8acaeaa0
4 changed files with 18 additions and 2 deletions
  1. 3 0
      Sources/Profile-View.php
  2. 5 0
      Sources/Subs-Admin.php
  3. 5 2
      Themes/default/Profile.template.php
  4. 5 0
      other/install.php

+ 3 - 0
Sources/Profile-View.php

@@ -188,6 +188,9 @@ function summary($memID)
 		$smcFunc['db_free_result']($request);
 	}
 
+	// Are they hidden?
+	if ($context['member']['online']['is_online'] && empty($user_profile[$memID]['show_online']))
+		$context['member']['is_hidden'] = true;
 	loadCustomFields($memID);
 }
 

+ 5 - 0
Sources/Subs-Admin.php

@@ -392,6 +392,11 @@ function updateSettingsFile($config_vars)
 				@copy($boarddir . '/Settings_bak.php', $boarddir . '/Settings.php');
 		}
 	}
+
+	// Even though on normal installations the filemtime should prevent this being used by the installer incorrectly
+	// it seems that there are times it might not. So let's MAKE it dump the cache.
+	if (function_exists('opcache_invalidate'))
+		opcache_invalidate($boarddir . '/Settings.php', true);
 }
 
 /**

+ 5 - 2
Themes/default/Profile.template.php

@@ -389,9 +389,12 @@ function template_summary()
 					<dt>', $txt['language'], ':</dt>
 					<dd>', $context['member']['language'], '</dd>';
 
-	echo '
+	if ($context['member']['online']['is_online'])
+		echo '
 					<dt>', $txt['lastLoggedIn'], ': </dt>
-					<dd>', $context['member']['last_login'], '</dd>
+					<dd>', $context['member']['last_login'], (!empty($context['member']['is_hidden']) ? ' (' . $txt['hidden'] . ')' : ''), '</dd>';
+
+	echo '
 				</dl>';
 
 	// Are there any custom profile fields for the summary?

+ 5 - 0
other/install.php

@@ -2020,6 +2020,11 @@ function updateSettingsFile($vars)
 	fwrite($fp, $settingsArray[$i] . '?' . '>');
 	fclose($fp);
 
+	// Even though on normal installations the filemtime should prevent this being used by the installer incorrectly
+	// it seems that there are times it might not. So let's MAKE it dump the cache.
+	if (function_exists('opcache_invalidate'))
+		opcache_invalidate(dirname(__FILE__) . '/Settings.php', true);
+
 	return true;
 }