Browse Source

Merge branch 'master' of https://github.com/Spuds/playpen

emanuele 12 years ago
parent
commit
eaf2731277

+ 1 - 2
Sources/Display.php

@@ -464,7 +464,6 @@ function Display()
 	$context['linktree'][] = array(
 		'url' => $scripturl . '?topic=' . $topic . '.0',
 		'name' => $topicinfo['subject'],
-		'extra_before' => $settings['linktree_inline'] ? $txt['topic'] . ': ' : ''
 	);
 
 	// Build a list of this board's moderators.
@@ -794,7 +793,7 @@ function Display()
 	$posters = array_unique($all_posters);
 
 	// Guests can't mark topics read or for notifications, just can't sorry.
-	if (!$user_info['is_guest'])
+	if (!$user_info['is_guest'] && !empty($messages))
 	{
 		$mark_at_msg = max($messages);
 		if ($mark_at_msg >= $topicinfo['id_last_msg'])

+ 4 - 3
Sources/Load.php

@@ -1283,6 +1283,7 @@ function detectBrowser()
 	if ($context['browser']['is_ie'])
 	{
 		$context['browser'] += array(
+			'is_ie9' => strpos($_SERVER['HTTP_USER_AGENT'], 'Trident/5.0') !== false,
 			'is_ie8' => strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 8') !== false,
 			'is_ie_mobi' => strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 7') !== false && strpos($_SERVER['HTTP_USER_AGENT'], 'IEMobile/7') !== false,
 			'is_ie5.5' => strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 5.5') !== false,
@@ -1291,11 +1292,11 @@ function detectBrowser()
 			'is_mac_ie' => strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 5.') !== false && strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') !== false,
 		);
 
-		// Detect IE7 and not IE8 in combat mode.
-		$context['browser']['is_ie7'] = strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 7') !== false && !$context['browser']['is_ie8'];
+		// Detect IE7 and not IE8/IE9 in combat mode.
+		$context['browser']['is_ie7'] = strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 7') !== false && (!$context['browser']['is_ie8'] || !$context['browser']['is_ie9']);
 
 		// Before IE8 we need to fix IE... lots!
-		$context['browser']['ie_standards_fix'] = !$context['browser']['is_ie8'];
+		$context['browser']['ie_standards_fix'] = ($context['browser']['is_ie8'] || $context['browser']['is_ie9']) ? false : true;
 
 		$context['browser']['is_ie6'] = strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 6') !== false && !$context['browser']['is_ie8'] && !$context['browser']['is_ie7'];
 	}

+ 2 - 2
Sources/ManageLanguages.php

