[Customisation Database Commits] r1782 [45/63] - in /branches/stable: language/en/acp/ language/en/mods/ titania/ titania/authors/ titania/contributions/ titania/docs/ titania/download/ titania/download/modx/ titania/files/contrib_temp/ titania/files/modx_files/ titania/images/ titania/includes/ titania/includes/core/ titania/includes/hooks/ titania/includes/library/Zend/ titania/includes/library/Zend/Search/ titania/includes/library/Zend/Search/Lucene/ titania/includes/library/Zend/Search/Lucene/Analysis/ titania/includes/library/Zend/Search/Lucene/Analysis/Analyzer/ titania/includes/library/Zend/Search/Lucene/Analysis/Analyzer/Common/ titania/includes/library/Zend/Search/Lucene/Analysis/Analyzer/Common/Text/ titania/includes/library/Zend/Search/Lucene/Analysis/Analyzer/Common/TextNum/ titania/includes/library/Zend/Search/Lucene/Analysis/Analyzer/Common/Utf8/ titania/includes/library/Zend/Search/Lucene/Analysis/Analyzer/Common/Utf8Num/ titania/includes/library/Zend/Search/Lucene/Analysis/TokenFilter/ titania/includes/library/Zend/Search/Lucene/Document/ titania/includes/library/Zend/Search/Lucene/Index/ titania/includes/library/Zend/Search/Lucene/Index/SegmentWriter/ titania/includes/library/Zend/Search/Lucene/Index/TermsStream/ titania/includes/library/Zend/Search/Lucene/Search/ titania/includes/library/Zend/Search/Lucene/Search/Highlighter/ titania/includes/library/Zend/Search/Lucene/Search/Query/ titania/includes/library/Zend/Search/Lucene/Search/Query/Preprocessing/ titania/includes/library/Zend/Search/Lucene/Search/QueryEntry/ titania/includes/library/Zend/Search/Lucene/Search/Similarity/ titania/includes/library/Zend/Search/Lucene/Search/Weight/ titania/includes/library/Zend/Search/Lucene/Storage/ titania/includes/library/Zend/Search/Lucene/Storage/Directory/ titania/includes/library/Zend/Search/Lucene/Storage/File/ titania/includes/library/automod/ titania/includes/library/ezcomponents/ titania/includes/library/ezcomponents/Base/ titania/includes/library/ezcomponents/Base/interfaces/ titania/includes/library/translations/ titania/includes/manage_tools/ titania/includes/objects/ titania/includes/overlords/ titania/includes/tools/ titania/includes/types/ titania/js/ titania/language/ titania/language/en/ titania/language/en/email/ titania/language/en/manage_tools/ titania/language/en/types/ titania/manage/ titania/store/ titania/store/phpbb_packages/ titania/store/phpbb_packages/extracted/ titania/store/search/ titania/styles/default/template/ titania/styles/default/template/authors/ titania/styles/default/template/common/ titania/styles/default/template/contributions/ titania/styles/default/template/manage/ titania/styles/default/template/posting/ titania/styles/default/template/posting/attachments/ titania/styles/default/template/posting/panels/ titania/styles/default/theme/ titania/styles/default/theme/en-gb/ titania/styles/prosilver/template/ titania/styles/prosilver/template/authors/ titania/styles/prosilver/template/common/ titania/styles/prosilver/theme/ titania/styles/prosilver/theme/en-gb/ umil/ umil/error_files/ umil/language/en/ umil/style/

David Colon davidiq at phpbb.com
Fri Nov 19 19:35:15 GMT 2010


