Przeglądaj źródła

! Stylistic consistency is nice.

Signed-off-by: Peter Spicer <[email protected]>
Peter Spicer 10 lat temu
rodzic
commit
40253fc5b5

+ 4 - 10
Sources/PersonalMessage.php

@@ -2671,10 +2671,8 @@ function MessageActionsApply()
 			if (!empty($labels_to_apply))
 			{
 				$inserts = array();
-				foreach($labels_to_apply as $pm => $label)
-				{
+				foreach ($labels_to_apply as $pm => $label)
 					$inserts[] = array($pm, $label);
-				}
 				
 				$smcFunc['db_insert']('', '{db_prefix}pm_labeled_messages', array('id_pm' => 'int', 'id_label' => 'int'), $inserts, array());
 			}
@@ -3195,10 +3193,8 @@ function ManageLabels()
 		if (!empty($labels_to_add))
 		{
 			$inserts = array();
-			foreach($labels_to_add AS $label)
-			{
+			foreach ($labels_to_add AS $label)
 				$inserts[] = array($user_info['id'], $label);
-			}
 			
 			$smcFunc['db_insert']('', '{db_prefix}pm_labels', array('id_member' => 'int', 'name' => 'string-30'), $inserts, array());
 		}
@@ -3206,7 +3202,7 @@ function ManageLabels()
 		// Update existing labels as needed
 		if (!empty($label_upates))
 		{
-			foreach($label_updates AS $id => $name)
+			foreach ($label_updates AS $id => $name)
 			{
 				$smcFunc['db_query']('', '
 					UPDATE {db_prefix}labels
@@ -3921,10 +3917,8 @@ function ApplyRules($all_messages = false)
 
 			$inserts = array();
 			// Now we insert the label info
-			foreach($realLabels as $a_label)
-			{
+			foreach ($realLabels as $a_label)
 				$inserts[] = array($user_info['id'], $pm, $label);
-			}
 
 			$smcFunc['db_insert']('', '{db_prefix}pm_labeled_messages', array('id_pm' => 'int', 'id_label' => 'int'), $inserts, array());
 		}

+ 2 - 2
other/upgrade_2-1_mysql.sql

@@ -638,7 +638,7 @@ ADD COLUMN in_inbox tinyint(3) NOT NULL default '1';
 			$labels = explode(',', $row['message_labels']);
 
 			// Build some inserts
-			foreach($labels AS $index => $label)
+			foreach ($labels AS $index => $label)
 			{
 				// Keep track of the index of this label - we'll need that in a bit...
 				$label_info[$row['id_member']][$label] = $index;
@@ -699,7 +699,7 @@ ADD COLUMN in_inbox tinyint(3) NOT NULL default '1';
 		{
 			$labels = explode(',', $row['labels']);
 			
-			foreach($labels as $a_label)
+			foreach ($labels as $a_label)
 			{
 				if ($a_label == '-1')
 					continue;

+ 2 - 2
other/upgrade_2-1_postgresql.sql

@@ -721,7 +721,7 @@ ADD COLUMN in_inbox smallint NOT NULL default '1';
 			$labels = explode(',', $row['message_labels']);
 
 			// Build some inserts
-			foreach($labels AS $index => $label)
+			foreach ($labels AS $index => $label)
 			{
 				// Keep track of the index of this label - we'll need that in a bit...
 				$label_info[$row['id_member']][$label] = $index;
@@ -782,7 +782,7 @@ ADD COLUMN in_inbox smallint NOT NULL default '1';
 		{
 			$labels = explode(',', $row['labels']);
 
-			foreach($labels as $a_label)
+			foreach ($labels as $a_label)
 			{
 				if ($a_label == '-1')
 					continue;

+ 2 - 2
other/upgrade_2-1_sqlite.sql

@@ -698,7 +698,7 @@ ADD COLUMN in_inbox tinyint(3) NOT NULL default '1';
 			$labels = explode(',', $row['message_labels']);
 
 			// Build some inserts
-			foreach($labels AS $index => $label)
+			foreach ($labels AS $index => $label)
 			{
 				// Keep track of the index of this label - we'll need that in a bit...
 				$label_info[$row['id_member']][$label] = $index;
@@ -759,7 +759,7 @@ ADD COLUMN in_inbox tinyint(3) NOT NULL default '1';
 		{
 			$labels = explode(',', $row['labels']);
 
-			foreach($labels as $a_label)
+			foreach ($labels as $a_label)
 			{
 				if ($a_label == '-1')
 					continue;