@@ -991,7 +991,7 @@ function ModifyLanguage()
 			// Got a new entry?
 			if ($line[0] == '$' && !empty($multiline_cache))
 			{
-				preg_match('~\$(helptxt|txt)\[\'(.+)\'\]\s=\s(.+);~', strtr($multiline_cache, array("\n" => '', "\t" => '')), $matches);
+				preg_match('~\$(helptxt|txt)\[\'(.+)\'\]\s?=\s?(.+);~', strtr($multiline_cache, array("\n" => '', "\t" => '')), $matches);
 				if (!empty($matches[3]))
 				{
 					$entries[$matches[2]] = array(
@@ -1007,7 +1007,7 @@ function ModifyLanguage()
 		// Last entry to add?
 		if ($multiline_cache)
 		{
-			preg_match('~\$(helptxt|txt)\[\'(.+)\'\]\s=\s(.+);~', strtr($multiline_cache, array("\n" => '', "\t" => '')), $matches);
+			preg_match('~\$(helptxt|txt)\[\'(.+)\'\]\s?=\s?(.+);~', strtr($multiline_cache, array("\n" => '', "\t" => '')), $matches);
 			if (!empty($matches[3]))
 				$entries[$matches[2]] = array(
 					'type' => $matches[1],

+ 6 - 1
Sources/ManagePaid.php

@@ -114,6 +114,9 @@ function ModifySubscriptionSettings($return_config = false)
 	if ($return_config)
 		return $config_vars;
 
+	// Get the settings template fired up.
+	require_once($sourcedir . '/ManageServer.php');
+
 	// Some important context stuff
 	$context['page_title'] = $txt['settings'];
 	$context['sub_template'] = 'show_settings';
@@ -1805,4 +1808,6 @@ function loadPaymentGateways()
 	closedir($dh);
 
 	return $gateways;
-}
+}
+
+?>

+ 20 - 18
Sources/ManageServer.php

@@ -133,13 +133,13 @@ function ModifySettings()
 
 /**
  * General forum settings - forum name, maintenance mode, etc.
- * Practically, this shows an interface for the settings in Settings.php
- * to be changed.
- * It uses the rawdata sub template (not theme-able.)
- * Requires the admin_forum permission.
- * Uses the edit_settings administration area.
- * Contains the actual array of settings to show from Settings.php.
- * Accessed from ?action=admin;area=serversettings;sa=general.
+ * Practically, this shows an interface for the settings in Settings.php to be changed.
+ *
+ * - It uses the rawdata sub template (not theme-able.)
+ * - Requires the admin_forum permission.
+ * - Uses the edit_settings administration area.
+ * - Contains the actual array of settings to show from Settings.php.
+ * - Accessed from ?action=admin;area=serversettings;sa=general.
  *
  * @param $return_config
  */
@@ -190,12 +190,13 @@ function ModifyGeneralSettings($return_config = false)
 
 /**
  * Basic database and paths settings - database name, host, etc.
- * It shows an interface for the settings in Settings.php to be changed.
- * It contains the actual array of settings to show from Settings.php.
- * It uses the rawdata sub template (not theme-able.)
- * Requires the admin_forum permission.
- * Uses the edit_settings administration area.
- * Accessed from ?action=admin;area=serversettings;sa=database.
+ *
+ * - It shows an interface for the settings in Settings.php to be changed.
+ * - It contains the actual array of settings to show from Settings.php.
+ * - It uses the rawdata sub template (not theme-able.)
+ * - Requires the admin_forum permission.
+ * - Uses the edit_settings administration area.
+ * - Accessed from ?action=admin;area=serversettings;sa=database.
  *
  * @param $return_config
  */
@@ -689,10 +690,11 @@ function prepareDBSettingContext(&$config_vars)
 
 /**
  * Helper function. Saves settings by putting them in Settings.php or saving them in the settings table.
- * Saves those settings set from ?action=admin;area=serversettings.
- * Requires the admin_forum permission.
- * Contains arrays of the types of data to save into Settings.php.
-
+ *
+ * - Saves those settings set from ?action=admin;area=serversettings.
+ * - Requires the admin_forum permission.
+ * - Contains arrays of the types of data to save into Settings.php.
+ *
  * @param $config_vars
  */
 function saveSettings(&$config_vars)
@@ -869,9 +871,9 @@ function saveDBSettings(&$config_vars)
 
 /**
  * Allows us to see the servers php settings
+ *
  * - loads the settings into an array for display in a template
  * - drops cookie values just in case
- *
  */
 function ShowPHPinfoSettings()
 {

+ 0 - 1
Sources/MoveTopic.php

@@ -108,7 +108,6 @@ function MoveTopic()
 	$context['linktree'][] = array(
 		'url' => $scripturl . '?topic=' . $topic . '.0',
 		'name' => $context['subject'],
-		'extra_before' => $settings['linktree_inline'] ? $txt['topic'] . ': ' : '',
 	);
 
 	$context['linktree'][] = array(

+ 1 - 1
Sources/Packages.php

@@ -81,7 +81,7 @@ function Packages()
 				'description' => $txt['package_file_perms_desc'],
 			),
 			'options' => array(
-				'description' => $txt['package_install_options_ftp_why'],
+				'description' => $txt['package_install_options_desc'],
 			),
 		),
 	);

+ 2 - 2
Sources/Post.php

@@ -1039,8 +1039,8 @@ function Post()
 		$context['linktree'][] = array(
 			'url' => $scripturl . '?topic=' . $topic . '.' . $_REQUEST['start'],
 			'name' => $form_subject,
-			'extra_before' => '<span' . ($settings['linktree_inline'] ? ' class="smalltext"' : '') . '><strong class="nav">' . $context['page_title'] . ' ( </strong></span>',
-			'extra_after' => '<span' . ($settings['linktree_inline'] ? ' class="smalltext"' : '') . '><strong class="nav"> )</strong></span>'
+			'extra_before' => '<span><strong class="nav">' . $context['page_title'] . ' ( </strong></span>',
+			'extra_after' => '<span><strong class="nav"> )</strong></span>'
 		);
 
 	// Give wireless a linktree url to the post screen, so that they can switch to full version.

+ 7 - 0
Sources/Subs-Auth.php

@@ -99,6 +99,13 @@ function setLoginCookie($cookie_length, $id, $password = '')
 		session_regenerate_id();
 		$_SESSION = $oldSessionData;
 
+		// Make sure to store the cookie of the new session.
+		if (!isset($_COOKIE[session_name()]) || $_COOKIE[session_name()] != session_id())
+		{
+			$sessionCookieLifetime = ini_get('session.cookie_lifetime');
+			smf_setcookie(session_name(), session_id(), time() + (empty($sessionCookieLifetime) ? $cookie_length : $sessionCookieLifetime), $cookie_url[1], $cookie_url[0], !empty($modSettings['secureCookies']));
+		}
+
 		$_SESSION['login_' . $cookiename] = $data;
 	}
 }