Modified: branches/stable/titania/includes/versions.php
==============================================================================
*** branches/stable/titania/includes/versions.php (original)
--- branches/stable/titania/includes/versions.php Fri Nov 19 19:35:14 2010
***************
*** 1,632 ****
! <?php
! /**
!  *
!  * @package Titania
!  * @version $Id$
!  * @copyright (c) 2008 phpBB Customisation Database Team
!  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
!  *
!  */
! 
! /**
!  * @ignore
!  */
! if (!defined('IN_TITANIA'))
! {
! 	exit;
! }
! 
! $mod_name = 'CUSTOMISATION_DATABASE';
! $version_config_name = 'titania_version';
! 
! $versions = array(
! 	'0.3.0'	=> array(
! 		'table_add' => array(
! 			array(TITANIA_ATTACHMENTS_TABLE, array(
! 				'COLUMNS'		=> array(
! 					'attachment_id'			=> array('UINT', NULL, 'auto_increment'),
! 					'object_type'			=> array('TINT:1', 0),
! 					'object_id'				=> array('UINT', 0),
! 					'attachment_access'		=> array('UINT', 2),
! 					'attachment_comment'	=> array('TEXT_UNI', ''),
! 					'attachment_directory'	=> array('VCHAR', ''),
! 					'physical_filename'		=> array('VCHAR', ''),
! 					'real_filename'			=> array('VCHAR', ''),
! 					'download_count'		=> array('UINT', 0),
! 					'filesize'				=> array('INT:11', 0),
! 					'filetime'				=> array('INT:11', 0),
! 					'extension'				=> array('VCHAR:100', ''),
! 					'mimetype'				=> array('VCHAR:100', ''),
! 					'hash'					=> array('VCHAR:32', ''),
! 					'thumbnail'				=> array('BOOL', 0),
! 					'is_orphan'				=> array('TINT:1', 1),
! 				),
! 				'PRIMARY_KEY'	=> 'attachment_id',
! 				'KEYS'			=> array(
! 					'object_type'			=> array('INDEX', 'object_type'),
! 					'object_id'				=> array('INDEX', 'object_id'),
! 					'attachment_access'		=> array('INDEX', 'attachment_access'),
! 					'is_orphan'				=> array('INDEX', 'is_orphan'),
! 				),
! 			)),
! 			array(TITANIA_ATTENTION_TABLE, array(
! 				'COLUMNS'		=> array(
! 					'attention_id'					=> array('UINT', NULL, 'auto_increment'),
! 					'attention_type'				=> array('UINT', 0), // attention type constants (reported, needs approval, etc)
! 					'attention_object_type'			=> array('UINT', 0),
! 					'attention_object_id'			=> array('UINT', 0),
! 					'attention_url'					=> array('VCHAR_CI', ''),
! 					'attention_requester'			=> array('UINT', 0),
! 					'attention_time'				=> array('TIMESTAMP', 0),
! 					'attention_close_time'			=> array('TIMESTAMP', 0),
! 					'attention_close_user'			=> array('UINT', 0),
! 					'attention_title'				=> array('STEXT_UNI', ''),
! 					'attention_description'			=> array('MTEXT_UNI', ''),
! 					'attention_poster_id'			=> array('UINT', 0),
! 					'attention_post_time'			=> array('TIMESTAMP', 0),
! 				),
! 				'PRIMARY_KEY'	=> 'attention_id',
! 				'KEYS'			=> array(
! 					'attention_type'				=> array('INDEX', 'attention_type'),
! 					'attention_object_type'			=> array('INDEX', 'attention_object_type'),
! 					'attention_object_id'			=> array('INDEX', 'attention_object_id'),
! 					'attention_time'				=> array('INDEX', 'attention_time'),
! 					'attention_close_time'			=> array('INDEX', 'attention_close_time'),
! 					'attention_close_user'			=> array('INDEX', 'attention_close_user'),
! 					'attention_poster_id'			=> array('INDEX', 'attention_poster_id'),
! 					'attention_post_time'			=> array('INDEX', 'attention_post_time'),
! 				),
! 			)),
! 			array(TITANIA_AUTOMOD_QUEUE_TABLE, array(
! 				'COLUMNS'		=> array(
! 					'row_id'					=> array('UINT', NULL, 'auto_increment'),
! 					'revision_id'				=> array('UINT', 0),
! 					'phpbb_version_branch'		=> array('TINT:1', 0),
! 					'phpbb_version_revision'	=> array('VCHAR', ''),
! 				),
! 				'PRIMARY_KEY'	=> 'row_id',
! 				'KEYS'			=> array(
! 					'revision_id'				=> array('INDEX', 'revision_id'),
! 				),
! 			)),
! 			array(TITANIA_AUTHORS_TABLE, array(
! 				'COLUMNS'		=> array(
! 					'author_id'				=> array('UINT', NULL, 'auto_increment'),
! 					'user_id'				=> array('UINT', 0),
! 					'phpbb_user_id'			=> array('UINT', 0),
! 					'author_realname'		=> array('VCHAR_CI', ''),
! 					'author_website'		=> array('VCHAR_UNI:200', ''),
! 					'author_rating'			=> array('DECIMAL', 0),
! 					'author_rating_count'	=> array('UINT', 0),
! 					'author_contribs'		=> array('UINT', 0), // Total # of contribs
! 					'author_snippets'		=> array('UINT', 0), // Number of snippets
! 					'author_mods'			=> array('UINT', 0), // Number of mods
! 					'author_styles'			=> array('UINT', 0), // Number of styles
! 					'author_visible'		=> array('BOOL', 1),
! 					'author_desc'			=> array('MTEXT_UNI', ''),
! 					'author_desc_bitfield'	=> array('VCHAR:255', ''),
! 					'author_desc_uid'		=> array('VCHAR:8', ''),
! 					'author_desc_options'	=> array('UINT:11', 7),
! 				),
! 				'PRIMARY_KEY'	=> 'author_id',
! 				'KEYS'			=> array(
! 					'user_id'				=> array('UNIQUE', 'user_id'),
! 					'author_rating'			=> array('INDEX', 'author_rating'),
! 					'author_contribs'		=> array('INDEX', 'author_contribs'),
! 					'author_snippets'		=> array('INDEX', 'author_snippets'),
! 					'author_mods'			=> array('INDEX', 'author_mods'),
! 					'author_styles'			=> array('INDEX', 'author_styles'),
! 					'author_visible'		=> array('INDEX', 'author_visible'),
! 				),
! 			)),
! 			array(TITANIA_CATEGORIES_TABLE, array(
! 				'COLUMNS'		=> array(
! 					'category_id'				=> array('UINT', NULL, 'auto_increment'),
! 					'parent_id'					=> array('UINT', 0),
! 					'left_id'					=> array('UINT', 0),
! 					'right_id'					=> array('UINT', 0),
! 					'category_type'				=> array('TINT:1', 0),
! 					'category_contribs'			=> array('UINT', 0), // Number of items
! 					'category_visible'			=> array('BOOL', 1),
! 					'category_name'				=> array('STEXT_UNI', '', 'true_sort'),
! 					'category_name_clean'		=> array('VCHAR_CI', ''),
! 					'category_desc'				=> array('MTEXT_UNI', ''),
! 					'category_desc_bitfield'	=> array('VCHAR:255', ''),
! 					'category_desc_uid'			=> array('VCHAR:8', ''),
! 					'category_desc_options'		=> array('UINT:11', 7),
! 				),
! 				'PRIMARY_KEY'	=> 'category_id',
! 				'KEYS'			=> array(
! 					'parent_id'			=> array('INDEX', 'parent_id'),
! 					'left_right_id'		=> array('INDEX', array('left_id', 'right_id')),
! 					'category_type'		=> array('INDEX', 'category_type'),
! 					'category_visible'	=> array('INDEX', 'category_visible'),
! 				),
! 			)),
! 			array(TITANIA_CONTRIBS_TABLE, array(
! 				'COLUMNS'		=> array(
! 					'contrib_id'					=> array('UINT', NULL, 'auto_increment'),
! 					'contrib_user_id'				=> array('UINT', 0),
! 					'contrib_type'					=> array('TINT:1', 0),
! 					'contrib_name'					=> array('STEXT_UNI', '', 'true_sort'),
! 					'contrib_name_clean'			=> array('VCHAR_CI', ''),
! 					'contrib_desc'					=> array('MTEXT_UNI', ''),
! 					'contrib_desc_bitfield'			=> array('VCHAR:255', ''),
! 					'contrib_desc_uid'				=> array('VCHAR:8', ''),
! 					'contrib_desc_options'			=> array('UINT:11', 7),
! 					'contrib_status'				=> array('TINT:2', 0),
! 					'contrib_downloads'				=> array('UINT', 0),
! 					'contrib_views'					=> array('UINT', 0),
! 					'contrib_rating'				=> array('DECIMAL', 0),
! 					'contrib_rating_count'			=> array('UINT', 0),
! 					'contrib_visible'				=> array('BOOL', 1),
! 					'contrib_last_update'			=> array('TIMESTAMP', 0),
! 					'contrib_demo'					=> array('VCHAR_UNI:200', ''),
! 					'contrib_release_topic_id'		=> array('UINT', 0),
! 				),
! 				'PRIMARY_KEY'	=> 'contrib_id',
! 				'KEYS'			=> array(
! 					'contrib_user_id'		=> array('INDEX', 'contrib_user_id'),
! 					'contrib_type'			=> array('INDEX', 'contrib_type'),
! 					'contrib_name_clean'	=> array('INDEX', 'contrib_name_clean'),
! 					'contrib_status'		=> array('INDEX', 'contrib_status'),
! 					'contrib_downloads'		=> array('INDEX', 'contrib_downloads'),
! 					'contrib_rating'		=> array('INDEX', 'contrib_rating'),
! 					'contrib_visible'		=> array('INDEX', 'contrib_visible'),
! 					'contrib_last_update'	=> array('INDEX', 'contrib_last_update'),
! 				),
! 			)),
! 			array(TITANIA_CONTRIB_COAUTHORS_TABLE, array(
! 				'COLUMNS'		=> array(
! 					'contrib_id'			=> array('UINT', 0),
! 					'user_id'				=> array('UINT', 0),
! 					'active'				=> array('BOOL', 0),
! 				),
! 				'PRIMARY_KEY'	=> array('contrib_id', 'user_id'),
! 				'KEYS'			=> array(
! 					'active'		=> array('INDEX', 'active'),
! 				),
! 			)),
! 			array(TITANIA_CONTRIB_FAQ_TABLE, array(
! 				'COLUMNS'		=> array(
! 					'faq_id'				=> array('UINT', NULL, 'auto_increment'),
! 					'contrib_id'			=> array('UINT', 0),
! 					'left_id'				=> array('UINT', 0),
! 					'right_id'				=> array('UINT', 0),
! 					'faq_subject'			=> array('STEXT_UNI', '', 'true_sort'),
! 					'faq_text'				=> array('MTEXT_UNI', ''),
! 					'faq_text_bitfield'		=> array('VCHAR:255', ''),
! 					'faq_text_uid'			=> array('VCHAR:8', ''),
! 					'faq_text_options'		=> array('UINT:11', 7),
! 					'faq_views'				=> array('UINT', 0),
! 					'faq_access'			=> array('TINT:1', 2),
! 				),
! 				'PRIMARY_KEY'	=> 'faq_id',
! 				'KEYS'			=> array(
! 					'contrib_id'		=> array('INDEX', 'contrib_id'),
! 					'faq_access'		=> array('INDEX', 'faq_access'),
! 					'left_right_id'		=> array('INDEX', array('left_id', 'right_id')),
! 				),
! 			)),
! 			array(TITANIA_CONTRIB_IN_CATEGORIES_TABLE, array(
! 				'COLUMNS'		=> array(
! 					'contrib_id'			=> array('UINT', 0),
! 					'category_id'			=> array('UINT', 0),
! 				),
! 				'PRIMARY_KEY'	=> array('contrib_id', 'category_id'),
! 			)),
! 			array(TITANIA_POSTS_TABLE, array(
! 				'COLUMNS'		=> array(
! 					'post_id'				=> array('UINT', NULL, 'auto_increment'),
! 					'topic_id'				=> array('UINT', 0),
! 					'post_url'				=> array('VCHAR_CI', ''),
! 					'post_type'				=> array('TINT:1', 0), // Post Type, Main TITANIA_ constants
! 					'post_access'			=> array('TINT:1', 0), // Access level, TITANIA_ACCESS_ constants
! 					'post_locked'			=> array('BOOL', 0),
! 					'post_approved'			=> array('BOOL', 1),
! 					'post_reported'			=> array('BOOL', 0),
! 					'post_attachment'		=> array('BOOL', 0),
! 					'post_user_id'			=> array('UINT', 0),
! 					'post_ip'				=> array('VCHAR:40', ''),
! 					'post_time'				=> array('UINT:11', 0),
! 					'post_edited'			=> array('UINT:11', 0), // Post edited; 0 for not edited, timestamp if (when) last edited
! 					'post_deleted'			=> array('UINT:11', 0), // Post deleted; 0 for not edited, timestamp if (when) last edited
! 					'post_delete_user'		=> array('UINT', 0), // The last user to delete the post
! 					'post_edit_user'		=> array('UINT', 0), // The last user to edit the post
! 					'post_edit_reason'		=> array('STEXT_UNI', ''), // Reason for deleting/editing
! 					'post_subject'			=> array('STEXT_UNI', '', 'true_sort'),
! 					'post_text'				=> array('MTEXT_UNI', '', 'true_sort'),
! 					'post_text_bitfield'	=> array('VCHAR:255', ''),
! 					'post_text_uid'			=> array('VCHAR:8', ''),
! 					'post_text_options'		=> array('UINT:11', 7),
! 				),
! 				'PRIMARY_KEY'	=> 'post_id',
! 				'KEYS'			=> array(
! 					'topic_id'				=> array('INDEX', 'topic_id'),
! 					'post_type'				=> array('INDEX', 'post_type'),
! 					'post_access'			=> array('INDEX', 'post_access'),
! 					'post_approved'			=> array('INDEX', 'post_approved'),
! 					'post_reported'			=> array('INDEX', 'post_reported'),
! 					'post_user_id'			=> array('INDEX', 'post_user_id'),
! 					'post_deleted'			=> array('INDEX', 'post_deleted'),
! 				),
! 			)),
! 			array(TITANIA_QUEUE_TABLE, array(
! 				'COLUMNS'		=> array(
! 					'queue_id'				=> array('UINT', NULL, 'auto_increment'),
! 					'revision_id'			=> array('UINT', 0),
! 					'contrib_id'			=> array('UINT', 0),
! 					'queue_type'			=> array('TINT:1', 0),
! 					'queue_status'			=> array('TINT:1', 0),
! 					'submitter_user_id'		=> array('UINT', 0),
! 					'queue_allow_repack'	=> array('BOOL', 1),
! 					'queue_notes'			=> array('MTEXT_UNI', ''),
! 					'queue_notes_bitfield'	=> array('VCHAR:255', ''),
! 					'queue_notes_uid'		=> array('VCHAR:8', ''),
! 					'queue_notes_options'	=> array('UINT:11', 7),
! 					'queue_validation_notes'			=> array('MTEXT_UNI', ''),
! 					'queue_validation_notes_bitfield'	=> array('VCHAR:255', ''),
! 					'queue_validation_notes_uid'		=> array('VCHAR:8', ''),
! 					'queue_validation_notes_options'	=> array('UINT:11', 7),
! 					'queue_submit_time'		=> array('UINT:11', 0),
! 					'queue_progress'		=> array('UINT', 0), // user_id
! 					'queue_progress_time'	=> array('UINT:11', 0),
! 					'queue_close_time'		=> array('UINT:11', 0),
! 					'queue_close_user'		=> array('UINT', 0),
! 					'queue_topic_id'		=> array('UINT', 0),
! 					'mpv_results'			=> array('MTEXT_UNI', ''),
! 					'mpv_results_bitfield'	=> array('VCHAR:255', ''),
! 					'mpv_results_uid'		=> array('VCHAR:8', ''),
! 					'automod_results'		=> array('MTEXT_UNI', ''),
! 				),
! 				'PRIMARY_KEY'	=> 'queue_id',
! 				'KEYS'			=> array(
! 					'revision_id'			=> array('INDEX', 'revision_id'),
! 					'contrib_id'			=> array('INDEX', 'contrib_id'),
! 					'queue_type'			=> array('INDEX', 'queue_type'),
! 					'queue_status'			=> array('INDEX', 'queue_status'),
! 					'submitter_user_id'		=> array('INDEX', 'submitter_user_id'),
! 					'queue_submit_time'		=> array('INDEX', 'queue_submit_time'),
! 				),
! 			)),
! 			array(TITANIA_RATINGS_TABLE, array(
! 				'COLUMNS'		=> array(
! 					'rating_id'				=> array('UINT', NULL, 'auto_increment'),
! 					'rating_type_id'		=> array('UINT', 0),
! 					'rating_user_id'		=> array('UINT', 0),
! 					'rating_object_id'		=> array('UINT', 0),
! 					'rating_value'			=> array('DECIMAL', 0), // Not sure if we should allow partial ratings (like 4.5/5) or just integer ratings...
! 				),
! 				'PRIMARY_KEY'	=> 'rating_id',
! 				'KEYS'			=> array(
! 					'type_user_object'		=> array('UNIQUE', array('rating_type_id', 'rating_user_id', 'rating_object_id')),
! 				),
! 			)),
! 			array(TITANIA_REVISIONS_TABLE, array(
! 				'COLUMNS'		=> array(
! 					'revision_id'				=> array('UINT', NULL, 'auto_increment'),
! 					'contrib_id'				=> array('UINT', 0),
! 					'attachment_id'				=> array('UINT', 0),
! 					'revision_version'			=> array('VCHAR', ''),
! 					'revision_name'				=> array('STEXT_UNI', '', 'true_sort'),
! 					'revision_time'				=> array('UINT:11', 0),
! 					'revision_validated'		=> array('UINT:11', 0),
! 					'validation_date'			=> array('UINT:11', 0),
! 					'install_time'				=> array('USINT', 0),
! 					'install_level'				=> array('TINT:1', 0),
! 					'revision_submitted'		=> array('BOOL', 0), // So we can hide the revision while we are creating it, false means someone is working on creating it (or did not finish creating it)
! 					'revision_queue_id'			=> array('UINT', 0),
! 				),
! 				'PRIMARY_KEY'	=> 'revision_id',
! 				'KEYS'			=> array(
! 					'contrib_id'			=> array('INDEX', 'contrib_id'),
! 					'revision_validated'	=> array('INDEX', 'revision_validated'),
! 					'revision_time'			=> array('INDEX', 'revision_time'),
! 					'validation_date'		=> array('INDEX', 'validation_date'),
! 					'revision_submitted'	=> array('INDEX', 'revision_submitted'),
! 					'revision_queue_id'		=> array('INDEX', 'revision_queue_id'),
! 				),
! 			)),
! 			array(TITANIA_REVISIONS_PHPBB_TABLE, array(
! 				'COLUMNS'		=> array(
! 					'row_id'					=> array('UINT', NULL, 'auto_increment'),
! 					'revision_id'				=> array('UINT', 0),
! 					'contrib_id'				=> array('UINT', 0),
! 					'phpbb_version_branch'		=> array('TINT:1', 0),
! 					'phpbb_version_revision'	=> array('VCHAR', ''),
! 					'revision_validated'		=> array('BOOL', 0),
! 				),
! 				'PRIMARY_KEY'	=> 'row_id',
! 				'KEYS'			=> array(
! 					'revision_id'				=> array('INDEX', 'revision_id'),
! 					'contrib_id'				=> array('INDEX', 'contrib_id'),
! 					'phpbb_version_branch'		=> array('INDEX', 'phpbb_version_branch'),
! 					'phpbb_version_revision'	=> array('INDEX', 'phpbb_version_revision'),
! 					'revision_validated'		=> array('INDEX', 'revision_validated'),
! 				),
! 			)),
! 			array(TITANIA_TAG_APPLIED_TABLE, array(
! 				'COLUMNS'		=> array(
! 					'object_type'			=> array('UINT', 0),
! 					'object_id'				=> array('UINT', 0),
! 					'tag_id'				=> array('UINT', 0),
! 					'tag_value'				=> array('STEXT_UNI', '', 'true_sort'),
! 				),
! 				'PRIMARY_KEY'	=> array('object_type', 'object_id', 'tag_id'),
! 			)),
! 			array(TITANIA_TAG_FIELDS_TABLE, array(
! 				'COLUMNS'		=> array(
! 					'tag_id'				=> array('UINT', NULL, 'auto_increment'),
! 					'tag_type_id'			=> array('UINT', 0),
! 					'tag_field_name'		=> array('XSTEXT_UNI', '', 'true_sort'),
! 					'tag_clean_name'		=> array('XSTEXT_UNI', '', 'true_sort'),
! 					'tag_field_desc'		=> array('STEXT_UNI', '', 'true_sort'),
! 					'no_delete'				=> array('BOOL', 0), // A few tags we have to hard-code (like new status for a queue item)
! 				),
! 				'PRIMARY_KEY'	=> 'tag_id',
! 				'KEYS'			=> array(
! 					'tag_type_id'			=> array('INDEX', 'tag_type_id'),
! 				),
! 			)),
! 			array(TITANIA_TAG_TYPES_TABLE, array(
! 				'COLUMNS'		=> array(
! 					'tag_type_id'			=> array('UINT', NULL, 'auto_increment'),
! 					'tag_type_name'			=> array('STEXT_UNI', '', 'true_sort'),
! 				),
! 				'PRIMARY_KEY'	=> 'tag_type_id',
! 			)),
! 			array(TITANIA_TOPICS_TABLE, array(
! 				'COLUMNS'		=> array(
! 					'topic_id'						=> array('UINT', NULL, 'auto_increment'),
! 					'parent_id'						=> array('UINT', 0),
! 					'topic_url'						=> array('VCHAR_CI', ''),
! 					'topic_type'					=> array('TINT:1', 0), // Post Type, Main TITANIA_ constants
! 					'topic_access'					=> array('TINT:1', 0), // Access level, TITANIA_ACCESS_ constants
! 					'topic_category'				=> array('UINT', 0), // Category for the topic. For the Tracker
! 					'topic_status'					=> array('UINT', 0), // Topic Status, use tags from the DB
! 					'topic_assigned'				=> array('VCHAR:255', ''), // Topic assigned status; u- for user, g- for group (followed by the id).  For the tracker
! 					'topic_time'					=> array('UINT:11', 0),
! 					'topic_sticky'					=> array('BOOL', 0),
! 					'topic_locked'					=> array('BOOL', 0),
! 					'topic_approved'				=> array('BOOL', 1),
! 					'topic_reported'				=> array('BOOL', 0), // True if any posts in the topic are reported
! 					'topic_views'					=> array('UINT', 0),
! 					'topic_posts'					=> array('VCHAR', ''), // Post count; separated by : between access levels ('10:9:8' = 10 team; 9 Mod Author; 8 Public)
! 					'topic_subject'					=> array('STEXT_UNI', ''),
! 					'topic_subject_clean'			=> array('STEXT_UNI', ''), // used for building the url
! 					'topic_first_post_id'			=> array('UINT', 0),
! 					'topic_first_post_user_id'		=> array('UINT', 0),
! 					'topic_first_post_username'		=> array('VCHAR_UNI', ''),
! 					'topic_first_post_user_colour'	=> array('VCHAR:6', ''),
! 					'topic_first_post_time'			=> array('UINT:11', 0),
! 					'topic_last_post_id'			=> array('UINT', 0),
! 					'topic_last_post_user_id'		=> array('UINT', 0),
! 					'topic_last_post_username'		=> array('VCHAR_UNI', ''),
! 					'topic_last_post_user_colour'	=> array('VCHAR:6', ''),
! 					'topic_last_post_time'			=> array('UINT:11', 0),
! 					'topic_last_post_subject'		=> array('STEXT_UNI', ''),
! 				),
! 				'PRIMARY_KEY'	=> 'topic_id',
! 				'KEYS'			=> array(
! 					'parent_id'				=> array('INDEX', 'parent_id'),
! 					'topic_type'			=> array('INDEX', 'topic_type'),
! 					'topic_access'			=> array('INDEX', 'topic_access'),
! 					'topic_category'		=> array('INDEX', 'topic_category'),
! 					'topic_status'			=> array('INDEX', 'topic_status'),
! 					'topic_assigned'		=> array('INDEX', 'topic_assigned'),
! 					'topic_sticky'			=> array('INDEX', 'topic_sticky'),
! 					'topic_approved'		=> array('INDEX', 'topic_approved'),
! 					'topic_reported'		=> array('INDEX', 'topic_reported'),
! 					'topic_time'			=> array('INDEX', 'topic_time'),
! 					'topic_last_post_time'	=> array('INDEX', 'topic_last_post_time'),
! 				),
! 			)),
! 			array(TITANIA_TRACK_TABLE, array(
! 				'COLUMNS'		=> array(
! 					'track_type'			=> array('UINT', 0),
! 					'track_id'				=> array('UINT', 0),
! 					'track_user_id'			=> array('UINT', 0),
! 					'track_time'			=> array('UINT:11', 0),
! 				),
! 				'PRIMARY_KEY'	=> array('track_type', 'track_id', 'track_user_id'),
! 			)),
! 			array(TITANIA_WATCH_TABLE, array(
! 				'COLUMNS'		=> array(
! 					'watch_type'			=> array('TINT:1', 0),
! 					'watch_object_type'		=> array('UINT', 0),
! 					'watch_object_id'		=> array('UINT', 0),
! 					'watch_user_id'			=> array('UINT', 0),
! 					'watch_mark_time'		=> array('UINT:11', 0),
! 				),
! 				'PRIMARY_KEY'	=> array('watch_object_type', 'watch_object_id', 'watch_user_id', 'watch_type'),
! 			)),
! 		),
! 
! 		'permission_add' => array(
! 			'u_titania_admin',				// Can administrate titania
! 
! 			'u_titania_mod_author_mod',		// Can moderate author profiles
! 			'u_titania_mod_contrib_mod',	// Can moderate all contrib items
! 			'u_titania_mod_rate_reset',		// Can reset the rating on items
! 			'u_titania_mod_faq_mod',		// Can moderate FAQ entries
! 			'u_titania_mod_post_mod',		// Can moderate topics
! 
! 			'u_titania_contrib_submit',		// Can submit contrib items
! 			'u_titania_rate',				// Can rate items
! 			'u_titania_faq_create',			// Can create FAQ entries
! 			'u_titania_faq_edit',			// Can edit own FAQ entries
! 			'u_titania_faq_delete',			// Can delete own FAQ entries
! 			'u_titania_topic',				// Can create new topics
! 			'u_titania_bbcode',				// Can post bbcode
! 			'u_titania_smilies',			// Can post smilies
! 			'u_titania_post',				// Can create new posts
! 			'u_titania_post_approved',		// Posts are approved?
! 			'u_titania_post_edit_own',		// Can edit own posts
! 			'u_titania_post_delete_own',	// Can delete own posts
! 			'u_titania_post_mod_own',		// Can moderate own contrib topics
! 			'u_titania_post_attach',		// Can attach files to posts
! 		),
! 
! 		'permission_role_add' => array(
! 			array('ROLE_TITANIA_MODIFICATION_TEAM', 'u_'),
! 			array('ROLE_TITANIA_STYLE_TEAM', 'u_'),
! 			array('ROLE_TITANIA_MODERATOR_TEAM', 'u_'),
! 			array('ROLE_TITANIA_ADMINISTRATOR_TEAM', 'u_'),
! 		),
! 
! 		'permission_set' => array(
! 			array('ROLE_ADMIN_FULL', array(
! 				'u_titania_admin',					// Can administrate titania
! 				'u_titania_mod_author_mod',			// Can moderate author profiles
! 				'u_titania_mod_contrib_mod',		// Can moderate all contrib items
! 				'u_titania_mod_rate_reset',			// Can reset the rating on items
! 				'u_titania_mod_faq_mod',			// Can moderate FAQ entries
! 				'u_titania_mod_post_mod',			// Can moderate topics
! 				'u_titania_mod_modification_queue',			// Can see the modifications queue
! 				'u_titania_mod_modification_validate',		// Can validate modifications
! 				'u_titania_mod_modification_moderate',		// Can moderate modifications
! 				'u_titania_mod_style_queue',		// Can see the styles queue
! 				'u_titania_mod_style_validate',		// Can validate styles
! 				'u_titania_mod_style_moderate',		// Can moderate styles
! 			)),
! 			array('ROLE_TITANIA_ADMINISTRATOR_TEAM', array(
! 				'u_titania_admin',					// Can administrate titania
! 				'u_titania_mod_author_mod',			// Can moderate author profiles
! 				'u_titania_mod_contrib_mod',		// Can moderate all contrib items
! 				'u_titania_mod_rate_reset',			// Can reset the rating on items
! 				'u_titania_mod_faq_mod',			// Can moderate FAQ entries
! 				'u_titania_mod_post_mod',			// Can moderate topics
! 				'u_titania_mod_modification_queue',			// Can see the modifications queue
! 				'u_titania_mod_modification_validate',		// Can validate modifications
! 				'u_titania_mod_modification_moderate',		// Can moderate modifications
! 				'u_titania_mod_style_queue',		// Can see the styles queue
! 				'u_titania_mod_style_validate',		// Can validate styles
! 				'u_titania_mod_style_moderate',		// Can moderate styles
! 			)),
! 			array('ROLE_TITANIA_MODIFICATION_TEAM', array(
! 				'u_titania_mod_author_mod',			// Can moderate author profiles
! 				'u_titania_mod_faq_mod',			// Can moderate FAQ entries
! 				'u_titania_mod_post_mod',			// Can moderate topics
! 				'u_titania_mod_modification_queue',			// Can see the modifications queue
! 				'u_titania_mod_modification_validate',		// Can validate modifications
! 				'u_titania_mod_modification_moderate',		// Can moderate modifications
! 			)),
! 			array('ROLE_TITANIA_STYLE_TEAM', array(
! 				'u_titania_mod_author_mod',			// Can moderate author profiles
! 				'u_titania_mod_faq_mod',			// Can moderate FAQ entries
! 				'u_titania_mod_post_mod',			// Can moderate topics
! 				'u_titania_mod_style_queue',		// Can see the styles queue
! 				'u_titania_mod_style_validate',		// Can validate styles
! 				'u_titania_mod_style_moderate',		// Can moderate styles
! 			)),
! 			array('ROLE_TITANIA_MODERATOR_TEAM', array(
! 				'u_titania_mod_author_mod',			// Can moderate author profiles
! 				'u_titania_mod_faq_mod',			// Can moderate FAQ entries
! 				'u_titania_mod_post_mod',			// Can moderate topics
! 			)),
! 			array('ROLE_USER_STANDARD', array(
! 				'u_titania_contrib_submit',		// Can submit contrib items
! 				'u_titania_rate',				// Can rate items
! 				'u_titania_faq_create',			// Can create FAQ entries
! 				'u_titania_faq_edit',			// Can edit own FAQ entries
! 				'u_titania_faq_delete',			// Can delete own FAQ entries
! 				'u_titania_topic',				// Can create new topics
! 				'u_titania_bbcode',				// Can post bbcode
! 				'u_titania_smilies',			// Can post smilies
! 				'u_titania_post',				// Can create new posts
! 				'u_titania_post_approved',		// Posts are approved?
! 				'u_titania_post_edit_own',		// Can edit own posts
! 				'u_titania_post_delete_own',	// Can delete own posts
! 				'u_titania_post_attach',		// Can attach files to posts
! 			)),
! 			array('ROLE_USER_FULL', array(
! 				'u_titania_contrib_submit',		// Can submit contrib items
! 				'u_titania_rate',				// Can rate items
! 				'u_titania_faq_create',			// Can create FAQ entries
! 				'u_titania_faq_edit',			// Can edit own FAQ entries
! 				'u_titania_faq_delete',			// Can delete own FAQ entries
! 				'u_titania_topic',				// Can create new topics
! 				'u_titania_bbcode',				// Can post bbcode
! 				'u_titania_smilies',			// Can post smilies
! 				'u_titania_post',				// Can create new posts
! 				'u_titania_post_approved',		// Posts are approved?
! 				'u_titania_post_edit_own',		// Can edit own posts
! 				'u_titania_post_delete_own',	// Can delete own posts
! 				'u_titania_post_attach',		// Can attach files to posts
! 			)),
! 		),
! 
! 		'config_add' => array(
! 			array('titania_num_contribs', 0, true),
! 		),
! 
! 		'custom' => array('titania_tags', 'titania_categories'),
! 
! 		'cache_purge' => '',
! 	),
! 
! 	'0.3.1' => array(
! 		'permission_add' => array(
! 			'u_titania_post_hard_delete',
! 		),
! 	),
! 
! 	'0.3.2' => array(
! 		'table_column_add' => array(
! 			array(TITANIA_REVISIONS_TABLE, 'revision_status', array('TINT:2', 0)),
! 		),
! 		'table_index_add' => array(
! 			array(TITANIA_REVISIONS_TABLE, 'revision_status'),
! 		),
! 
! 		'custom' => 'titania_custom',
! 
! 		'table_index_remove' => array(
! 			array(TITANIA_REVISIONS_TABLE, 'revision_validated'),
! 		),
! 
! 		'table_column_remove' => array(
! 			array(TITANIA_REVISIONS_TABLE, 'revision_validated'),
! 		),
! 	),
! 
! 	'0.3.3' => array(
! 		'table_column_add' => array(
! 			array(TITANIA_CONTRIBS_TABLE, 'contrib_faq_count', array('VCHAR', '')),
! 		),
! 
! 		'custom' => 'titania_custom',
! 	),
! 
! 	'0.3.4' => array(
! 		'table_column_add' => array(
! 			array(TITANIA_ATTACHMENTS_TABLE, 'attachment_user_id', array('UINT', 0)),
! 		),
! 	),
! 	
! 	'0.3.5' => array(
! 		'table_column_add' => array(
! 			array(TITANIA_CONTRIBS_TABLE, 'contrib_iso_code', array('VCHAR', '')),
! 			array(TITANIA_CONTRIBS_TABLE, 'contrib_local_name', array('VCHAR', '')),
! 		),
! 	),
! 	'0.3.5' => array(
! 		'table_column_add' => array(
! 			array(TITANIA_CONTRIBS_TABLE, 'contrib_iso_code', array('VCHAR', '')),
! 			array(TITANIA_CONTRIBS_TABLE, 'contrib_local_name', array('VCHAR', '')),
! 		),
! 	),
! 
! 	'0.3.6' => array(
! 		'table_column_add' => array(
! 			array(USERS_TABLE, 'titania_enhanced_editor', array('BOOL', true)),
! 		),
! 	),
! 
! 	'0.3.7' => array(
! 		'table_column_add' => array(
! 			array(TITANIA_REVISIONS_TABLE, 'revision_license', array('VCHAR', '')),
! 		),
! 	),
! 	// IF YOU ADD A NEW VERSION DO NOT FORGET TO INCREMENT THE VERSION NUMBER IN common.php!
! );
--- 1,638 ----
! <?php
! /**
!  *
!  * @package Titania
!  * @version $Id$
!  * @copyright (c) 2008 phpBB Customisation Database Team
!  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
!  *
!  */
! 
! /**
!  * @ignore
!  */
! if (!defined('IN_TITANIA'))
! {
! 	exit;
! }
! 
! $mod_name = 'CUSTOMISATION_DATABASE';
! $version_config_name = 'titania_version';
! 
! $versions = array(
! 	'0.3.0'	=> array(
! 		'table_add' => array(
! 			array(TITANIA_ATTACHMENTS_TABLE, array(
! 				'COLUMNS'		=> array(
! 					'attachment_id'			=> array('UINT', NULL, 'auto_increment'),
! 					'object_type'			=> array('TINT:1', 0),
! 					'object_id'				=> array('UINT', 0),
! 					'attachment_access'		=> array('UINT', 2),
! 					'attachment_comment'	=> array('TEXT_UNI', ''),
! 					'attachment_directory'	=> array('VCHAR', ''),
! 					'physical_filename'		=> array('VCHAR', ''),
! 					'real_filename'			=> array('VCHAR', ''),
! 					'download_count'		=> array('UINT', 0),
! 					'filesize'				=> array('INT:11', 0),
! 					'filetime'				=> array('INT:11', 0),
! 					'extension'				=> array('VCHAR:100', ''),
! 					'mimetype'				=> array('VCHAR:100', ''),
! 					'hash'					=> array('VCHAR:32', ''),
! 					'thumbnail'				=> array('BOOL', 0),
! 					'is_orphan'				=> array('TINT:1', 1),
! 				),
! 				'PRIMARY_KEY'	=> 'attachment_id',
! 				'KEYS'			=> array(
! 					'object_type'			=> array('INDEX', 'object_type'),
! 					'object_id'				=> array('INDEX', 'object_id'),
! 					'attachment_access'		=> array('INDEX', 'attachment_access'),
! 					'is_orphan'				=> array('INDEX', 'is_orphan'),
! 				),
! 			)),
! 			array(TITANIA_ATTENTION_TABLE, array(
! 				'COLUMNS'		=> array(
! 					'attention_id'					=> array('UINT', NULL, 'auto_increment'),
! 					'attention_type'				=> array('UINT', 0), // attention type constants (reported, needs approval, etc)
! 					'attention_object_type'			=> array('UINT', 0),
! 					'attention_object_id'			=> array('UINT', 0),
! 					'attention_url'					=> array('VCHAR_CI', ''),
! 					'attention_requester'			=> array('UINT', 0),
! 					'attention_time'				=> array('TIMESTAMP', 0),
! 					'attention_close_time'			=> array('TIMESTAMP', 0),
! 					'attention_close_user'			=> array('UINT', 0),
! 					'attention_title'				=> array('STEXT_UNI', ''),
! 					'attention_description'			=> array('MTEXT_UNI', ''),
! 					'attention_poster_id'			=> array('UINT', 0),
! 					'attention_post_time'			=> array('TIMESTAMP', 0),
! 				),
! 				'PRIMARY_KEY'	=> 'attention_id',
! 				'KEYS'			=> array(
! 					'attention_type'				=> array('INDEX', 'attention_type'),
! 					'attention_object_type'			=> array('INDEX', 'attention_object_type'),
! 					'attention_object_id'			=> array('INDEX', 'attention_object_id'),
! 					'attention_time'				=> array('INDEX', 'attention_time'),
! 					'attention_close_time'			=> array('INDEX', 'attention_close_time'),
! 					'attention_close_user'			=> array('INDEX', 'attention_close_user'),
! 					'attention_poster_id'			=> array('INDEX', 'attention_poster_id'),
! 					'attention_post_time'			=> array('INDEX', 'attention_post_time'),
! 				),
! 			)),
! 			array(TITANIA_AUTOMOD_QUEUE_TABLE, array(
! 				'COLUMNS'		=> array(
! 					'row_id'					=> array('UINT', NULL, 'auto_increment'),
! 					'revision_id'				=> array('UINT', 0),
! 					'phpbb_version_branch'		=> array('TINT:1', 0),
! 					'phpbb_version_revision'	=> array('VCHAR', ''),
! 				),
! 				'PRIMARY_KEY'	=> 'row_id',
! 				'KEYS'			=> array(
! 					'revision_id'				=> array('INDEX', 'revision_id'),
! 				),
! 			)),
! 			array(TITANIA_AUTHORS_TABLE, array(
! 				'COLUMNS'		=> array(
! 					'author_id'				=> array('UINT', NULL, 'auto_increment'),
! 					'user_id'				=> array('UINT', 0),
! 					'phpbb_user_id'			=> array('UINT', 0),
! 					'author_realname'		=> array('VCHAR_CI', ''),
! 					'author_website'		=> array('VCHAR_UNI:200', ''),
! 					'author_rating'			=> array('DECIMAL', 0),
! 					'author_rating_count'	=> array('UINT', 0),
! 					'author_contribs'		=> array('UINT', 0), // Total # of contribs
! 					'author_snippets'		=> array('UINT', 0), // Number of snippets
! 					'author_mods'			=> array('UINT', 0), // Number of mods
! 					'author_styles'			=> array('UINT', 0), // Number of styles
! 					'author_visible'		=> array('BOOL', 1),
! 					'author_desc'			=> array('MTEXT_UNI', ''),
! 					'author_desc_bitfield'	=> array('VCHAR:255', ''),
! 					'author_desc_uid'		=> array('VCHAR:8', ''),
! 					'author_desc_options'	=> array('UINT:11', 7),
! 				),
! 				'PRIMARY_KEY'	=> 'author_id',
! 				'KEYS'			=> array(
! 					'user_id'				=> array('UNIQUE', 'user_id'),
! 					'author_rating'			=> array('INDEX', 'author_rating'),
! 					'author_contribs'		=> array('INDEX', 'author_contribs'),
! 					'author_snippets'		=> array('INDEX', 'author_snippets'),
! 					'author_mods'			=> array('INDEX', 'author_mods'),
! 					'author_styles'			=> array('INDEX', 'author_styles'),
! 					'author_visible'		=> array('INDEX', 'author_visible'),
! 				),
! 			)),
! 			array(TITANIA_CATEGORIES_TABLE, array(
! 				'COLUMNS'		=> array(
! 					'category_id'				=> array('UINT', NULL, 'auto_increment'),
! 					'parent_id'					=> array('UINT', 0),
! 					'left_id'					=> array('UINT', 0),
! 					'right_id'					=> array('UINT', 0),
! 					'category_type'				=> array('TINT:1', 0),
! 					'category_contribs'			=> array('UINT', 0), // Number of items
! 					'category_visible'			=> array('BOOL', 1),
! 					'category_name'				=> array('STEXT_UNI', '', 'true_sort'),
! 					'category_name_clean'		=> array('VCHAR_CI', ''),
! 					'category_desc'				=> array('MTEXT_UNI', ''),
! 					'category_desc_bitfield'	=> array('VCHAR:255', ''),
! 					'category_desc_uid'			=> array('VCHAR:8', ''),
! 					'category_desc_options'		=> array('UINT:11', 7),
! 				),
! 				'PRIMARY_KEY'	=> 'category_id',
! 				'KEYS'			=> array(
! 					'parent_id'			=> array('INDEX', 'parent_id'),
! 					'left_right_id'		=> array('INDEX', array('left_id', 'right_id')),
! 					'category_type'		=> array('INDEX', 'category_type'),
! 					'category_visible'	=> array('INDEX', 'category_visible'),
! 				),
! 			)),
! 			array(TITANIA_CONTRIBS_TABLE, array(
! 				'COLUMNS'		=> array(
! 					'contrib_id'					=> array('UINT', NULL, 'auto_increment'),
! 					'contrib_user_id'				=> array('UINT', 0),
! 					'contrib_type'					=> array('TINT:1', 0),
! 					'contrib_name'					=> array('STEXT_UNI', '', 'true_sort'),
! 					'contrib_name_clean'			=> array('VCHAR_CI', ''),
! 					'contrib_desc'					=> array('MTEXT_UNI', ''),
! 					'contrib_desc_bitfield'			=> array('VCHAR:255', ''),
! 					'contrib_desc_uid'				=> array('VCHAR:8', ''),
! 					'contrib_desc_options'			=> array('UINT:11', 7),
! 					'contrib_status'				=> array('TINT:2', 0),
! 					'contrib_downloads'				=> array('UINT', 0),
! 					'contrib_views'					=> array('UINT', 0),
! 					'contrib_rating'				=> array('DECIMAL', 0),
! 					'contrib_rating_count'			=> array('UINT', 0),
! 					'contrib_visible'				=> array('BOOL', 1),
! 					'contrib_last_update'			=> array('TIMESTAMP', 0),
! 					'contrib_demo'					=> array('VCHAR_UNI:200', ''),
! 					'contrib_release_topic_id'		=> array('UINT', 0),
! 				),
! 				'PRIMARY_KEY'	=> 'contrib_id',
! 				'KEYS'			=> array(
! 					'contrib_user_id'		=> array('INDEX', 'contrib_user_id'),
! 					'contrib_type'			=> array('INDEX', 'contrib_type'),
! 					'contrib_name_clean'	=> array('INDEX', 'contrib_name_clean'),
! 					'contrib_status'		=> array('INDEX', 'contrib_status'),
! 					'contrib_downloads'		=> array('INDEX', 'contrib_downloads'),
! 					'contrib_rating'		=> array('INDEX', 'contrib_rating'),
! 					'contrib_visible'		=> array('INDEX', 'contrib_visible'),
! 					'contrib_last_update'	=> array('INDEX', 'contrib_last_update'),
! 				),
! 			)),
! 			array(TITANIA_CONTRIB_COAUTHORS_TABLE, array(
! 				'COLUMNS'		=> array(
! 					'contrib_id'			=> array('UINT', 0),
! 					'user_id'				=> array('UINT', 0),
! 					'active'				=> array('BOOL', 0),
! 				),
! 				'PRIMARY_KEY'	=> array('contrib_id', 'user_id'),
! 				'KEYS'			=> array(
! 					'active'		=> array('INDEX', 'active'),
! 				),
! 			)),
! 			array(TITANIA_CONTRIB_FAQ_TABLE, array(
! 				'COLUMNS'		=> array(
! 					'faq_id'				=> array('UINT', NULL, 'auto_increment'),
! 					'contrib_id'			=> array('UINT', 0),
! 					'left_id'				=> array('UINT', 0),
! 					'right_id'				=> array('UINT', 0),
! 					'faq_subject'			=> array('STEXT_UNI', '', 'true_sort'),
! 					'faq_text'				=> array('MTEXT_UNI', ''),
! 					'faq_text_bitfield'		=> array('VCHAR:255', ''),
! 					'faq_text_uid'			=> array('VCHAR:8', ''),
! 					'faq_text_options'		=> array('UINT:11', 7),
! 					'faq_views'				=> array('UINT', 0),
! 					'faq_access'			=> array('TINT:1', 2),
! 				),
! 				'PRIMARY_KEY'	=> 'faq_id',
! 				'KEYS'			=> array(
! 					'contrib_id'		=> array('INDEX', 'contrib_id'),
! 					'faq_access'		=> array('INDEX', 'faq_access'),
! 					'left_right_id'		=> array('INDEX', array('left_id', 'right_id')),
! 				),
! 			)),
! 			array(TITANIA_CONTRIB_IN_CATEGORIES_TABLE, array(
! 				'COLUMNS'		=> array(
! 					'contrib_id'			=> array('UINT', 0),
! 					'category_id'			=> array('UINT', 0),
! 				),
! 				'PRIMARY_KEY'	=> array('contrib_id', 'category_id'),
! 			)),
! 			array(TITANIA_POSTS_TABLE, array(
! 				'COLUMNS'		=> array(
! 					'post_id'				=> array('UINT', NULL, 'auto_increment'),
! 					'topic_id'				=> array('UINT', 0),
! 					'post_url'				=> array('VCHAR_CI', ''),
! 					'post_type'				=> array('TINT:1', 0), // Post Type, Main TITANIA_ constants
! 					'post_access'			=> array('TINT:1', 0), // Access level, TITANIA_ACCESS_ constants
! 					'post_locked'			=> array('BOOL', 0),
! 					'post_approved'			=> array('BOOL', 1),
! 					'post_reported'			=> array('BOOL', 0),
! 					'post_attachment'		=> array('BOOL', 0),
! 					'post_user_id'			=> array('UINT', 0),
! 					'post_ip'				=> array('VCHAR:40', ''),
! 					'post_time'				=> array('UINT:11', 0),
! 					'post_edited'			=> array('UINT:11', 0), // Post edited; 0 for not edited, timestamp if (when) last edited
! 					'post_deleted'			=> array('UINT:11', 0), // Post deleted; 0 for not edited, timestamp if (when) last edited
! 					'post_delete_user'		=> array('UINT', 0), // The last user to delete the post
! 					'post_edit_user'		=> array('UINT', 0), // The last user to edit the post
! 					'post_edit_reason'		=> array('STEXT_UNI', ''), // Reason for deleting/editing
! 					'post_subject'			=> array('STEXT_UNI', '', 'true_sort'),
! 					'post_text'				=> array('MTEXT_UNI', '', 'true_sort'),
! 					'post_text_bitfield'	=> array('VCHAR:255', ''),
! 					'post_text_uid'			=> array('VCHAR:8', ''),
! 					'post_text_options'		=> array('UINT:11', 7),
! 				),
! 				'PRIMARY_KEY'	=> 'post_id',
! 				'KEYS'			=> array(
! 					'topic_id'				=> array('INDEX', 'topic_id'),
! 					'post_type'				=> array('INDEX', 'post_type'),
! 					'post_access'			=> array('INDEX', 'post_access'),
! 					'post_approved'			=> array('INDEX', 'post_approved'),
! 					'post_reported'			=> array('INDEX', 'post_reported'),
! 					'post_user_id'			=> array('INDEX', 'post_user_id'),
! 					'post_deleted'			=> array('INDEX', 'post_deleted'),
! 				),
! 			)),
! 			array(TITANIA_QUEUE_TABLE, array(
! 				'COLUMNS'		=> array(
! 					'queue_id'				=> array('UINT', NULL, 'auto_increment'),
! 					'revision_id'			=> array('UINT', 0),
! 					'contrib_id'			=> array('UINT', 0),
! 					'queue_type'			=> array('TINT:1', 0),
! 					'queue_status'			=> array('TINT:1', 0),
! 					'submitter_user_id'		=> array('UINT', 0),
! 					'queue_allow_repack'	=> array('BOOL', 1),
! 					'queue_notes'			=> array('MTEXT_UNI', ''),
! 					'queue_notes_bitfield'	=> array('VCHAR:255', ''),
! 					'queue_notes_uid'		=> array('VCHAR:8', ''),
! 					'queue_notes_options'	=> array('UINT:11', 7),
! 					'queue_validation_notes'			=> array('MTEXT_UNI', ''),
! 					'queue_validation_notes_bitfield'	=> array('VCHAR:255', ''),
! 					'queue_validation_notes_uid'		=> array('VCHAR:8', ''),
! 					'queue_validation_notes_options'	=> array('UINT:11', 7),
! 					'queue_submit_time'		=> array('UINT:11', 0),
! 					'queue_progress'		=> array('UINT', 0), // user_id
! 					'queue_progress_time'	=> array('UINT:11', 0),
! 					'queue_close_time'		=> array('UINT:11', 0),
! 					'queue_close_user'		=> array('UINT', 0),
! 					'queue_topic_id'		=> array('UINT', 0),
! 					'mpv_results'			=> array('MTEXT_UNI', ''),
! 					'mpv_results_bitfield'	=> array('VCHAR:255', ''),
! 					'mpv_results_uid'		=> array('VCHAR:8', ''),
! 					'automod_results'		=> array('MTEXT_UNI', ''),
! 				),
! 				'PRIMARY_KEY'	=> 'queue_id',
! 				'KEYS'			=> array(
! 					'revision_id'			=> array('INDEX', 'revision_id'),
! 					'contrib_id'			=> array('INDEX', 'contrib_id'),
! 					'queue_type'			=> array('INDEX', 'queue_type'),
! 					'queue_status'			=> array('INDEX', 'queue_status'),
! 					'submitter_user_id'		=> array('INDEX', 'submitter_user_id'),
! 					'queue_submit_time'		=> array('INDEX', 'queue_submit_time'),
! 				),
! 			)),
! 			array(TITANIA_RATINGS_TABLE, array(
! 				'COLUMNS'		=> array(
! 					'rating_id'				=> array('UINT', NULL, 'auto_increment'),
! 					'rating_type_id'		=> array('UINT', 0),
! 					'rating_user_id'		=> array('UINT', 0),
! 					'rating_object_id'		=> array('UINT', 0),
! 					'rating_value'			=> array('DECIMAL', 0), // Not sure if we should allow partial ratings (like 4.5/5) or just integer ratings...
! 				),
! 				'PRIMARY_KEY'	=> 'rating_id',
! 				'KEYS'			=> array(
! 					'type_user_object'		=> array('UNIQUE', array('rating_type_id', 'rating_user_id', 'rating_object_id')),
! 				),
! 			)),
! 			array(TITANIA_REVISIONS_TABLE, array(
! 				'COLUMNS'		=> array(
! 					'revision_id'				=> array('UINT', NULL, 'auto_increment'),
! 					'contrib_id'				=> array('UINT', 0),
! 					'attachment_id'				=> array('UINT', 0),
! 					'revision_version'			=> array('VCHAR', ''),
! 					'revision_name'				=> array('STEXT_UNI', '', 'true_sort'),
! 					'revision_time'				=> array('UINT:11', 0),
! 					'revision_validated'		=> array('UINT:11', 0),
! 					'validation_date'			=> array('UINT:11', 0),
! 					'install_time'				=> array('USINT', 0),
! 					'install_level'				=> array('TINT:1', 0),
! 					'revision_submitted'		=> array('BOOL', 0), // So we can hide the revision while we are creating it, false means someone is working on creating it (or did not finish creating it)
! 					'revision_queue_id'			=> array('UINT', 0),
! 				),
! 				'PRIMARY_KEY'	=> 'revision_id',
! 				'KEYS'			=> array(
! 					'contrib_id'			=> array('INDEX', 'contrib_id'),
! 					'revision_validated'	=> array('INDEX', 'revision_validated'),
! 					'revision_time'			=> array('INDEX', 'revision_time'),
! 					'validation_date'		=> array('INDEX', 'validation_date'),
! 					'revision_submitted'	=> array('INDEX', 'revision_submitted'),
! 					'revision_queue_id'		=> array('INDEX', 'revision_queue_id'),
! 				),
! 			)),
! 			array(TITANIA_REVISIONS_PHPBB_TABLE, array(
! 				'COLUMNS'		=> array(
! 					'row_id'					=> array('UINT', NULL, 'auto_increment'),
! 					'revision_id'				=> array('UINT', 0),
! 					'contrib_id'				=> array('UINT', 0),
! 					'phpbb_version_branch'		=> array('TINT:1', 0),
! 					'phpbb_version_revision'	=> array('VCHAR', ''),
! 					'revision_validated'		=> array('BOOL', 0),
! 				),
! 				'PRIMARY_KEY'	=> 'row_id',
! 				'KEYS'			=> array(
! 					'revision_id'				=> array('INDEX', 'revision_id'),
! 					'contrib_id'				=> array('INDEX', 'contrib_id'),
! 					'phpbb_version_branch'		=> array('INDEX', 'phpbb_version_branch'),
! 					'phpbb_version_revision'	=> array('INDEX', 'phpbb_version_revision'),
! 					'revision_validated'		=> array('INDEX', 'revision_validated'),
! 				),
! 			)),
! 			array(TITANIA_TAG_APPLIED_TABLE, array(
! 				'COLUMNS'		=> array(
! 					'object_type'			=> array('UINT', 0),
! 					'object_id'				=> array('UINT', 0),
! 					'tag_id'				=> array('UINT', 0),
! 					'tag_value'				=> array('STEXT_UNI', '', 'true_sort'),
! 				),
! 				'PRIMARY_KEY'	=> array('object_type', 'object_id', 'tag_id'),
! 			)),
! 			array(TITANIA_TAG_FIELDS_TABLE, array(
! 				'COLUMNS'		=> array(
! 					'tag_id'				=> array('UINT', NULL, 'auto_increment'),
! 					'tag_type_id'			=> array('UINT', 0),
! 					'tag_field_name'		=> array('XSTEXT_UNI', '', 'true_sort'),
! 					'tag_clean_name'		=> array('XSTEXT_UNI', '', 'true_sort'),
! 					'tag_field_desc'		=> array('STEXT_UNI', '', 'true_sort'),
! 					'no_delete'				=> array('BOOL', 0), // A few tags we have to hard-code (like new status for a queue item)
! 				),
! 				'PRIMARY_KEY'	=> 'tag_id',
! 				'KEYS'			=> array(
! 					'tag_type_id'			=> array('INDEX', 'tag_type_id'),
! 				),
! 			)),
! 			array(TITANIA_TAG_TYPES_TABLE, array(
! 				'COLUMNS'		=> array(
! 					'tag_type_id'			=> array('UINT', NULL, 'auto_increment'),
! 					'tag_type_name'			=> array('STEXT_UNI', '', 'true_sort'),
! 				),
! 				'PRIMARY_KEY'	=> 'tag_type_id',
! 			)),
! 			array(TITANIA_TOPICS_TABLE, array(
! 				'COLUMNS'		=> array(
! 					'topic_id'						=> array('UINT', NULL, 'auto_increment'),
! 					'parent_id'						=> array('UINT', 0),
! 					'topic_url'						=> array('VCHAR_CI', ''),
! 					'topic_type'					=> array('TINT:1', 0), // Post Type, Main TITANIA_ constants
! 					'topic_access'					=> array('TINT:1', 0), // Access level, TITANIA_ACCESS_ constants
! 					'topic_category'				=> array('UINT', 0), // Category for the topic. For the Tracker
! 					'topic_status'					=> array('UINT', 0), // Topic Status, use tags from the DB
! 					'topic_assigned'				=> array('VCHAR:255', ''), // Topic assigned status; u- for user, g- for group (followed by the id).  For the tracker
! 					'topic_time'					=> array('UINT:11', 0),
! 					'topic_sticky'					=> array('BOOL', 0),
! 					'topic_locked'					=> array('BOOL', 0),
! 					'topic_approved'				=> array('BOOL', 1),
! 					'topic_reported'				=> array('BOOL', 0), // True if any posts in the topic are reported
! 					'topic_views'					=> array('UINT', 0),
! 					'topic_posts'					=> array('VCHAR', ''), // Post count; separated by : between access levels ('10:9:8' = 10 team; 9 Mod Author; 8 Public)
! 					'topic_subject'					=> array('STEXT_UNI', ''),
! 					'topic_subject_clean'			=> array('STEXT_UNI', ''), // used for building the url
! 					'topic_first_post_id'			=> array('UINT', 0),
! 					'topic_first_post_user_id'		=> array('UINT', 0),
! 					'topic_first_post_username'		=> array('VCHAR_UNI', ''),
! 					'topic_first_post_user_colour'	=> array('VCHAR:6', ''),
! 					'topic_first_post_time'			=> array('UINT:11', 0),
! 					'topic_last_post_id'			=> array('UINT', 0),
! 					'topic_last_post_user_id'		=> array('UINT', 0),
! 					'topic_last_post_username'		=> array('VCHAR_UNI', ''),
! 					'topic_last_post_user_colour'	=> array('VCHAR:6', ''),
! 					'topic_last_post_time'			=> array('UINT:11', 0),
! 					'topic_last_post_subject'		=> array('STEXT_UNI', ''),
! 				),
! 				'PRIMARY_KEY'	=> 'topic_id',
! 				'KEYS'			=> array(
! 					'parent_id'				=> array('INDEX', 'parent_id'),
! 					'topic_type'			=> array('INDEX', 'topic_type'),
! 					'topic_access'			=> array('INDEX', 'topic_access'),
! 					'topic_category'		=> array('INDEX', 'topic_category'),
! 					'topic_status'			=> array('INDEX', 'topic_status'),
! 					'topic_assigned'		=> array('INDEX', 'topic_assigned'),
! 					'topic_sticky'			=> array('INDEX', 'topic_sticky'),
! 					'topic_approved'		=> array('INDEX', 'topic_approved'),
! 					'topic_reported'		=> array('INDEX', 'topic_reported'),
! 					'topic_time'			=> array('INDEX', 'topic_time'),
! 					'topic_last_post_time'	=> array('INDEX', 'topic_last_post_time'),
! 				),
! 			)),
! 			array(TITANIA_TRACK_TABLE, array(
! 				'COLUMNS'		=> array(
! 					'track_type'			=> array('UINT', 0),
! 					'track_id'				=> array('UINT', 0),
! 					'track_user_id'			=> array('UINT', 0),
! 					'track_time'			=> array('UINT:11', 0),
! 				),
! 				'PRIMARY_KEY'	=> array('track_type', 'track_id', 'track_user_id'),
! 			)),
! 			array(TITANIA_WATCH_TABLE, array(
! 				'COLUMNS'		=> array(
! 					'watch_type'			=> array('TINT:1', 0),
! 					'watch_object_type'		=> array('UINT', 0),
! 					'watch_object_id'		=> array('UINT', 0),
! 					'watch_user_id'			=> array('UINT', 0),
! 					'watch_mark_time'		=> array('UINT:11', 0),
! 				),
! 				'PRIMARY_KEY'	=> array('watch_object_type', 'watch_object_id', 'watch_user_id', 'watch_type'),
! 			)),
! 		),
! 
! 		'permission_add' => array(
! 			'u_titania_admin',				// Can administrate titania
! 
! 			'u_titania_mod_author_mod',		// Can moderate author profiles
! 			'u_titania_mod_contrib_mod',	// Can moderate all contrib items
! 			'u_titania_mod_rate_reset',		// Can reset the rating on items
! 			'u_titania_mod_faq_mod',		// Can moderate FAQ entries
! 			'u_titania_mod_post_mod',		// Can moderate topics
! 
! 			'u_titania_contrib_submit',		// Can submit contrib items
! 			'u_titania_rate',				// Can rate items
! 			'u_titania_faq_create',			// Can create FAQ entries
! 			'u_titania_faq_edit',			// Can edit own FAQ entries
! 			'u_titania_faq_delete',			// Can delete own FAQ entries
! 			'u_titania_topic',				// Can create new topics
! 			'u_titania_bbcode',				// Can post bbcode
! 			'u_titania_smilies',			// Can post smilies
! 			'u_titania_post',				// Can create new posts
! 			'u_titania_post_approved',		// Posts are approved?
! 			'u_titania_post_edit_own',		// Can edit own posts
! 			'u_titania_post_delete_own',	// Can delete own posts
! 			'u_titania_post_mod_own',		// Can moderate own contrib topics
! 			'u_titania_post_attach',		// Can attach files to posts
! 		),
! 
! 		'permission_role_add' => array(
! 			array('ROLE_TITANIA_MODIFICATION_TEAM', 'u_'),
! 			array('ROLE_TITANIA_STYLE_TEAM', 'u_'),
! 			array('ROLE_TITANIA_MODERATOR_TEAM', 'u_'),
! 			array('ROLE_TITANIA_ADMINISTRATOR_TEAM', 'u_'),
! 		),
! 
! 		'permission_set' => array(
! 			array('ROLE_ADMIN_FULL', array(
! 				'u_titania_admin',					// Can administrate titania
! 				'u_titania_mod_author_mod',			// Can moderate author profiles
! 				'u_titania_mod_contrib_mod',		// Can moderate all contrib items
! 				'u_titania_mod_rate_reset',			// Can reset the rating on items
! 				'u_titania_mod_faq_mod',			// Can moderate FAQ entries
! 				'u_titania_mod_post_mod',			// Can moderate topics
! 				'u_titania_mod_modification_queue',			// Can see the modifications queue
! 				'u_titania_mod_modification_validate',		// Can validate modifications
! 				'u_titania_mod_modification_moderate',		// Can moderate modifications
! 				'u_titania_mod_style_queue',		// Can see the styles queue
! 				'u_titania_mod_style_validate',		// Can validate styles
! 				'u_titania_mod_style_moderate',		// Can moderate styles
! 			)),
! 			array('ROLE_TITANIA_ADMINISTRATOR_TEAM', array(
! 				'u_titania_admin',					// Can administrate titania
! 				'u_titania_mod_author_mod',			// Can moderate author profiles
! 				'u_titania_mod_contrib_mod',		// Can moderate all contrib items
! 				'u_titania_mod_rate_reset',			// Can reset the rating on items
! 				'u_titania_mod_faq_mod',			// Can moderate FAQ entries
! 				'u_titania_mod_post_mod',			// Can moderate topics
! 				'u_titania_mod_modification_queue',			// Can see the modifications queue
! 				'u_titania_mod_modification_validate',		// Can validate modifications
! 				'u_titania_mod_modification_moderate',		// Can moderate modifications
! 				'u_titania_mod_style_queue',		// Can see the styles queue
! 				'u_titania_mod_style_validate',		// Can validate styles
! 				'u_titania_mod_style_moderate',		// Can moderate styles
! 			)),
! 			array('ROLE_TITANIA_MODIFICATION_TEAM', array(
! 				'u_titania_mod_author_mod',			// Can moderate author profiles
! 				'u_titania_mod_faq_mod',			// Can moderate FAQ entries
! 				'u_titania_mod_post_mod',			// Can moderate topics
! 				'u_titania_mod_modification_queue',			// Can see the modifications queue
! 				'u_titania_mod_modification_validate',		// Can validate modifications
! 				'u_titania_mod_modification_moderate',		// Can moderate modifications
! 			)),
! 			array('ROLE_TITANIA_STYLE_TEAM', array(
! 				'u_titania_mod_author_mod',			// Can moderate author profiles
! 				'u_titania_mod_faq_mod',			// Can moderate FAQ entries
! 				'u_titania_mod_post_mod',			// Can moderate topics
! 				'u_titania_mod_style_queue',		// Can see the styles queue
! 				'u_titania_mod_style_validate',		// Can validate styles
! 				'u_titania_mod_style_moderate',		// Can moderate styles
! 			)),
! 			array('ROLE_TITANIA_MODERATOR_TEAM', array(
! 				'u_titania_mod_author_mod',			// Can moderate author profiles
! 				'u_titania_mod_faq_mod',			// Can moderate FAQ entries
! 				'u_titania_mod_post_mod',			// Can moderate topics
! 			)),
! 			array('ROLE_USER_STANDARD', array(
! 				'u_titania_contrib_submit',		// Can submit contrib items
! 				'u_titania_rate',				// Can rate items
! 				'u_titania_faq_create',			// Can create FAQ entries
! 				'u_titania_faq_edit',			// Can edit own FAQ entries
! 				'u_titania_faq_delete',			// Can delete own FAQ entries
! 				'u_titania_topic',				// Can create new topics
! 				'u_titania_bbcode',				// Can post bbcode
! 				'u_titania_smilies',			// Can post smilies
! 				'u_titania_post',				// Can create new posts
! 				'u_titania_post_approved',		// Posts are approved?
! 				'u_titania_post_edit_own',		// Can edit own posts
! 				'u_titania_post_delete_own',	// Can delete own posts
! 				'u_titania_post_attach',		// Can attach files to posts
! 			)),
! 			array('ROLE_USER_FULL', array(
! 				'u_titania_contrib_submit',		// Can submit contrib items
! 				'u_titania_rate',				// Can rate items
! 				'u_titania_faq_create',			// Can create FAQ entries
! 				'u_titania_faq_edit',			// Can edit own FAQ entries
! 				'u_titania_faq_delete',			// Can delete own FAQ entries
! 				'u_titania_topic',				// Can create new topics
! 				'u_titania_bbcode',				// Can post bbcode
! 				'u_titania_smilies',			// Can post smilies
! 				'u_titania_post',				// Can create new posts
! 				'u_titania_post_approved',		// Posts are approved?
! 				'u_titania_post_edit_own',		// Can edit own posts
! 				'u_titania_post_delete_own',	// Can delete own posts
! 				'u_titania_post_attach',		// Can attach files to posts
! 			)),
! 		),
! 
! 		'config_add' => array(
! 			array('titania_num_contribs', 0, true),
! 		),
! 
! 		'custom' => array('titania_tags', 'titania_categories'),
! 
! 		'cache_purge' => '',
! 	),
! 
! 	'0.3.1' => array(
! 		'permission_add' => array(
! 			'u_titania_post_hard_delete',
! 		),
! 	),
! 
! 	'0.3.2' => array(
! 		'table_column_add' => array(
! 			array(TITANIA_REVISIONS_TABLE, 'revision_status', array('TINT:2', 0)),
! 		),
! 		'table_index_add' => array(
! 			array(TITANIA_REVISIONS_TABLE, 'revision_status'),
! 		),
! 
! 		'custom' => 'titania_custom',
! 
! 		'table_index_remove' => array(
! 			array(TITANIA_REVISIONS_TABLE, 'revision_validated'),
! 		),
! 
! 		'table_column_remove' => array(
! 			array(TITANIA_REVISIONS_TABLE, 'revision_validated'),
! 		),
! 	),
! 
! 	'0.3.3' => array(
! 		'table_column_add' => array(
! 			array(TITANIA_CONTRIBS_TABLE, 'contrib_faq_count', array('VCHAR', '')),
! 		),
! 
! 		'custom' => 'titania_custom',
! 	),
! 
! 	'0.3.4' => array(
! 		'table_column_add' => array(
! 			array(TITANIA_ATTACHMENTS_TABLE, 'attachment_user_id', array('UINT', 0)),
! 		),
! 	),
! 	
! 	'0.3.5' => array(
! 		'table_column_add' => array(
! 			array(TITANIA_CONTRIBS_TABLE, 'contrib_iso_code', array('VCHAR', '')),
! 			array(TITANIA_CONTRIBS_TABLE, 'contrib_local_name', array('VCHAR', '')),
! 		),
! 	),
! 	'0.3.5' => array(
! 		'table_column_add' => array(
! 			array(TITANIA_CONTRIBS_TABLE, 'contrib_iso_code', array('VCHAR', '')),
! 			array(TITANIA_CONTRIBS_TABLE, 'contrib_local_name', array('VCHAR', '')),
! 		),
! 	),
! 
! 	'0.3.6' => array(
! 		'table_column_add' => array(
! 			array(USERS_TABLE, 'titania_enhanced_editor', array('BOOL', true)),
! 		),
! 	),
! 
! 	'0.3.7' => array(
! 		'table_column_add' => array(
! 			array(TITANIA_REVISIONS_TABLE, 'revision_license', array('VCHAR', '')),
! 		),
! 	),
! 
! 	'0.3.8' => array(
! 		'table_column_add' => array(
! 			array(TITANIA_QUEUE_TABLE, 'allow_author_repack', array('BOOL', 0)),
! 		),
! 	),
! 	// IF YOU ADD A NEW VERSION DO NOT FORGET TO INCREMENT THE VERSION NUMBER IN common.php!
! );

