Browse Source

Merge branch 'release-2.1' of git://github.com/SimpleMachines/SMF2.1.git into theme_stuff

Suki 11 years ago
parent
commit
51f3d24ac3
78 changed files with 1790 additions and 918 deletions
  1. 3 0
      Sources/Avatar.php
  2. 2 2
      Sources/Calendar.php
  3. 1 1
      Sources/Class-BrowserDetect.php
  4. 20 20
      Sources/Class-CurlFetchWeb.php
  5. 3 0
      Sources/Class-Graphics.php
  6. 49 42
      Sources/Class-Package.php
  7. 13 13
      Sources/DbExtra-mysql.php
  8. 13 13
      Sources/DbExtra-postgresql.php
  9. 14 14
      Sources/DbExtra-sqlite.php
  10. 14 14
      Sources/DbExtra-sqlite3.php
  11. 55 47
      Sources/DbPackages-mysql.php
  12. 53 46
      Sources/DbPackages-postgresql.php
  13. 55 48
      Sources/DbPackages-sqlite.php
  14. 55 48
      Sources/DbPackages-sqlite3.php
  15. 3 2
      Sources/DbSearch-mysql.php
  16. 8 6
      Sources/DbSearch-postgresql.php
  17. 8 6
      Sources/DbSearch-sqlite.php
  18. 8 6
      Sources/DbSearch-sqlite3.php
  19. 20 9
      Sources/Display.php
  20. 19 24
      Sources/Drafts.php
  21. 17 17
      Sources/Errors.php
  22. 0 1
      Sources/Load.php
  23. 1 0
      Sources/ManageBoards.php
  24. 21 1
      Sources/Packages.php
  25. 454 180
      Sources/PersonalMessage.php
  26. 1 1
      Sources/Poll.php
  27. 25 5
      Sources/Post.php
  28. 0 22
      Sources/Profile-Modify.php
  29. 22 14
      Sources/Profile.php
  30. 33 1
      Sources/Subs-BoardIndex.php
  31. 7 4
      Sources/Subs-Editor.php
  32. 0 1
      Sources/Subs-Members.php
  33. 2 1
      Sources/Subs-Package.php
  34. 1 0
      Sources/Subs-Post.php
  35. 3 0
      Sources/Subs.php
  36. 3 27
      Themes/default/BoardIndex.template.php
  37. 2 0
      Themes/default/Display.template.php
  38. 5 2
      Themes/default/ManageBoards.template.php
  39. 4 4
      Themes/default/ManageMaintenance.template.php
  40. 1 1
      Themes/default/ManageScheduledTasks.template.php
  41. 2 16
      Themes/default/MessageIndex.template.php
  42. 3 3
      Themes/default/PersonalMessage.template.php
  43. 12 0
      Themes/default/Post.template.php
  44. 1 1
      Themes/default/Profile.template.php
  45. 10 2
      Themes/default/Xml.template.php
  46. 3 13
      Themes/default/css/admin.css
  47. 49 124
      Themes/default/css/index.css
  48. BIN
      Themes/default/images/admin/drafts.png
  49. BIN
      Themes/default/images/admin/frenemy.png
  50. BIN
      Themes/default/images/admin/members_delete.png
  51. BIN
      Themes/default/images/admin/openid.png
  52. BIN
      Themes/default/images/admin/personal_message.png
  53. BIN
      Themes/default/images/admin/stats.png
  54. BIN
      Themes/default/images/boardicons.png
  55. BIN
      Themes/default/images/icons/stats_info_hd.png
  56. BIN
      Themes/default/images/new_none.png
  57. BIN
      Themes/default/images/new_some.png
  58. BIN
      Themes/default/images/off.png
  59. BIN
      Themes/default/images/on.png
  60. BIN
      Themes/default/images/on2.png
  61. BIN
      Themes/default/images/redirect.png
  62. 0 1
      Themes/default/languages/Errors.english.php
  63. 1 0
      Themes/default/languages/ManageBoards.english.php
  64. 0 1
      Themes/default/languages/ManageSettings.english.php
  65. 1 0
      Themes/default/languages/Packages.english.php
  66. 1 53
      Themes/default/languages/Post.english.php
  67. 0 1
      Themes/default/languages/Profile.english.php
  68. 2 0
      Themes/default/languages/index.english.php
  69. 0 16
      Themes/default/scripts/script.js
  70. 3 3
      other/install.php
  71. 21 2
      other/install_2-1_mysql.sql
  72. 29 1
      other/install_2-1_postgresql.sql
  73. 22 2
      other/install_2-1_sqlite.sql
  74. 23 2
      other/install_2-1_sqlite3.sql
  75. 3 0
      other/upgrade.php
  76. 197 11
      other/upgrade_2-1_mysql.sql
  77. 198 12
      other/upgrade_2-1_postgresql.sql
  78. 191 11
      other/upgrade_2-1_sqlite.sql

+ 3 - 0
Sources/Avatar.php

@@ -17,6 +17,9 @@
 if (!defined('SMF'))
 	die('No direct access...');
 
