Browse Source

! And also message icons don't need their table hard-sorted either.

Signed-off-by: Peter Spicer <sleeping@myperch.org>
Peter Spicer 11 years ago
parent
commit
7fcf510481
3 changed files with 4 additions and 14 deletions
  1. 2 10
      Sources/ManageSmileys.php
  2. 0 3
      Sources/Subs-Db-postgresql.php
  3. 2 1
      Sources/Subs-Editor.php

+ 2 - 10
Sources/ManageSmileys.php

@@ -1708,7 +1708,8 @@ function EditMessageIcons()
 		SELECT m.id_icon, m.title, m.filename, m.icon_order, m.id_board, b.name AS board_name
 		FROM {db_prefix}message_icons AS m
 			LEFT JOIN {db_prefix}boards AS b ON (b.id_board = m.id_board)
-		WHERE ({query_see_board} OR b.id_board IS NULL)',
+		WHERE ({query_see_board} OR b.id_board IS NULL)
+		ORDER BY m.icon_order',
 		array(
 		)
 	);
@@ -1829,15 +1830,6 @@ function EditMessageIcons()
 			}
 		}
 
-		// Sort by order, so it is quicker :)
-		$smcFunc['db_query']('alter_table_icons', '
-			ALTER TABLE {db_prefix}message_icons
-			ORDER BY icon_order',
-			array(
-				'db_error_skip' => true,
-			)
-		);
-
 		// Unless we're adding a new thing, we'll escape
 		if (!isset($_POST['add']))
 			redirectexit('action=admin;area=smileys;sa=editicons');

+ 0 - 3
Sources/Subs-Db-postgresql.php

@@ -276,9 +276,6 @@ function smf_db_query($identifier, $db_string, $db_values = array(), $connection
 		'alter_table_boards' => array(
 			'~(.+)~' => '',
 		),
-		'alter_table_icons' => array(
-			'~(.+)~' => '',
-		),
 		'ban_suggest_error_ips' => array(
 			'~RLIKE~' => '~',
 			'~\\.~' => '\.',

+ 2 - 1
Sources/Subs-Editor.php

@@ -1403,7 +1403,8 @@ function getMessageIcons($board_id)
 			$request = $smcFunc['db_query']('select_message_icons', '
 				SELECT title, filename
 				FROM {db_prefix}message_icons
-				WHERE id_board IN (0, {int:board_id})',
+				WHERE id_board IN (0, {int:board_id})
+				ORDER BY icon_order',
 				array(
 					'board_id' => $board_id,
 				)