Modified: branches/stable/titania/install.php
==============================================================================
*** branches/stable/titania/install.php (original)
--- branches/stable/titania/install.php Fri Nov 19 19:35:14 2010
***************
*** 1,47 ****
! <?php
! /**
!  *
!  * @package titania
!  * @version $Id$
!  * @copyright (c) 2008 phpBB Customisation Database Team
!  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
!  *
!  */
! 
! /**
!  * @ignore
!  */
! define('IN_TITANIA', true);
! define('IN_TITANIA_INSTALL', true);
! define('UMIL_AUTO', true);
! if (!defined('TITANIA_ROOT')) define('TITANIA_ROOT', './');
! if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
! include(TITANIA_ROOT . 'common.' . PHP_EXT);
! titania::add_lang('install');
! 
! // Hopefully this helps
! @set_time_limit(0);
! 
! include(TITANIA_ROOT . 'includes/functions_install.' . PHP_EXT);
! 
! // Just to be on the safe side, add a php version check.
! if (version_compare(PHP_VERSION, '5.2.0') < 0)
! {
! 	die('You are running an unsupported PHP version. Please upgrade to PHP 5.2.0 or higher before trying to install Titania');
! }
! 
! if (!file_exists(PHPBB_ROOT_PATH . 'umil/umil_auto.' . PHP_EXT))
! {
! 	trigger_error('Please download the latest UMIL (Unified MOD Install Library) from: <a href="http://www.phpbb.com/mods/umil/">phpBB.com/mods/umil</a>', E_USER_ERROR);
! }
! 
! // Make sure we are not using the same table prefix as phpBB (will cause conflicts).
! if (titania::$config->table_prefix == $GLOBALS['table_prefix'])
! {
! 	trigger_error('You can not use the same table prefix for Titania as you are using for phpBB.');
! }
! 
! // Include the versions/data file
! include(TITANIA_ROOT . 'includes/versions.' . PHP_EXT);
! 
  include(PHPBB_ROOT_PATH . 'umil/umil_auto.' . PHP_EXT);
