瀏覽代碼

Coding stile

Signed-off-by: emanuele <[email protected]>
emanuele 11 年之前
父節點
當前提交
296744f23f

+ 4 - 4
Sources/Load.php

@@ -1537,13 +1537,13 @@ function loadTheme($id_theme = 0, $initialize = true)
 	// Some basic information...
 	if (!isset($context['html_headers']))
 		$context['html_headers'] = '';
-	if(!isset($context['javascript_files']))
+	if (!isset($context['javascript_files']))
 		$context['javascript_files'] = array();
-	if(!isset($context['css_files']))
+	if (!isset($context['css_files']))
 		$context['css_files'] = array();
-	if(!isset($context['javascript_inline']))
+	if (!isset($context['javascript_inline']))
 		$context['javascript_inline'] = array('standard' => array(), 'defer' => array());
-	if(!isset($context['javascript_vars']))
+	if (!isset($context['javascript_vars']))
 		$context['javascript_vars'] = array();
 
 	$context['menu_separator'] = !empty($settings['use_image_buttons']) ? ' ' : ' | ';

+ 5 - 5
Sources/ManageAttachments.php

@@ -214,7 +214,7 @@ function ManageAttachmentSettings($return_config = false)
 
 		if (!empty($_POST['use_subdirectories_for_attachments']))
 		{
-			if(isset($_POST['use_subdirectories_for_attachments']) && empty($_POST['basedirectory_for_attachments']))
+			if (isset($_POST['use_subdirectories_for_attachments']) && empty($_POST['basedirectory_for_attachments']))
 				$_POST['basedirectory_for_attachments'] = (!empty($modSettings['basedirectory_for_attachments']) ? ($modSettings['basedirectory_for_attachments']) : $boarddir);
 
 			if (!empty($_POST['use_subdirectories_for_attachments']) && !empty($modSettings['attachment_basedirectories']))
@@ -2077,7 +2077,7 @@ function ManageAttachmentPaths()
 				$bid = -1;
 				$use_subdirectories_for_attachments = 0;
 				if (!empty($modSettings['attachment_basedirectories']))
-					foreach($modSettings['attachment_basedirectories'] as $bid => $base)
+					foreach ($modSettings['attachment_basedirectories'] as $bid => $base)
 						if (strpos($modSettings['attachmentUploadDir'][$_POST['current_dir']], $base . DIRECTORY_SEPARATOR) !==false)
 						{
 							$use_subdirectories_for_attachments = 1;
@@ -2158,7 +2158,7 @@ function ManageAttachmentPaths()
 
 		If (isset($_POST['base_dir']))
 		{
-			foreach($_POST['base_dir'] as $id => $dir)
+			foreach ($_POST['base_dir'] as $id => $dir)
 			{
 				if (!empty($dir) && $dir != $modSettings['attachmentUploadDir'][$id])
 				{
@@ -2232,11 +2232,11 @@ function ManageAttachmentPaths()
 		{
 			$errors = array();
 			if (!empty($_SESSION['errors']['dir']))
-				foreach($_SESSION['errors']['dir'] as $error)
+				foreach ($_SESSION['errors']['dir'] as $error)
 					$errors['dir'][] = $smcFunc['htmlspecialchars']($error, ENT_QUOTES);
 
 			if (!empty($_SESSION['errors']['base']))
-				foreach($_SESSION['errors']['base'] as $error)
+				foreach ($_SESSION['errors']['base'] as $error)
 					$errors['base'][] = $smcFunc['htmlspecialchars']($error, ENT_QUOTES);
 		}
 		unset($_SESSION['errors']);

+ 1 - 1
Sources/MessageIndex.php

@@ -486,7 +486,7 @@ function MessageIndex()
 			if (!empty($settings['avatars_on_indexes']))
 			{
 				// Allow themers to show the latest poster's avatar along with the topic
-				if(!empty($row['avatar']))
+				if (!empty($row['avatar']))
 				{
 					if ($modSettings['avatar_action_too_large'] == 'option_html_resize' || $modSettings['avatar_action_too_large'] == 'option_js_resize')
 					{

+ 1 - 1
Sources/Post.php

@@ -1223,7 +1223,7 @@ function Post2()
 				$keep_ids[] = (int) $dummy;
 
 		if (isset($_SESSION['temp_attachments']))
-			foreach($_SESSION['temp_attachments'] as $attachID => $attachment)
+			foreach ($_SESSION['temp_attachments'] as $attachID => $attachment)
 			{
 				if ((isset($_SESSION['temp_attachments']['post']['files'], $attachment['name']) && in_array($attachment['name'], $_SESSION['temp_attachments']['post']['files'])) || in_array($attachID, $keep_temp) || strpos($attachID, 'post_tmp_' . $user_info['id']) === false)
 					continue;

+ 1 - 1
Sources/Printpage.php

@@ -276,7 +276,7 @@ function PrintTopic()
 	if (isset($_REQUEST['images']) && !empty($modSettings['attachmentEnable']) && allowedTo('view_attachments'))
 	{
 		$messages = array();
-		foreach($context['posts'] as $temp)
+		foreach ($context['posts'] as $temp)
 			$messages[] = $temp['id_msg'];
 		
 		// build the request

+ 1 - 1
Sources/Profile.php

@@ -777,7 +777,7 @@ function loadCustomFields($memID, $area = 'summary')
 		// Parse BBCode
 		if ($row['bbc'])
 			$output_html = parse_bbc($output_html);
-		elseif($row['field_type'] == 'textarea')
+		elseif ($row['field_type'] == 'textarea')
 			// Allow for newlines at least
 			$output_html = strtr($output_html, array("\n" => '<br />'));
 

+ 1 - 1
Sources/Subs-BoardIndex.php

@@ -233,7 +233,7 @@ function getBoardIndex($boardIndexOptions)
 		if (!empty($settings['avatars_on_indexes']))
 		{
 			// Allow themers to show the latest poster's avatar along with the board
-			if(!empty($row_board['avatar']))
+			if (!empty($row_board['avatar']))
 			{
 				if ($modSettings['avatar_action_too_large'] == 'option_html_resize' || $modSettings['avatar_action_too_large'] == 'option_js_resize')
 				{

+ 1 - 1
Sources/Subs.php

@@ -2902,7 +2902,7 @@ function setupThemeContext($forceload = false)
 	$context['show_pm_popup'] = $context['user']['popup_messages'] && !empty($options['popup_messages']) && (!isset($_REQUEST['action']) || $_REQUEST['action'] != 'pm');
 
 	// 2.1+: Add the PM popup here instead. Theme authors can still override it simply by editing/removing the 'fPmPopup' in the array.
-	if($context['show_pm_popup'])
+	if ($context['show_pm_popup'])
 		addInlineJavascript('
 		$(document).ready(function(){
 			new smc_Popup({

+ 1 - 1
Themes/default/ManageAttachments.template.php

@@ -172,7 +172,7 @@ function template_maintenance()
 							<dd><select name="to">
 								<option value="0">', $txt['attachment_transfer_select'], '</option>';
 
-	foreach($context['attach_dirs'] as $id => $dir)
+	foreach ($context['attach_dirs'] as $id => $dir)
 		echo '
 								<option value="', $id, '">', $dir, '</option>';
 	echo '

+ 1 - 1
Themes/default/PersonalMessage.template.php

@@ -368,7 +368,7 @@ function template_folder()
 		}
 		elseif ($context['can_send_pm'] && !$message['is_message_author'] && !$message['member']['is_guest'])
 		{
-			if(!empty($modSettings['onlineEnable']))
+			if (!empty($modSettings['onlineEnable']))
 				echo '
 				<li class="poster_online"><a href="', $scripturl,'?action=pm;sa=send;u=', $message['member']['id'], '" title="', $message['member']['online']['member_online_text'], '">', $txt['send_message'], ' <img src="'. $message['member']['online']['image_href']. '" alt="" /></a></li>';
 			else

+ 1 - 1
Themes/default/index.template.php

@@ -97,7 +97,7 @@ function template_html_above()
 	<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css?alp21" />';
 
 	// Save some database hits, if a width for multiple wrappers is set in admin.
-	if(!empty($settings['forum_width']))
+	if (!empty($settings['forum_width']))
 		echo '
 	<style type="text/css">#wrapper, .frame {width: ', $settings['forum_width'], ';}</style>';
 

+ 1 - 1
other/install.php

@@ -1214,7 +1214,7 @@ function DatabasePopulation()
 		$smcFunc['db_optimize_table']($table) != -1 or $db_messed = true;
 
 		// Optimizing one sqlite table, optimizes them all
-		if($db_type == 'sqlite')
+		if ($db_type == 'sqlite')
 			break;
 
 		if (!empty($db_messed))