Explorar o código

Merge pull request #1270 from Arantor/release-2.1

Stuff
Arantor %!s(int64=10) %!d(string=hai) anos
pai
achega
0e8acaeaa0

+ 3 - 0
Sources/Profile-View.php

@@ -188,6 +188,9 @@ function summary($memID)
 		$smcFunc['db_free_result']($request);
 		$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);
 	loadCustomFields($memID);
 }
 }
 
 

+ 5 - 0
Sources/Subs-Admin.php

@@ -392,6 +392,11 @@ function updateSettingsFile($config_vars)
 				@copy($boarddir . '/Settings_bak.php', $boarddir . '/Settings.php');
 				@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>
 					<dt>', $txt['language'], ':</dt>
 					<dd>', $context['member']['language'], '</dd>';
 					<dd>', $context['member']['language'], '</dd>';
 
 
-	echo '
+	if ($context['member']['online']['is_online'])
+		echo '
 					<dt>', $txt['lastLoggedIn'], ': </dt>
 					<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>';
 				</dl>';
 
 
 	// Are there any custom profile fields for the summary?
 	// 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] . '?' . '>');
 	fwrite($fp, $settingsArray[$i] . '?' . '>');
 	fclose($fp);
 	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;
 	return true;
 }
 }