\ No newline at end of file
--- 1,47 ----
! <?php
! /**
!  *
!  * @package titania
!  * @version $Id$
!  * @copyright (c) 2008 phpBB Customisation Database Team
!  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
!  *
!  */
! 
! /**
!  * @ignore
!  */
! define('IN_TITANIA', true);
! define('IN_TITANIA_INSTALL', true);
! define('UMIL_AUTO', true);
! if (!defined('TITANIA_ROOT')) define('TITANIA_ROOT', './');
! if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
! include(TITANIA_ROOT . 'common.' . PHP_EXT);
! titania::add_lang('install');
! 
! // Hopefully this helps
! @set_time_limit(0);
! 
! include(TITANIA_ROOT . 'includes/functions_install.' . PHP_EXT);
! 
! // Just to be on the safe side, add a php version check.
! if (version_compare(PHP_VERSION, '5.2.0') < 0)
! {
! 	die('You are running an unsupported PHP version. Please upgrade to PHP 5.2.0 or higher before trying to install Titania');
! }
! 
! if (!file_exists(PHPBB_ROOT_PATH . 'umil/umil_auto.' . PHP_EXT))
! {
! 	trigger_error('Please download the latest UMIL (Unified MOD Install Library) from: <a href="http://www.phpbb.com/mods/umil/">phpBB.com/mods/umil</a>', E_USER_ERROR);
! }
! 
! // Make sure we are not using the same table prefix as phpBB (will cause conflicts).
! if (titania::$config->table_prefix == $GLOBALS['table_prefix'])
! {
! 	trigger_error('You can not use the same table prefix for Titania as you are using for phpBB.');
! }
! 
! // Include the versions/data file
! include(TITANIA_ROOT . 'includes/versions.' . PHP_EXT);
! 
  include(PHPBB_ROOT_PATH . 'umil/umil_auto.' . PHP_EXT);