+/**
+ * Shows an avatar based on $_GET['attach']
+ */
 function showAvatar()
 {
 	global $smcFunc, $modSettings, $maintenance;

+ 2 - 2
Sources/Calendar.php

@@ -166,8 +166,8 @@ function CalendarMain()
 /**
  * This function processes posting/editing/deleting a calendar event.
  *
- * 	- calls Post() function if event is linked to a post.
- *  - calls insertEvent() to insert the event if not linked to post.
+ * 	- calls {@link Post.php|Post() Post()} function if event is linked to a post.
+ *  - calls {@link Subs-Calendar.php|insertEvent() insertEvent()} to insert the event if not linked to post.
  *
  * It requires the calendar_post permission to use.
  * It uses the event_post sub template in the Calendar template.

+ 1 - 1
Sources/Class-BrowserDetect.php

@@ -37,7 +37,7 @@ class browser_detector
 	/**
 	 * Holds if the detected device may be a mobile one
 	 *
-	 * @var type
+	 * @var boolean
 	 */
 	private $_is_mobile = null;
 

+ 20 - 20
Sources/Class-CurlFetchWeb.php

@@ -41,7 +41,7 @@ class curl_fetch_web_data
 	/**
 	 * Set the default items for this class
 	 *
-	 * @var type
+	 * @var array
 	 */
 	private $default_options = array(
 		CURLOPT_RETURNTRANSFER	=> 1, // Get returned value as a string (don't output it)
@@ -61,8 +61,8 @@ class curl_fetch_web_data
 	* Start the curl object
 	* - allow for user override values
 	*
-	* @param type $options cURL options as an array
-	* @param type $max_redirect use to overide the default of 3
+	* @param array $options cURL options as an array
+	* @param int $max_redirect use to overide the default of 3
 	*/
 	public function __construct($options = array(), $max_redirect = 3)
 	{
@@ -78,8 +78,8 @@ class curl_fetch_web_data
 	*  - passed arrays will be converted to a post string joined with &'s
 	*  - calls set_options to set the curl opts array values based on the defaults and user input
 	*
-	* @param type $url the site we are going to fetch
-	* @param type $post_data any post data as form name => value
+	* @param string $url the site we are going to fetch
+	* @param array $post_data any post data as form name => value
 	*/
 	public function get_url_data($url, $post_data = array())
 	{
@@ -101,8 +101,8 @@ class curl_fetch_web_data
 	*  - stores responses (url, code, error, headers, body) in the response array
 	*  - detects 301, 302, 307 codes and will redirect to the given response header location
 	*
-	* @param type $url site to fetch
-	* @param type $redirect flag to indicate if this was a redirect request or not
+	* @param string $url site to fetch
+	* @param boolean $redirect flag to indicate if this was a redirect request or not
 	* @return boolean
 	*/
 	private function curl_request($url, $redirect = false)
@@ -157,9 +157,9 @@ class curl_fetch_web_data
 	/**
 	* Used if being redirected to ensure we have a fully qualified address
 	*
-	* @param type $last_url where we went to
-	* @param type $new_url where we were redirected to
-	* @return new url location
+	* @param string $last_url where we went to
+	* @param string $new_url where we were redirected to
+	* @return string new url location
 	*/
 	private function get_redirect_url($last_url = '', $new_url = '')
 	{
@@ -182,8 +182,8 @@ class curl_fetch_web_data
 	*  - called as ->result() will return the full final array
 	*  - called as ->result('body') to just return the page source of the result
 	*
-	* @param type $area used to return an area such as body, header, error
-	* @return type
+	* @param string $area used to return an area such as body, header, error
+	* @return string
 	*/
 	public function result($area = '')
 	{
@@ -201,8 +201,8 @@ class curl_fetch_web_data
 	*  - Can be called as ->result_raw(x) where x is a specific loop results.
 	*  - Call as ->result_raw() for everything.
 	*
-	* @param type $response_number
-	* @return type
+	* @param string $response_number
+	* @return array|string The entire response array or just the specified response
 	*/
 	public function result_raw($response_number = '')
 	{
@@ -220,8 +220,8 @@ class curl_fetch_web_data
 	*  - forms the date (for post) in to a string var=xyz&var2=abc&var3=123
 	*  - drops vars with @ since we don't support sending files (uploading)
 	*
-	* @param type $post_data
-	* @return type
+	* @param array|string $post_data
+	* @return string A string of post data
 	*/
 	private function build_post_data($post_data)
 	{
@@ -273,8 +273,8 @@ class curl_fetch_web_data
 	* Called to initiate a redirect from a 301, 302 or 307 header
 	*  - resets the cURL options for the loop, sets the referrer flag
 	*
-	* @param type $target_url
-	* @param type $referer_url
+	* @param string $target_url
+	* @param string $referer_url
 	*/
 	private function redirect($target_url, $referer_url)
 	{
@@ -289,8 +289,8 @@ class curl_fetch_web_data
 	*  - lowercases everything to make it consistent
 	*
 	* @param type $cr
-	* @param type $header
-	* @return type
+	* @param string $header
+	* @return int The length of the header
 	*/
 	private function header_callback($cr, $header)
 	{

+ 3 - 0
Sources/Class-Graphics.php

@@ -22,6 +22,9 @@
 if (!defined('SMF'))
 	die('No direct access...');
 
+/**
+ * An implementation of the LZW compression algorithm
+ */
 class gif_lzw_compression
 {
 	public $MAX_LZW_BITS;

+ 49 - 42
Sources/Class-Package.php

@@ -29,7 +29,7 @@ class xmlArray
 
 	/**
 	 * holds debugging level
-	 * @var type
+	 * @var int
 	 */
 	public $debug_level;
 
@@ -80,6 +80,7 @@ class xmlArray
 	 * Get the root element's name.
 	 * Example use:
 	 *  echo $element->name();
+	 * @return string The root element's name
 	 */
 	public function name()
 	{
@@ -94,6 +95,7 @@ class xmlArray
 	 *  $data = $xml->fetch('html/head/title');
 	 * @param string $path - the path to the element to fetch
 	 * @param bool $get_elements - whether to include elements
+	 * @return string The value or attribute of the specified element
 	 */
 	public function fetch($path, $get_elements = false)
 	{
@@ -315,6 +317,7 @@ class xmlArray
 	 *  print_r($xml->to_array());
 	 *
 	 * @param string $path the path to output.
+	 * @return array An array of XML data
 	 */
 	public function to_array($path = null)
 	{
@@ -340,6 +343,7 @@ class xmlArray
 	 * Parse data into an array. (privately used...)
 	 *
 	 * @param string $data to parse
+	 * @return array The parsed array
 	 */
 	protected function _parse($data)
 	{
@@ -487,8 +491,8 @@ class xmlArray
 	/**
 	 * Get a specific element's xml. (privately used...)
 	 *
-	 * @param $array
-	 * @param $indent
+	 * @param array $array An array of element data
+	 * @param null|int $indent How many levels to indent the elements (null = no indent)
 	 */
 	protected function _xml($array, $indent)
 	{
@@ -540,8 +544,8 @@ class xmlArray
 	/**
 	 * Return an element as an array
 	 *
-	 * @param type $array
-	 * @return type
+	 * @param array $array
+	 * @return string|array A string with the element's value or an array of element datas
 	 */
 	protected function _array($array)
 	{
@@ -567,7 +571,8 @@ class xmlArray
 	/**
 	 * Parse out CDATA tags. (htmlspecialchars them...)
 	 *
-	 * @param $data
+	 * @param string $data The data with CDATA tags included
+	 * @return string The data contained within CDATA tags
 	 */
 	function _to_cdata($data)
 	{
@@ -604,7 +609,8 @@ class xmlArray
 	/**
 	 * Turn the CDATAs back to normal text.
 	 *
-	 * @param $data
+	 * @param string $data
+	 * @return string The transformed data	 
 	 */
 	protected function _from_cdata($data)
 	{
@@ -621,6 +627,7 @@ class xmlArray
 	 * Given an array, return the text from that array. (recursive and privately used.)
 	 *
 	 * @param array $array
+	 * @return string The text from the array
 	 */
 	protected function _fetch($array)
 	{
@@ -654,6 +661,7 @@ class xmlArray
 	 * @param string $path
 	 * @param int $level
 	 * @param bool $no_error
+	 * @return string|array The specified array (or the contents of said array if there's only one result) 
 	 */
 	protected function _path($array, $path, $level, $no_error = false)
 	{
@@ -725,29 +733,29 @@ class ftp_connection
 
 	/**
 	 * holds any errors
-	 * @var type
+	 * @var string
 	 */
 	public $error;
 
 	/**
 	 * holds last message from the server
-	 * @var type
+	 * @var string
 	 */
 	public $last_message;
 
 	/**
 	 * Passive connection
-	 * @var type
+	 * @var boolean
 	 */
 	public $pasv;
 
 	/**
 	 * Create a new FTP connection...
 	 *
-	 * @param type $ftp_server
-	 * @param type $ftp_port
-	 * @param type $ftp_user
-	 * @param type $ftp_pass
+	 * @param string $ftp_server
+	 * @param int $ftp_port
+	 * @param string $ftp_user
+	 * @param string $ftp_pass
 	 */
 	public function __construct($ftp_server, $ftp_port = 21, $ftp_user = 'anonymous', $ftp_pass = 'ftpclient@simplemachines.org')
 	{
@@ -763,11 +771,10 @@ class ftp_connection
 	/**
 	 * Connects to a server
 	 *
-	 * @param type $ftp_server
-	 * @param type $ftp_port
-	 * @param type $ftp_user
-	 * @param type $ftp_pass
-	 * @return type
+	 * @param string $ftp_server
+	 * @param int $ftp_port
+	 * @param string $ftp_user
+	 * @param string $ftp_pass
 	 */
 	public function connect($ftp_server, $ftp_port = 21, $ftp_user = 'anonymous', $ftp_pass = 'ftpclient@simplemachines.org')
 	{
@@ -814,8 +821,8 @@ class ftp_connection
 	/**
 	 * Changes to a directory (chdir) via the ftp connection
 	 *
-	 * @param type $ftp_path
-	 * @return boolean
+	 * @param string $ftp_path The path to the directory we want to change to
+	 * @return boolean Whether or not the operation was successful
 	 */
 	public function chdir($ftp_path)
 	{
@@ -839,9 +846,9 @@ class ftp_connection
 	/**
 	 * Changes a files atrributes (chmod)
 	 *
-	 * @param string $ftp_file
-	 * @param type $chmod
-	 * @return boolean
+	 * @param string $ftp_file The file to CHMOD
+	 * @param int|string $chmod The value for the CHMOD operation
+	 * @return boolean Whether or not the operation was successful
 	 */
 	public function chmod($ftp_file, $chmod)
 	{
@@ -865,8 +872,8 @@ class ftp_connection
 	/**
 	 * Deletes a file
 	 *
-	 * @param type $ftp_file
-	 * @return boolean
+	 * @param string $ftp_file The file to delete
+	 * @return boolean Whether or not the operation was successful
 	 */
 	public function unlink($ftp_file)
 	{
@@ -894,8 +901,8 @@ class ftp_connection
 	/**
 	 * Reads the response to the command from the server
 	 *
-	 * @param type $desired
-	 * @return type
+	 * @param string $desired The desired response
+	 * @return boolean Whether or not we got the desired response
 	 */
 	public function check_response($desired)
 	{
@@ -912,7 +919,7 @@ class ftp_connection
 	/**
 	 * Used to create a passive connection
 	 *
-	 * @return boolean
+	 * @return boolean Whether the passive connection was created successfully
 	 */
 	public function passive()
 	{
@@ -950,8 +957,8 @@ class ftp_connection
 	/**
 	 * Creates a new file on the server
 	 *
-	 * @param type $ftp_file
-	 * @return boolean
+	 * @param string $ftp_file The file to create
+	 * @return boolean Whether or not the file was created successfully
 	 */
 	public function create_file($ftp_file)
 	{
@@ -989,9 +996,9 @@ class ftp_connection
 	/**
 	 * Generates a direcotry listing for the current directory
 	 *
-	 * @param type $ftp_path
-	 * @param type $search
-	 * @return boolean
+	 * @param string $ftp_path The path to the directory
+	 * @param type $search Whether or not to get a recursive directory listing
+	 * @return string|boolean The results of the command or false if unsuccessful
 	 */
 	public function list_dir($ftp_path = '', $search = false)
 	{
@@ -1034,8 +1041,8 @@ class ftp_connection
 	/**
 	 * Determins the current dirctory we are in
 	 *
-	 * @param type $file
-	 * @param type $listing
+	 * @param string $file The name of a file
+	 * @param string $listing A directory listing or null to generate one
 	 * @return string|boolean
 	 */
 	public function locate($file, $listing = null)
@@ -1081,8 +1088,8 @@ class ftp_connection
 	/**
 	 * Creates a new directory on the server
 	 *
-	 * @param type $ftp_dir
-	 * @return boolean
+	 * @param string $ftp_dir The name of the directory to create
+	 * @return boolean Whether or not the operation was successful
 	 */
 	public function create_dir($ftp_dir)
 	{
@@ -1104,9 +1111,9 @@ class ftp_connection
 	/**
 	 * Detects the current path
 	 *
-	 * @param type $filesystem_path
-	 * @param type $lookup_file
-	 * @return type
+	 * @param string $filesystem_path The full path from the filesystem
+	 * @param string $lookup_file The name of a file in the specified path
+	 * @return array An array of detected info - username, path from FTP root and whether or not the current path was found
 	 */
 	public function detect_path($filesystem_path, $lookup_file = null)
 	{
@@ -1156,7 +1163,7 @@ class ftp_connection
 	/**
 	 * Close the ftp connection
 	 *
-	 * @return boolean
+	 * @return boolean Always returns true
 	 */
 	public function close()
 	{

+ 13 - 13
Sources/DbExtra-mysql.php

@@ -36,8 +36,8 @@ function db_extra_init()
 
 /**
  * Backup $table to $backup_table.
- * @param string $table
- * @param string $backup_table
+ * @param string $table The name of the table to backup
+ * @param string $backup_table The name of the backup table for this table
  * @return resource -the request handle to the table creation query
  */
 function smf_db_backup_table($table, $backup_table)
@@ -169,8 +169,8 @@ function smf_db_backup_table($table, $backup_table)
 
 /**
  * This function optimizes a table.
- * @param string $table - the table to be optimized
- * @return how much it was gained
+ * @param string $table The table to be optimized
+ * @return int How much space was gained
  */
 function smf_db_optimize_table($table)
 {
@@ -217,9 +217,9 @@ function smf_db_optimize_table($table)
  * This function lists all tables in the database.
  * The listing could be filtered according to $filter.
  *
- * @param mixed $db string holding the table name, or false, default false
- * @param mixed $filter string to filter by, or false, default false
- * @return array, an array of table names. (strings)
+ * @param string|boolean $db string The database name or false to use the current DB
+ * @param string|boolean $filter String to filter by or false to list all tables
+ * @return array An array of table names
  */
 function smf_db_list_tables($db = false, $filter = false)
 {
@@ -250,9 +250,9 @@ function smf_db_list_tables($db = false, $filter = false)
  * Gets all the necessary INSERTs for the table named table_name.
  * It goes in 250 row segments.
  *
- * @param string $tableName - the table to create the inserts for.
- * @param bool $new_table
- * @return string the query to insert the data back in, or an empty string if the table was empty.
+ * @param string $tableName The table to create the inserts for.
+ * @param boolean $new_table Whether or not this is a new table (resets $start and $limit)
+ * @return string The query to insert the data back in, or an empty string if the table was empty.
  */
 function smf_db_insert_sql($tableName, $new_table = false)
 {
@@ -326,8 +326,8 @@ function smf_db_insert_sql($tableName, $new_table = false)
 /**
  * Dumps the schema (CREATE) for a table.
  * @todo why is this needed for?
- * @param string $tableName - the table
- * @return string - the CREATE statement as string
+ * @param string $tableName The name of the table
+ * @return string The "CREATE TABLE" SQL string for this table
  */
 function smf_db_table_sql($tableName)
 {
@@ -436,7 +436,7 @@ function smf_db_table_sql($tableName)
 
 /**
  *  Get the version number.
- *  @return string - the version
+ *  @return string The version
  */
 function smf_db_get_version()
 {

+ 13 - 13
Sources/DbExtra-postgresql.php

@@ -36,8 +36,8 @@ function db_extra_init()
 
 /**
  * Backup $table to $backup_table.
- * @param string $table
- * @param string $backup_table
+ * @param string $table The name of the table to backup
+ * @param string $backup_table The name of the backup table for this table
  * @return resource -the request handle to the table creation query
  */
 function smf_db_backup_table($table, $backup_table)
@@ -82,8 +82,8 @@ function smf_db_backup_table($table, $backup_table)
 
 /**
  * This function optimizes a table.
- * @param string $table - the table to be optimized
- * @return how much it was gained
+ * @param string $table The table to be optimized
+ * @return int How much space was gained
  */
 function smf_db_optimize_table($table)
 {
@@ -113,9 +113,9 @@ function smf_db_optimize_table($table)
  * This function lists all tables in the database.
  * The listing could be filtered according to $filter.
  *
- * @param mixed $db string holding the table name, or false, default false
- * @param mixed $filter string to filter by, or false, default false
- * @return array an array of table names. (strings)
+ * @param string|boolean $db string The database name or false to use the current DB
+ * @param string|boolean $filter String to filter by or false to list all tables
+ * @return array An array of table names
  */
 function smf_db_list_tables($db = false, $filter = false)
 {
@@ -145,9 +145,9 @@ function smf_db_list_tables($db = false, $filter = false)
  * Gets all the necessary INSERTs for the table named table_name.
  * It goes in 250 row segments.
  *
- * @param string $tableName - the table to create the inserts for.
- * @param bool new_table
- * @return string the query to insert the data back in, or an empty string if the table was empty.
+ * @param string $tableName The table to create the inserts for.
+ * @param boolean $new_table Whether or not this a new table (resets $start and $limit)
+ * @return string The query to insert the data back in, or an empty string if the table was empty.
  */
 function smf_db_insert_sql($tableName, $new_table = false)
 {
@@ -223,8 +223,8 @@ function smf_db_insert_sql($tableName, $new_table = false)
 /**
  * Dumps the schema (CREATE) for a table.
  * @todo why is this needed for?
- * @param string $tableName - the table
- * @return string - the CREATE statement as string
+ * @param string $tableName The name of the table
+ * @return string The "CREATE TABLE" SQL string for this table
  */
 function smf_db_table_sql($tableName)
 {
@@ -326,7 +326,7 @@ function smf_db_table_sql($tableName)
 
 /**
  *  Get the version number.
- *  @return string - the version
+ *  @return string The version
  */
 function smf_db_get_version()
 {

+ 14 - 14
Sources/DbExtra-sqlite.php

@@ -37,8 +37,8 @@ function db_extra_init()
 
 /**
  * Backup $table to $backup_table.
- * @param string $table
- * @param string $backup_table
+ * @param string $table The name of the table to backup
+ * @param string $backup_table The name of the backup table for this table
  * @return resource -the request handle to the table creation query
  */
 function smf_db_backup_table($table, $backup_table)
@@ -130,8 +130,8 @@ function smf_db_backup_table($table, $backup_table)
 
 /**
  * This function optimizes a table.
- * @param string $table - the table to be optimized
- * @return how much it was gained
+ * @param string $table The table to be optimized
+ * @return int How much space was gained
  */
 function smf_db_optimize_table($table)
 {
@@ -159,9 +159,9 @@ function smf_db_optimize_table($table)
  * This function lists all tables in the database.
  * The listing could be filtered according to $filter.
  *
- * @param mixed $db string holding the table name, or false, default false
- * @param mixed $filter string to filter by, or false, default false
- * @return array an array of table names. (strings)
+ * @param string|boolean $db string The database name or false to use the current DB
+ * @param string|boolean $filter String to filter by or false to list all tables
+ * @return array An array of table names
  */
 function smf_db_list_tables($db = false, $filter = false)
 {
@@ -192,9 +192,9 @@ function smf_db_list_tables($db = false, $filter = false)
  * Gets all the necessary INSERTs for the table named table_name.
  * It goes in 250 row segments.
  *
- * @param string $tableName - the table to create the inserts for.
- * @param bool new_table
- * @return string the query to insert the data back in, or an empty string if the table was empty.
+ * @param string $tableName The table to create the inserts for.
+ * @param boolean $new_table Whether or not this a new table
+ * @return string The query to insert the data back in, or an empty string if the table was empty.
  */
 function smf_db_insert_sql($tableName, $new_table = false)
 {
@@ -276,8 +276,8 @@ function smf_db_insert_sql($tableName, $new_table = false)
 /**
  * Dumps the schema (CREATE) for a table.
  * @todo why is this needed for?
- * @param string $tableName - the table
- * @return string - the CREATE statement as string
+ * @param string $tableName The name of the table
+ * @return string The "CREATE TABLE" SQL string for this table
  */
 function smf_db_table_sql($tableName)
 {
@@ -331,7 +331,7 @@ function smf_db_table_sql($tableName)
 
 /**
  *  Get the version number.
- *  @return string - the version
+ *  @return string The version
  */
 function smf_db_get_version()
 {
@@ -340,7 +340,7 @@ function smf_db_get_version()
 
 /**
  * Simply return the database - and die!
- * Used by DumpDatabase.php.
+ * Used by {@link DumpDatabase.php}.
  */
 function smf_db_get_backup()
 {

+ 14 - 14
Sources/DbExtra-sqlite3.php

@@ -37,8 +37,8 @@ function db_extra_init()
 
 /**
  * Backup $table to $backup_table.
- * @param string $table
- * @param string $backup_table
+ * @param string $table The name of the table to backup
+ * @param string $backup_table The name of the backup table for this table
  * @return resource -the request handle to the table creation query
  */
 function smf_db_backup_table($table, $backup_table)
@@ -130,8 +130,8 @@ function smf_db_backup_table($table, $backup_table)
 
 /**
  * This function optimizes a table.
- * @param string $table - the table to be optimized
- * @return how much it was gained
+ * @param string $table The table to be optimized
+ * @return int How much space was gained
  */
 function smf_db_optimize_table($table)
 {
@@ -159,9 +159,9 @@ function smf_db_optimize_table($table)
  * This function lists all tables in the database.
  * The listing could be filtered according to $filter.
  *
- * @param mixed $db string holding the table name, or false, default false
- * @param mixed $filter string to filter by, or false, default false
- * @return array an array of table names. (strings)
+ * @param string|boolean $db string The database name or false to use the current DB
+ * @param string|boolean $filter String to filter by or false to list all tables
+ * @return array An array of table names
  */
 function smf_db_list_tables($db = false, $filter = false)
 {
@@ -192,9 +192,9 @@ function smf_db_list_tables($db = false, $filter = false)
  * Gets all the necessary INSERTs for the table named table_name.
  * It goes in 250 row segments.
  *
- * @param string $tableName - the table to create the inserts for.
- * @param bool new_table
- * @return string the query to insert the data back in, or an empty string if the table was empty.
+ * @param string $tableName The table to create the inserts for.
+ * @param boolean $new_table Whether or not this a new table
+ * @return string The query to insert the data back in, or an empty string if the table was empty.
  */
 function smf_db_insert_sql($tableName, $new_table = false)
 {
@@ -276,8 +276,8 @@ function smf_db_insert_sql($tableName, $new_table = false)
 /**
  * Dumps the schema (CREATE) for a table.
  * @todo why is this needed for?
- * @param string $tableName - the table
- * @return string - the CREATE statement as string
+ * @param string $tableName The name of the table
+ * @return string The "CREATE TABLE" SQL string for this table
  */
 function smf_db_table_sql($tableName)
 {
@@ -331,7 +331,7 @@ function smf_db_table_sql($tableName)
 
 /**
  *  Get the version number.
- *  @return string - the version
+ *  @return string The version
  */
 function smf_db_get_version()
 {
@@ -341,7 +341,7 @@ function smf_db_get_version()
 
 /**
  * Simply return the database - and die!
- * Used by DumpDatabase.php.
+ * Used by {@link DumpDatabase.php}.
  */
 function smf_db_get_backup()
 {

+ 55 - 47
Sources/DbPackages-mysql.php

@@ -83,12 +83,13 @@ function db_packages_init()
  *  	- 'overwrite' will drop any existing table of the same name.
  *  	- 'error' will return false if the table already exists.
  *
- * @param string $table_name
- * @param array $columns in the format specified.
- * @param array $indexes default array(), in the format specified.
- * @param array $parameters default array()
- * @param string $if_exists default 'ignore'
- * @param string $error default 'fatal'
+ * @param string $table_name The name of the table to create
+ * @param array $columns An array of column info in the specified format
+ * @param array $indexes An array of index info in the specified format
+ * @param array $parameters Currently not used
+ * @param string $if_exists What to do if the table exists.
+ * @param string $error
+ * @return boolean Whether or not the operation was successful
  */
 function smf_db_create_table($table_name, $columns, $indexes = array(), $parameters = array(), $if_exists = 'ignore', $error = 'fatal')
 {
@@ -159,9 +160,10 @@ function smf_db_create_table($table_name, $columns, $indexes = array(), $paramet
 /**
  * Drop a table.
  *
- * @param string $table_name
- * @param array $parameters default array()
- * @param string $error default 'fatal'
+ * @param string $table_name The name of the table to drop
+ * @param array $parameters Not used at the moment
+ * @param string $error
+ * @return boolean Whether or not the operation was successful
  */
 function smf_db_drop_table($table_name, $parameters = array(), $error = 'fatal')
 {
@@ -199,11 +201,12 @@ function smf_db_drop_table($table_name, $parameters = array(), $error = 'fatal')
 /**
  * This function adds a column.
  *
- * @param string $table_name the name of the table
- * @param array $column_info with column information
- * @param array $parameters default array()
- * @param string $if_exists default 'update'
- * @param string $error default 'fatal'
+ * @param string $table_name The name of the table to add the column to
+ * @param array $column_info An array of column info ({@see smf_db_create_table})
+ * @param array $parameters Not used?
+ * @param string $if_exists What to do if the column exists. If 'update', column is updated.
+ * @param string $error
+ * @return boolean Whether or not the operation was successful
  */
 function smf_db_add_column($table_name, $column_info, $parameters = array(), $if_exists = 'update', $error = 'fatal')
 {
@@ -252,10 +255,11 @@ function smf_db_add_column($table_name, $column_info, $parameters = array(), $if
 /**
  * Removes a column.
  *
- * @param string $table_name
- * @param string $column_name
- * @param array $parameters default array()
- * @param string $error default 'fatal'
+ * @param string $table_name The name of the table to drop the column from
+ * @param string $column_name The name of the column to drop
+ * @param array $parameters Not used?
+ * @param string $error
+ * @return boolean Whether or not the operation was successful
  */
 function smf_db_remove_column($table_name, $column_name, $parameters = array(), $error = 'fatal')
 {
@@ -286,11 +290,11 @@ function smf_db_remove_column($table_name, $column_name, $parameters = array(),
 /**
  * Change a column.
  *
- * @param string $table_name
- * @param $old_column
- * @param $column_info
- * @param array $parameters default array()
- * @param string $error default 'fatal'
+ * @param string $table_name The name of the table this column is in
+ * @param string $old_column The name of the column we want to change
+ * @param array $column_info An array of info about the "new" column definition (see {@link smf_db_create_table()})
+ * @param array $parameters Not used?
+ * @param string $error
  */
 function smf_db_change_column($table_name, $old_column, $column_info, $parameters = array(), $error = 'fatal')
 {
@@ -347,11 +351,12 @@ function smf_db_change_column($table_name, $old_column, $column_info, $parameter
 /**
  * Add an index.
  *
- * @param string $table_name
- * @param array $index_info
- * @param array $parameters default array()
- * @param string $if_exists default 'update'
- * @param string $error default 'fatal'
+ * @param string $table_name The name of the table to add the index to
+ * @param array $index_info An array of index info (see {@link smf_db_create_table()})
+ * @param array $parameters Not used?
+ * @param string $if_exists What to do if the index exists. If 'update', the definition will be updated.
+ * @param string $error
+ * @return boolean Whether or not the operation was successful
  */
 function smf_db_add_index($table_name, $index_info, $parameters = array(), $if_exists = 'update', $error = 'fatal')
 {
@@ -420,10 +425,11 @@ function smf_db_add_index($table_name, $index_info, $parameters = array(), $if_e
 /**
  * Remove an index.
  *
- * @param string $table_name
- * @param string $index_name
- * @param array$parameters default array()
- * @param string $error default 'fatal'
+ * @param string $table_name The name of the table to remove the index from
+ * @param string $index_name The name of the index to remove
+ * @param array $parameters Not used?
+ * @param string $error
+ * @return boolean Whether or not the operation was successful
  */
 function smf_db_remove_index($table_name, $index_name, $parameters = array(), $error = 'fatal')
 {
@@ -472,9 +478,10 @@ function smf_db_remove_index($table_name, $index_name, $parameters = array(), $e
 /**
  * Get the schema formatted name for a type.
  *
- * @param string $type_name
- * @param $type_size
- * @param $reverse
+ * @param string $type_name The data type (int, varchar, smallint, etc.)
+ * @param int $type_size The size (8, 255, etc.)
+ * @param boolean $reverse
+ * @return An array containing the appropriate type and size for this DB type
  */
 function smf_db_calculate_type($type_name, $type_size = null, $reverse = false)
 {
@@ -485,8 +492,9 @@ function smf_db_calculate_type($type_name, $type_size = null, $reverse = false)
 /**
  * Get table structure.
  *
- * @param string $table_name
- * @param array $parameters default array()
+ * @param string $table_name The name of the table
+ * @param array $parameters Not used?
+ * @return An array of table structure - the name, the column info from {@link smf_db_list_columns()} and the index info from {@link smf_db_list_indexes()}
  */
 function smf_db_table_structure($table_name, $parameters = array())
 {
@@ -504,10 +512,10 @@ function smf_db_table_structure($table_name, $parameters = array())
 /**
  * Return column information for a table.
  *
- * @param string $table_name
- * @param bool $detail
- * @param array $parameters default array()
- * @return mixed
+ * @param string $table_name The name of the table to get column info for
+ * @param bool $detail Whether or not to return detailed info. If true, returns the column info. If false, just returns the column names.
+ * @param array $parameters Not used?
+ * @return array An array of column names or detailed column info, depending on $detail
  */
 function smf_db_list_columns($table_name, $detail = false, $parameters = array())
 {
@@ -572,10 +580,10 @@ function smf_db_list_columns($table_name, $detail = false, $parameters = array()
 /**
  * Get index information.
  *
- * @param string $table_name
- * @param bool $detail
- * @param array $parameters
- * @return mixed
+ * @param string $table_name The name of the table to get indexes for
+ * @param bool $detail Whether or not to return detailed info.
+ * @param array $parameters Not used?
+ * @return array An array of index names or a detailed array of index info, depending on $detail
  */
 function smf_db_list_indexes($table_name, $detail = false, $parameters = array())
 {
@@ -632,8 +640,8 @@ function smf_db_list_indexes($table_name, $detail = false, $parameters = array()
 /**
  * Creates a query for a column
  *
- * @param array $column
- * @return type
+ * @param array $column An array of column info
+ * @return string The column definition
  */
 function smf_db_create_query_column($column)
 {

+ 53 - 46
Sources/DbPackages-postgresql.php

@@ -83,12 +83,12 @@ function db_packages_init()
  *  	- 'overwrite' will drop any existing table of the same name.
  *  	- 'error' will return false if the table already exists.
  *
- * @param string $table_name
- * @param array $columns in the format specified.
- * @param array $indexes default array(), in the format specified.
- * @param array $parameters default array()
- * @param string $if_exists default 'ignore'
- * @param string $error default 'fatal'
+ * @param string $table_name The name of the table to create
+ * @param array $columns An array of column info in the specified format
+ * @param array $indexes An array of index info in the specified format
+ * @param array $parameters Currently not used
+ * @param string $if_exists What to do if the table exists.
+ * @param string $error
  */
 function smf_db_create_table($table_name, $columns, $indexes = array(), $parameters = array(), $if_exists = 'ignore', $error = 'fatal')
 {
@@ -192,11 +192,12 @@ function smf_db_create_table($table_name, $columns, $indexes = array(), $paramet
 }
 
 /**
- * Drop a table.
+ * Drop a table and its associated sequences.
  *
- * @param string $table_name
- * @param array $parameters default array()
- * @param string $error default 'fatal'
+ * @param string $table_name The name of the table to drop
+ * @param array $parameters Not used at the moment
+ * @param string $error
+ * @return boolean Whether or not the operation was successful
  */
 function smf_db_drop_table($table_name, $parameters = array(), $error = 'fatal')
 {
@@ -251,11 +252,12 @@ function smf_db_drop_table($table_name, $parameters = array(), $error = 'fatal')
 /**
  * This function adds a column.
  *
- * @param string $table_name the name of the table
- * @param array $column_info with column information
- * @param array $parameters default array()
- * @param string $if_exists default 'update'
- * @param string $error default 'fatal'
+ * @param string $table_name The name of the table to add the column to
+ * @param array $column_info An array of column info (see {@link smf_db_create_table()})
+ * @param array $parameters Not used?
+ * @param string $if_exists What to do if the column exists. If 'update', column is updated.
+ * @param string $error
+ * @return boolean Whether or not the operation was successful
  */
 function smf_db_add_column($table_name, $column_info, $parameters = array(), $if_exists = 'update', $error = 'fatal')
 {
@@ -306,10 +308,11 @@ function smf_db_add_column($table_name, $column_info, $parameters = array(), $if
 /**
  * Removes a column.
  *
- * @param string $table_name
- * @param string $column_name
- * @param array $parameters default array()
- * @param string $error default 'fatal'
+ * @param string $table_name The name of the table to drop the column from
+ * @param string $column_name The name of the column to drop
+ * @param array $parameters Not used?
+ * @param string $error
+ * @return boolean Whether or not the operation was successful
  */
 function smf_db_remove_column($table_name, $column_name, $parameters = array(), $error = 'fatal')
 {
@@ -349,11 +352,11 @@ function smf_db_remove_column($table_name, $column_name, $parameters = array(),
 /**
  * Change a column.
  *
- * @param string $table_name
- * @param $old_column
- * @param $column_info
- * @param array $parameters default array()
- * @param string $error default 'fatal'
+ * @param string $table_name The name of the table this column is in
+ * @param $old_column The name of the column we want to change
+ * @param $column_info An array of info about the "new" column definition (see {@link smf_db_create_table()})
+ * @param array $parameters Not used?
+ * @param string $error
  */
 function smf_db_change_column($table_name, $old_column, $column_info, $parameters = array(), $error = 'fatal')
 {
@@ -506,11 +509,12 @@ function smf_db_change_column($table_name, $old_column, $column_info, $parameter
 /**
  * Add an index.
  *
- * @param string $table_name
- * @param array $index_info
- * @param array $parameters default array()
- * @param string $if_exists default 'update'
- * @param string $error default 'fatal'
+ * @param string $table_name The name of the table to add the index to
+ * @param array $index_info An array of index info (see {@link smf_db_create_table()})
+ * @param array $parameters Not used?
+ * @param string $if_exists What to do if the index exists. If 'update', the definition will be updated.
+ * @param string $error
+ * @return boolean Whether or not the operation was successful
  */
 function smf_db_add_index($table_name, $index_info, $parameters = array(), $if_exists = 'update', $error = 'fatal')
 {
@@ -578,10 +582,11 @@ function smf_db_add_index($table_name, $index_info, $parameters = array(), $if_e
 /**
  * Remove an index.
  *
- * @param string $table_name
- * @param string $index_name
- * @param array$parameters default array()
- * @param string $error default 'fatal'
+ * @param string $table_name The name of the table to remove the index from
+ * @param string $index_name The name of the index to remove
+ * @param array $parameters Not used?
+ * @param string $error
+ * @return boolean Whether or not the operation was successful
  */
 function smf_db_remove_index($table_name, $index_name, $parameters = array(), $error = 'fatal')
 {
@@ -631,9 +636,10 @@ function smf_db_remove_index($table_name, $index_name, $parameters = array(), $e
 /**
  * Get the schema formatted name for a type.
  *
- * @param string $type_name
- * @param $type_size
- * @param $reverse
+ * @param string $type_name The data type (int, varchar, smallint, etc.)
+ * @param int $type_size The size (8, 255, etc.)
+ * @param boolean $reverse If true, returns specific types for a generic type
+ * @return array An array containing the appropriate type and size for this DB type
  */
 function smf_db_calculate_type($type_name, $type_size = null, $reverse = false)
 {
@@ -678,8 +684,9 @@ function smf_db_calculate_type($type_name, $type_size = null, $reverse = false)
 /**
  * Get table structure.
  *
- * @param string $table_name
- * @param array $parameters default array()
+ * @param string $table_name The name of the table
+ * @param array $parameters Not used?
+ * @return An array of table structure - the name, the column info from {@link smf_db_list_columns()} and the index info from {@link smf_db_list_indexes()}
  */
 function smf_db_table_structure($table_name, $parameters = array())
 {
@@ -697,10 +704,10 @@ function smf_db_table_structure($table_name, $parameters = array())
 /**
  * Return column information for a table.
  *
- * @param string $table_name
- * @param bool $detail
- * @param array $parameters default array()
- * @return mixed
+ * @param string $table_name The name of the table to get column info for
+ * @param bool $detail Whether or not to return detailed info. If true, returns the column info. If false, just returns the column names.
+ * @param array $parameters Not used?
+ * @return array An array of column names or detailed column info, depending on $detail
  */
 function smf_db_list_columns($table_name, $detail = false, $parameters = array())
 {
@@ -759,10 +766,10 @@ function smf_db_list_columns($table_name, $detail = false, $parameters = array()
 /**
  * Get index information.
  *
- * @param string $table_name
- * @param bool $detail
- * @param array $parameters
- * @return mixed
+ * @param string $table_name The name of the table to get indexes for
+ * @param bool $detail Whether or not to return detailed info.
+ * @param array $parameters Not used?
+ * @return array An array of index names or a detailed array of index info, depending on $detail
  */
 function smf_db_list_indexes($table_name, $detail = false, $parameters = array())
 {

+ 55 - 48
Sources/DbPackages-sqlite.php

@@ -84,12 +84,12 @@ function db_packages_init()
  *  	- 'overwrite' will drop any existing table of the same name.
  *  	- 'error' will return false if the table already exists.
  *
- * @param string $table_name
- * @param array $columns in the format specified.
- * @param array $indexes default array(), in the format specified.
- * @param array $parameters default array()
- * @param string $if_exists default 'ignore'
- * @param string $error default 'fatal'
+ * @param string $table_name The name of the table to create
+ * @param array $columns An array of column info in the specified format
+ * @param array $indexes An array of index info in the specified format
+ * @param array $parameters Currently not used
+ * @param string $if_exists What to do if the table exists.
+ * @param string $error
  */
 function smf_db_create_table($table_name, $columns, $indexes = array(), $parameters = array(), $if_exists = 'ignore', $error = 'fatal')
 {
@@ -198,10 +198,10 @@ function smf_db_create_table($table_name, $columns, $indexes = array(), $paramet
 /**
  * Drop a table.
  *
- * @param string $table_name
- * @param array $parameters default array()
- * @param bool $error
- * @param string $error default 'fatal'
+ * @param string $table_name The name of the table to drop
+ * @param array $parameters Not used at the moment
+ * @param string $error
+ * @return boolean Whether or not the operation was successful
  */
 function smf_db_drop_table($table_name, $parameters = array(), $error = 'fatal')
 {
@@ -236,11 +236,12 @@ function smf_db_drop_table($table_name, $parameters = array(), $error = 'fatal')
 /**
  * This function adds a column.
  *
- * @param string $table_name the name of the table
- * @param array $column_info with column information
- * @param array $parameters default array()
- * @param string $if_exists default 'update'
- * @param string $error default 'fatal'
+ * @param string $table_name The name of the table to add the column to
+ * @param array $column_info An array of column info ({@see smf_db_create_table})
+ * @param array $parameters Not used?
+ * @param string $if_exists What to do if the column exists. If 'update', column is updated.
+ * @param string $error
+ * @return boolean Whether or not the operation was successful
  */
 function smf_db_add_column($table_name, $column_info, $parameters = array(), $if_exists = 'update', $error = 'fatal')
 {
@@ -274,10 +275,11 @@ function smf_db_add_column($table_name, $column_info, $parameters = array(), $if
  * Removes a column.
  *
  * We can't reliably do this on SQLite - damn!
- * @param string $table_name
- * @param string $column_name
- * @param array $parameters default array()
- * @param string $error default 'fatal'
+ * @param string $table_name The name of the table to drop the column from
+ * @param string $column_name The name of the column to drop
+ * @param array $parameters Not used?
+ * @param string $error
+ * @return boolean Whether or not the operation was successful
  */
 function smf_db_remove_column($table_name, $column_name, $parameters = array(), $error = 'fatal')
 {
@@ -294,11 +296,11 @@ function smf_db_remove_column($table_name, $column_name, $parameters = array(),
 /**
  * Change a column.
  *
- * @param string $table_name
- * @param $old_column
- * @param $column_info
- * @param array $parameters default array()
- * @param string $error default 'fatal'
+ * @param string $table_name The name of the table this column is in
+ * @param string $old_column The name of the column we want to change
+ * @param array $column_info An array of info about the "new" column definition (see {@link smf_db_create_table()})
+ * @param array $parameters Not used?
+ * @param string $error
  */
 function smf_db_change_column($table_name, $old_column, $column_info, $parameters = array(), $error = 'fatal')
 {
@@ -315,11 +317,12 @@ function smf_db_change_column($table_name, $old_column, $column_info, $parameter
 /**
  * Add an index.
  *
- * @param string $table_name
- * @param array $index_info
- * @param array $parameters default array()
- * @param string $if_exists default 'update'
- * @param string $error default 'fatal'
+ * @param string $table_name The name of the table to add the index to
+ * @param array $index_info An array of index info (see {@link smf_db_create_table()})
+ * @param array $parameters Not used?
+ * @param string $if_exists What to do if the index exists. If 'update', the definition will be updated.
+ * @param string $error
+ * @return boolean Whether or not the operation was successful
  */
 function smf_db_add_index($table_name, $index_info, $parameters = array(), $if_exists = 'update', $error = 'fatal')
 {
@@ -381,10 +384,11 @@ function smf_db_add_index($table_name, $index_info, $parameters = array(), $if_e
 /**
  * Remove an index.
  *
- * @param string $table_name
- * @param string $index_name
- * @param array$parameters default array()
- * @param string $error default 'fatal'
+ * @param string $table_name The name of the table to remove the index from
+ * @param string $index_name The name of the index to remove
+ * @param array $parameters Not used?
+ * @param string $error
+ * @return boolean Whether or not the operation was successful
  */
 function smf_db_remove_index($table_name, $index_name, $parameters = array(), $error = 'fatal')
 {
@@ -419,9 +423,10 @@ function smf_db_remove_index($table_name, $index_name, $parameters = array(), $e
 /**
  * Get the schema formatted name for a type.
  *
- * @param string $type_name
- * @param $type_size
- * @param $reverse
+ * @param string $type_name The data type (int, varchar, smallint, etc.)
+ * @param int $type_size The size (8, 255, etc.)
+ * @param boolean $reverse If true, returns specific types for a generic type
+ * @return An array containing the appropriate type and size for this DB type
  */
 function smf_db_calculate_type($type_name, $type_size = null, $reverse = false)
 {
@@ -461,8 +466,9 @@ function smf_db_calculate_type($type_name, $type_size = null, $reverse = false)
 /**
  * Get table structure.
  *
- * @param string $table_name
- * @param array $parameters default array()
+ * @param string $table_name The name of the table
+ * @param array $parameters Not used?
+ * @return An array of table structure - the name, the column info from {@link smf_db_list_columns()} and the index info from {@link smf_db_list_indexes()}
  */
 function smf_db_table_structure($table_name, $parameters = array())
 {
@@ -481,10 +487,10 @@ function smf_db_table_structure($table_name, $parameters = array())
  * Return column information for a table.
  * Harder than it should be, on sqlite!
  *
- * @param string $table_name
- * @param bool $detail
- * @param array $parameters default array()
- * @return mixed
+ * @param string $table_name The name of the table to get column info for
+ * @param bool $detail Whether or not to return detailed info. If true, returns the column info. If false, just returns the column names.
+ * @param array $parameters Not used?
+ * @return array An array of column names or detailed column info, depending on $detail
  */
 function smf_db_list_columns($table_name, $detail = false, $parameters = array())
 {
@@ -547,10 +553,10 @@ function smf_db_list_columns($table_name, $detail = false, $parameters = array()
 /**
  * Get index information.
  *
- * @param string $table_name
- * @param bool $detail
- * @param array $parameters
- * @return mixed
+ * @param string $table_name The name of the table to get indexes for
+ * @param bool $detail Whether or not to return detailed info.
+ * @param array $parameters Not used?
+ * @return array An array of index names or a detailed array of index info, depending on $detail
  */
 function smf_db_list_indexes($table_name, $detail = false, $parameters = array())
 {
@@ -609,8 +615,9 @@ function smf_db_list_indexes($table_name, $detail = false, $parameters = array()
 /**
  * Alter table on SQLite.
  *
- * @param string $table_name
- * @param array $columns
+ * @param string $table_name The name of the table
+ * @param array $columns An array of arrays of column info and what to do. Can contain 'remove', an array of names of columns to remove, and/or 'add', an array of details of columns to add (see {@link smf_db_list_columns()})
+ * @return boolean Whether or not the operations were successful
  */
 function smf_db_alter_table($table_name, $columns)
 {

+ 55 - 48
Sources/DbPackages-sqlite3.php

@@ -84,12 +84,12 @@ function db_packages_init()
  *  	- 'overwrite' will drop any existing table of the same name.
  *  	- 'error' will return false if the table already exists.
  *
- * @param string $table_name
- * @param array $columns in the format specified.
- * @param array $indexes default array(), in the format specified.
- * @param array $parameters default array()
- * @param string $if_exists default 'ignore'
- * @param string $error default 'fatal'
+ * @param string $table_name The name of the table to create
+ * @param array $columns An array of column info in the specified format
+ * @param array $indexes An array of index info in the specified format
+ * @param array $parameters Currently not used
+ * @param string $if_exists What to do if the table exists.
+ * @param string $error
  */
 function smf_db_create_table($table_name, $columns, $indexes = array(), $parameters = array(), $if_exists = 'ignore', $error = 'fatal')
 {
@@ -198,10 +198,10 @@ function smf_db_create_table($table_name, $columns, $indexes = array(), $paramet
 /**
  * Drop a table.
  *
- * @param string $table_name
- * @param array $parameters default array()
- * @param bool $error
- * @param string $error default 'fatal'
+ * @param string $table_name The name of the table to drop
+ * @param array $parameters Not used at the moment
+ * @param string $error
+ * @return boolean Whether or not the operation was successful
  */
 function smf_db_drop_table($table_name, $parameters = array(), $error = 'fatal')
 {
@@ -236,11 +236,12 @@ function smf_db_drop_table($table_name, $parameters = array(), $error = 'fatal')
 /**
  * This function adds a column.
  *
- * @param string $table_name the name of the table
- * @param array $column_info with column information
- * @param array $parameters default array()
- * @param string $if_exists default 'update'
- * @param string $error default 'fatal'
+ * @param string $table_name The name of the table to add the column to
+ * @param array $column_info An array of column info (see {@link smf_db_create_table()})
+ * @param array $parameters Not used?
+ * @param string $if_exists What to do if the column exists. If 'update', column is updated.
+ * @param string $error
+ * @return boolean Whether or not the operation was successful
  */
 function smf_db_add_column($table_name, $column_info, $parameters = array(), $if_exists = 'update', $error = 'fatal')
 {
@@ -274,10 +275,11 @@ function smf_db_add_column($table_name, $column_info, $parameters = array(), $if
  * Removes a column.
  *
  * We can't reliably do this on SQLite - damn!
- * @param string $table_name
- * @param string $column_name
- * @param array $parameters default array()
- * @param string $error default 'fatal'
+ * @param string $table_name The name of the table to drop the column from
+ * @param string $column_name The name of the column to drop
+ * @param array $parameters Not used?
+ * @param string $error
+ * @return boolean Whether or not the operation was successful
  */
 function smf_db_remove_column($table_name, $column_name, $parameters = array(), $error = 'fatal')
 {
@@ -294,11 +296,11 @@ function smf_db_remove_column($table_name, $column_name, $parameters = array(),
 /**
  * Change a column.
  *
- * @param string $table_name
- * @param $old_column
- * @param $column_info
- * @param array $parameters default array()
- * @param string $error default 'fatal'
+ * @param string $table_name The name of the table this column is in
+ * @param $old_column The name of the column we want to change
+ * @param $column_info An array of info about the "new" column definition (see {@link smf_db_create_table()})
+ * @param array $parameters Not used?
+ * @param string $error
  */
 function smf_db_change_column($table_name, $old_column, $column_info, $parameters = array(), $error = 'fatal')
 {
@@ -315,11 +317,12 @@ function smf_db_change_column($table_name, $old_column, $column_info, $parameter
 /**
  * Add an index.
  *
- * @param string $table_name
- * @param array $index_info
- * @param array $parameters default array()
- * @param string $if_exists default 'update'
- * @param string $error default 'fatal'
+ * @param string $table_name The name of the table to add the index to
+ * @param array $index_info An array of index info (see {@link smf_db_create_table()})
+ * @param array $parameters Not used?
+ * @param string $if_exists What to do if the index exists. If 'update', the definition will be updated.
+ * @param string $error
+ * @return boolean Whether or not the operation was successful
  */
 function smf_db_add_index($table_name, $index_info, $parameters = array(), $if_exists = 'update', $error = 'fatal')
 {
@@ -381,10 +384,11 @@ function smf_db_add_index($table_name, $index_info, $parameters = array(), $if_e
 /**
  * Remove an index.
  *
- * @param string $table_name
- * @param string $index_name
- * @param array$parameters default array()
- * @param string $error default 'fatal'
+ * @param string $table_name The name of the table to remove the index from
+ * @param string $index_name The name of the index to remove
+ * @param array $parameters Not used?
+ * @param string $error
+ * @return boolean Whether or not the operation was successful
  */
 function smf_db_remove_index($table_name, $index_name, $parameters = array(), $error = 'fatal')
 {
@@ -419,9 +423,10 @@ function smf_db_remove_index($table_name, $index_name, $parameters = array(), $e
 /**
  * Get the schema formatted name for a type.
  *
- * @param string $type_name
- * @param $type_size
- * @param $reverse
+ * @param string $type_name The data type (int, varchar, smallint, etc.)
+ * @param int $type_size The size (8, 255, etc.)
+ * @param boolean $reverse If true, returns specific types for a generic type
+ * @return array An array containing the appropriate type and size for this DB type
  */
 function smf_db_calculate_type($type_name, $type_size = null, $reverse = false)
 {
@@ -461,8 +466,9 @@ function smf_db_calculate_type($type_name, $type_size = null, $reverse = false)
 /**
  * Get table structure.
  *
- * @param string $table_name
- * @param array $parameters default array()
+ * @param string $table_name The name of the table
+ * @param array $parameters Not used?
+ * @return An array of table structure - the name, the column info from {@link smf_db_list_columns()} and the index info from {@link smf_db_list_indexes()}
  */
 function smf_db_table_structure($table_name, $parameters = array())
 {
@@ -481,10 +487,10 @@ function smf_db_table_structure($table_name, $parameters = array())
  * Return column information for a table.
  * Harder than it should be, on sqlite!
  *
- * @param string $table_name
- * @param bool $detail
- * @param array $parameters default array()
- * @return mixed
+ * @param string $table_name The name of the table to get column info for
+ * @param bool $detail Whether or not to return detailed info. If true, returns the column info. If false, just returns the column names.
+ * @param array $parameters Not used?
+ * @return array An array of column names or detailed column info, depending on $detail
  */
 function smf_db_list_columns($table_name, $detail = false, $parameters = array())
 {
@@ -547,10 +553,10 @@ function smf_db_list_columns($table_name, $detail = false, $parameters = array()
 /**
  * Get index information.
  *
- * @param string $table_name
- * @param bool $detail
- * @param array $parameters
- * @return mixed
+ * @param string $table_name The name of the table to get indexes for
+ * @param bool $detail Whether or not to return detailed info.
+ * @param array $parameters Not used?
+ * @return array An array of index names or a detailed array of index info, depending on $detail
  */
 function smf_db_list_indexes($table_name, $detail = false, $parameters = array())
 {
@@ -609,8 +615,9 @@ function smf_db_list_indexes($table_name, $detail = false, $parameters = array()
 /**
  * Alter table on SQLite.
  *
- * @param string $table_name
- * @param array $columns
+ * @param string $table_name The name of the table
+ * @param array $columns An array of arrays of column info and what to do. Can contain 'remove', an array of names of columns to remove, and/or 'add', an array of details of columns to add (see {@link smf_db_list_columns()})
+ * @return boolean Whether or not the operations were successful
  */
 function smf_db_alter_table($table_name, $columns)
 {

+ 3 - 2
Sources/DbSearch-mysql.php

@@ -35,7 +35,8 @@ function db_search_init()
 /**
  * This function will tell you whether this database type supports this search type.
  *
- * @param string $search_type
+ * @param string $search_type The search type.
+ * @return boolean Whether or not the specified search type is supported by this db system
  */
 function smf_db_search_support($search_type)
 {
@@ -47,7 +48,7 @@ function smf_db_search_support($search_type)
 /**
  * Highly specific function, to create the custom word index table.
  *
- * @param $size
+ * @param string $size The size of the desired index.
  */
 function smf_db_create_word_search($size)
 {

+ 8 - 6
Sources/DbSearch-postgresql.php

@@ -35,7 +35,8 @@ function db_search_init()
 /**
  * This function will tell you whether this database type supports this search type.
  *
- * @param string $search_type
+ * @param string $search_type The search type
+ * @return boolean Whether or not the specified search type is supported by this DB system.
  */
 function smf_db_search_support($search_type)
 {
@@ -47,10 +48,11 @@ function smf_db_search_support($search_type)
 /**
  * Returns the correct query for this search type.
  *
- * @param string $identifier
- * @param string $db_string
- * @param array $db_values default array()
- * @param resource $connection
+ * @param string $identifier A query identifier
+ * @param string $db_string The query text
+ * @param array $db_values An array of values to pass to $smcFunc['db_query']
+ * @param resource $connection The current DB connection resource
+ * @return resource The query result resource from $smcFunc['db_query']
  */
 function smf_db_search_query($identifier, $db_string, $db_values = array(), $connection = null)
 {
@@ -106,7 +108,7 @@ function smf_db_search_query($identifier, $db_string, $db_values = array(), $con
 /**
  * Highly specific function, to create the custom word index table.
  *
- * @param $size
+ * @param string $size The column size type (int, mediumint (8), etc.). Not used here.
  */
 function smf_db_create_word_search($size)
 {

+ 8 - 6
Sources/DbSearch-sqlite.php

@@ -35,7 +35,8 @@ function db_search_init()
 /**
  * This function will tell you whether this database type supports this search type.
  *
- * @param string $search_type
+ * @param string $search_type The search type.
+ * @return boolean Whether or not the specified search type is supported by this DB system.
  */
 function smf_db_search_support($search_type)
 {
@@ -47,10 +48,11 @@ function smf_db_search_support($search_type)
 /**
  * Returns the correct query for this search type.
  *
- * @param string $identifier
- * @param string $db_string
- * @param array $db_values default array()
- * @param resource $connection
+ * @param string $identifier A query identifier
+ * @param string $db_string The query text
+ * @param array $db_values An array of values to pass to $smcFunc['db_query']
+ * @param resource $connection The current DB connection resource
+ * @return resource The query result resource from $smcFunc['db_query']
  */
 function smf_db_search_query($identifier, $db_string, $db_values = array(), $connection = null)
 {
@@ -86,7 +88,7 @@ function smf_db_search_query($identifier, $db_string, $db_values = array(), $con
 /**
  * Highly specific function, to create the custom word index table.
  *
- * @param $size
+ * @param string $size The column size type (int, mediumint (8), etc.). Not used here.
  */
 function smf_db_create_word_search($size)
 {

+ 8 - 6
Sources/DbSearch-sqlite3.php

@@ -35,7 +35,8 @@ function db_search_init()
 /**
  * This function will tell you whether this database type supports this search type.
  *
- * @param string $search_type
+ * @param string $search_type The search type.
+ * @return boolean Whether or not the specified search type is supported by this DB system.
  */
 function smf_db_search_support($search_type)
 {
@@ -47,10 +48,11 @@ function smf_db_search_support($search_type)
 /**
  * Returns the correct query for this search type.
  *
- * @param string $identifier
- * @param string $db_string
- * @param array $db_values default array()
- * @param resource $connection
+ * @param string $identifier A query identifier
+ * @param string $db_string The query text
+ * @param array $db_values An array of values to pass to $smcFunc['db_query']
+ * @param resource $connection The current DB connection resource
+ * @return resource The query result resource from $smcFunc['db_query']
  */
 function smf_db_search_query($identifier, $db_string, $db_values = array(), $connection = null)
 {
@@ -86,7 +88,7 @@ function smf_db_search_query($identifier, $db_string, $db_values = array(), $con
 /**
  * Highly specific function, to create the custom word index table.
  *
- * @param $size
+ * @param string $size The column size type (int, mediumint (8), etc.). Not used here.
  */
 function smf_db_create_word_search($size)
 {

+ 20 - 9
Sources/Display.php

@@ -1011,7 +1011,7 @@ function Display()
 			loadMemberData($posters);
 		$messages_request = $smcFunc['db_query']('', '
 			SELECT
-				id_msg, icon, subject, poster_time, poster_ip, id_member, modified_time, modified_name, body,
+				id_msg, icon, subject, poster_time, poster_ip, id_member, modified_time, modified_name, modified_reason, body,
 				smileys_enabled, poster_name, poster_email, approved, likes,
 				id_msg_modified < {int:new_from} AS is_read
 				' . (!empty($msg_selects) ? implode(',', $msg_selects) : '') . '
@@ -1205,7 +1205,8 @@ function Display()
  * This function will start over from the beginning if reset is set to true, which is
  * useful for showing an index before or after the posts.
  *
- * @param bool $reset default false.
+ * @param bool $reset Whether or not to reset the db seek pointer
+ * @return array A large array of contextual data for the posts
  */
 function prepareDisplayContext($reset = false)
 {
@@ -1305,7 +1306,8 @@ function prepareDisplayContext($reset = false)
 		'modified' => array(
 			'time' => timeformat($message['modified_time']),
 			'timestamp' => forum_time(true, $message['modified_time']),
-			'name' => $message['modified_name']
+			'name' => $message['modified_name'],
+			'reason' => $message['modified_reason']
 		),
 		'likes' => array(
 			'count' => $message['likes'],
@@ -1328,6 +1330,10 @@ function prepareDisplayContext($reset = false)
 	$output['is_message_author'] = $message['id_member'] == $user_info['id'];
 	if (!empty($output['modified']['name']))
 		$output['modified']['last_edit_text'] = sprintf($txt['last_edit_by'], $output['modified']['time'], $output['modified']['name']);
+	
+	// Did they give a reason for editing?
+	if (!empty($output['modified']['name']) && !empty($output['modified']['reason']))
+		$output['modified']['last_edit_text'] .= '&nbsp;' . sprintf($txt['last_edit_reason'], $output['modified']['reason']);
 
 	call_integration_hook('integrate_prepare_display_context', array(&$output, &$message));
 
@@ -1545,8 +1551,8 @@ function Download()
  * It attempts to keep the "aspect ratio" of the posted image in line, even if it has to be resized by
  * the max_image_width and max_image_height settings.
  *
- * @param type $id_msg message number to load attachments for
- * @return array of attachemnts
+ * @param int $id_msg ID of the post to load attachments for
+ * @return array An array of attachemnt info
  */
 function loadAttachmentContext($id_msg)
 {
@@ -1714,9 +1720,9 @@ function loadAttachmentContext($id_msg)
 
 /**
  * A sort function for putting unapproved attachments first.
- * @param $a
- * @param $b
- * @return int, -1, 0, 1
+ * @param $a An array of info about one attachment
+ * @param $b An array of info about a second attachment
+ * @return int -1 if $a is approved but $b isn't, 0 if both are approved/unapproved, 1 if $b is approved but a isn't
  */
 function approved_attach_sort($a, $b)
 {
@@ -1849,6 +1855,11 @@ function QuickInTopicModeration()
 	redirectexit(!empty($topicGone) ? 'board=' . $board : 'topic=' . $topic . '.' . $_REQUEST['start']);
 }
 
+/**
+ * Prepares an array of "likes" info for the topic specified by $topic
+ * @uses $topic and $context['user']['id']
+ * @return Array an array of IDs of messages in the specified topic that the current user likes
+ */
 function prepareLikesContext()
 {
 	global $context, $smcFunc, $topic;
@@ -1857,7 +1868,7 @@ function prepareLikesContext()
 	$cache_key = 'likes_topic_' . $topic . '_' . $context['user']['id'];
 	$ttl = 180;
 
-	if ($temp = cache_get_data($cache_key, $ttl) === null)
+	if (($temp = cache_get_data($cache_key, $ttl)) === null)
 	{
 		$temp = array();
 		$request = $smcFunc['db_query']('', '

+ 19 - 24
Sources/Drafts.php

@@ -25,8 +25,8 @@ loadLanguage('Drafts');
  * Determines if this is a new or an existing draft
  * Returns errors in $post_errors for display in the template
  *
- * @param string $post_errors
- * @return boolean
+ * @param string $post_errors Any errors encountered trying to save this draft
+ * @return boolean Always returns true
  */
 function SaveDraft(&$post_errors)
 {
@@ -170,13 +170,9 @@ function SaveDraft(&$post_errors)
  * The core draft feature must be enabled, as well as the pm draft option
  * Determines if this is a new or and update to an existing pm draft
  *
- * @global type $context
- * @global type $user_info
- * @global type $smcFunc
- * @global type $modSettings
- * @param string $post_errors
- * @param type $recipientList
- * @return boolean
+ * @param string $post_errors A string of info about errors encountered trying to save this draft
+ * @param array $recipientList An array of data about who this PM is being sent to
+ * @return boolean false if you can't save the draft, true if we're doing this via XML more than 5 seconds after the last save, nothing otherwise
  */
 function SavePMDraft(&$post_errors, $recipientList)
 {
@@ -302,15 +298,14 @@ function SavePMDraft(&$post_errors, $recipientList)
 
 /**
  * Reads a draft in from the user_drafts table
- * Only loads the draft of a given type 0 for post, 1 for pm draft
- * validates that the draft is the users draft
+ * Validates that the draft is the user''s draft
  * Optionally loads the draft in to context or superglobal for loading in to the form
  *
- * @param type $id_draft - draft to load
- * @param type $type - type of draft
- * @param type $check - validate the user
- * @param type $load - load it for use in a form
- * @return boolean
+ * @param int $id_draft ID of the draft to load
+ * @param int $type Type of draft - 0 for post or 1 for PM
+ * @param boolean $check Validate that this draft belongs to the current user
+ * @param boolean $load Whether or not to load the data into variables for use on a form
+ * @return boolean|array False if the data couldn't be loaded, true if it's a PM draft or an array of info about the draft if it's a post draft
  */
 function ReadDraft($id_draft, $type = 0, $check = true, $load = false)
 {
@@ -392,9 +387,9 @@ function ReadDraft($id_draft, $type = 0, $check = true, $load = false)
  * Validates the drafts are from the user
  * is supplied an array of drafts will attempt to remove all of them
  *
- * @param type $id_draft
- * @param type $check
- * @return boolean
+ * @param int $id_draft The ID of the draft to delete
+ * @param boolean $check Whether or not to check that the draft belongs to the current user
+ * @return boolean False if it couldn't be deleted (doesn't return anything otherwise)
  */
 function DeleteDraft($id_draft, $check = true)
 {
@@ -423,12 +418,12 @@ function DeleteDraft($id_draft, $check = true)
  * Loads in a group of drafts for the user of a given type (0/posts, 1/pm's)
  * loads a specific draft for forum use if selected.
  * Used in the posting screens to allow draft selection
- * WIll load a draft if selected is supplied via post
+ * Will load a draft if selected is supplied via post
  *
- * @param type $member_id
- * @param type $topic
- * @param type $draft_type
- * @return boolean
+ * @param int $member_id ID of the member to show drafts for
+ * @param boolean|integer If $type is 1, this can be set to only load drafts for posts in the specific topic
+ * @param int $draft_type The type of drafts to show - 0 for post drafts, 1 for PM drafts
+ * @return boolean False if the drafts couldn't be loaded, nothing otherwise
  */
 function ShowDrafts($member_id, $topic = false, $draft_type = 0)
 {

+ 17 - 17
Sources/Errors.php

@@ -24,11 +24,11 @@ if (!defined('SMF'))
  * Example use:
  *  die(log_error($msg));
  *
- * @param string $error_message
- * @param string $error_type = 'general'
- * @param string $file = null
- * @param int $line = null
- * @return string, the error message
+ * @param string $error_message The message to log
+ * @param string $error_type The type of error
+ * @param string $file The name of the file where this error occurred
+ * @param int $line The line where the error occurred
+ * @return string The message that was logged
  */
 function log_error($error_message, $error_type = 'general', $file = null, $line = null)
 {
@@ -116,8 +116,8 @@ function log_error($error_message, $error_type = 'general', $file = null, $line
 /**
  * An irrecoverable error. This function stops execution and displays an error message.
  * It logs the error message if $log is specified.
- * @param string $error
- * @param string $log = 'general'
+ * @param string $error The error message
+ * @param string $log = 'general' What type of error to log this as (false to not log it))
  */
 function fatal_error($error, $log = 'general')
 {
@@ -140,9 +140,9 @@ function fatal_error($error, $log = 'general')
  *  - uses Errors language file and applies the $sprintf information if specified.
  *  - the information is logged if log is specified.
  *
- * @param $error
- * @param $log
- * @param $sprintf
+ * @param string $error The error message
+ * @param string $log The type of error, or false to not log it
+ * @param array $sprintf An array of data to be sprintf()'d into the specified message
  */
 function fatal_lang_error($error, $log = 'general', $sprintf = array())
 {
@@ -183,10 +183,10 @@ function fatal_lang_error($error, $log = 'general', $sprintf = array())
 /**
  * Handler for standard error messages, standard PHP error handler replacement.
  * It dies with fatal_error() if the error_level matches with error_reporting.
- * @param int $error_level
- * @param string $error_string
- * @param string $file
- * @param int $line
+ * @param int $error_level A pre-defined error-handling constant (see {@link http://www.php.net/errorfunc.constants})
+ * @param string $error_string The error message
+ * @param string $file The file where the error occurred
+ * @param int $line The line where the error occurred
  */
 function error_handler($error_level, $error_string, $file, $line)
 {
@@ -258,11 +258,11 @@ function error_handler($error_level, $error_string, $file, $line)
 }
 
 /**
- * It is called by fatal_error() and fatal_lang_error().
+ * It is called by {@link fatal_error()} and {@link fatal_lang_error()}.
  * @uses Errors template, fatal_error sub template, or Wireless template, error sub template.
  *
- * @param string $error_message
- * @param type $error_code
+ * @param string $error_message The error message
+ * @param string $error_code An error code
  */
 function setup_fatal_error_context($error_message, $error_code)
 {

+ 0 - 1
Sources/Load.php

@@ -1816,7 +1816,6 @@ function loadTheme($id_theme = 0, $initialize = true)
 		'smf_session_var' => '"' . $context['session_var'] . '"',
 		'smf_member_id' => $context['user']['id'],
 		'ajax_notification_text' => JavaScriptEscape($txt['ajax_in_progress']),
-		'ajax_notification_cancel_text' => JavaScriptEscape($txt['modify_cancel']),
 		'help_popup_heading_text' => JavaScriptEscape($txt['help_popup']),
 	);
 

+ 1 - 0
Sources/ManageBoards.php

@@ -129,6 +129,7 @@ function ManageBoardsMain()
 				'child_level' => &$boards[$boardid]['level'],
 				'move' => $move_cat && ($boardid == $context['move_board'] || isChildOf($boardid, $context['move_board'])),
 				'permission_profile' => &$boards[$boardid]['profile'],
+				'is_redirect' => !empty($boards[$boardid]['redirect']),
 			);
 		}
 	}

+ 21 - 1
Sources/Packages.php

@@ -1428,7 +1428,6 @@ function PackageBrowse()
 				'version' . $type => array(
 					'header' => array(
 						'value' => $txt['mod_version'],
-						'style' => 'width: 25%;',
 					),
 					'data' => array(
 						'function' => create_function('$package_md5', '
@@ -1443,6 +1442,24 @@ function PackageBrowse()
 						'reverse' => 'version',
 					),
 				),
+				'time_installed' . $type => array(
+					'header' => array(
+						'value' => $txt['mod_installed_time'],
+					),
+					'data' => array(
+						'function' => create_function('$package_md5', '
+							global $context, $txt;
+
+							if (isset($context[\'available_' . $type . '\'][$package_md5]))
+								return !empty($context[\'available_' . $type . '\'][$package_md5][\'time_installed\']) ? timeformat($context[\'available_' . $type . '\'][$package_md5][\'time_installed\']) : $txt[\'not_applicable\'];
+						'),
+						'class' => 'smalltext',
+					),
+					'sort' => array(
+						'default' => 'time_installed',
+						'reverse' => 'time_installed',
+					),
+				),
 				'operations' . $type => array(
 					'header' => array(
 						'value' => '',
@@ -1561,6 +1578,7 @@ function list_getPackages($start, $items_per_page, $sort, $params, $installed)
 			$installed_mods[$installed_mod['package_id']] = array(
 				'id' => $installed_mod['id'],
 				'version' => $installed_mod['version'],
+				'time_installed' => $installed_mod['time_installed'],
 			);
 
 		// Get a list of all the ids installed, so the latest packages won't include already installed ones.
@@ -1579,6 +1597,7 @@ function list_getPackages($start, $items_per_page, $sort, $params, $installed)
 				'filename' => $installed_mod['filename'],
 				'installed_id' => $installed_mod['id'],
 				'version' => $installed_mod['version'],
+				'time_installed' => $installed_mod['time_installed'],
 				'is_installed' => true,
 				'is_current' => true,
 			);
@@ -1639,6 +1658,7 @@ function list_getPackages($start, $items_per_page, $sort, $params, $installed)
 			if (!empty($packageInfo))
 			{
 				$packageInfo['installed_id'] = isset($installed_mods[$packageInfo['id']]) ? $installed_mods[$packageInfo['id']]['id'] : 0;
+				$packageInfo['time_installed'] = isset($installed_mods[$packageInfo['id']]) ? $installed_mods[$packageInfo['id']]['time_installed'] : 0;
 
 				$packageInfo['sort_id'] = $sort_id[$packageInfo['type']];
 				$packageInfo['is_installed'] = isset($installed_mods[$packageInfo['id']]);

File diff suppressed because it is too large
+ 454 - 180
Sources/PersonalMessage.php


+ 1 - 1
Sources/Poll.php

@@ -197,7 +197,7 @@ function Vote()
 		// Time is stored in case the poll is reset later, plus what they voted for.
 		$_COOKIE['guest_poll_vote'] = empty($_COOKIE['guest_poll_vote']) ? '' : $_COOKIE['guest_poll_vote'];
 		// ;id,timestamp,[vote,vote...]; etc
-		$_COOKIE['guest_poll_vote'] .= ';' . $row['id_poll'] . ',' . time() . ',' . (count($pollOptions) > 1 ? explode(',' . $pollOptions) : $pollOptions[0]);
+		$_COOKIE['guest_poll_vote'] .= ';' . $row['id_poll'] . ',' . time() . ',' . implode(',', $pollOptions);
 
 		// Increase num guest voters count by 1
 		$smcFunc['db_query']('', '

+ 25 - 5
Sources/Post.php

@@ -83,7 +83,7 @@ function Post($post_errors = array())
 		$request = $smcFunc['db_query']('', '
 			SELECT
 				t.locked, IFNULL(ln.id_topic, 0) AS notify, t.is_sticky, t.id_poll, t.id_last_msg, mf.id_member,
-				t.id_first_msg, mf.subject,
+				t.id_first_msg, mf.subject, ml.modified_reason,
 				CASE WHEN ml.poster_time > ml.modified_time THEN ml.poster_time ELSE ml.modified_time END AS last_post_time
 			FROM {db_prefix}topics AS t
 				LEFT JOIN {db_prefix}log_notify AS ln ON (ln.id_topic = t.id_topic AND ln.id_member = {int:current_member})
@@ -96,7 +96,7 @@ function Post($post_errors = array())
 				'current_topic' => $topic,
 			)
 		);
-		list ($locked, $context['notify'], $sticky, $pollID, $context['topic_last_message'], $id_member_poster, $id_first_msg, $first_subject, $lastPostTime) = $smcFunc['db_fetch_row']($request);
+		list ($locked, $context['notify'], $sticky, $pollID, $context['topic_last_message'], $id_member_poster, $id_first_msg, $first_subject, $editReason, $lastPostTime) = $smcFunc['db_fetch_row']($request);
 		$smcFunc['db_free_result']($request);
 
 		// If this topic already has a poll, they sure can't add another.
@@ -605,12 +605,14 @@ function Post($post_errors = array())
 	// Editing a message...
 	elseif (isset($_REQUEST['msg']) && !empty($topic))
 	{
+		$context['editing'] = true;
+
 		$_REQUEST['msg'] = (int) $_REQUEST['msg'];
 
 		// Get the existing message. Editing.
 		$request = $smcFunc['db_query']('', '
 			SELECT
-				m.id_member, m.modified_time, m.modified_name, m.smileys_enabled, m.body,
+				m.id_member, m.modified_time, m.modified_name, m.modified_reason, m.smileys_enabled, m.body,
 				m.poster_name, m.poster_email, m.subject, m.icon, m.approved,
 				IFNULL(a.size, -1) AS filesize, a.filename, a.id_attach,
 				a.approved AS attachment_approved, t.id_member_started AS id_member_poster,
@@ -663,7 +665,8 @@ function Post($post_errors = array())
 		if (!empty($row['modified_time']))
 		{
 			$context['last_modified'] = timeformat($row['modified_time']);
-			$context['last_modified_text'] = sprintf($txt['last_edit_by'], $context['last_modified'], $row['modified_name']);
+			$context['last_modified_reason'] = censorText($row['modified_reason']);
+			$context['last_modified_text'] = sprintf($txt['last_edit_by'], $context['last_modified'], $row['modified_name']) . empty($row['modified_reason']) ? '' : '&nbsp;' . $txt['last_edit_reason'] . ':&nbsp;' . $row['modified_reason'];
 		}
 
 		// Get the stuff ready for the form.
@@ -1615,11 +1618,16 @@ function Post2()
 	$_POST['subject'] = strtr($smcFunc['htmlspecialchars']($_POST['subject']), array("\r" => '', "\n" => '', "\t" => ''));
 	$_POST['guestname'] = $smcFunc['htmlspecialchars']($_POST['guestname']);
 	$_POST['email'] = $smcFunc['htmlspecialchars']($_POST['email']);
+	$_POST['modify_reason'] = empty($_POST['modify_reason']) ? '' : strtr($smcFunc['htmlspecialchars']($_POST['modify_reason']), array("\r" => '', "\n" => '', "\t" => ''));
 
 	// At this point, we want to make sure the subject isn't too long.
 	if ($smcFunc['strlen']($_POST['subject']) > 100)
 		$_POST['subject'] = $smcFunc['substr']($_POST['subject'], 0, 100);
 
+	// Same with the "why did you edit this" text.
+	if ($smcFunc['strlen']($_POST['modify_reason']) > 100)
+		$_POST['modify_reason'] = $smcFunc['substr']($_POST['modify_reason'], 0, 100);
+
 	// Make the poll...
 	if (isset($_REQUEST['poll']))
 	{
@@ -1813,6 +1821,7 @@ function Post2()
 		{
 			$msgOptions['modify_time'] = time();
 			$msgOptions['modify_name'] = $user_info['name'];
+			$msgOptions['modify_reason'] = $_POST['modify_reason']; 
 		}
 
 		// This will save some time...
@@ -2638,7 +2647,7 @@ function JavaScriptModify()
 		SELECT
 			t.locked, t.num_replies, t.id_member_started, t.id_first_msg,
 			m.id_msg, m.id_member, m.poster_time, m.subject, m.smileys_enabled, m.body, m.icon,
-			m.modified_time, m.modified_name, m.approved
+			m.modified_time, m.modified_name, m.modified_reason, m.approved
 		FROM {db_prefix}messages AS m
 			INNER JOIN {db_prefix}topics AS t ON (t.id_topic = {int:current_topic})
 		WHERE m.id_msg = {raw:id_msg}
@@ -2744,6 +2753,15 @@ function JavaScriptModify()
 	if (isset($_POST['sticky']) && !allowedTo('make_sticky'))
 		unset($_POST['sticky']);
 
+	if (isset($_POST['modify_reason']))
+	{
+		$_POST['modify_reason'] = strtr($smcFunc['htmlspecialchars']($_POST['modify_reason']), array("\r" => '', "\n" => '', "\t" => ''));
+
+		// Maximum number of characters.
+		if ($smcFunc['strlen']($_POST['modify_reason']) > 100)
+			$_POST['modify_reason'] = $smcFunc['substr']($_POST['modify_reason'], 0, 100);
+	}
+
 	if (empty($post_errors))
 	{
 		$msgOptions = array(
@@ -2769,6 +2787,7 @@ function JavaScriptModify()
 			{
 				$msgOptions['modify_time'] = time();
 				$msgOptions['modify_name'] = $user_info['name'];
+				$msgOptions['modify_reason'] = isset($_POST['modify_reason']) ? $_POST['modify_reason'] : '';
 			}
 		}
 		// If nothing was changed there's no need to add an entry to the moderation log.
@@ -2782,6 +2801,7 @@ function JavaScriptModify()
 		{
 			$msgOptions['modify_time'] = $row['modified_time'];
 			$msgOptions['modify_name'] = $row['modified_name'];
+			$msgOptions['modify_reason'] = $row['modified_reason'];
 		}
 
 		// Changing the first subject updates other subjects to 'Re: new_subject'.

+ 0 - 22
Sources/Profile-Modify.php

@@ -1618,28 +1618,6 @@ function forumProfile($memID)
 	);
 }
 
-/**
- * Allow the edit of *someone elses* personal message settings.
- *
- * @param int $memID id_member
- */
-function pmprefs($memID)
-{
-	global $sourcedir, $context, $txt, $scripturl;
-
-	loadThemeOptions($memID);
-	loadCustomFields($memID, 'pmprefs');
-
-	$context['sub_template'] = 'edit_options';
-	$context['page_desc'] = $txt['pm_settings_desc'];
-
-	setupProfileContext(
-		array(
-			'pm_prefs',
-		)
-	);
-}
-
 /**
  * Recursive function to retrieve server-stored avatar files
  *

+ 22 - 14
Sources/Profile.php

@@ -92,6 +92,7 @@ function ModifyProfile($post_errors = array())
 					'label' => $txt['summary'],
 					'file' => 'Profile-View.php',
 					'function' => 'summary',
+					'icon' => 'administration.png',
 					'permission' => array(
 						'own' => 'is_not_guest',
 						'any' => 'profile_view',
@@ -101,6 +102,7 @@ function ModifyProfile($post_errors = array())
 					'label' => $txt['statPanel'],
 					'file' => 'Profile-View.php',
 					'function' => 'statPanel',
+					'icon' => 'stats.png',
 					'permission' => array(
 						'own' => 'is_not_guest',
 						'any' => 'profile_view',
@@ -110,6 +112,7 @@ function ModifyProfile($post_errors = array())
 					'label' => $txt['showPosts'],
 					'file' => 'Profile-View.php',
 					'function' => 'showPosts',
+					'icon' => 'posts.png',
 					'subsections' => array(
 						'messages' => array($txt['showMessages'], array('is_not_guest', 'profile_view')),
 						'topics' => array($txt['showTopics'], array('is_not_guest', 'profile_view')),
@@ -125,6 +128,7 @@ function ModifyProfile($post_errors = array())
 					'label' => $txt['drafts_show'],
 					'file' => 'Drafts.php',
 					'function' => 'showProfileDrafts',
+					'icon' => 'drafts.png',
 					'enabled' => !empty($modSettings['drafts_post_enabled']) && $context['user']['is_owner'],
 					'permission' => array(
 						'own' => 'is_not_guest',
@@ -135,6 +139,7 @@ function ModifyProfile($post_errors = array())
 					'label' => $txt['showPermissions'],
 					'file' => 'Profile-View.php',
 					'function' => 'showPermissions',
+					'icon' => 'permissions.png',
 					'permission' => array(
 						'own' => 'manage_permissions',
 						'any' => 'manage_permissions',
@@ -144,6 +149,7 @@ function ModifyProfile($post_errors = array())
 					'label' => $txt['trackUser'],
 					'file' => 'Profile-View.php',
 					'function' => 'tracking',
+					'icon' => 'logs.png',
 					'subsections' => array(
 						'activity' => array($txt['trackActivity'], 'moderate_forum'),
 						'ip' => array($txt['trackIP'], 'moderate_forum'),
@@ -160,6 +166,7 @@ function ModifyProfile($post_errors = array())
 					'enabled' => $modSettings['warning_settings'][0] == 1 && $cur_profile['warning'] && (!empty($modSettings['warning_show']) && ($context['user']['is_owner'] || $modSettings['warning_show'] == 2)),
 					'file' => 'Profile-View.php',
 					'function' => 'viewWarning',
+					'icon' => 'warning.png',
 					'permission' => array(
 						'own' => 'is_not_guest', // @todo this needs to be a view-own warning
 						'any' => 'issue_warning',
@@ -174,6 +181,7 @@ function ModifyProfile($post_errors = array())
 					'label' => $txt['account'],
 					'file' => 'Profile-Modify.php',
 					'function' => 'account',
+					'icon' => 'maintain.png',
 					'enabled' => $context['user']['is_admin'] || ($cur_profile['id_group'] != 1 && !in_array(1, explode(',', $cur_profile['additional_groups']))),
 					'sc' => 'post',
 					'token' => 'profile-ac%u',
@@ -187,6 +195,7 @@ function ModifyProfile($post_errors = array())
 					'label' => $txt['forumprofile'],
 					'file' => 'Profile-Modify.php',
 					'function' => 'forumProfile',
+					'icon' => 'members.png',
 					'sc' => 'post',
 					'token' => 'profile-fp%u',
 					'permission' => array(
@@ -198,6 +207,7 @@ function ModifyProfile($post_errors = array())
 					'label' => $txt['theme'],
 					'file' => 'Profile-Modify.php',
 					'function' => 'theme',
+					'icon' => 'features.png',
 					'sc' => 'post',
 					'token' => 'profile-th%u',
 					'permission' => array(
@@ -209,6 +219,7 @@ function ModifyProfile($post_errors = array())
 					'label' => $txt['authentication'],
 					'file' => 'Profile-Modify.php',
 					'function' => 'authentication',
+					'icon' => 'openid.png',
 					'enabled' => !empty($modSettings['enableOpenID']) || !empty($cur_profile['openid_uri']),
 					'sc' => 'post',
 					'token' => 'profile-au%u',
@@ -223,6 +234,7 @@ function ModifyProfile($post_errors = array())
 					'label' => $txt['notification'],
 					'file' => 'Profile-Modify.php',
 					'function' => 'notification',
+					'icon' => 'mail.png',
 					'sc' => 'post',
 					'token' => 'profile-nt%u',
 					'permission' => array(
@@ -230,23 +242,11 @@ function ModifyProfile($post_errors = array())
 						'any' => array('profile_extra_any'),
 					),
 				),
-				// Without profile_extra_own, settings are accessible from the PM section.
-				'pmprefs' => array(
-					'label' => $txt['pmprefs'],
-					'file' => 'Profile-Modify.php',
-					'function' => 'pmprefs',
-					'enabled' => allowedTo(array('profile_extra_own', 'profile_extra_any')),
-					'sc' => 'post',
-					'token' => 'profile-pm%u',
-					'permission' => array(
-						'own' => array('pm_read'),
-						'any' => array('profile_extra_any'),
-					),
-				),
 				'ignoreboards' => array(
 					'label' => $txt['ignoreboards'],
 					'file' => 'Profile-Modify.php',
 					'function' => 'ignoreboards',
+					'icon' => 'boards.png',
 					'enabled' => !empty($modSettings['allow_ignore_boards']),
 					'sc' => 'post',
 					'token' => 'profile-ib%u',
@@ -259,6 +259,7 @@ function ModifyProfile($post_errors = array())
 					'label' => $txt['editBuddyIgnoreLists'],
 					'file' => 'Profile-Modify.php',
 					'function' => 'editBuddyIgnoreLists',
+					'icon' => 'frenemy.png',
 					'enabled' => !empty($modSettings['enable_buddylist']) && $context['user']['is_owner'],
 					'sc' => 'post',
 					'token' => 'profile-bl%u',
@@ -275,6 +276,7 @@ function ModifyProfile($post_errors = array())
 					'label' => $txt['groupmembership'],
 					'file' => 'Profile-Modify.php',
 					'function' => 'groupMembership',
+					'icon' => 'membergroups.png',
 					'enabled' => !empty($modSettings['show_group_membership']) && $context['user']['is_owner'],
 					'sc' => 'request',
 					'token' => 'profile-gm%u',
@@ -292,6 +294,7 @@ function ModifyProfile($post_errors = array())
 				'sendpm' => array(
 					'label' => $txt['profileSendIm'],
 					'custom_url' => $scripturl . '?action=pm;sa=send',
+					'icon' => 'personal_message.png',
 					'permission' => array(
 						'own' => array(),
 						'any' => array('pm_send'),
@@ -302,6 +305,7 @@ function ModifyProfile($post_errors = array())
 					'enabled' => $modSettings['warning_settings'][0] == 1,
 					'file' => 'Profile-Actions.php',
 					'function' => 'issueWarning',
+					'icon' => 'warning.png',
 					'token' => 'profile-iw%u',
 					'permission' => array(
 						'own' => array(),
@@ -311,6 +315,7 @@ function ModifyProfile($post_errors = array())
 				'banuser' => array(
 					'label' => $txt['profileBanUser'],
 					'custom_url' => $scripturl . '?action=admin;area=ban;sa=add',
+					'icon' => 'ban.png',
 					'enabled' => $cur_profile['id_group'] != 1 && !in_array(1, explode(',', $cur_profile['additional_groups'])),
 					'permission' => array(
 						'own' => array(),
@@ -321,6 +326,7 @@ function ModifyProfile($post_errors = array())
 					'label' => $txt['subscriptions'],
 					'file' => 'Profile-Actions.php',
 					'function' => 'subscriptions',
+					'icon' => 'paid.png',
 					'enabled' => !empty($modSettings['paid_enabled']),
 					'permission' => array(
 						'own' => array('is_not_guest'),
@@ -331,6 +337,7 @@ function ModifyProfile($post_errors = array())
 					'label' => $txt['deleteAccount'],
 					'file' => 'Profile-Actions.php',
 					'function' => 'deleteAccount',
+					'icon' => 'members_delete.png',
 					'sc' => 'post',
 					'token' => 'profile-da%u',
 					'password' => true,
@@ -342,6 +349,7 @@ function ModifyProfile($post_errors = array())
 				'activateaccount' => array(
 					'file' => 'Profile-Actions.php',
 					'function' => 'activateAccount',
+					'icon' => 'regcenter.png',
 					'sc' => 'get',
 					'token' => 'profile-aa%u',
 					'permission' => array(
@@ -590,7 +598,7 @@ function ModifyProfile($post_errors = array())
 		{
 			authentication($memID, true);
 		}
-		elseif (in_array($current_area, array('account', 'forumprofile', 'theme', 'pmprefs')))
+		elseif (in_array($current_area, array('account', 'forumprofile', 'theme')))
 			saveProfileFields();
 		else
 		{

+ 33 - 1
Sources/Subs-BoardIndex.php

@@ -153,8 +153,27 @@ function getBoardIndex($boardIndexOptions)
 					'unapproved_posts' => $row_board['unapproved_posts'] - $row_board['unapproved_topics'],
 					'can_approve_posts' => !empty($user_info['mod_cache']['ap']) && ($user_info['mod_cache']['ap'] == array(0) || in_array($row_board['id_board'], $user_info['mod_cache']['ap'])),
 					'href' => $scripturl . '?board=' . $row_board['id_board'] . '.0',
-					'link' => '<a href="' . $scripturl . '?board=' . $row_board['id_board'] . '.0">' . $row_board['board_name'] . '</a>'
+					'link' => '<a href="' . $scripturl . '?board=' . $row_board['id_board'] . '.0">' . $row_board['board_name'] . '</a>',
+					'board_class' => 'off',
 				);
+
+				// We can do some of the figuring-out-what-icon now.
+				// For certain types of thing we also set up what the tooltip is.
+				if ($this_category[$row_board['id_board']]['is_redirect'])
+				{
+					$this_category[$row_board['id_board']]['board_class'] = 'redirect';
+					$this_category[$row_board['id_board']]['board_tooltip'] = $txt['redirect_board'];
+				}
+				elseif ($this_category[$row_board['id_board']]['new'] || $context['user']['is_guest'])
+				{
+					// If we're showing to guests, we want to give them the idea that something interesting is going on!
+					$this_category[$row_board['id_board']]['board_class'] = 'on';
+					$this_category[$row_board['id_board']]['board_tooltip'] = $txt['new_posts'];
+				}
+				else
+				{
+					$this_category[$row_board['id_board']]['board_tooltip'] = $txt['old_posts'];
+				}
 			}
 			if (!empty($row_board['id_moderator']))
 			{
@@ -215,6 +234,13 @@ function getBoardIndex($boardIndexOptions)
 			// Does this board contain new boards?
 			$this_category[$row_board['id_parent']]['children_new'] |= empty($row_board['is_read']);
 
+			// Update the icon if appropriate
+			if ($this_category[$row_board['id_parent']]['children_new'] && $this_category[$row_board['id_parent']]['board_class'] == 'off')
+			{
+				$this_category[$row_board['id_parent']]['board_class'] = 'on2';
+				$this_category[$row_board['id_parent']]['board_tooltip'] = $txt['new_posts'];
+			}
+
 			// This is easier to use in many cases for the theme....
 			$this_category[$row_board['id_parent']]['link_children'][] = &$this_category[$row_board['id_parent']]['children'][$row_board['id_board']]['link'];
 		}
@@ -343,6 +369,12 @@ function getBoardIndex($boardIndexOptions)
 	if (!empty($boardIndexOptions['set_latest_post']) && !empty($latest_post['ref']))
 		$context['latest_post'] = $latest_post['ref'];
 
+	// I can't remember why but trying to make a ternary to get this all in one line is actually a Very Bad Idea.
+	if ($boardIndexOptions['include_categories'])
+		call_integration_hook('integrate_getboardtree', array($boardIndexOptions, &$categories));
+	else
+		call_integration_hook('integrate_getboardtree', array($boardIndexOptions, &$this_category));
+
 	return $boardIndexOptions['include_categories'] ? $categories : $this_category;
 }
 

+ 7 - 4
Sources/Subs-Editor.php

@@ -2373,10 +2373,13 @@ function AutoSuggest_Search_SMFVersions()
 		'SMF 2.0 beta 1.2',
 		'SMF 2.0 beta 2',
 		'SMF 2.0 beta 3',
-		'SMF 2.0 RC 1',
-		'SMF 2.0 RC 1.2',
-		'SMF 2.0 RC 2',
-		'SMF 2.0 RC 3',
+		'SMF 2.0 beta 4',
+		'SMF 2.0 RC1',
+		'SMF 2.0 RC1.2',
+		'SMF 2.0 RC2',
+		'SMF 2.0 RC3',
+		'SMF 2.0 RC4',
+		'SMF 2.0 RC5',
 		'SMF 2.0',
 		'SMF 2.0.1',
 		'SMF 2.0.2',

+ 0 - 1
Sources/Subs-Members.php

@@ -623,7 +623,6 @@ function registerMember(&$regOptions, $return_errors = false)
 		'lngfile' => '',
 		'buddy_list' => '',
 		'pm_ignore_list' => '',
-		'message_labels' => '',
 		'website_title' => '',
 		'website_url' => '',
 		'location' => '',

+ 2 - 1
Sources/Subs-Package.php

@@ -387,7 +387,7 @@ function loadInstalledPackages()
 
 	// Load the packages from the database - note this is ordered by install time to ensure latest package uninstalled first.
 	$request = $smcFunc['db_query']('', '
-		SELECT id_install, package_id, filename, name, version
+		SELECT id_install, package_id, filename, name, version, time_installed
 		FROM {db_prefix}log_packages
 		WHERE install_state != {int:not_installed}
 		ORDER BY time_installed DESC',
@@ -411,6 +411,7 @@ function loadInstalledPackages()
 			'filename' => $row['filename'],
 			'package_id' => $row['package_id'],
 			'version' => $row['version'],
+			'time_installed' => !empty($row['time_installed']) ? $row['time_installed'] : 0,
 		);
 	}
 	$smcFunc['db_free_result']($request);

+ 1 - 0
Sources/Subs-Post.php

@@ -2141,6 +2141,7 @@ function modifyPost(&$msgOptions, &$topicOptions, &$posterOptions)
 	{
 		$messages_columns['modified_time'] = $msgOptions['modify_time'];
 		$messages_columns['modified_name'] = $msgOptions['modify_name'];
+		$messages_columns['modified_reason'] = $msgOptions['modify_reason'];
 		$messages_columns['id_msg_modified'] = $modSettings['maxMsgID'];
 	}
 	if (isset($msgOptions['smileys_enabled']))

+ 3 - 0
Sources/Subs.php

@@ -4070,7 +4070,10 @@ function setupMenuContext()
 		$context['menu_buttons'][$current_action]['active_button'] = true;
 
 	if (!empty($user_info['mod_cache']) && $user_info['mod_cache']['bq'] != '0=1' && $context['open_mod_reports'] > 0)
+	{
 		$context['menu_buttons']['moderate']['title'] .= ' <span class="amt">' . $context['open_mod_reports'] . '</span>';
+		$context['menu_buttons']['moderate']['sub_buttons']['reports']['title'] .= ' <span class="amt">' . $context['open_mod_reports'] . '</span>';
+	}
 
 	if (!empty($context['unapproved_members']))
 	{

+ 3 - 27
Themes/default/BoardIndex.template.php

@@ -142,22 +142,8 @@ function template_main()
 				echo '
 				<tr id="board_', $board['id'], '" class="windowbg2">
 					<td class="windowbg icon"', !empty($board['children']) ? ' rowspan="2"' : '', '>
-						<a href="', ($board['is_redirect'] || $context['user']['is_guest'] ? $board['href'] : $scripturl . '?action=unread;board=' . $board['id'] . '.0;children'), '">';
-
-				// If the board or children is new, show an indicator.
-				if ($board['new'] || $board['children_new'])
-					echo '
-							<img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'on', $board['new'] ? '' : '2', '.png" alt="', $txt['new_posts'], '" title="', $txt['new_posts'], '" />';
-				// Is it a redirection board?
-				elseif ($board['is_redirect'])
-					echo '
-							<img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'redirect.png" alt="*" title="*" />';
-				// No new posts at all! The agony!!
-				else
-					echo '
-							<img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'off.png" alt="', $txt['old_posts'], '" title="', $txt['old_posts'], '" />';
-
-				echo '
+						<a href="', ($board['is_redirect'] || $context['user']['is_guest'] ? $board['href'] : $scripturl . '?action=unread;board=' . $board['id'] . '.0;children'), '">
+							<span class="board_', $board['board_class'], '"', !empty($board['board_tooltip']) ? ' title="' . $board['board_tooltip'] . '"' : '', '></span>
 						</a>
 					</td>
 					<td class="info">
@@ -234,17 +220,7 @@ function template_main()
 	}
 	echo '
 		</table>
-	</div>
-		<ul id="posting_icons">';
-
-	if ($context['user']['is_logged'])
-	echo '
-			<li class="floatleft"><img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'new_some.png" alt="" /> ', $txt['new_posts'], '</li>';
-
-	echo '
-			<li class="floatleft"><img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'new_none.png" alt="" /> ', $txt['old_posts'], '</li>
-			<li class="floatleft"><img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'new_redirect.png" alt="" /> ', $txt['redirect_board'], '</li>
-		</ul>';
+	</div>';
 
 	// Show the mark all as read button?
 	if ($context['user']['is_logged'] && $settings['show_mark_read'] && !empty($context['categories']))

+ 2 - 0
Themes/default/Display.template.php

@@ -926,6 +926,8 @@ function template_main()
 							sTemplateBodyNormal: ', JavaScriptEscape('%body%'), ',
 							sTemplateSubjectNormal: ', JavaScriptEscape('<a href="' . $scripturl . '?topic=' . $context['current_topic'] . '.msg%msg_id%#msg%msg_id%" rel="nofollow">%subject%</a>'), ',
 							sTemplateTopSubject: ', JavaScriptEscape($txt['topic'] . ': %subject% &nbsp;(' . $context['num_views_text'] . ')'), ',
+							sTemplateReasonEdit: ', JavaScriptEscape('<input type="text" style="width: 90%;" name="modify_reason" value="%modify_reason%" size="80" maxlength="80" tabindex="' . $context['tabindex']++ . '" class="input_text" />)'), ',
+							sTemplateReasonNormal: ', JavaScriptEscape('%modify_text'), ',
 							sErrorBorderStyle: ', JavaScriptEscape('1px solid red'), ($context['can_reply'] && !empty($options['display_quick_reply'])) ? ',
 							sFormRemoveAccessKeys: \'postmodify\'' : '', '
 						});

+ 5 - 2
Themes/default/ManageBoards.template.php

@@ -61,13 +61,16 @@ function template_main()
 
 		$alternate = false;
 
+		$recycle_board = '<a href="' . $scripturl . '?action=admin;area=manageboards;sa=settings"> <img src="' . $settings['images_url'] . '/post/recycled.png" alt="' . $txt['recycle_board'] . '" title="' . $txt['recycle_board'] . '" /></a>';
+		$redirect_board = '<img src="' . $settings['images_url'] . '/new_redirect.png" alt="' . $txt['redirect_board_desc'] . '" title="' . $txt['redirect_board_desc'] . '" />';
+
 		// List through every board in the category, printing its name and link to modify the board.
 		foreach ($category['boards'] as $board)
 		{
 
 			echo '
-						<li', !empty($modSettings['recycle_board']) && !empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] == $board['id'] ? ' id="recycle_board"' : ' ', ' class="windowbg', $alternate ? '' : '2', '" style="padding-' . ($context['right_to_left'] ? 'right' : 'left') . ': ', 5 + 30 * $board['child_level'], 'px;">
-							<span class="floatleft"><a', $board['move'] ? ' style="color: red;"' : '', ' href="', $scripturl, '?board=', $board['id'], '">', $board['name'], '</a>', !empty($modSettings['recycle_board']) && !empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] == $board['id'] ? '<a href="' . $scripturl . '?action=admin;area=manageboards;sa=settings"> <img src="' . $settings['images_url'] . '/post/recycled.png" alt="' . $txt['recycle_board'] . '" /></a></span>' : '</span>', '
+						<li', !empty($modSettings['recycle_board']) && !empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] == $board['id'] ? ' id="recycle_board"' : ' ', ' class="windowbg', $alternate ? '' : '2', $board['is_redirect'] ? ' redirect_board' : '', '" style="padding-' . ($context['right_to_left'] ? 'right' : 'left') . ': ', 5 + 30 * $board['child_level'], 'px;">
+							<span class="floatleft"><a', $board['move'] ? ' style="color: red;"' : '', ' href="', $scripturl, '?board=', $board['id'], '">', $board['name'], '</a>', !empty($modSettings['recycle_board']) && !empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] == $board['id'] ? $recycle_board : '', $board['is_redirect'] ? $redirect_board : '', '</span>
 							<span class="floatright">', $context['can_manage_permissions'] ? '<span class="modify_boards"><a href="' . $scripturl . '?action=admin;area=permissions;sa=index;pid=' . $board['permission_profile'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '">' . $txt['mboards_permissions'] . '</a></span>' : '', '
 							<span class="modify_boards"><a href="', $scripturl, '?action=admin;area=manageboards;move=', $board['id'], '">', $txt['mboards_move'], '</a></span>
 							<span class="modify_boards"><a href="', $scripturl, '?action=admin;area=manageboards;sa=board;boardid=', $board['id'], '">', $txt['mboards_modify'], '</a></span></span><br style="clear: right;" />

+ 4 - 4
Themes/default/ManageMaintenance.template.php

@@ -18,7 +18,7 @@ function template_maintain_database()
 	// If maintenance has finished tell the user.
 	if (!empty($context['maintenance_finished']))
 		echo '
-			<div class="maintenance_finished">
+			<div class="infobox">
 				', sprintf($txt['maintain_done'], $context['maintenance_finished']), '
 			</div>';
 
@@ -113,7 +113,7 @@ function template_maintain_routine()
 	// If maintenance has finished tell the user.
 	if (!empty($context['maintenance_finished']))
 		echo '
-			<div class="maintenance_finished">
+			<div class="infobox">
 				', sprintf($txt['maintain_done'], $context['maintenance_finished']), '
 			</div>';
 
@@ -252,7 +252,7 @@ function template_maintain_members()
 	// If maintenance has finished tell the user.
 	if (!empty($context['maintenance_finished']))
 	echo '
-		<div class="maintenance_finished">
+		<div class="infobox">
 			', sprintf($txt['maintain_done'], $context['maintenance_finished']), '
 		</div>';
 
@@ -365,7 +365,7 @@ function template_maintain_topics()
 	// If maintenance has finished tell the user.
 	if (!empty($context['maintenance_finished']))
 		echo '
-			<div class="maintenance_finished">
+			<div class="infobox">
 				', sprintf($txt['maintain_done'], $context['maintenance_finished']), '
 			</div>';
 

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

@@ -20,7 +20,7 @@ function template_view_scheduled_tasks()
 	{
 		if (empty($context['scheduled_errors']))
 			echo '
-	<div id="task_completed">
+	<div class="infobox">
 		', $txt['scheduled_tasks_were_run'], '
 	</div>';
 		else

+ 2 - 16
Themes/default/MessageIndex.template.php

@@ -35,22 +35,8 @@ function template_main()
 			echo '
 				<tr id="board_', $board['id'], '" class="windowbg2">
 					<td class="windowbg icon"', !empty($board['children']) ? ' rowspan="2"' : '', '>
-						<a href="', ($board['is_redirect'] || $context['user']['is_guest'] ? $board['href'] : $scripturl . '?action=unread;board=' . $board['id'] . '.0;children'), '">';
-
-			// If the board or children is new, show an indicator.
-			if ($board['new'] || $board['children_new'])
-				echo '
-							<img src="', $settings['images_url'], '/' .$context['theme_variant_url'], 'on', $board['new'] ? '' : '2', '.png" alt="', $txt['new_posts'], '" title="', $txt['new_posts'], '" />';
-			// Is it a redirection board?
-			elseif ($board['is_redirect'])
-				echo '
-							<img src="', $settings['images_url'], '/' .$context['theme_variant_url'], 'redirect.png" alt="*" title="*" />';
-			// No new posts at all! The agony!!
-			else
-				echo '
-							<img src="', $settings['images_url'], '/' .$context['theme_variant_url'], 'off.png" alt="', $txt['old_posts'], '" title="', $txt['old_posts'], '" />';
-
-			echo '
+						<a href="', ($board['is_redirect'] || $context['user']['is_guest'] ? $board['href'] : $scripturl . '?action=unread;board=' . $board['id'] . '.0;children'), '">
+							<span class="board_', $board['board_class'], '"', !empty($board['board_tooltip']) ? ' title="' . $board['board_tooltip'] . '"' : '', '></span>
 						</a>
 					</td>
 					<td class="info">

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

@@ -1607,7 +1607,7 @@ function template_add_rule()
 	foreach ($context['labels'] as $label)
 		if ($label['id'] != -1)
 			echo '
-			labels[', ($label['id'] + 1), '] = "', addslashes($label['name']), '";';
+			labels[', ($label['id']), '] = "', addslashes($label['name']), '";';
 
 	echo '
 			function addCriteriaOption()
@@ -1642,7 +1642,7 @@ function template_add_rule()
 
 	foreach ($context['labels'] as $label)
 		if ($label['id'] != -1)
-			echo '<option value="', ($label['id'] + 1), '">', addslashes($label['name']), '<\' + \'/option>';
+			echo '<option value="', ($label['id']), '">', addslashes($label['name']), '<\' + \'/option>';
 
 	echo '<\' + \'/select><\' + \'/span><span id="actionAddHere"><\' + \'/span>\');
 			}
@@ -1829,7 +1829,7 @@ function template_add_rule()
 		foreach ($context['labels'] as $label)
 			if ($label['id'] != -1)
 				echo '
-							<option value="', ($label['id'] + 1), '" ', $action['t'] == 'lab' && $action['v'] == $label['id'] ? 'selected="selected"' : '', '>', $label['name'], '</option>';
+							<option value="', ($label['id']), '" ', $action['t'] == 'lab' && $action['v'] == $label['id'] ? 'selected="selected"' : '', '>', $label['name'], '</option>';
 
 		echo '
 						</select>

+ 12 - 0
Themes/default/Post.template.php

@@ -357,6 +357,18 @@ function template_main()
 	echo '
 					', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message');
 
+	// If we're editing and displaying edit details, show a box where they can say why
+	if (isset($context['editing']) && $settings['show_last_edit'])
+		echo '
+					<dl>
+						<dt class="clear">
+							<span id="caption_edit_reason">', $txt['reason_for_edit'], ':</span>
+						</dt>
+						<dd>
+							<input type="text" name="modify_reason"', $context['last_modified_reason'] == '' ? '' : ' value="' . $context['modified_reason'] . '"', ' tabindex="', $context['tabindex']++, '" size="80" maxlength="80" class="input_text" />
+						</dd>
+					</dl>';
+
 	// If this message has been edited in the past - display when it was.
 	if (isset($context['last_modified']))
 		echo '

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

@@ -727,7 +727,7 @@ function template_trackActivity()
 	echo '
 		<div class="generic_list_wrapper">
 			<div class="cat_bar">
-				<h3 class="catbg"><strong>', $txt['view_ips_by'], ' ', $context['member']['name'], '</strong></h3>
+				<h3 class="catbg">', $txt['view_ips_by'], ' ', $context['member']['name'], '</h3>
 			</div>';
 
 	// The last IP the user used.

+ 10 - 2
Themes/default/Xml.template.php

@@ -51,8 +51,12 @@ function template_modifydone()
 	<message id="msg_', $context['message']['id'], '">';
 	if (empty($context['message']['errors']))
 	{
+		// Build our string of info about when and why it was modified
+		$modified = empty($context['message']['modified']['time']) ? '' : sprintf($txt['last_edit_by'], $context['message']['modified']['time'], $context['message']['modified']['name']);
+		$modified .= empty($context['message']['modified']['reason']) ? '' : sprintf($txt['last_edit_reason'], $context['message']['modified']['reason']);
+
 		echo '
-		<modified><![CDATA[', empty($context['message']['modified']['time']) ? '' : cleanXml('&#171; <em>' . sprintf($txt['last_edit_by'], $context['message']['modified']['time'], $context['message']['modified']['name']) . '</em> &#187;'), ']]></modified>
+		<modified><![CDATA[', empty($modified) ? '' : cleanXml('&#171; <em>' . $modified . '</em>&#187;'), ']]></modified>
 		<subject is_first="', $context['message']['first_in_topic'] ? '1' : '0', '"><![CDATA[', cleanXml($context['message']['subject']), ']]></subject>
 		<body><![CDATA[', $context['message']['body'], ']]></body>';
 	}
@@ -73,8 +77,12 @@ function template_modifytopicdone()
 	<message id="msg_', $context['message']['id'], '">';
 	if (empty($context['message']['errors']))
 	{
+		// Build our string of info about when and why it was modified
+		$modified = empty($context['message']['modified']['time']) ? '' : sprintf($txt['last_edit_by'], $context['message']['modified']['time'], $context['message']['modified']['name']);
+		$modified .= empty($context['message']['modified']['reason']) ? '' : sprintf($txt['last_edit_reason'], $context['message']['modified']['reason']);
+
 		echo '
-		<modified><![CDATA[', empty($context['message']['modified']['time']) ? '' : cleanXml('&#171; <em>' . sprintf($txt['last_edit_by'], $context['message']['modified']['time'], $context['message']['modified']['name']) . '</em> &#187;'), ']]></modified>';
+		<modified><![CDATA[', empty($modified) ? '' : cleanXml('&#171; <em>' . $modified . '</em>&#187;'), ']]></modified>';
 		if (!empty($context['message']['subject']))
 			echo '
 		<subject><![CDATA[', cleanXml($context['message']['subject']), ']]></subject>';

+ 3 - 13
Themes/default/css/admin.css

@@ -774,6 +774,9 @@ pre.file_content {
 #manage_boards li#recycle_board {
 	background-color: #dee;
 }
+#manage_boards li.redirect_board {
+	background-color: #eed;
+}
 .move_links {
 	padding: 0 13px 0 0;
 }
@@ -876,19 +879,6 @@ dl.right dt {
 #manage_maintenance .settings {
 	margin: 16px 0 0 0;
 }
-.maintenance_finished, #task_completed {
-	background: #B7FCA7 url(../images/warning_watch.png) 8px 50% no-repeat;
-	border: 1px solid green;
-	padding: 6px 30px;
-	margin-bottom: 1em;
-}
-#manage_maintenance .maintenance_finished {
-	background: #B7FCA7 url(../images/warning_watch.png) 8px 50% no-repeat;
-	border: 1px solid green;
-	border-radius: 4px 4px 0 0;
-	padding: 6px 30px;
-	margin: 0 0 6px 0;
-}
 
 /* Styles for the question and answers
 ------------------------------------------------- */

+ 49 - 124
Themes/default/css/index.css

@@ -152,11 +152,8 @@ input:focus, textarea:focus, button:focus, select:focus, textarea.editor:focus {
 	border-bottom: 1px solid #aaa;
 	border-radius: 1px;
 	box-shadow: 1px 1px 1px rgba(0,0,0,0.1);
-	background: linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
-	background: -o-linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
-	background: -moz-linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
 	background: -webkit-linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
-	background: -ms-linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
+	background: linear-gradient(to top, #E2E9F3 1%, #FFFFFF 70%);
 }
 .button_submit:hover, .button_reset:hover, .button_link:hover {
 	color: #af6700;
@@ -164,11 +161,8 @@ input:focus, textarea:focus, button:focus, select:focus, textarea.editor:focus {
 	border-left: 1px solid #bbb;
 	border-top: 1px solid #aaa;
 	box-shadow: -1px -1px 2px rgba(0,0,0,0.07), -1px -2px 4px rgba(255,255,255,0.33) inset;
-	background: linear-gradient(bottom, #FFFFFF 1%, #E2E9F3 70%);
-	background: -o-linear-gradient(bottom, #FFFFFF 1%, #E2E9F3 70%);
-	background: -moz-linear-gradient(bottom, #FFFFFF 1%, #E2E9F3 70%);
 	background: -webkit-linear-gradient(bottom, #FFFFFF 1%, #E2E9F3 70%);
-	background: -ms-linear-gradient(bottom, #FFFFFF 1%, #E2E9F3 70%);
+	background: linear-gradient(to top, #FFFFFF 1%, #E2E9F3 70%);
 }
 a.button_link {
 	color: #000;
@@ -506,21 +500,15 @@ a img {
 	color: #444;
 	font-size: /*1.1em*/1em;
 	font-weight: bold;
-	background: linear-gradient(bottom, #FFFFFF 1%, #F1F3F5 96%);
-	background: -o-linear-gradient(bottom, #FFFFFF 1%, #F1F3F5 96%);
-	background: -moz-linear-gradient(bottom, #FFFFFF 1%, #F1F3F5 96%);
 	background: -webkit-linear-gradient(bottom, #FFFFFF 1%, #F1F3F5 96%);
-	background: -ms-linear-gradient(bottom, #FFFFFF 1%, #F1F3F5 96%);
+	background: linear-gradient(to top, #FFFFFF 1%, #F1F3F5 96%);
 }
 .catbg, .catbg2, tr.catbg td, tr.catbg2 td, tr.catbg th, tr.catbg2 th {
 	color: #fff;
 	font-size: 1.1em;
 	font-weight: bold;
-	background: linear-gradient(bottom, #FFFFFF 1%, #E2E9F3 70%);
-	background: -o-linear-gradient(bottom, #FFFFFF 1%, #E2E9F3 70%);
-	background: -moz-linear-gradient(bottom, #FFFFFF 1%, #E2E9F3 70%);
 	background: -webkit-linear-gradient(bottom, #FFFFFF 1%, #E2E9F3 70%);
-	background: -ms-linear-gradient(bottom, #FFFFFF 1%, #E2E9F3 70%);
+	background: linear-gradient(to top, #FFFFFF 1%, #E2E9F3 70%);
 }
 
 /* adjust the table versions of headers */
@@ -617,11 +605,8 @@ div.pagesection div.floatright input, div.pagesection div.floatright select {
 	padding: 2px 7px 1px 7px;
 	margin: 5px 8px 0 0;
 	color: #222;
-	background: linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
-	background: -o-linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
-	background: -moz-linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
 	background: -webkit-linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
-	background: -ms-linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
+	background: linear-gradient(to top, #E2E9F3 1%, #FFFFFF 70%);
 }
 .topbottom:hover {
 	text-decoration: none;
@@ -631,11 +616,8 @@ div.pagesection div.floatright input, div.pagesection div.floatright select {
 	border-left: 1px solid #bbb;
 	border-top: 1px solid #aaa;
 	box-shadow: -1px -1px 2px rgba(0,0,0,0.07), -1px -2px 4px rgba(255,255,255,0.33) inset;
-	background: linear-gradient(bottom, #FFFFFF 1%, #E2E9F3 70%);
-	background: -o-linear-gradient(bottom, #FFFFFF 1%, #E2E9F3 70%);
-	background: -moz-linear-gradient(bottom, #FFFFFF 1%, #E2E9F3 70%);
 	background: -webkit-linear-gradient(bottom, #FFFFFF 1%, #E2E9F3 70%);
-	background: -ms-linear-gradient(bottom, #FFFFFF 1%, #E2E9F3 70%);
+	background: linear-gradient(to top, #FFFFFF 1%, #E2E9F3 70%);
 }
 
 /* Sticky topics get a different background */
@@ -1176,11 +1158,8 @@ img.sort, .sort {
 	border-top: solid 1px #ccc;
 	border-radius: 2px 7px 0 4px;
 	box-shadow: 3px 3px 4px rgba(0,0,0,0.3);
-	background: linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
-	background: -o-linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
-	background: -moz-linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
 	background: -webkit-linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
-	background: -ms-linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
+	background: linear-gradient(to top, #E2E9F3 1%, #FFFFFF 70%);
 }
 /* Level 2 link background. */
 .dropmenu li li {
@@ -1238,22 +1217,16 @@ img.sort, .sort {
 	border: 1px solid #cfcfcf;
 	border-top: 1px solid #d4dee6;
 	border-bottom: 1px solid #cbdae6;
-	background: linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
-	background: -o-linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
-	background: -moz-linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
 	background: -webkit-linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
-	background: -ms-linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
+	background: linear-gradient(to top, #E2E9F3 1%, #FFFFFF 70%);
 }
 .dropmenu li li:hover>a, .dropmenu li li.sfhover a:focus, .dropmenu li li a:hover, .dropmenu li li a:focus {
 	color: #333;
 	text-decoration: none;
 	border: 1px solid #cfcfcf;
 	border-top: 1px solid #d4dee6;
-	background: linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
-	background: -o-linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
-	background: -moz-linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
 	background: -webkit-linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
-	background: -ms-linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
+	background: linear-gradient(to top, #E2E9F3 1%, #FFFFFF 70%);
 }
 /* Reposition Level 2 submenu as visible on hover. */
 .dropmenu li:hover ul, .dropmenu li.sfhover ul {
@@ -1318,11 +1291,8 @@ img.sort, .sort {
 	overflow: visible;
 	color: #444;
 	font-size: 0.8em;
-	background: linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
-	background: -o-linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
-	background: -moz-linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
 	background: -webkit-linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
-	background: -ms-linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
+	background: linear-gradient(to top, #E2E9F3 1%, #FFFFFF 70%);
 }
 /* Keep a consistent size when wrapped in pagesection. */
 .pagesection .buttonlist ul li a {
@@ -1335,11 +1305,8 @@ img.sort, .sort {
 	border-left: 1px solid #bbb;
 	border-top: 1px solid #aaa;
 	box-shadow: -1px -1px 2px rgba(0,0,0,0.07), -1px -2px 4px rgba(255,255,255,0.33) inset;
-	background: linear-gradient(bottom, #FFFFFF 1%, #E2E9F3 70%);
-	background: -o-linear-gradient(bottom, #FFFFFF 1%, #E2E9F3 70%);
-	background: -moz-linear-gradient(bottom, #FFFFFF 1%, #E2E9F3 70%);
 	background: -webkit-linear-gradient(bottom, #FFFFFF 1%, #E2E9F3 70%);
-	background: -ms-linear-gradient(bottom, #FFFFFF 1%, #E2E9F3 70%);
+	background: linear-gradient(to top, #FFFFFF 1%, #E2E9F3 70%);
 }
 .buttonlist ul li a span {
 	display: block;
@@ -1392,11 +1359,8 @@ img.sort, .sort {
 	padding: 0 4px;
 	border-bottom: 1px solid #bbb;
 	box-shadow: 0 1px 4px rgba(0,0,0,0.16);
-	background: linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
-	background: -o-linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
-	background: -moz-linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
 	background: -webkit-linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
-	background: -ms-linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
+	background: linear-gradient(to top, #E2E9F3 1%, #FFFFFF 70%);
 }
 #top_section .frame{
 	clear: both;
@@ -1445,11 +1409,8 @@ img.sort, .sort {
 	padding: 1px 2px;
 	border-radius: 3px;
 	color: #333;
-	background: linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
-	background: -o-linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
-	background: -moz-linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
 	background: -webkit-linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
-	background: -ms-linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
+	background: linear-gradient(to top, #E2E9F3 1%, #FFFFFF 70%);
 }
 /* @todo In practice it may be better to set a different value for Firefox and Opera only, */
 /*	just to save a little bit of code. Will wait for Opera detection on body tag. */
@@ -1460,11 +1421,8 @@ img.sort, .sort {
 #search_form .button_submit:hover {
 	color: #a85400;
 	text-decoration: none;
-	background: linear-gradient(bottom, #FFFFFF 1%, #E2E9F3 70%);
-	background: -o-linear-gradient(bottom, #FFFFFF 1%, #E2E9F3 70%);
-	background: -moz-linear-gradient(bottom, #FFFFFF 1%, #E2E9F3 70%);
 	background: -webkit-linear-gradient(bottom, #FFFFFF 1%, #E2E9F3 70%);
-	background: -ms-linear-gradient(bottom, #FFFFFF 1%, #E2E9F3 70%);
+	background: linear-gradient(to top, #FFFFFF 1%, #E2E9F3 70%);
 }
 /* The logo and slogan. */
 #header {
@@ -1513,11 +1471,8 @@ img#smflogo {
 #inner_section {
 	padding: 12px 10px 2px 10px;
 	border-radius: 6px 6px 0 0;
-	background: linear-gradient(bottom, #FFFFFF 1%, #F1F3F5 98%);
-	background: -o-linear-gradient(bottom, #FFFFFF 1%, #F1F3F5 98%);
-	background: -moz-linear-gradient(bottom, #FFFFFF 1%, #F1F3F5 98%);
 	background: -webkit-linear-gradient(bottom, #FFFFFF 1%, #F1F3F5 98%);
-	background: -ms-linear-gradient(bottom, #FFFFFF 1%, #F1F3F5 98%);
+	background: linear-gradient(to top, #FFFFFF 1%, #F1F3F5 98%);
 }
 #inner_section:after {
 	content:"";
@@ -1595,11 +1550,8 @@ ul li.greeting {
 	border-radius: 2px;
 	box-shadow: 0 -2px 2px rgba(0,0,0,0.08);
 	-moz-box-sizing: border-box; box-sizing: border-box; -webkit-box-sizing: border-box;
-	background: linear-gradient(bottom, #FFFFFF 1%, #F1F3F5 96%);
-	background: -o-linear-gradient(bottom, #FFFFFF 1%, #F1F3F5 96%);
-	background: -moz-linear-gradient(bottom, #FFFFFF 1%, #F1F3F5 96%);
 	background: -webkit-linear-gradient(bottom, #FFFFFF 1%, #F1F3F5 96%);
-	background: -ms-linear-gradient(bottom, #FFFFFF 1%, #F1F3F5 96%);
+	background: linear-gradient(to top, #FFFFFF 1%, #F1F3F5 96%);
 }
 .navigate_section ul li {
 	float: left;
@@ -1714,7 +1666,7 @@ ul li.greeting {
 	margin: 0 0 0 1px;
 	padding: 8px 0 0 0;
 	width: 5%;
-	min-width: 50px;
+	min-width: 60px;
 	/*Top aligned is much nicer for the icon. */
 	vertical-align: top;
 	border-left: 1px solid #ddd;
@@ -1774,11 +1726,27 @@ ul li.greeting {
 }
 .table_list .icon, .table_list .info, .table_list .stats, .table_list .lastpost {
 	border-top: double #ddd;
-	background: linear-gradient(bottom, #FFFFFF 1%, #F1F3F5 96%);
-	background: -o-linear-gradient(bottom, #FFFFFF 1%, #F1F3F5 96%);
-	background: -moz-linear-gradient(bottom, #FFFFFF 1%, #F1F3F5 96%);
 	background: -webkit-linear-gradient(bottom, #FFFFFF 1%, #F1F3F5 96%);
-	background: -ms-linear-gradient(bottom, #FFFFFF 1%, #F1F3F5 96%);
+	background: linear-gradient(to top, #FFFFFF 1%, #F1F3F5 96%);
+}
+/* The board index and its icons. */
+.table_list .icon span {
+	background: url(../images/boardicons.png) no-repeat 0 0;
+	display: inline-block;
+	width: 45px;
+	height: 45px;
+}
+.table_list .icon span.board_on {
+	background-position: 0 0;
+}
+.table_list .icon span.board_on2 {
+	background-position: -45px 0;
+}
+.table_list .icon span.board_off {
+	background-position: 0 -45px;
+}
+.table_list .icon span.board_redirect {
+	background-position: -45px -45px;
 }
 /* Hiding unwanted border repeats. */
 .table_list .content tr:first-child .icon, .table_list .content tr:first-child .info,
@@ -1792,25 +1760,12 @@ ul li.greeting {
 }
 
 /* the posting icons */
-#posting_icons {
-	padding: 0 12px 6px 0;
-	margin: -6px 0 16px -8px;
-	line-height: 12px;
-	float: left;
-}
-#posting_icons li {
-	font-size: 0.9em;
-}
-#posting_icons img {
-	vertical-align: middle;
-	margin: 0 0 0 12px;
-}
 #postbuttons_upper ul li a span {
 	line-height: 19px;
 	padding: 0 0 0 6px;
 }
 .mark_read {
-	margin: -5px 0 0 0;
+	margin: -5px 0 16px 0;
 	padding: 0;
 	float: right;
 }
@@ -2187,11 +2142,8 @@ div#pollmoderation {
 }
 .dropmenu  li ul li:hover {
 	border: none;
-	background: linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
-	background: -o-linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
-	background: -moz-linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
 	background: -webkit-linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
-	background: -ms-linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
+	background: linear-gradient(to top, #E2E9F3 1%, #FFFFFF 70%);
 }
 .poster .dropmenu  li ul li.im_icons, .poster .dropmenu   ul ol li {
 	padding: 3px;
@@ -2403,11 +2355,8 @@ ul.quickbuttons li.inline_mod_check {
 	color: #222;
 	margin: 3px 19px;
 	overflow: visible;
-	background: linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
-	background: -o-linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
-	background: -moz-linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
 	background: -webkit-linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
-	background: -ms-linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
+	background: linear-gradient(to top, #E2E9F3 1%, #FFFFFF 70%);
 }
 .quickbuttons li:first-child {
 	border-radius: 4px 1px 1px 4px;
@@ -2419,11 +2368,8 @@ ul.quickbuttons li.inline_mod_check {
 	border-bottom: 1px solid #aaa;
 	border-radius: 1px;
 	box-shadow: 1px 1px 1px rgba(0,0,0,0.1);
-	background: linear-gradient(bottom, #FFFFFF 1%, #E2E9F3 70%);
-	background: -o-linear-gradient(bottom, #FFFFFF 1%, #E2E9F3 70%);
-	background: -moz-linear-gradient(bottom, #FFFFFF 1%, #E2E9F3 70%);
 	background: -webkit-linear-gradient(bottom, #FFFFFF 1%, #E2E9F3 70%);
-	background: -ms-linear-gradient(bottom, #FFFFFF 1%, #E2E9F3 70%);
+	background: linear-gradient(to top, #FFFFFF 1%, #E2E9F3 70%);
 }
 .quickbuttons li.quick_edit, .quickbuttons li.post_options {
 	padding: 0 6px 0 22px;
@@ -2470,11 +2416,8 @@ ul.quickbuttons li.inline_mod_check {
 	border-top: solid 1px #bbb;
 	border-radius: 4px 2px 4px 0;
 	box-shadow: 2px 3px 3px rgba(0,0,0,0.2);
-	background: linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
-	background: -o-linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
-	background: -moz-linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
 	background: -webkit-linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
-	background: -ms-linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
+	background: linear-gradient(to top, #E2E9F3 1%, #FFFFFF 70%);
 }
 .quickbuttons li:hover ul, .quickbuttons li.sfhover ul {
 	left: auto;
@@ -2493,11 +2436,8 @@ ul.quickbuttons li.inline_mod_check {
 	border: 1px solid #cfcfcf;
 	border-top: 1px solid #d4dee6;
 	border-bottom: 1px solid #cbdae6;
-	background: linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
-	background: -o-linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
-	background: -moz-linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
 	background: -webkit-linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
-	background: -ms-linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
+	background: linear-gradient(to top, #E2E9F3 1%, #FFFFFF 70%);
 }
 .quickbuttons ul li a, .quickbuttons ul li a:focus {
 	padding: 0 6px 0 26px;
@@ -2509,11 +2449,8 @@ ul.quickbuttons li.inline_mod_check {
 /* Note: The next declarations are for keyboard access with js disabled. */
 .quickbuttons ul li a:focus {
 	margin: 0 -9910px 0 9910px;
-	background: linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
-	background: -o-linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
-	background: -moz-linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
 	background: -webkit-linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
-	background: -ms-linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
+	background: linear-gradient(to top, #E2E9F3 1%, #FFFFFF 70%);
 }
 /* Cancel for hover and/or js access. */
 .quickbuttons ul li:hover a:focus, .quickbuttons ul li.sfhover a:focus {
@@ -3099,7 +3036,7 @@ tr.windowbg td, tr.windowbg2 td, tr.approvebg td, tr.highlight2 td {
 }
 .infobox  {
 	color: #222;
-	background: #efe;
+	background: #cfc url(../images/warning_watch.png) 8px 50% no-repeat;
 	text-align: left;
 	border-top: 1px solid green;
 	border-bottom: 1px solid green;
@@ -3989,11 +3926,8 @@ span.hidelink {
 	border-radius: 7px 7px 3px 3px;
 	max-height: none!important; /* Is this declaration necessary? None is the default anyway. */
 	overflow: visible!important;
-	background: linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
-	background: -o-linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
-	background: -moz-linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
 	background: -webkit-linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
-	background: -ms-linear-gradient(bottom, #E2E9F3 1%, #FFFFFF 70%);
+	background: linear-gradient(to top, #E2E9F3 1%, #FFFFFF 70%);
 }
 .popup_heading
 {
@@ -4017,11 +3951,8 @@ span.hidelink {
 	border-bottom: 1px solid #ccc;
 	border-radius: 6px 6px 2px 2px;
 	box-shadow: 0 -2px 3px rgba(0,0,0,0.15), 0 1px 1px rgba(255,255,255,0.2);
-	background: linear-gradient(bottom, #FFFFFF 1%, #F1F3F5 96%);
-	background: -o-linear-gradient(bottom, #FFFFFF 1%, #F1F3F5 96%);
-	background: -moz-linear-gradient(bottom, #FFFFFF 1%, #F1F3F5 96%);
 	background: -webkit-linear-gradient(bottom, #FFFFFF 1%, #F1F3F5 96%);
-	background: -ms-linear-gradient(bottom, #FFFFFF 1%, #F1F3F5 96%);
+	background: linear-gradient(to top, #FFFFFF 1%, #F1F3F5 96%);
 }
 .popup_heading .hide_popup
 {
@@ -4064,10 +3995,7 @@ span.hidelink {
 	height: 15pt;
 	background-color: #c1ffc1;
 	background-image: -webkit-linear-gradient(top, #c1ffc1, green);
-	background-image: -moz-linear-gradient(top, #c1ffc1, green);
-	background-image: -ms-linear-gradient(top, #c1ffc1, green);
-	background-image: -o-linear-gradient(top, #c1ffc1, green);
-	background-image: linear-gradient(top, #c1ffc1, green);
+	background-image: linear-gradient(to bottom, #c1ffc1, green);
 	border-radius: 3px;
 	z-index: 1;
 }
@@ -4075,10 +4003,7 @@ span.hidelink {
 	height: 15pt;
 	background-color: #98b8f4;
 	background-image: -webkit-linear-gradient(top, #98b8f4, blue);
-	background-image: -moz-linear-gradient(top, #98b8f4, blue);
-	background-image: -ms-linear-gradient(top, #98b8f4, blue);
-	background-image: -o-linear-gradient(top, #98b8f4, blue);
-	background-image: linear-gradient(top, #98b8f4, blue);
+	background-image: linear-gradient(to bottom, #98b8f4, blue);
 	border-radius: 3px;
 	z-index: 1;
 }

BIN
Themes/default/images/admin/drafts.png


BIN
Themes/default/images/admin/frenemy.png


BIN
Themes/default/images/admin/members_delete.png


BIN
Themes/default/images/admin/openid.png


BIN
Themes/default/images/admin/personal_message.png


BIN
Themes/default/images/admin/stats.png


BIN
Themes/default/images/boardicons.png


BIN
Themes/default/images/icons/stats_info_hd.png


BIN
Themes/default/images/new_none.png


BIN
Themes/default/images/new_some.png


BIN
Themes/default/images/off.png


BIN
Themes/default/images/on.png


BIN
Themes/default/images/on2.png


BIN
Themes/default/images/redirect.png


+ 0 - 1
Themes/default/languages/Errors.english.php

@@ -232,7 +232,6 @@ $txt['too_many_groups'] = 'Sorry, you selected too many groups, please remove so
 $txt['post_upload_error'] = 'The post data is missing. This error is can be caused by trying to submit a file larger than allowed by the server.  Please contact your administrator if this problem continues.';
 $txt['quoted_post_deleted'] = 'The post you are trying to quote either does not exist, was deleted, or is no longer viewable by you.';
 $txt['pm_too_many_per_hour'] = 'You have exceeded the limit of %1$d personal messages per hour.';
-$txt['labels_too_many'] = 'Sorry, %1$s messages already had the maximum amount of labels allowed!';
 
 $txt['register_only_once'] = 'Sorry, but you\'re not allowed to register multiple accounts at the same time from the same computer.';
 $txt['admin_setting_coppa_require_contact'] = 'You must enter either a postal or fax contact if parent/guardian approval is required.';

+ 1 - 0
Themes/default/languages/ManageBoards.english.php

@@ -87,6 +87,7 @@ $txt['groups_manage_boards'] = 'Membergroups allowed to manage boards and catego
 $txt['mboards_settings_submit'] = 'Save';
 $txt['recycle_enable'] = 'Enable recycling of deleted topics';
 $txt['recycle_board'] = 'Board for recycled topics';
+$txt['redirect_board_desc'] = 'A board that redirects users if they visit it';
 $txt['recycle_board_unselected_notice'] = 'You have enabled the recycling of topics without specifying a board to place them in.  This feature will not be enabled until you specify a board to place recycled topics into.';
 $txt['countChildPosts'] = 'Count child\'s posts in parent\'s totals';
 $txt['allow_ignore_boards'] = 'Allow boards to be ignored';

+ 0 - 1
Themes/default/languages/ManageSettings.english.php

@@ -158,7 +158,6 @@ $txt['posts_require_captcha_desc'] = '(0 for no limit, moderators are exempt)';
 $txt['search_enable_captcha'] = 'Require verification on all guest searches';
 $txt['setting_guests_require_captcha'] = 'Guests must pass verification when making a post';
 $txt['setting_guests_require_captcha_desc'] = '(Automatically set if you specify a minimum post count below)';
-$txt['guests_report_require_captcha'] = 'Guests must pass verification when reporting a post'; // Deprecated
 
 $txt['configure_verification_means'] = 'Configure Verification Methods';
 $txt['setting_qa_verification_number'] = 'Number of verification questions user must answer';

+ 1 - 0
Themes/default/languages/Packages.english.php

@@ -57,6 +57,7 @@ $txt['language_extracted'] = 'The language pack has been installed, you can now
 
 $txt['mod_name'] = 'Mod Name';
 $txt['mod_version'] = 'Version';
+$txt['mod_installed_time'] = 'Installed';
 $txt['mod_author'] = 'Author';
 $txt['author_website'] = 'Author\'s Homepage';
 $txt['package_no_description'] = 'No description given';

+ 1 - 53
Themes/default/languages/Post.english.php

@@ -9,35 +9,7 @@ $txt['subject_not_filled'] = 'The subject field was not filled out. It is requir
 $txt['message_body_not_filled'] = 'The message body was not filled out. It is required.';
 // Use numeric entities in the below string.
 $txt['add_bbc'] = 'Add BBC tags';
-$txt['bold'] = 'Bold'; // deprecated
-$txt['italic'] = 'Italicized'; // deprecated
-$txt['underline'] = 'Underline'; // deprecated
-$txt['center'] = 'Centered'; // deprecated
-$txt['hyperlink'] = 'Insert Hyperlink'; // deprecated
-$txt['insert_email'] = 'Insert Email'; // deprecated
-$txt['bbc_code'] = 'Insert Code'; // deprecated
-// Escape any single quotes in here twice.. 'it\'s' -> 'it\\\'s'.
-$txt['bbc_quote'] = 'Insert Quote'; // deprecated
-$txt['list'] = 'Insert List'; // deprecated
-$txt['list_unordered'] = 'Insert unordered list'; // deprecated
-$txt['list_ordered'] = 'Insert ordered list'; // deprecated
-
-$txt['change_color'] = 'Change color'; // deprecated
-$txt['black'] = 'Black'; // deprecated
-$txt['red'] = 'Red'; // deprecated
-$txt['yellow'] = 'Yellow'; // deprecated
-$txt['pink'] = 'Pink'; // deprecated
-$txt['green'] = 'Green'; // deprecated
-$txt['orange'] = 'Orange'; // deprecated
-$txt['purple'] = 'Purple'; // deprecated
-$txt['blue'] = 'Blue'; // deprecated
-$txt['beige'] = 'Beige'; // deprecated
-$txt['brown'] = 'Brown'; // deprecated
-$txt['teal'] = 'Teal'; // deprecated
-$txt['navy'] = 'Navy'; // deprecated
-$txt['maroon'] = 'Maroon'; // deprecated
-$txt['lime_green'] = 'Lime Green'; // deprecated
-$txt['white'] = 'White'; // deprecated
+
 $txt['disable_smileys'] = 'Disable smileys';
 $txt['dont_use_smileys'] = 'Don\'t use smileys.';
 // Escape any single quotes in here twice.. 'it\'s' -> 'it\\\'s'.
@@ -50,33 +22,9 @@ $txt['question_mark'] = 'Question mark';
 $txt['icon_poll'] = 'Poll';
 $txt['lamp'] = 'Lamp';
 $txt['add_smileys'] = 'Add smileys';
-$txt['flash'] = 'Insert Flash'; // deprecated
-$txt['ftp'] = 'Insert FTP Link'; // deprecated
-$txt['image'] = 'Insert image'; // deprecated
-$txt['table'] = 'Insert table'; // deprecated
-$txt['table_td'] = 'Insert table column'; // deprecated
 $txt['topic_notify_no'] = 'There are no topics with notification.';
-$txt['marquee'] = 'Marquee'; // deprecated
-$txt['teletype'] = 'Teletype'; // deprecated
-$txt['strike'] = 'Strikethrough'; // deprecated
-$txt['glow'] = 'Glow'; // deprecated
-$txt['shadow'] = 'Shadow'; // deprecated
-$txt['preformatted'] = 'Preformatted text'; // deprecated
-$txt['left_align'] = 'Left align'; // deprecated
-$txt['right_align'] = 'Right align'; // deprecated
-$txt['superscript'] = 'Superscript'; // deprecated
-$txt['subscript'] = 'Subscript'; // deprecated
-$txt['table_tr'] = 'Insert table row'; // deprecated
 // post_too_long seems unused (duplicate in Errors: error_post_too_long
 $txt['post_too_long'] = 'Your message is too long. Please go back and shorten it, then try again.';
-$txt['horizontal_rule'] = 'Horizontal Rule'; // deprecated
-$txt['font_size'] = 'Font size'; // deprecated
-$txt['font_face'] = 'Font face'; // deprecated
-$txt['toggle_view'] = 'Toggle view'; // deprecated
-$txt['unformat_text'] = 'Remove formatting'; // deprecated
-
-$txt['rich_edit_wont_work'] = 'Your browser does not support Rich Text editing.'; // deprecated
-$txt['rich_edit_function_disabled'] = 'Your browser does not support this function.'; // deprecated
 
 // Use numeric entities in the below five strings.
 $txt['notifyUnsubscribe'] = 'Unsubscribe to this topic by clicking here';

+ 0 - 1
Themes/default/languages/Profile.english.php

@@ -178,7 +178,6 @@ $txt['groupmembership'] = 'Group Membership';
 $txt['groupMembership_info'] = 'In this section of your profile you can change which groups you belong to.';
 $txt['ignoreboards'] = 'Ignore Boards Options';
 $txt['ignoreboards_info'] = 'This page lets you ignore particular boards.  When a board is ignored, the new post indicator will not show up on the board index.  New posts will not show up using the "unread post" search link (when searching it will not look in those boards) however, ignored boards will still appear on the board index and upon entering will show which topics have new posts.  When using the "unread replies" link, new posts in an ignored board will still be shown.';
-$txt['pmprefs'] = 'Personal Messaging';
 
 $txt['profileAction'] = 'Actions';
 $txt['deleteAccount'] = 'Delete this account';

+ 2 - 0
Themes/default/languages/index.english.php

@@ -76,6 +76,7 @@ $txt['subject'] = 'Subject';
 $txt['message'] = 'Message';
 $txt['redirects'] = 'Redirects';
 $txt['quick_modify'] = 'Modify Inline';
+$txt['reason_for_edit'] = 'Reason for editing';
 
 $txt['choose_pass'] = 'Choose password';
 $txt['verify_pass'] = 'Verify password';
@@ -188,6 +189,7 @@ $txt['memberlist_searchable'] = 'Searchable list of all registered members.';
 $txt['welcome_newest_member'] = 'Please welcome %1$s, our newest member.';
 $txt['admin_center'] = 'Administration Center';
 $txt['last_edit_by'] = '<span class="lastedit">Last Edit</span>: %1$s by %2$s';
+$txt['last_edit_reason'] = '<span class="lastedit">Reason</span>: %1$s';
 $txt['notify_deactivate'] = 'Would you like to deactivate notification on this topic?';
 
 $txt['recent_posts'] = 'Recent Posts';

+ 0 - 16
Themes/default/scripts/script.js

@@ -972,22 +972,6 @@ function create_ajax_indicator_ele()
 	// Set the id so it'll load the style properly.
 	ajax_indicator_ele.id = 'ajax_in_progress';
 
-	// Add the image in and link to turn it off.
-	var cancel_link = document.createElement('a');
-	cancel_link.href = 'javascript:ajax_indicator(false)';
-	var cancel_img = document.createElement('img');
-	cancel_img.src = smf_images_url + '/icons/quick_remove.png';
-
-	if (typeof(ajax_notification_cancel_text) != 'undefined')
-	{
-		cancel_img.alt = ajax_notification_cancel_text;
-		cancel_img.title = ajax_notification_cancel_text;
-	}
-
-	// Add the cancel link and image to the indicator.
-	cancel_link.appendChild(cancel_img);
-	ajax_indicator_ele.appendChild(cancel_link);
-
 	// Set the text.  (Note:  You MUST append here and not overwrite.)
 	ajax_indicator_ele.innerHTML += ajax_notification_text;
 

+ 3 - 3
other/install.php

@@ -938,7 +938,7 @@ function DatabaseSettings()
 // Let's start with basic forum type settings.
 function ForumSettings()
 {
-	global $txt, $incontext, $databases, $smcFunc, $db_connection, $db_type;
+	global $txt, $incontext, $databases, $smcFunc, $db_connection, $db_type, $boardurl;
 
 	$incontext['sub_template'] = 'forum_settings';
 	$incontext['page_title'] = $txt['install_settings'];
@@ -1431,7 +1431,7 @@ function AdminAccount()
 					'id_group' => 'int', 'posts' => 'int', 'date_registered' => 'int', 'hide_email' => 'int',
 					'password_salt' => 'string', 'lngfile' => 'string', 'personal_text' => 'string', 'avatar' => 'string',
 					'member_ip' => 'string', 'member_ip2' => 'string', 'buddy_list' => 'string', 'pm_ignore_list' => 'string',
-					'message_labels' => 'string', 'website_title' => 'string', 'website_url' => 'string', 'location' => 'string',
+					'website_title' => 'string', 'website_url' => 'string', 'location' => 'string',
 					'aim' => 'string', 'icq' => 'string', 'skype' => 'string', 'signature' => 'string', 'usertitle' => 'string', 'secret_question' => 'string',
 					'additional_groups' => 'string', 'ignore_boards' => 'string', 'openid_uri' => 'string',
 				),
@@ -1440,7 +1440,7 @@ function AdminAccount()
 					1, 0, time(), 0,
 					$incontext['member_salt'], '', '', '',
 					$ip, $ip, '', '',
-					'', '', '', '',
+					'', '', '',
 					'', '', '', '', '', '',
 					'', '', '',
 				),

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

@@ -1236,7 +1236,6 @@ CREATE TABLE {$db_prefix}members (
   pm_ignore_list varchar(255) NOT NULL default '',
   pm_prefs mediumint(8) NOT NULL default '0',
   mod_prefs varchar(20) NOT NULL default '',
-  message_labels text NOT NULL,
   passwd varchar(64) NOT NULL default '',
   openid_uri text NOT NULL,
   email_address varchar(255) NOT NULL default '',
@@ -1365,6 +1364,7 @@ CREATE TABLE {$db_prefix}messages (
   smileys_enabled tinyint(4) NOT NULL default '1',
   modified_time int(10) unsigned NOT NULL default '0',
   modified_name varchar(255) NOT NULL default '',
+  modified_reason varchar(255) NOT NULL default '',
   body text NOT NULL,
   icon varchar(16) NOT NULL default 'xx',
   approved tinyint(3) NOT NULL default '1',
@@ -1559,6 +1559,25 @@ CREATE TABLE {$db_prefix}personal_messages (
   KEY id_pm_head (id_pm_head)
 ) ENGINE=MyISAM;
 
+#
+# Table structure for table `pm_labels`
+#
+CREATE TABLE {$db_prefix}pm_labels (
+  id_label int(10) unsigned NOT NULL auto_increment,
+  id_member mediumint(8) unsigned NOT NULL default '0',
+  name varchar(30) NOT NULL default '',
+  PRIMARY KEY (id_label)
+) ENGINE=MyISAM;
+
+#
+# Table structure for table `pm_labeled_messages`
+#
+CREATE TABLE {$db_prefix}pm_labeled_messages (
+  id_label int(10) unsigned NOT NULL default '0',
+  id_pm int(10) unsigned NOT NULL default '0',
+  PRIMARY KEY (id_label, id_pm)
+) ENGINE=MyISAM;
+
 #
 # Table structure for table `pm_recipients`
 #
@@ -1566,11 +1585,11 @@ CREATE TABLE {$db_prefix}personal_messages (
 CREATE TABLE {$db_prefix}pm_recipients (
   id_pm int(10) unsigned NOT NULL default '0',
   id_member mediumint(8) unsigned NOT NULL default '0',
-  labels varchar(60) NOT NULL default '-1',
   bcc tinyint(3) unsigned NOT NULL default '0',
   is_read tinyint(3) unsigned NOT NULL default '0',
   is_new tinyint(3) unsigned NOT NULL default '0',
   deleted tinyint(3) unsigned NOT NULL default '0',
+  in_inbox tinyint(3) unsigned NOT NULL default '1',
   PRIMARY KEY (id_pm, id_member),
   UNIQUE id_member (id_member, deleted, id_pm)
 ) ENGINE=MyISAM;

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

@@ -1633,7 +1633,6 @@ CREATE TABLE {$db_prefix}members (
   pm_ignore_list varchar(255) NOT NULL,
   pm_prefs int NOT NULL default '0',
   mod_prefs varchar(20) NOT NULL default '',
-  message_labels text NOT NULL,
   passwd varchar(64) NOT NULL default '',
   openid_uri text NOT NULL,
   email_address varchar(255) NOT NULL,
@@ -1794,6 +1793,7 @@ CREATE TABLE {$db_prefix}messages (
   smileys_enabled smallint NOT NULL default '1',
   modified_time int NOT NULL default '0',
   modified_name varchar(255) NOT NULL,
+  modified_reason varchar(255) NOT NULL,
   body text NOT NULL,
   icon varchar(16) NOT NULL default 'xx',
   approved smallint NOT NULL default '1',
@@ -2020,6 +2020,33 @@ CREATE INDEX {$db_prefix}personal_messages_id_member ON {$db_prefix}personal_mes
 CREATE INDEX {$db_prefix}personal_messages_msgtime ON {$db_prefix}personal_messages (msgtime);
 CREATE INDEX {$db_prefix}personal_messages_id_pm_head ON {$db_prefix}personal_messages (id_pm_head);
 
+#
+# Sequence for table `pm_labels`
+#
+
+CREATE SEQUENCE {$db_prefix}pm_labels_seq;
+
+#
+# Table structure for table `pm_labels`
+#
+
+CREATE TABLE {$db_prefix}pm_labels (
+  id_label int NOT NULL default nextval('{$db_prefix}pm_labels_seq'),
+  id_member int NOT NULL default '0',
+  name varchar(30) NOT NULL default '',
+  PRIMARY KEY (id_label)
+);
+
+#
+# Table structure for table `pm_labeled_messages`
+#
+
+CREATE TABLE {$db_prefix}pm_labeled_messages (
+  id_label int NOT NULL default '0',
+  id_pm int NOT NULL default '0',
+  PRIMARY KEY (id_label, id_pm)
+);
+
 #
 # Table structure for table `pm_recipients`
 #
@@ -2032,6 +2059,7 @@ CREATE TABLE {$db_prefix}pm_recipients (
   is_read smallint NOT NULL default '0',
   is_new smallint NOT NULL default '0',
   deleted smallint NOT NULL default '0',
+  in_inbox smallint NOT NULL default '1',
   PRIMARY KEY (id_pm, id_member)
 );
 

+ 22 - 2
other/install_2-1_sqlite.sql

@@ -1340,7 +1340,6 @@ CREATE TABLE {$db_prefix}members (
   pm_ignore_list varchar(255) NOT NULL,
   pm_prefs int NOT NULL default '0',
   mod_prefs varchar(20) NOT NULL default '',
-  message_labels text NOT NULL,
   passwd varchar(64) NOT NULL default '',
   openid_uri text NOT NULL,
   email_address varchar(255) NOT NULL,
@@ -1482,6 +1481,7 @@ CREATE TABLE {$db_prefix}messages (
   smileys_enabled smallint NOT NULL default '1',
   modified_time int NOT NULL default '0',
   modified_name varchar(255) NOT NULL,
+  modified_reason varchar(255) NOT NULL,
   body text NOT NULL,
   icon varchar(16) NOT NULL default 'xx',
   approved smallint NOT NULL default '1',
@@ -1691,6 +1691,27 @@ CREATE INDEX {$db_prefix}personal_messages_id_member ON {$db_prefix}personal_mes
 CREATE INDEX {$db_prefix}personal_messages_msgtime ON {$db_prefix}personal_messages (msgtime);
 CREATE INDEX {$db_prefix}personal_messages_id_pm_head ON {$db_prefix}personal_messages (id_pm_head);
 
+#
+# Table structure for table `pm_labels`
+#
+
+CREATE TABLE {$db_prefix}pm_labels (
+  id_label integer primary key,
+  id_member int NOT NULL default '0',
+  name varchar(30) NOT NULL,
+  PRIMARY KEY (id_label)
+);
+
+#
+# Table structure for table `pm_labeled_messages`
+#
+
+CREATE TABLE {$db_prefix}pm_labeled_messages (
+  id_label int NOT NULL default '0',
+  id_pm int NOT NULL default '0',
+  PRIMARY KEY (id_label, id_pm)
+);
+
 #
 # Table structure for table `pm_recipients`
 #
@@ -1698,7 +1719,6 @@ CREATE INDEX {$db_prefix}personal_messages_id_pm_head ON {$db_prefix}personal_me
 CREATE TABLE {$db_prefix}pm_recipients (
   id_pm int NOT NULL default '0',
   id_member int NOT NULL default '0',
-  labels varchar(60) NOT NULL default '-1',
   bcc smallint NOT NULL default '0',
   is_read smallint NOT NULL default '0',
   is_new smallint NOT NULL default '0',

+ 23 - 2
other/install_2-1_sqlite3.sql

@@ -1340,7 +1340,6 @@ CREATE TABLE {$db_prefix}members (
   pm_ignore_list varchar(255) NOT NULL,
   pm_prefs int NOT NULL default '0',
   mod_prefs varchar(20) NOT NULL default '',
-  message_labels text NOT NULL,
   passwd varchar(64) NOT NULL default '',
   openid_uri text NOT NULL,
   email_address varchar(255) NOT NULL,
@@ -1482,6 +1481,7 @@ CREATE TABLE {$db_prefix}messages (
   smileys_enabled smallint NOT NULL default '1',
   modified_time int NOT NULL default '0',
   modified_name varchar(255) NOT NULL,
+  modified_reason varchar(255) NOT NULL,
   body text NOT NULL,
   icon varchar(16) NOT NULL default 'xx',
   approved smallint NOT NULL default '1',
@@ -1690,6 +1690,27 @@ CREATE INDEX {$db_prefix}personal_messages_id_member ON {$db_prefix}personal_mes
 CREATE INDEX {$db_prefix}personal_messages_msgtime ON {$db_prefix}personal_messages (msgtime);
 CREATE INDEX {$db_prefix}personal_messages_id_pm_head ON {$db_prefix}personal_messages (id_pm_head);
 
+#
+# Table structure for table `pm_labels`
+#
+
+CREATE TABLE {$db_prefix}pm_labels (
+  id_label integer primary key,
+  id_member int NOT NULL default '0',
+  name varchar(30) NOT NULL,
+  PRIMARY KEY (id_label)
+);
+
+#
+# Table structure for table `pm_labeled_messages`
+#
+
+CREATE TABLE {$db_prefix}pm_labeled_messages (
+  id_label int NOT NULL default '0',
+  id_pm int NOT NULL default '0',
+  PRIMARY KEY (id_label, id_pm)
+);
+
 #
 # Table structure for table `pm_recipients`
 #
@@ -1697,11 +1718,11 @@ CREATE INDEX {$db_prefix}personal_messages_id_pm_head ON {$db_prefix}personal_me
 CREATE TABLE {$db_prefix}pm_recipients (
   id_pm int NOT NULL default '0',
   id_member int NOT NULL default '0',
-  labels varchar(60) NOT NULL default '-1',
   bcc smallint NOT NULL default '0',
   is_read smallint NOT NULL default '0',
   is_new smallint NOT NULL default '0',
   deleted smallint NOT NULL default '0',
+  in_inbox smallint NOT NULL default '1',
   PRIMARY KEY (id_pm, id_member)
 );
 

+ 3 - 0
other/upgrade.php

@@ -1391,6 +1391,9 @@ function BackupDatabase()
 
 	// Some useful stuff here.
 	db_extend();
+	
+	// Might need this as well
+	db_extend('packages');
 
 	// Get all the table names.
 	$filter = str_replace('_', '\_', preg_match('~^`(.+?)`\.(.+?)$~', $db_prefix, $match) != 0 ? $match[2] : $db_prefix) . '%';

+ 197 - 11
other/upgrade_2-1_mysql.sql

@@ -484,19 +484,18 @@ $get_questions = upgrade_query("
 	WHERE comment_type = 'ver_test'");
 
 	while ($row = $smcFunc['db_fetch_assoc']($get_questions))
-	{
-		$questions[] = "($language, $row[question], serialize(array($row[answer])))";
-	}
+		$questions[] = array($language, $row['question'], serialize(array($row['answer'])));
 
 	$smcFunc['db_free_result']($get_questions);
 
 	if (!empty($questions))
 	{
-		upgrade_query("
-			INSERT INTO {$db_prefix}qanda
-				(lngfile, question, answers)
-			VALUES
-				" . implode(',', $questions));
+		$smcFunc['db_insert']('',
+			'{db_prefix}qanda',
+			array('lngfile' => 'string', 'question' => 'string', 'answers' => 'string'),
+			$questions,
+			array('id_question')
+		);
 
 		// Delete the questions from log_comments now
 		upgrade_query("
@@ -551,8 +550,8 @@ $request = upgrade_query("
 			INSERT INTO {$db_prefix}permissions
 				(id_group, permission, add_deny)
 			VALUES
-				" . implode(',', $inserts));
-		}
+				" . implode(',', $inserts)
+		);
 	}
 ---}
 ---#
@@ -583,7 +582,194 @@ $request = upgrade_query("
 			INSERT INTO {$db_prefix}permissions
 				(id_group, permission, add_deny)
 			VALUES
-				" . implode(',', $inserts));
+				" . implode(',', $inserts)
+			);
 	}
 ---}
+---#
+
+/******************************************************************************/
+--- Upgrading PM labels...
+/******************************************************************************/
+---# Adding pm_labels table...
+CREATE TABLE IF NOT EXISTS {$db_prefix}pm_labels (
+  id_label int(10) unsigned NOT NULL auto_increment,
+  id_member mediumint(8) unsigned NOT NULL default '0',
+  name varchar(30) NOT NULL default '',
+  PRIMARY KEY (id_label)
+) ENGINE=MyISAM;
+---#
+
+---# Adding pm_labeled_messages table...
+CREATE TABLE IF NOT EXISTS {$db_prefix}pm_labeled_messages (
+  id_label int(10) unsigned NOT NULL default '0',
+  id_pm int(10) unsigned NOT NULL default '0',
+  PRIMARY KEY (id_label, id_pm)
+) ENGINE=MyISAM;
+---#
+
+---# Adding "in_inbox" column to pm_recipients
+ALTER TABLE {$db_prefix}pm_recipients
+ADD COLUMN in_inbox tinyint(3) NOT NULL default '1';
+---#
+
+---# Moving label info to new tables and updating rules...
+---{
+	// First see if we still have a message_labels column
+	$results = $smcFunc['db_list_columns']('{db_prefix}members');
+	if (in_array('message_labels', $results))
+	{
+		// They've still got it, so pull the label info
+		$get_labels = $smcFunc['db_query']('', '
+			SELECT id_member, message_labels
+			FROM {db_prefix}members
+			WHERE message_labels != {string:blank}',
+			array(
+				'blank' => '',
+			)
+		);
+
+		$inserts = array();
+		$label_info = array();
+		while ($row = $smcFunc['db_fetch_assoc']($get_labels))
+		{
+			// Stick this in an array
+			$labels = explode(',', $row['message_labels']);
+
+			// Build some inserts
+			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;
+				$inserts[] = array($row['id_member'], $label);
+			}
+		}
+
+		$smcFunc['db_free_result']($get_labels);
+
+		if (!empty($inserts))
+		{
+			$smcFunc['db_insert']('', '{db_prefix}pm_labels', array('id_member' => 'int', 'name' => 'string-30'), $inserts, array());
+			
+			// Clear this out for our next query below
+			$inserts = array();
+		}
+
+		// This is the easy part - update the inbox stuff
+		$smcFunc['db_query']('', '
+			UPDATE {db_prefix}pm_recipients
+			SET in_inbox = {int:in_inbox}
+			WHERE FIND_IN_SET({int:minusone}, labels)',
+			array(
+				'in_inbox' => 1,
+				'minusone' => -1,
+			)
+		);
+
+		// Now we go pull the new IDs for each label
+		$get_new_label_ids = $smcFunc['db_query']('', '
+			SELECT *
+			FROM {db_prefix}pm_labels',
+			array(
+			)
+		);
+
+		$label_info_2 = array();
+		while ($label_row = $smcFunc['db_fetch_assoc']($get_new_label_ids))
+		{
+			// Map the old index values to the new ID values...
+			$old_index = $label_info[$row['id_member']][$row['label_name']];
+			$label_info_2[$row['id_member']][$old_index] = $row['id_label'];
+		}
+
+		$smcFunc['db_free_result']($get_new_label_ids);
+
+		// Pull label info from pm_recipients
+		// Ignore any that are only in the inbox
+		$get_pm_labels = $smcFunc['db_query']('', '
+			SELECT id_pm, id_member, labels
+			FROM {db_prefix}pm_recipients
+			WHERE deleted = {int:not_deleted}
+				AND labels != {string:minus_one}',
+			array(
+				'not_deleted' => 0,
+				'minus_one' => -1,
+			)
+		);
+
+		while ($row = $smcFunc['db_fetch_assoc']($get_pm_labels))
+		{
+			$labels = explode(',', $row['labels']);
+			
+			foreach ($labels as $a_label)
+			{
+				if ($a_label == '-1')
+					continue;
+
+				$new_label_info = $label_info_2[$row['id_member']][$a_label];
+				$inserts[] = array($row['id_pm'], $new_label_info);
+			}
+		}
+
+		$smcFunc['db_free_result']($get_pm_labels);
+
+		// Insert the new data
+		if (!empty($inserts))
+		{
+			$smcFunc['db_insert']('', '{db_prefix}pm_labeled_messages', array('id_pm' => 'int', 'id_label' => 'int'), $inserts, array());
+		}
+
+		// Final step of this ridiculously massive process
+		$get_pm_rules = $smcFunc['db_query']('', '
+			SELECT id_member, id_rule, actions
+			FROM {db_prefix}pm_rules',
+			array(
+			)
+		);
+
+		// Go through the rules, unserialize the actions, then figure out if there's anything we can use
+		while ($row = $smcFunc['db_fetch_assoc']($get_pm_rules))
+		{
+			// Turn this into an array...
+			$actions = unserialize($row['actions']);
+
+			// Loop through the actions and see if we're applying a label anywhere
+			foreach ($actions as $index => $action)
+			{
+				if ($action['t'] == 'lab')
+				{
+					// Update the value of this label...
+					$actions[$index]['v'] = $label_info_2[$row['id_member']][$action['v']];
+				}
+			}
+
+			// Put this back into a string
+			$actions = serialize($actions);
+
+			$smcFunc['db_query']('', '
+				UPDATE {db_prefix}pm_rules
+				SET actions = {string:actions}
+				WHERE id_rule = {int:id_rule}',
+				array(
+					'actions' => $actions,
+					'id_rule' => $row['id_rule'],
+				)	
+			);
+		}
+
+		$smcFunc['db_free_result']($get_pm_rules);
+
+		// Lastly, we drop the old columns
+		$smcFunc['db_remove_column']('{db_prefix}members', 'message_labels');
+		$smcFunc['db_remove_column']('{db_prefix}pm_recipients', 'labels');
+	}
+---}
+---#
+
+/******************************************************************************/
+--- Adding support for edit reasons
+/******************************************************************************/
+---# Adding "modified_reason" column to messages
+ALTER TABLE {$db_prefix}messages
+ADD COLUMN modified_reason varchar(255) NOT NULL;
 ---#

+ 198 - 12
other/upgrade_2-1_postgresql.sql

@@ -548,22 +548,18 @@ CREATE TABLE {$db_prefix}qanda (
 		WHERE comment_type = 'ver_test'");
 
 	while ($row = $smcFunc['db_fetch_assoc']($get_questions))
-	{
-		$questions[] = "($language, $row[question], serialize(array($row[answer])))";
-	}
+		$questions[] = array($language, $row['question'], serialize(array($row['answer'])));
 
 	$smcFunc['db_free_result']($get_questions);
 
 	if (!empty($questions))
 	{
-		foreach ($questions as $question)
-		{
-			upgrade_query("
-				INSERT INTO {$db_prefix}qanda
-					(lngfile, question, answers)
-				VALUES
-					" . $question);
-		}
+		$smcFunc['db_insert']('',
+			'{db_prefix}qanda',
+			array('lngfile' => 'string', 'question' => 'string', 'answers' => 'string'),
+			$questions,
+			array('id_question')
+		);
 
 		// Delete the questions from log_comments now
 		upgrade_query("
@@ -661,8 +657,198 @@ $request = upgrade_query("
 				INSERT INTO {$db_prefix}permissions
 					(id_group, permission, add_deny)
 				VALUES
-					" . $insert);
+					" . $insert
+			);
 		}
 	}
 ---}
+---#
+
+/******************************************************************************/
+--- Upgrading PM labels...
+/******************************************************************************/
+---# Creating pm_labels sequence...
+CREATE SEQUENCE {$db_prefix}pm_labels_sequence;
+---#
+
+---# Adding pm_labels table...
+CREATE TABLE IF NOT EXISTS {$db_prefix}pm_labels (
+  id_label int NOT NULL default nextval('{$db_prefix}pm_labels_seq'),
+  id_member int NOT NULL default '0',
+  name varchar(30) NOT NULL default '',
+  PRIMARY KEY (id_label)
+);
+---#
+
+---# Adding pm_labeled_messages table...
+CREATE TABLE IF NOT EXISTS {$db_prefix}pm_labeled_messages (
+  id_label int NOT NULL default '0',
+  id_pm int NOT NULL default '0',
+  PRIMARY KEY (id_label, id_pm)
+);
+---#
+
+---# Adding "in_inbox" column to pm_recipients
+ALTER TABLE {$db_prefix}pm_recipients
+ADD COLUMN in_inbox smallint NOT NULL default '1';
+---#
+
+---# Moving label info to new tables and updating rules...
+---{
+	// First see if we still have a message_labels column
+	$results = $smcFunc['db_list_columns']('{db_prefix}members', false);
+	if (in_array('message_labels', $results))
+	{
+		// They've still got it, so pull the label info
+		$get_labels = $smcFunc['db_query']('', '
+			SELECT id_member, message_labels
+			FROM {db_prefix}members
+			WHERE message_labels != {string:blank}',
+			array(
+				'blank' => '',
+			)
+		);
+
+		$inserts = array();
+		$label_info = array();
+		while ($row = $smcFunc['db_fetch_assoc']($get_labels))
+		{
+			// Stick this in an array
+			$labels = explode(',', $row['message_labels']);
+
+			// Build some inserts
+			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;
+				$inserts[] = array($row['id_member'], $label);
+			}
+		}
+		
+		$smcFunc['db_free_result']($get_labels);
+
+		if (!empty($inserts))
+		{
+			$smcFunc['db_insert']('', '{db_prefix}pm_labels', array('id_member' => 'int', 'name' => 'string-30'), $inserts, array());
+
+			// Clear this out for our next query below
+			$inserts = array();
+		}
+
+		// This is the easy part - update the inbox stuff
+		$smcFunc['db_query']('', '
+			UPDATE {db_prefix}pm_recipients
+			SET in_inbox = {int:in_inbox}
+			WHERE FIND_IN_SET({int:minus_one}, labels)',
+			array(
+				'in_inbox' => 1,
+				'minus_one' => -1,
+			)
+		);
+
+		// Now we go pull the new IDs for each label
+		$get_new_label_ids = $smcFunc['db_query']('', '
+			SELECT *
+			FROM {db_prefix}pm_labels',
+			array(
+			)
+		);
+
+		$label_info_2 = array();
+		while ($label_row = $smcFunc['db_fetch_assoc']($get_new_label_ids))
+		{
+			// Map the old index values to the new ID values...
+			$old_index = $label_info[$row['id_member']][$row['label_name']];
+			$label_info_2[$row['id_member']][$old_index] = $row['id_label'];
+		}
+
+		$smcFunc['db_free_result']($get_new_label_ids);
+
+		// Pull label info from pm_recipients
+		// Ignore any that are only in the inbox
+		$get_pm_labels = $smcFunc['db_query']('', '
+			SELECT id_pm, id_member, labels
+			FROM {db_prefix}pm_recipients
+			WHERE deleted = {int:not_deleted}
+				AND labels != {string:minus_one}',
+			array(
+				'not_deleted' => 0,
+				'minus_one' => -1,
+			)
+		);
+
+		while ($row = $smcFunc['db_fetch_assoc']($get_pm_labels))
+		{
+			$labels = explode(',', $row['labels']);
+
+			foreach ($labels as $a_label)
+			{
+				if ($a_label == '-1')
+					continue;
+
+				$new_label_info = $label_info_2[$row['id_member']][$a_label];
+				$inserts[] = array($row['id_pm'], $new_label_info); 
+			}
+		}
+
+		$smcFunc['db_free_result']($get_pm_labels);
+
+		// Insert the new data
+		if (!empty($inserts))
+		{
+			$smcFunc['db_insert']('', '{db_prefix}pm_labeled_messages', array('id_pm' => 'int', 'id_label' => 'int'), $inserts, array());
+		}
+
+		// Final step of this ridiculously massive process
+		$get_pm_rules = $smcFunc['db_query']('', '
+			SELECT id_member, id_rule, actions
+			FROM {db_prefix}pm_rules',
+			array(
+			),
+		);
+
+		// Go through the rules, unserialize the actions, then figure out if there's anything we can use
+		while ($row = $smcFunc['db_fetch_assoc']($get_pm_rules))
+		{
+			// Turn this into an array...
+			$actions = unserialize($row['actions']);
+
+			// Loop through the actions and see if we're applying a label anywhere
+			foreach ($actions as $index => $action)
+			{
+				if ($action['t'] == 'lab')
+				{
+					// Update the value of this label...
+					$actions[$index]['v'] = $label_info_2[$row['id_member']][$action['v']];
+				}
+			}
+
+			// Put this back into a string
+			$actions = serialize($actions);
+
+			$smcFunc['db_query']('', '
+				UPDATE {db_prefix}pm_rules
+				SET actions = {string:actions}
+				WHERE id_rule = {int:id_rule}',
+				array(
+					'actions' => $actions,
+					'id_rule' => $row['id_rule'],
+				)	
+			);
+		}
+
+		$smcFunc['db_free_result']($get_pm_rules);
+
+		// Lastly, we drop the old columns
+		$smcFunc['db_remove_column']('{db_prefix}members', 'message_labels');
+		$smcFunc['db_remove_column']('{db_prefix}pm_recipients', 'labels');
+	}
+}
+
+/******************************************************************************/
+--- Adding support for edit reasons
+/******************************************************************************/
+---# Adding "modified_reason" column to messages
+ALTER TABLE {$db_prefix}messages
+ADD COLUMN modified_reason varchar(255) NOT NULL default '';
 ---#

+ 191 - 11
other/upgrade_2-1_sqlite.sql

@@ -538,22 +538,18 @@ CREATE TABLE IF NOT EXISTS {$db_prefix}qanda (
 		WHERE comment_type = 'ver_test'");
 
 	while ($row = $smcFunc['db_fetch_assoc']($get_questions))
-	{
-		$questions[] = "($language, $row[question], serialize(array($row[answer])))";
-	}
+		$questions[] = array($language, $row['question'], serialize(array($row['answer'])));
 
 	$smcFunc['db_free_result']($get_questions);
 
 	if (!empty($questions))
 	{
-		foreach ($questions as $question)
-		{
-			upgrade_query("
-				INSERT INTO {$db_prefix}qanda
-					(lngfile, question, answers)
-				VALUES
-					" . $question);
-		}
+		$smcFunc['db_insert']('',
+			'{db_prefix}qanda',
+			array('lngfile' => 'string', 'question' => 'string', 'answers' => 'string'),
+			$questions,
+			array('id_question')
+		);
 
 		// Delete the questions from log_comments now
 		upgrade_query("
@@ -648,4 +644,188 @@ $request = upgrade_query("
 		}
 	}
 ---}
+---#
+
+/******************************************************************************/
+--- Upgrading PM labels...
+/******************************************************************************/
+---# Adding pm_labels table...
+CREATE TABLE IF NOT EXISTS {$db_prefix}pm_labels (
+  id_label integer primary key,
+  id_member int NOT NULL default '0',
+  name varchar(30) NOT NULL default '',
+);
+---#
+
+---# Adding pm_labeled_messages table...
+CREATE TABLE IF NOT EXISTS {$db_prefix}pm_labeled_messages (
+  id_label int NOT NULL default '0',
+  id_pm int NOT NULL default '0',
+  PRIMARY KEY (id_label, id_pm)
+);
+---#
+
+---# Adding "in_inbox" column to pm_recipients
+ALTER TABLE {$db_prefix}pm_recipients
+ADD COLUMN in_inbox tinyint(3) NOT NULL default '1';
+---#
+
+---# Moving label info to new tables and updating rules...
+---{
+	// First see if we still have a message_labels column
+	$results = $smcFunc['db_list_columns']('{db_prefix}members');
+	if (in_array('message_labels', $results))
+	{
+		// They've still got it, so pull the label info
+		$get_labels = $smcFunc['db_query']('', '
+			SELECT id_member, message_labels
+			FROM {db_prefix}members
+			WHERE message_labels != {string:blank}',
+			array(
+				'blank' => '',
+			)
+		);
+
+		$inserts = array();
+		$label_info = array();
+		while ($row = $smcFunc['db_fetch_assoc']($get_labels))
+		{
+			// Stick this in an array
+			$labels = explode(',', $row['message_labels']);
+
+			// Build some inserts
+			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;
+				$inserts[] = array($row['id_member'], $label);
+			}
+		}
+
+		$smcFunc['db_free_result']($get_labels);
+
+		if (!empty($inserts))
+		{
+			$smcFunc['db_insert']('', '{db_prefix}pm_labels', array('id_member' => 'int', 'name' => 'int'), $inserts, array());
+
+			// Clear this out for our next query below
+			$inserts = array();
+		}
+
+		// This is the easy part - update the inbox stuff
+		$smcFunc['db_query']('', '
+			UPDATE {db_prefix}pm_recipients
+			SET in_inbox = {int:in_inbox}
+			WHERE FIND_IN_SET({int:minus_one}, labels)',
+			array(
+				'in_inbox' => 1,
+				'minus_one' => -1,
+			)
+		);
+
+		// Now we go pull the new IDs for each label
+		$get_new_label_ids = $smcFunc['db_query']('', '
+			SELECT *
+			FROM {db_prefix}pm_labels',
+			array(
+			)
+		);
+
+		$label_info_2 = array();
+		while ($label_row = $smcFunc['db_fetch_assoc']($get_new_label_ids))
+		{
+			// Map the old index values to the new ID values...
+			$old_index = $label_info[$row['id_member']][$row['label_name']];
+			$label_info_2[$row['id_member']][$old_index] = $row['id_label'];
+		}
+
+		$smcFunc['db_free_result']($get_new_label_ids);
+
+		// Pull label info from pm_recipients
+		// Ignore any that are only in the inbox
+		$get_pm_labels = $smcFunc['db_query']('', '
+			SELECT id_pm, id_member, labels
+			FROM {db_prefix}pm_recipients
+			WHERE deleted = {int:not_deleted}
+				AND labels != {string:minus_one}',
+			array(
+				'not_deleted' => 0,
+				'minus_one' => -1,
+			)
+		);
+
+		while ($row = $smcFunc['db_fetch_assoc']($get_pm_labels))
+		{
+			$labels = explode(',', $row['labels']);
+
+			foreach ($labels as $a_label)
+			{
+				if ($a_label == '-1')
+					continue;
+
+				$new_label_info = $label_info_2[$row['id_member']][$a_label];
+				$inserts[] = array($row['id_pm'], $new_label_info); 
+			}
+		}
+
+		$smcFunc['db_free_result']($get_pm_labels);
+
+		// Insert the new data
+		if (!empty($inserts))
+		{
+			$smcFunc['db_insert']('', '{db_prefix}pm_labeled_messages', array('id_pm', 'id_label'), $inserts, array());
+		}
+
+		// Final step of this ridiculously massive process
+		$get_pm_rules = $smcFunc['db_query']('', '
+			SELECT id_member, id_rule, actions
+			FROM {db_prefix}pm_rules',
+			array(
+			),
+		);
+
+		// Go through the rules, unserialize the actions, then figure out if there's anything we can use
+		while ($row = $smcFunc['db_fetch_assoc']($get_pm_rules))
+		{
+			// Turn this into an array...
+			$actions = unserialize($row['actions']);
+
+			// Loop through the actions and see if we're applying a label anywhere
+			foreach ($actions as $index => $action)
+			{
+				if ($action['t'] == 'lab')
+				{
+					// Update the value of this label...
+					$actions[$index]['v'] = $label_info_2[$row['id_member']][$action['v']];
+				}
+			}
+
+			// Put this back into a string
+			$actions = serialize($actions);
+
+			$smcFunc['db_query']('', '
+				UPDATE {db_prefix}pm_rules
+				SET actions = {string:actions}
+				WHERE id_rule = {int:id_rule}',
+				array(
+					'actions' => $actions,
+					'id_rule' => $row['id_rule'],
+				)	
+			);
+		}
+
+		$smcFunc['db_free_result']($get_pm_rules);
+
+		// Lastly, we drop the old columns
+		$smcFunc['db_remove_column']('{db_prefix}members', 'message_labels');
+		$smcFunc['db_remove_column']('{db_prefix}pm_recipients', 'labels');
+	}
+}
+
+******************************************************************************/
+--- Adding support for edit reasons
+/******************************************************************************/
+---# Adding "modified_reason" column to messages
+ALTER TABLE {$db_prefix}messages
+ADD COLUMN modified_reason varchar(255) NOT NULL default '';
 ---#

Some files were not shown because too many files changed in this diff