Jelajahi Sumber

+ Add new message icon for polls ... remarkable how many files need to be updated for such a simple add

Spuds 13 tahun lalu
induk
melakukan
123eb94fe4

+ 2 - 2
SSI.php

@@ -431,7 +431,7 @@ function ssi_recentTopics($num_recent = 8, $exclude_boards = null, $include_boar
 		$include_boards = array();
 	}
 
-	$stable_icons = array('xx', 'thumbup', 'thumbdown', 'exclamation', 'question', 'lamp', 'smiley', 'angry', 'cheesy', 'grin', 'sad', 'wink', 'moved', 'recycled', 'wireless');
+	$stable_icons = array('xx', 'thumbup', 'thumbdown', 'exclamation', 'question', 'lamp', 'smiley', 'angry', 'cheesy', 'grin', 'sad', 'wink', 'poll', 'moved', 'recycled', 'wireless');
 	$icon_sources = array();
 	foreach ($stable_icons as $icon)
 		$icon_sources[$icon] = 'images_url';
@@ -1629,7 +1629,7 @@ function ssi_boardNews($board = null, $limit = null, $start = null, $length = nu
 	$smcFunc['db_free_result']($request);
 
 	// Load the message icons - the usual suspects.
-	$stable_icons = array('xx', 'thumbup', 'thumbdown', 'exclamation', 'question', 'lamp', 'smiley', 'angry', 'cheesy', 'grin', 'sad', 'wink', 'moved', 'recycled', 'wireless');
+	$stable_icons = array('xx', 'thumbup', 'thumbdown', 'exclamation', 'question', 'lamp', 'smiley', 'angry', 'cheesy', 'grin', 'sad', 'wink', 'poll', 'moved', 'recycled', 'wireless');
 	$icon_sources = array();
 	foreach ($stable_icons as $icon)
 		$icon_sources[$icon] = 'images_url';

+ 1 - 1
Sources/Display.php

@@ -1096,7 +1096,7 @@ function prepareDisplayContext($reset = false)
 	// $context['icon_sources'] says where each icon should come from - here we set up the ones which will always exist!
 	if (empty($context['icon_sources']))
 	{
-		$stable_icons = array('xx', 'thumbup', 'thumbdown', 'exclamation', 'question', 'lamp', 'smiley', 'angry', 'cheesy', 'grin', 'sad', 'wink', 'moved', 'recycled', 'wireless', 'clip');
+		$stable_icons = array('xx', 'thumbup', 'thumbdown', 'exclamation', 'question', 'lamp', 'smiley', 'angry', 'cheesy', 'grin', 'sad', 'wink', 'poll', 'moved', 'recycled', 'wireless', 'clip');
 		$context['icon_sources'] = array();
 		foreach ($stable_icons as $icon)
 			$context['icon_sources'][$icon] = 'images_url';

+ 1 - 1
Sources/MessageIndex.php

@@ -312,7 +312,7 @@ function MessageIndex()
 		$fake_ascending = false;
 
 	// Setup the default topic icons...
-	$stable_icons = array('xx', 'thumbup', 'thumbdown', 'exclamation', 'question', 'lamp', 'smiley', 'angry', 'cheesy', 'grin', 'sad', 'wink', 'moved', 'recycled', 'wireless', 'clip');
+	$stable_icons = array('xx', 'thumbup', 'thumbdown', 'exclamation', 'question', 'lamp', 'smiley', 'angry', 'cheesy', 'grin', 'sad', 'wink', 'poll', 'moved', 'recycled', 'wireless', 'clip');
 	$context['icon_sources'] = array();
 	foreach ($stable_icons as $icon)
 		$context['icon_sources'][$icon] = 'images_url';

+ 14 - 1
Sources/Post.php

@@ -1089,6 +1089,20 @@ function Post()
 
 	if (!empty($context['icons']))
 		$context['icons'][count($context['icons']) - 1]['is_last'] = true;
+	
+	// Are we starting a poll? if set the poll icon as selected if its available
+	if (isset($_REQUEST['poll']))
+	{
+	    foreach ($context['icons'] as $icons)
+		{  
+			if (isset($icons['value']) && $icons['value'] == 'poll')
+			{
+				// if found we are done
+				$context['icon'] = 'poll';
+				break;
+			}
+		}
+	}
 
 	$context['icon_url'] = '';
 	for ($i = 0, $n = count($context['icons']); $i < $n; $i++)
@@ -2068,7 +2082,6 @@ function Post2()
 		redirectexit('board=' . $board . '.0');
 }
 
-// General function for topic announcements.
 /**
  * handle the announce topic function (action=announce).
  * checks the topic announcement permissions and loads the announcement template.

+ 1 - 1
Sources/Recent.php

@@ -653,7 +653,7 @@ function UnreadTopics()
 	}
 
 	// Setup the default topic icons... for checking they exist and the like ;)
-	$stable_icons = array('xx', 'thumbup', 'thumbdown', 'exclamation', 'question', 'lamp', 'smiley', 'angry', 'cheesy', 'grin', 'sad', 'wink', 'moved', 'recycled', 'wireless', 'clip');
+	$stable_icons = array('xx', 'thumbup', 'thumbdown', 'exclamation', 'question', 'lamp', 'smiley', 'angry', 'cheesy', 'grin', 'sad', 'wink', 'poll', 'moved', 'recycled', 'wireless', 'clip');
 	$context['icon_sources'] = array();
 	foreach ($stable_icons as $icon)
 		$context['icon_sources'][$icon] = 'images_url';

+ 1 - 1
Sources/Search.php

@@ -1803,7 +1803,7 @@ function PlushSearch2()
 	$context['key_words'] = &$searchArray;
 
 	// Setup the default topic icons... for checking they exist and the like!
-	$stable_icons = array('xx', 'thumbup', 'thumbdown', 'exclamation', 'question', 'lamp', 'smiley', 'angry', 'cheesy', 'grin', 'sad', 'wink', 'moved', 'recycled', 'wireless', 'clip');
+	$stable_icons = array('xx', 'thumbup', 'thumbdown', 'exclamation', 'question', 'lamp', 'smiley', 'angry', 'cheesy', 'grin', 'sad', 'wink', 'poll', 'moved', 'recycled', 'wireless', 'clip');
 	$context['icon_sources'] = array();
 	foreach ($stable_icons as $icon)
 		$context['icon_sources'][$icon] = 'images_url';

+ 6 - 5
Sources/Subs-Editor.php

@@ -930,10 +930,10 @@ function fetchTagAttributes($text)
 
 /**
  * Retrieves a list of message icons.
- * Based on the settings, the array will either contain a list of default
- * message icons or a list of custom message icons retrieved from the database.
- * The board_id is needed for the custom message icons (which can be set for
- * each board individually).
+ * - Based on the settings, the array will either contain a list of default
+ *   message icons or a list of custom message icons retrieved from the database.
+ * - The board_id is needed for the custom message icons (which can be set for
+ *   each board individually).
  * 
  * @param int $board_id
  * @return array
@@ -958,7 +958,8 @@ function getMessageIcons($board_id)
 			array('value' => 'cheesy', 'name' => $txt['icon_cheesy']),
 			array('value' => 'grin', 'name' => $txt['icon_grin']),
 			array('value' => 'sad', 'name' => $txt['icon_sad']),
-			array('value' => 'wink', 'name' => $txt['icon_wink'])
+			array('value' => 'wink', 'name' => $txt['icon_wink']),
+			array('value' => 'poll', 'name' => $txt['icon_poll']),
 		);
 
 		foreach ($icons as $k => $dummy)

TEMPAT SAMPAH
Themes/default/images/post/poll.png


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

@@ -1323,7 +1323,8 @@ VALUES ('xx', 'Standard', '0'),
 	('cheesy', 'Cheesy', '8'),
 	('grin', 'Grin', '9'),
 	('sad', 'Sad', '10'),
-	('wink', 'Wink', '11');
+	('wink', 'Wink', '11'),
+	('poll', 'Poll', '12');
 # --------------------------------------------------------
 
 #

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

@@ -1747,6 +1747,7 @@ INSERT INTO {$db_prefix}message_icons (filename, title, icon_order) VALUES ('che
 INSERT INTO {$db_prefix}message_icons (filename, title, icon_order) VALUES ('grin', 'Grin', '9');
 INSERT INTO {$db_prefix}message_icons (filename, title, icon_order) VALUES ('sad', 'Sad', '10');
 INSERT INTO {$db_prefix}message_icons (filename, title, icon_order) VALUES ('wink', 'Wink', '11');
+INSERT INTO {$db_prefix}message_icons (filename, title, icon_order) VALUES ('poll', 'Poll', '12');
 # --------------------------------------------------------
 
 #

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

@@ -1439,6 +1439,7 @@ INSERT INTO {$db_prefix}message_icons (filename, title, icon_order) VALUES ('che
 INSERT INTO {$db_prefix}message_icons (filename, title, icon_order) VALUES ('grin', 'Grin', '9');
 INSERT INTO {$db_prefix}message_icons (filename, title, icon_order) VALUES ('sad', 'Sad', '10');
 INSERT INTO {$db_prefix}message_icons (filename, title, icon_order) VALUES ('wink', 'Wink', '11');
+INSERT INTO {$db_prefix}message_icons (filename, title, icon_order) VALUES ('poll', 'Poll', '12');
 COMMIT;
 
 # --------------------------------------------------------