\ No newline at end of file

Modified: branches/stable/titania/js/common.js
==============================================================================
*** branches/stable/titania/js/common.js (original)
--- branches/stable/titania/js/common.js Fri Nov 19 19:35:14 2010
***************
*** 1,180 ****
! $(document).ready(function(){
! /* Not working...
! 	// AJAX Rate
! 	$("ul.rating li a, ul.rated li a").click(function(event){
! 		event.preventDefault();
! 
! 		// Get the child img id which holds some info we need.
! 		var child = $(this).children().attr('id');
! 
! 		// Child contains the object_id and the star number.
! 		var object = child.split('_');
! 
! 		// Set the red stars that we neeed to.
! 		for (i = 1; i <= max_rating; i++)
! 		{
! 			if (i <= object[1])
! 			{
! 				$('#rating_' + object[1] + '_' + i).attr({src: green_star.src});
! 			}
! 			else
! 			{
! 				$('#rating_' + object[1] + '_' + i).attr({src: grey_star.src});
! 			}
! 		}
! 
! 		if ($("#rating_" + object[1]).hasClass("rating"))
! 		{
! 			$("#rating_" + object[1]).removeClass("rating");
! 			$("#rating_" + object[1]).addClass("rated");
! 			$(this).unbind("hover");
! 			$("#rating_" + object[1] + "_remove").parent().parent().removeClass("hidden");
! 		}
! 		else
! 		{
! 			$("#rating_" + object[1]).removeClass("rated");
! 			$("#rating_" + object[1]).addClass("rating");
! 			$("#rating_" + object[1] + "_remove").parent().parent().addClass("hidden");
! 		}
! 
! 		return;
! 
! 		$.ajax({
! 			type: "POST",
! 			url: $(this).attr('href'),
! 			success: function() {
! 			}
! 		});
! 	});
! */
! 	// Rating hover functions
! 	$("ul.rating li a").hover(
! 		function(){
! 			// Over function. This will change the stars up to the point that was hovered on to red
! 
! 			// Get the child img id which holds some info we need.
! 			var child = $(this).children().attr('id');
! 
! 			// Child contains the object_id and the star number.
! 			var object = child.split('_');
! 
! 			// Set all the stars to grey first
! 			$('#rating_' + object[1] + " li a img").each(function() {
! 				$(this).attr({src: grey_star.src});
! 			});
! 
! 			// Set the red stars that we neeed to.
! 			for (i = 1; i <= object[2]; i++)
! 			{
! 				$('#rating_' + object[1] + '_' + i).attr({src: red_star.src});
! 			}
! 		},
! 		function(){
! 			// Out function. Reset to default stars
! 			$("ul.rating li a img.green").each(function() {
! 				$(this).attr({src: green_star.src});
! 			});
! 
! 			$("ul.rating li a img.orange").each(function() {
! 				$(this).attr({src: orange_star.src});
! 			});
! 
! 			$("ul.rating li a img.grey").each(function() {
! 				$(this).attr({src: grey_star.src});
! 			});
! 		}
! 	);
! 
! 	// Ajax Quick Edit
! 	$('.postbody > .profile-icons > .edit-icon').click(function() {
! 		var postbody = $(this).parent().parent();
! 		var post = $(postbody).children('.content');
! 
! 		// Ajax time
! 		$.ajax({
! 			type: "POST",
! 			url: $(post).parent().children('.quick_edit').val(),
! 			success: function(html){
! 				$(post).replaceWith(html);
! 
! 				var quickeditor = $(postbody).children('form').children('textarea');
! 
! 				// Make elastic and tabby
! 				$(quickeditor).elastic();
! 				$(quickeditor).tabby();
! 
! 				$(quickeditor).parent().children('.submit-buttons').children('[name=submit]').click(function() {
! 					$(this).parent().hide();
! 
! 					// Ajax time
! 					$.ajax({
! 						type: "POST",
! 						url: $(quickeditor).parent().attr('action'),
! 						data: $(quickeditor).parent().serialize() + '&submit=1',
! 						success: function(html){
! 							$(quickeditor).parent().replaceWith('<div class="content text-content">' + html + '</div>');
! 						}
! 					});
! 
! 					// Do not redirect
! 					return false;
! 				});
! 			}
! 		});
! 
! 		// Do not follow the link
! 		return false;
! 	});
! 
! 	// Show only the first five revisions
! 	$('.revisions > li').each(function(cnt) {
! 		if (cnt > 5)
! 		{
! 			// Hide the revision from the list
! 			$(this).hide();
! 
! 			$(this).parent().parent().children('.show-all').show();
! 		}
! 	});
! 
! 	// Hide all of the revision details
! 	$('.revision-details:not(.first)').hide();
! 
! 	// Show revision details on click
! 	$('.revisions > li').click(function() {
! 		$(this).children('.revision-details').toggle('fast');
! 	});
! 
! 	// Queue Subactions
! 	$('.queue-actions > li > .subactions').hide();
! 	$('.queue-actions > li').hover(function() {
! 		$(this).children('.subactions').toggle();
! 	}, function() {
! 		$(this).children('.subactions').toggle();
! 	});
! });
! 
! function hide_quotebox(box)
! {
! 	$(box).parent().children('div').hide();
! 	$(box).parent().children('.hide_quote').hide();
! 
! 	$(box).parent().children('.show_quote').show();
! }
! 
! function show_quotebox(box)
! {
! 	$(box).parent().children('div').show();
! 	$(box).parent().children('.show_quote').hide();
! 
! 	$(box).parent().children('.hide_quote').show();
! }
! 
! function show_all_revisions(box)
! {
! 	$(box).parent().children('.revisions').children('li').each(function(cnt) {
! 		$(this).show();
! 
! 		$(this).parent().parent().children('.show-all').hide();
! 	});
  }