+ 28 - 11
Themes/default/Profile.template.php

@@ -485,7 +485,10 @@ function template_showPosts()
 function template_editBuddies()
 {
 	global $context, $settings, $options, $scripturl, $modSettings, $txt;
-
+	
+	$disabled_fields = isset($modSettings['disabled_profile_fields']) ? array_flip(explode(',', $modSettings['disabled_profile_fields'])) : array();
+	$buddy_fields = array('icq', 'aim', 'yim', 'msn');
+	
 	echo '
 		<div class="title_bar">
 			<h3 class="titlebg">
@@ -496,11 +499,17 @@ function template_editBuddies()
 			<tr class="catbg">
 				<th class="first_th lefttext" scope="col" width="20%">', $txt['name'], '</th>
 				<th scope="col">', $txt['status'], '</th>
-				<th scope="col">', $txt['email'], '</th>
-				<th scope="col">', $txt['icq'], '</th>
-				<th scope="col">', $txt['aim'], '</th>
-				<th scope="col">', $txt['yim'], '</th>
-				<th scope="col">', $txt['msn'], '</th>
+				<th scope="col">', $txt['email'], '</th>';
+	
+	// don't show them if they are sdisabled
+	foreach ($buddy_fields as $key => $column)
+	{
+		if (!isset($disabled_fields[$column]))
+			echo '
+				<th scope="col">', $txt[$column], '</th>';
+	}
+
+	echo '
 				<th class="last_th" scope="col"></th>
 			</tr>';
 
@@ -519,11 +528,17 @@ function template_editBuddies()
 			<tr class="', $alternate ? 'windowbg' : 'windowbg2', '">
 				<td>', $buddy['link'], '</td>
 				<td align="center"><a href="', $buddy['online']['href'], '"><img src="', $buddy['online']['image_href'], '" alt="', $buddy['online']['label'], '" title="', $buddy['online']['label'], '" /></a></td>
-				<td align="center">', ($buddy['show_email'] == 'no' ? '' : '<a href="' . $scripturl . '?action=emailuser;sa=email;uid=' . $buddy['id'] . '" rel="nofollow"><img src="' . $settings['images_url'] . '/email_sm.gif" alt="' . $txt['email'] . '" title="' . $txt['email'] . ' ' . $buddy['name'] . '" /></a>'), '</td>
-				<td align="center">', $buddy['icq']['link'], '</td>
-				<td align="center">', $buddy['aim']['link'], '</td>
-				<td align="center">', $buddy['yim']['link'], '</td>
-				<td align="center">', $buddy['msn']['link'], '</td>
+				<td align="center">', ($buddy['show_email'] == 'no' ? '' : '<a href="' . $scripturl . '?action=emailuser;sa=email;uid=' . $buddy['id'] . '" rel="nofollow"><img src="' . $settings['images_url'] . '/email_sm.gif" alt="' . $txt['email'] . '" title="' . $txt['email'] . ' ' . $buddy['name'] . '" /></a>'), '</td>';
+		
+		// If these are off, don't show them
+		foreach ($buddy_fields as $key => $column)
+		{
+			if (!isset($disabled_fields[$column]))
+				echo '
+					<td align="center">', $buddy[$column]['link'], '</td>';
+		}
+		
+		echo '
 				<td align="center"><a href="', $scripturl, '?action=profile;area=lists;sa=buddies;u=', $context['id_member'], ';remove=', $buddy['id'], ';', $context['session_var'], '=', $context['session_id'], '"><img src="', $settings['images_url'], '/icons/delete.gif" alt="', $txt['buddy_remove'], '" title="', $txt['buddy_remove'], '" /></a></td>
 			</tr>';
 
@@ -2817,6 +2832,7 @@ function template_profile_karma_modify()
 							</dd>';
 }
 
