ソースを参照

! Let's cache the file_exists too (Subs-Editor.php => messageicons)...why do we check it?

emanuele 12 年 前
コミット
5d06ba438b
1 ファイル変更13 行追加13 行削除
  1. 13 13
      Sources/Subs-Editor.php

+ 13 - 13
Sources/Subs-Editor.php

@@ -986,21 +986,21 @@ function getMessageIcons($board_id)
 				$icon_data[] = $row;
 			$smcFunc['db_free_result']($request);
 
-			cache_put_data('posting_icons-' . $board_id, $icon_data, 480);
-		}
-		else
-			$icon_data = $temp;
+			$icons = array();
+			foreach ($icon_data as $icon)
+			{
+				$icons[$icon['filename']] = array(
+					'value' => $icon['filename'],
+					'name' => $icon['title'],
+					'url' => $settings[file_exists($settings['theme_dir'] . '/images/post/' . $icon['filename'] . '.png') ? 'images_url' : 'default_images_url'] . '/post/' . $icon['filename'] . '.png',
+					'is_last' => false,
+				);
+			}
 
-		$icons = array();
-		foreach ($icon_data as $icon)
-		{
-			$icons[$icon['filename']] = array(
-				'value' => $icon['filename'],
-				'name' => $icon['title'],
-				'url' => $settings[file_exists($settings['theme_dir'] . '/images/post/' . $icon['filename'] . '.png') ? 'images_url' : 'default_images_url'] . '/post/' . $icon['filename'] . '.png',
-				'is_last' => false,
-			);
+			cache_put_data('posting_icons-' . $board_id, $icons, 480);
 		}
+		else
+			$icons = $temp;
 	}
 
 	return array_values($icons);