\ No newline at end of file
--- 1,180 ----
! $(document).ready(function(){
! /* Not working...
! 	// AJAX Rate
! 	$("ul.rating li a, ul.rated li a").click(function(event){
! 		event.preventDefault();
! 
! 		// Get the child img id which holds some info we need.
! 		var child = $(this).children().attr('id');
! 
! 		// Child contains the object_id and the star number.
! 		var object = child.split('_');
! 
! 		// Set the red stars that we neeed to.
! 		for (i = 1; i <= max_rating; i++)
! 		{
! 			if (i <= object[1])
! 			{
! 				$('#rating_' + object[1] + '_' + i).attr({src: green_star.src});
! 			}
! 			else
! 			{
! 				$('#rating_' + object[1] + '_' + i).attr({src: grey_star.src});
! 			}
! 		}
! 
! 		if ($("#rating_" + object[1]).hasClass("rating"))
! 		{
! 			$("#rating_" + object[1]).removeClass("rating");
! 			$("#rating_" + object[1]).addClass("rated");
! 			$(this).unbind("hover");
! 			$("#rating_" + object[1] + "_remove").parent().parent().removeClass("hidden");
! 		}
! 		else
! 		{
! 			$("#rating_" + object[1]).removeClass("rated");
! 			$("#rating_" + object[1]).addClass("rating");
! 			$("#rating_" + object[1] + "_remove").parent().parent().addClass("hidden");
! 		}
! 
! 		return;
! 
! 		$.ajax({
! 			type: "POST",
! 			url: $(this).attr('href'),
! 			success: function() {
! 			}
! 		});
! 	});
! */
! 	// Rating hover functions
! 	$("ul.rating li a").hover(
! 		function(){
! 			// Over function. This will change the stars up to the point that was hovered on to red
! 
! 			// Get the child img id which holds some info we need.
! 			var child = $(this).children().attr('id');
! 
! 			// Child contains the object_id and the star number.
! 			var object = child.split('_');
! 
! 			// Set all the stars to grey first
! 			$('#rating_' + object[1] + " li a img").each(function() {
! 				$(this).attr({src: grey_star.src});
! 			});
! 
! 			// Set the red stars that we neeed to.
! 			for (i = 1; i <= object[2]; i++)
! 			{
! 				$('#rating_' + object[1] + '_' + i).attr({src: red_star.src});
! 			}
! 		},
! 		function(){
! 			// Out function. Reset to default stars
! 			$("ul.rating li a img.green").each(function() {
! 				$(this).attr({src: green_star.src});
! 			});
! 
! 			$("ul.rating li a img.orange").each(function() {
! 				$(this).attr({src: orange_star.src});
! 			});
! 
! 			$("ul.rating li a img.grey").each(function() {
! 				$(this).attr({src: grey_star.src});
! 			});
! 		}
! 	);
! 
! 	// Ajax Quick Edit
! 	$('.postbody > .profile-icons > .edit-icon').click(function() {
! 		var postbody = $(this).parent().parent();
! 		var post = $(postbody).children('.content');
! 
! 		// Ajax time
! 		$.ajax({
! 			type: "POST",
! 			url: $(post).parent().children('.quick_edit').val(),
! 			success: function(html){
! 				$(post).replaceWith(html);
! 
! 				var quickeditor = $(postbody).children('form').children('textarea');
! 
! 				// Make elastic and tabby
! 				$(quickeditor).elastic();
! 				$(quickeditor).tabby();
! 
! 				$(quickeditor).parent().children('.submit-buttons').children('[name=submit]').click(function() {
! 					$(this).parent().hide();
! 
! 					// Ajax time
! 					$.ajax({
! 						type: "POST",
! 						url: $(quickeditor).parent().attr('action'),
! 						data: $(quickeditor).parent().serialize() + '&submit=1',
! 						success: function(html){
! 							$(quickeditor).parent().replaceWith('<div class="content text-content">' + html + '</div>');
! 						}
! 					});
! 
! 					// Do not redirect
! 					return false;
! 				});
! 			}
! 		});
! 
! 		// Do not follow the link
! 		return false;
! 	});
! 
! 	// Show only the first five revisions
! 	$('.revisions > li').each(function(cnt) {
! 		if (cnt > 5)
! 		{
! 			// Hide the revision from the list
! 			$(this).hide();
! 
! 			$(this).parent().parent().children('.show-all').show();
! 		}
! 	});
! 
! 	// Hide all of the revision details
! 	$('.revision-details:not(.first)').hide();
! 
! 	// Show revision details on click
! 	$('.revisions > li').click(function() {
! 		$(this).children('.revision-details').toggle('fast');
! 	});
! 
! 	// Queue Subactions
! 	$('.queue-actions > li > .subactions').hide();
! 	$('.queue-actions > li').hover(function() {
! 		$(this).children('.subactions').toggle();
! 	}, function() {
! 		$(this).children('.subactions').toggle();
! 	});
! });
! 
! function hide_quotebox(box)
! {
! 	$(box).parent().children('div').hide();
! 	$(box).parent().children('.hide_quote').hide();
! 
! 	$(box).parent().children('.show_quote').show();
! }
! 
! function show_quotebox(box)
! {
! 	$(box).parent().children('div').show();
! 	$(box).parent().children('.show_quote').hide();
! 
! 	$(box).parent().children('.hide_quote').show();
! }
! 
! function show_all_revisions(box)
! {
! 	$(box).parent().children('.revisions').children('li').each(function(cnt) {
! 		$(this).show();
! 
! 		$(this).parent().parent().children('.show-all').hide();
! 	});
  }