+
 // Select the time format!
 function template_profile_timeformat_modify()
 {
@@ -3021,4 +3037,5 @@ function template_authentication_method()
 	// ]]></script>';
 }
 
+
 ?>

+ 1 - 0
Themes/default/languages/Packages.english.php

@@ -127,6 +127,7 @@ $txt['package_uninstall_done'] = 'The package has been uninstalled, it should no
 $txt['package_uninstall_cannot'] = 'This package cannot be uninstalled, because there is no uninstaller!<br /><br />Please contact the mod author for more information.';
 
 $txt['package_install_options'] = 'Installation Options';
+$txt['package_install_options_desc'] = 'Set various options for how the package manager installs modifications, including backups and ftp access';
 $txt['package_install_options_ftp_why'] = 'Using the package manager\'s FTP functionality is the easiest way to avoid having to manually chmod the files writable through FTP yourself for the package manager to work.<br />Here you can set the default values for some fields.';
 $txt['package_install_options_ftp_server'] = 'FTP Server';
 $txt['package_install_options_ftp_port'] = 'Port';

+ 0 - 2
Themes/default/languages/Themes.english.php

@@ -71,8 +71,6 @@ $txt['who_display_viewing_names'] = 'Show member names';
 $txt['disable_recent_posts'] = 'Disable recent posts';
 $txt['enable_single_post'] = 'Enable single post';
 $txt['enable_multiple_posts'] = 'Enable multiple posts';
-$txt['enable_inline_links'] = 'Enable inline links';
-$txt['inline_desc'] = 'Enabling this will cause your current location to be drawn in a single line, as opposed to in a tree-like manner.';
 $txt['show_stats_index'] = 'Show statistics on board index';
 $txt['latest_members'] = 'Show latest member on board index';
 $txt['last_modification'] = 'Show last modification date on modified posts';

+ 1 - 1
Themes/default/languages/index.english.php

@@ -421,7 +421,7 @@ $txt['search_advanced'] = 'Advanced search';
 
 $txt['security_risk'] = 'MAJOR SECURITY RISK:';
 $txt['not_removed'] = 'You have not removed ';
-$txt['not_removed_extra'] ='%1$s is a backup of %2$s that was not generated by SMF. It can be accessed directly and used to gain unauthorised access to your forum. You should delete it immediately.';
+$txt['not_removed_extra'] = '%1$s is a backup of %2$s that was not generated by SMF. It can be accessed directly and used to gain unauthorised access to your forum. You should delete it immediately.';
 
 $txt['cache_writable_head'] = 'Performance Warning';
 $txt['cache_writable'] = 'The cache directory is not writable - this will adversely affect the performance of your forum.';

+ 0 - 1
other/install_2-1_mysql.sql

@@ -1954,7 +1954,6 @@ VALUES (1, 'name', '{$default_theme_name}'),
 	(1, 'show_profile_buttons', '1'),
 	(1, 'show_mark_read', '1'),
 	(1, 'show_stats_index', '1'),
-	(1, 'linktree_inline', '0'),
 	(1, 'show_board_desc', '1'),
 	(1, 'newsfader_time', '5000'),
 	(1, 'allow_no_censored', '0'),

+ 0 - 1
other/install_2-1_postgresql.sql

@@ -2456,7 +2456,6 @@ INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'linktree_
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'show_profile_buttons', '1');
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'show_mark_read', '1');
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'show_stats_index', '1');
-INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'linktree_inline', '0');
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'show_board_desc', '1');
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'newsfader_time', '5000');
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'allow_no_censored', '0');

+ 0 - 1
other/install_2-1_sqlite.sql

@@ -2104,7 +2104,6 @@ INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'linktree_
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'show_profile_buttons', '1');
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'show_mark_read', '1');
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'show_stats_index', '1');
-INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'linktree_inline', '0');
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'show_board_desc', '1');
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'newsfader_time', '5000');
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'allow_no_censored', '0');

+ 0 - 1
other/upgrade.php

@@ -2035,7 +2035,6 @@ function convertSettingsToTheme()
 		'newsfader_time' => @$GLOBALS['fadertime'],
 		'use_image_buttons' => empty($GLOBALS['MenuType']) ? 1 : 0,
 		'enable_news' => @$GLOBALS['enable_news'],
-		'linktree_inline' => @$modSettings['enableInlineLinks'],
 		'return_to_post' => @$modSettings['returnToPost'],
 	);