\ No newline at end of file

Modified: branches/stable/titania/js/editor.js
==============================================================================
*** branches/stable/titania/js/editor.js (original)
--- branches/stable/titania/js/editor.js Fri Nov 19 19:35:14 2010
***************
*** 1,402 ****
! /**
! * bbCode control by subBlue design [ www.subBlue.com ]
! * Includes unixsafe colour palette selector by SHS`
! */
! 
! // Startup variables
! var imageTag = false;
! var theSelection = false;
! 
! // Check for Browser & Platform for PC & IE specific bits
! // More details from: http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html
! var clientPC = navigator.userAgent.toLowerCase(); // Get client info
! var clientVer = parseInt(navigator.appVersion); // Get browser version
! 
! var is_ie = ((clientPC.indexOf('msie') != -1) && (clientPC.indexOf('opera') == -1));
! var is_win = ((clientPC.indexOf('win') != -1) || (clientPC.indexOf('16bit') != -1));
! 
! var baseHeight;
! 
! /**
! * Shows the help messages in the helpline window
! */
! function helpline(help)
! {
! 	document.forms[form_name].helpbox.value = help_line[help];
! }
! 
! /**
! * Fix a bug involving the TextRange object. From
! * http://www.frostjedi.com/terra/scripts/demo/caretBug.html
! */
! function initInsertions()
! {
! 	var doc;
! 
! 	if (document.forms[form_name])
! 	{
! 		doc = document;
! 	}
! 	else
! 	{
! 		doc = opener.document;
! 	}
! 
! 	var textarea = doc.forms[form_name].elements[text_name];
! 
! 	if (is_ie && typeof(baseHeight) != 'number')
! 	{
! 		textarea.focus();
! 		baseHeight = doc.selection.createRange().duplicate().boundingHeight;
! 
! 		if (!document.forms[form_name])
! 		{
! 			document.body.focus();
! 		}
! 	}
! }
! 
! /**
! * bbstyle
! */
! function bbstyle(bbnumber)
! {
! 	if (bbnumber != -1)
! 	{
! 		bbfontstyle(bbtags[bbnumber], bbtags[bbnumber+1]);
! 	}
! 	else
! 	{
! 		insert_text('[*]');
! 		document.forms[form_name].elements[text_name].focus();
! 	}
! }
! 
! /**
! * Apply bbcodes
! */
! function bbfontstyle(bbopen, bbclose)
! {
! 	theSelection = false;
! 
! 	var textarea = document.forms[form_name].elements[text_name];
! 
! 	textarea.focus();
! 
! 	if ((clientVer >= 4) && is_ie && is_win)
! 	{
! 		// Get text selection
! 		theSelection = document.selection.createRange().text;
! 
! 		if (theSelection)
! 		{
! 			// Add tags around selection
! 			document.selection.createRange().text = bbopen + theSelection + bbclose;
! 			document.forms[form_name].elements[text_name].focus();
! 			theSelection = '';
! 			return;
! 		}
! 	}
! 	else if (document.forms[form_name].elements[text_name].selectionEnd && (document.forms[form_name].elements[text_name].selectionEnd - document.forms[form_name].elements[text_name].selectionStart > 0))
! 	{
! 		mozWrap(document.forms[form_name].elements[text_name], bbopen, bbclose);
! 		document.forms[form_name].elements[text_name].focus();
! 		theSelection = '';
! 		return;
! 	}
! 
! 	//The new position for the cursor after adding the bbcode
! 	var caret_pos = getCaretPosition(textarea).start;
! 	var new_pos = caret_pos + bbopen.length;
! 
! 	// Open tag
! 	insert_text(bbopen + bbclose);
! 
! 	// Center the cursor when we don't have a selection
! 	// Gecko and proper browsers
! 	if (!isNaN(textarea.selectionStart))
! 	{
! 		textarea.selectionStart = new_pos;
! 		textarea.selectionEnd = new_pos;
! 	}
! 	// IE
! 	else if (document.selection)
! 	{
! 		var range = textarea.createTextRange();
! 		range.move("character", new_pos);
! 		range.select();
! 		storeCaret(textarea);
! 	}
! 
! 	textarea.focus();
! 	return;
! }
! 
! /**
! * Insert text at position
! */
! function insert_text(text, spaces, popup)
! {
! 	var textarea;
! 
! 	if (!popup)
! 	{
! 		textarea = document.forms[form_name].elements[text_name];
! 	}
! 	else
! 	{
! 		textarea = opener.document.forms[form_name].elements[text_name];
! 	}
! 	if (spaces)
! 	{
! 		text = ' ' + text + ' ';
! 	}
! 
! 	if (!isNaN(textarea.selectionStart))
! 	{
! 		var sel_start = textarea.selectionStart;
! 		var sel_end = textarea.selectionEnd;
! 
! 		mozWrap(textarea, text, '')
! 		textarea.selectionStart = sel_start + text.length;
! 		textarea.selectionEnd = sel_end + text.length;
! 	}
! 	else if (textarea.createTextRange && textarea.caretPos)
! 	{
! 		if (baseHeight != textarea.caretPos.boundingHeight)
! 		{
! 			textarea.focus();
! 			storeCaret(textarea);
! 		}
! 
! 		var caret_pos = textarea.caretPos;
! 		caret_pos.text = caret_pos.text.charAt(caret_pos.text.length - 1) == ' ' ? caret_pos.text + text + ' ' : caret_pos.text + text;
! 	}
! 	else
! 	{
! 		textarea.value = textarea.value + text;
! 	}
! 	if (!popup)
! 	{
! 		textarea.focus();
! 	}
! }
! 
! /**
! * Add inline attachment at position
! */
! function attach_inline(index, filename)
! {
! 	insert_text('[attachment=' + index + ']' + filename + '[/attachment]');
! 	document.forms[form_name].elements[text_name].focus();
! }
! 
! /**
! * Add quote text to message
! */
! function addquote(post_id, username)
! {
! 	var message_name = 'message_' + post_id;
! 	var theSelection = '';
! 	var divarea = false;
! 
! 	if (document.all)
! 	{
! 		divarea = document.all[message_name];
! 	}
! 	else
! 	{
! 		divarea = document.getElementById(message_name);
! 	}
! 
! 	// Get text selection - not only the post content :(
! 	if (window.getSelection)
! 	{
! 		theSelection = window.getSelection().toString();
! 	}
! 	else if (document.getSelection)
! 	{
! 		theSelection = document.getSelection();
! 	}
! 	else if (document.selection)
! 	{
! 		theSelection = document.selection.createRange().text;
! 	}
! 
! 	if (theSelection == '' || typeof theSelection == 'undefined' || theSelection == null)
! 	{
! 		if (divarea.innerHTML)
! 		{
! 			theSelection = divarea.innerHTML.replace(/<br>/ig, '\n');
! 			theSelection = theSelection.replace(/<br\/>/ig, '\n');
! 			theSelection = theSelection.replace(/&lt\;/ig, '<');
! 			theSelection = theSelection.replace(/&gt\;/ig, '>');
! 			theSelection = theSelection.replace(/&amp\;/ig, '&');
! 			theSelection = theSelection.replace(/&nbsp\;/ig, ' ');
! 		}
! 		else if (document.all)
! 		{
! 			theSelection = divarea.innerText;
! 		}
! 		else if (divarea.textContent)
! 		{
! 			theSelection = divarea.textContent;
! 		}
! 		else if (divarea.firstChild.nodeValue)
! 		{
! 			theSelection = divarea.firstChild.nodeValue;
! 		}
! 	}
! 
! 	if (theSelection)
! 	{
! 		insert_text('[quote="' + username + '"]' + theSelection + '[/quote]');
! 	}
! 
! 	return;
! }
! 
! /**
! * From http://www.massless.org/mozedit/
! */
! function mozWrap(txtarea, open, close)
! {
! 	var selLength = txtarea.textLength;
! 	var selStart = txtarea.selectionStart;
! 	var selEnd = txtarea.selectionEnd;
! 	var scrollTop = txtarea.scrollTop;
! 
! 	if (selEnd == 1 || selEnd == 2)
! 	{
! 		selEnd = selLength;
! 	}
! 
! 	var s1 = (txtarea.value).substring(0,selStart);
! 	var s2 = (txtarea.value).substring(selStart, selEnd)
! 	var s3 = (txtarea.value).substring(selEnd, selLength);
! 
! 	txtarea.value = s1 + open + s2 + close + s3;
! 	txtarea.selectionStart = selEnd + open.length + close.length;
! 	txtarea.selectionEnd = txtarea.selectionStart;
! 	txtarea.focus();
! 	txtarea.scrollTop = scrollTop;
! 
! 	return;
! }
! 
! /**
! * Insert at Caret position. Code from
! * http://www.faqts.com/knowledge_base/view.phtml/aid/1052/fid/130
! */
! function storeCaret(textEl)
! {
! 	if (textEl.createTextRange)
! 	{
! 		textEl.caretPos = document.selection.createRange().duplicate();
! 	}
! }
! 
! /**
! * Color pallette
! */
! function colorPalette(dir, width, height)
! {
! 	var r = 0, g = 0, b = 0;
! 	var numberList = new Array(6);
! 	var color = '';
! 
! 	numberList[0] = '00';
! 	numberList[1] = '40';
! 	numberList[2] = '80';
! 	numberList[3] = 'BF';
! 	numberList[4] = 'FF';
! 
! 	document.writeln('<table cellspacing="1" cellpadding="0" border="0">');
! 
! 	for (r = 0; r < 5; r++)
! 	{
! 		if (dir == 'h')
! 		{
! 			document.writeln('<tr>');
! 		}
! 
! 		for (g = 0; g < 5; g++)
! 		{
! 			if (dir == 'v')
! 			{
! 				document.writeln('<tr>');
! 			}
! 
! 			for (b = 0; b < 5; b++)
! 			{
! 				color = String(numberList[r]) + String(numberList[g]) + String(numberList[b]);
! 				document.write('<td bgcolor="#' + color + '" style="width: ' + width + 'px; height: ' + height + 'px;">');
! 				document.write('<a href="#" onclick="bbfontstyle(\'[color=#' + color + ']\', \'[/color]\'); return false;"><img src="' + spacer_img + '" width="' + width + '" height="' + height + '" alt="#' + color + '" title="#' + color + '" /></a>');
! 				document.writeln('</td>');
! 			}
! 
! 			if (dir == 'v')
! 			{
! 				document.writeln('</tr>');
! 			}
! 		}
! 
! 		if (dir == 'h')
! 		{
! 			document.writeln('</tr>');
! 		}
! 	}
! 	document.writeln('</table>');
! }
! 
! 
! /**
! * Caret Position object
! */
! function caretPosition()
! {
! 	var start = null;
! 	var end = null;
! }
! 
! 
! /**
! * Get the caret position in an textarea
! */
! function getCaretPosition(txtarea)
! {
! 	var caretPos = new caretPosition();
! 
! 	// simple Gecko/Opera way
! 	if(txtarea.selectionStart || txtarea.selectionStart == 0)
! 	{
! 		caretPos.start = txtarea.selectionStart;
! 		caretPos.end = txtarea.selectionEnd;
! 	}
! 	// dirty and slow IE way
! 	else if(document.selection)
! 	{
! 
! 		// get current selection
! 		var range = document.selection.createRange();
! 
! 		// a new selection of the whole textarea
! 		var range_all = document.body.createTextRange();
! 		range_all.moveToElementText(txtarea);
! 
! 		// calculate selection start point by moving beginning of range_all to beginning of range
! 		var sel_start;
! 		for (sel_start = 0; range_all.compareEndPoints('StartToStart', range) < 0; sel_start++)
! 		{
! 			range_all.moveStart('character', 1);
! 		}
! 
! 		txtarea.sel_start = sel_start;
! 
! 		// we ignore the end value for IE, this is already dirty enough and we don't need it
! 		caretPos.start = txtarea.sel_start;
! 		caretPos.end = txtarea.sel_start;
! 	}
! 
! 	return caretPos;
  }
\ No newline at end of file
--- 1,402 ----
! /**
! * bbCode control by subBlue design [ www.subBlue.com ]
! * Includes unixsafe colour palette selector by SHS`
! */
! 
! // Startup variables
! var imageTag = false;
! var theSelection = false;
! 
! // Check for Browser & Platform for PC & IE specific bits
! // More details from: http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html
! var clientPC = navigator.userAgent.toLowerCase(); // Get client info
! var clientVer = parseInt(navigator.appVersion); // Get browser version
! 
! var is_ie = ((clientPC.indexOf('msie') != -1) && (clientPC.indexOf('opera') == -1));
! var is_win = ((clientPC.indexOf('win') != -1) || (clientPC.indexOf('16bit') != -1));
! 
! var baseHeight;
! 
! /**
! * Shows the help messages in the helpline window
! */
! function helpline(help)
! {
! 	document.forms[form_name].helpbox.value = help_line[help];
! }
! 
! /**
! * Fix a bug involving the TextRange object. From
! * http://www.frostjedi.com/terra/scripts/demo/caretBug.html
! */
! function initInsertions()
! {
! 	var doc;
! 
! 	if (document.forms[form_name])
! 	{
! 		doc = document;
! 	}
! 	else
! 	{
! 		doc = opener.document;
! 	}
! 
! 	var textarea = doc.forms[form_name].elements[text_name];
! 
! 	if (is_ie && typeof(baseHeight) != 'number')
! 	{
! 		textarea.focus();
! 		baseHeight = doc.selection.createRange().duplicate().boundingHeight;
! 
! 		if (!document.forms[form_name])
! 		{
! 			document.body.focus();
! 		}
! 	}
! }
! 
! /**
! * bbstyle
! */
! function bbstyle(bbnumber)
! {
! 	if (bbnumber != -1)
! 	{
! 		bbfontstyle(bbtags[bbnumber], bbtags[bbnumber+1]);
! 	}
! 	else
! 	{
! 		insert_text('[*]');
! 		document.forms[form_name].elements[text_name].focus();
! 	}
! }
! 
! /**
! * Apply bbcodes
! */
! function bbfontstyle(bbopen, bbclose)
! {
! 	theSelection = false;
! 
! 	var textarea = document.forms[form_name].elements[text_name];
! 
! 	textarea.focus();
! 
! 	if ((clientVer >= 4) && is_ie && is_win)
! 	{
! 		// Get text selection
! 		theSelection = document.selection.createRange().text;
! 
! 		if (theSelection)
! 		{
! 			// Add tags around selection
! 			document.selection.createRange().text = bbopen + theSelection + bbclose;
! 			document.forms[form_name].elements[text_name].focus();
! 			theSelection = '';
! 			return;
! 		}
! 	}
! 	else if (document.forms[form_name].elements[text_name].selectionEnd && (document.forms[form_name].elements[text_name].selectionEnd - document.forms[form_name].elements[text_name].selectionStart > 0))
! 	{
! 		mozWrap(document.forms[form_name].elements[text_name], bbopen, bbclose);
! 		document.forms[form_name].elements[text_name].focus();
! 		theSelection = '';
! 		return;
! 	}
! 
! 	//The new position for the cursor after adding the bbcode
! 	var caret_pos = getCaretPosition(textarea).start;
! 	var new_pos = caret_pos + bbopen.length;
! 
! 	// Open tag
! 	insert_text(bbopen + bbclose);
! 
! 	// Center the cursor when we don't have a selection
! 	// Gecko and proper browsers
! 	if (!isNaN(textarea.selectionStart))
! 	{
! 		textarea.selectionStart = new_pos;
! 		textarea.selectionEnd = new_pos;
! 	}
! 	// IE
! 	else if (document.selection)
! 	{
! 		var range = textarea.createTextRange();
! 		range.move("character", new_pos);
! 		range.select();
! 		storeCaret(textarea);
! 	}
! 
! 	textarea.focus();
! 	return;
! }
! 
! /**
! * Insert text at position
! */
! function insert_text(text, spaces, popup)
! {
! 	var textarea;
! 
! 	if (!popup)
! 	{
! 		textarea = document.forms[form_name].elements[text_name];
! 	}
! 	else
! 	{
! 		textarea = opener.document.forms[form_name].elements[text_name];
! 	}
! 	if (spaces)
! 	{
! 		text = ' ' + text + ' ';
! 	}
! 
! 	if (!isNaN(textarea.selectionStart))
! 	{
! 		var sel_start = textarea.selectionStart;
! 		var sel_end = textarea.selectionEnd;
! 
! 		mozWrap(textarea, text, '')
! 		textarea.selectionStart = sel_start + text.length;
! 		textarea.selectionEnd = sel_end + text.length;
! 	}
! 	else if (textarea.createTextRange && textarea.caretPos)
! 	{
! 		if (baseHeight != textarea.caretPos.boundingHeight)
! 		{
! 			textarea.focus();
! 			storeCaret(textarea);
! 		}
! 
! 		var caret_pos = textarea.caretPos;
! 		caret_pos.text = caret_pos.text.charAt(caret_pos.text.length - 1) == ' ' ? caret_pos.text + text + ' ' : caret_pos.text + text;
! 	}
! 	else
! 	{
! 		textarea.value = textarea.value + text;
! 	}
! 	if (!popup)
! 	{
! 		textarea.focus();
! 	}
! }
! 
! /**
! * Add inline attachment at position
! */
! function attach_inline(index, filename)
! {
! 	insert_text('[attachment=' + index + ']' + filename + '[/attachment]');
! 	document.forms[form_name].elements[text_name].focus();
! }
! 
! /**
! * Add quote text to message
! */
! function addquote(post_id, username)
! {
! 	var message_name = 'message_' + post_id;
! 	var theSelection = '';
! 	var divarea = false;
! 
! 	if (document.all)
! 	{
! 		divarea = document.all[message_name];
! 	}
! 	else
! 	{
! 		divarea = document.getElementById(message_name);
! 	}
! 
! 	// Get text selection - not only the post content :(
! 	if (window.getSelection)
! 	{
! 		theSelection = window.getSelection().toString();
! 	}
! 	else if (document.getSelection)
! 	{
! 		theSelection = document.getSelection();
! 	}
! 	else if (document.selection)
! 	{
! 		theSelection = document.selection.createRange().text;
! 	}
! 
! 	if (theSelection == '' || typeof theSelection == 'undefined' || theSelection == null)
! 	{
! 		if (divarea.innerHTML)
! 		{
! 			theSelection = divarea.innerHTML.replace(/<br>/ig, '\n');
! 			theSelection = theSelection.replace(/<br\/>/ig, '\n');
! 			theSelection = theSelection.replace(/&lt\;/ig, '<');
! 			theSelection = theSelection.replace(/&gt\;/ig, '>');
! 			theSelection = theSelection.replace(/&amp\;/ig, '&');
! 			theSelection = theSelection.replace(/&nbsp\;/ig, ' ');
! 		}
! 		else if (document.all)
! 		{
! 			theSelection = divarea.innerText;
! 		}
! 		else if (divarea.textContent)
! 		{
! 			theSelection = divarea.textContent;
! 		}
! 		else if (divarea.firstChild.nodeValue)
! 		{
! 			theSelection = divarea.firstChild.nodeValue;
! 		}
! 	}
! 
! 	if (theSelection)
! 	{
! 		insert_text('[quote="' + username + '"]' + theSelection + '[/quote]');
! 	}
! 
! 	return;
! }
! 
! /**
! * From http://www.massless.org/mozedit/
! */
! function mozWrap(txtarea, open, close)
! {
! 	var selLength = txtarea.textLength;
! 	var selStart = txtarea.selectionStart;
! 	var selEnd = txtarea.selectionEnd;
! 	var scrollTop = txtarea.scrollTop;
! 
! 	if (selEnd == 1 || selEnd == 2)
! 	{
! 		selEnd = selLength;
! 	}
! 
! 	var s1 = (txtarea.value).substring(0,selStart);
! 	var s2 = (txtarea.value).substring(selStart, selEnd)
! 	var s3 = (txtarea.value).substring(selEnd, selLength);
! 
! 	txtarea.value = s1 + open + s2 + close + s3;
! 	txtarea.selectionStart = selEnd + open.length + close.length;
! 	txtarea.selectionEnd = txtarea.selectionStart;
! 	txtarea.focus();
! 	txtarea.scrollTop = scrollTop;
! 
! 	return;
! }
! 
! /**
! * Insert at Caret position. Code from
! * http://www.faqts.com/knowledge_base/view.phtml/aid/1052/fid/130
! */
! function storeCaret(textEl)
! {
! 	if (textEl.createTextRange)
! 	{
! 		textEl.caretPos = document.selection.createRange().duplicate();
! 	}
! }
! 
! /**
! * Color pallette
! */
! function colorPalette(dir, width, height)
! {
! 	var r = 0, g = 0, b = 0;
! 	var numberList = new Array(6);
! 	var color = '';
! 
! 	numberList[0] = '00';
! 	numberList[1] = '40';
! 	numberList[2] = '80';
! 	numberList[3] = 'BF';
! 	numberList[4] = 'FF';
! 
! 	document.writeln('<table cellspacing="1" cellpadding="0" border="0">');
! 
! 	for (r = 0; r < 5; r++)
! 	{
! 		if (dir == 'h')
! 		{
! 			document.writeln('<tr>');
! 		}
! 
! 		for (g = 0; g < 5; g++)
! 		{
! 			if (dir == 'v')
! 			{
! 				document.writeln('<tr>');
! 			}
! 
! 			for (b = 0; b < 5; b++)
! 			{
! 				color = String(numberList[r]) + String(numberList[g]) + String(numberList[b]);
! 				document.write('<td bgcolor="#' + color + '" style="width: ' + width + 'px; height: ' + height + 'px;">');
! 				document.write('<a href="#" onclick="bbfontstyle(\'[color=#' + color + ']\', \'[/color]\'); return false;"><img src="' + spacer_img + '" width="' + width + '" height="' + height + '" alt="#' + color + '" title="#' + color + '" /></a>');
! 				document.writeln('</td>');
! 			}
! 
! 			if (dir == 'v')
! 			{
! 				document.writeln('</tr>');
! 			}
! 		}
! 
! 		if (dir == 'h')
! 		{
! 			document.writeln('</tr>');
! 		}
! 	}
! 	document.writeln('</table>');
! }
! 
! 
! /**
! * Caret Position object
! */
! function caretPosition()
! {
! 	var start = null;
! 	var end = null;
! }
! 
! 
! /**
! * Get the caret position in an textarea
! */
! function getCaretPosition(txtarea)
! {
! 	var caretPos = new caretPosition();
! 
! 	// simple Gecko/Opera way
! 	if(txtarea.selectionStart || txtarea.selectionStart == 0)
! 	{
! 		caretPos.start = txtarea.selectionStart;
! 		caretPos.end = txtarea.selectionEnd;
! 	}
! 	// dirty and slow IE way
! 	else if(document.selection)
! 	{
! 
! 		// get current selection
! 		var range = document.selection.createRange();
! 
! 		// a new selection of the whole textarea
! 		var range_all = document.body.createTextRange();
! 		range_all.moveToElementText(txtarea);
! 
! 		// calculate selection start point by moving beginning of range_all to beginning of range
! 		var sel_start;
! 		for (sel_start = 0; range_all.compareEndPoints('StartToStart', range) < 0; sel_start++)
! 		{
! 			range_all.moveStart('character', 1);
! 		}
! 
! 		txtarea.sel_start = sel_start;
! 
! 		// we ignore the end value for IE, this is already dirty enough and we don't need it
! 		caretPos.start = txtarea.sel_start;
! 		caretPos.end = txtarea.sel_start;
! 	}
! 
! 	return caretPos;
  }
\ No newline at end of file




More information about the customisationdb-commits mailing list