[Customisation Database Commits] r223 [2/2] - in /trunk/titania: contributions/ includes/ includes/core/ includes/objects/ install/ language/en/ modules/authors/info/ modules/contribs/ modules/contribs/info/ modules/titania/info/
Nathan Guse
exreaction at phpbb.com
Tue Jun 16 21:58:05 UTC 2009
Removed: trunk/titania/install/shema_dump.sql
==============================================================================
*** trunk/titania/install/shema_dump.sql (original)
--- trunk/titania/install/shema_dump.sql (removed)
***************
*** 1,229 ****
- SET NAMES utf8;
- SET FOREIGN_KEY_CHECKS = 0;
-
- CREATE TABLE `customisation_authors` (
- `author_id` mediumint(8) unsigned NOT NULL auto_increment,
- `user_id` mediumint(8) unsigned NOT NULL default '0',
- `phpbb_user_id` mediumint(8) unsigned NOT NULL default '0',
- `author_username` varchar(255) collate utf8_bin NOT NULL,
- `author_username_clean` varchar(255) collate utf8_bin NOT NULL,
- `author_realname` varchar(255) collate utf8_bin NOT NULL,
- `author_website` varchar(200) collate utf8_bin NOT NULL,
- `author_email` varchar(100) collate utf8_bin NOT NULL,
- `author_email_hash` bigint(20) NOT NULL default '0',
- `author_rating` decimal(11,9) unsigned NOT NULL default '0.000000000',
- `author_rating_count` mediumint(8) unsigned NOT NULL default '0',
- `author_contribs` mediumint(8) unsigned NOT NULL default '0',
- `author_snippets` mediumint(8) unsigned NOT NULL default '0',
- `author_mods` mediumint(8) unsigned NOT NULL default '0',
- `author_styles` mediumint(8) unsigned NOT NULL default '0',
- `author_visible` tinyint(1) unsigned NOT NULL default '1',
- PRIMARY KEY (`author_id`),
- KEY `user_id` (`user_id`),
- KEY `author_email_hash` (`author_email_hash`),
- KEY `author_visible` (`author_visible`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-
- insert into `customisation_authors` values('2','2','165089','Highway of Life','highway of life','David Lewis','http://startrekguide.com','highwayoflife@gmail.com','175420516723','0.000000000','0','1','0','1','0','1');
-
- CREATE TABLE `customisation_contrib_faq` (
- `faq_id` mediumint(8) unsigned NOT NULL auto_increment,
- `contrib_id` mediumint(8) unsigned NOT NULL default '0',
- `parent_id` mediumint(8) unsigned NOT NULL default '0',
- `revision_id` mediumint(8) unsigned NOT NULL default '0',
- `faq_order_id` mediumint(8) unsigned NOT NULL default '0',
- `faq_subject` varchar(255) collate utf8_bin NOT NULL default '',
- `faq_text` mediumtext collate utf8_bin NOT NULL,
- `faq_text_bitfield` varchar(255) collate utf8_bin NOT NULL,
- `faq_text_uid` varchar(8) collate utf8_bin NOT NULL,
- `faq_text_options` int(11) unsigned NOT NULL default '7',
- PRIMARY KEY (`faq_id`),
- KEY `contrib_id` (`contrib_id`),
- KEY `parent_id` (`parent_id`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-
- insert into `customisation_contrib_faq` values('1','1','','1.0.1','','This is a faq test!',' 0x61206661712074657874206c6f6f6b206174206d652e','','','7');
-
-
- CREATE TABLE `customisation_contrib_tags` (
- `contrib_id` mediumint(8) unsigned NOT NULL default '0',
- `tag_id` mediumint(8) unsigned NOT NULL default '0',
- `tag_value` varchar(255) collate utf8_bin NOT NULL,
- PRIMARY KEY (`contrib_id`,`tag_id`),
- KEY `tag_id` (`tag_id`),
- KEY `contrib_id` (`contrib_id`),
- CONSTRAINT `fk_tags_contrib_id` FOREIGN KEY (`contrib_id`) REFERENCES `customisation_contribs` (`contrib_id`),
- CONSTRAINT `fk_tags_tag_id` FOREIGN KEY (`tag_id`) REFERENCES `customisation_tag_fields` (`tag_id`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-
- insert into `customisation_contrib_tags` values('1','2','');
-
- CREATE TABLE `customisation_contribs` (
- `contrib_id` mediumint(8) unsigned NOT NULL auto_increment,
- `contrib_type` tinyint(1) unsigned NOT NULL default '1',
- `contrib_name` varchar(255) collate utf8_bin NOT NULL,
- `contrib_description` mediumtext collate utf8_bin NOT NULL,
- `contrib_desc_bitfield` varchar(255) collate utf8_bin NOT NULL,
- `contrib_desc_options` int(11) unsigned NOT NULL default '7',
- `contrib_desc_uid` varchar(8) collate utf8_bin NOT NULL,
- `contrib_status` tinyint(2) unsigned NOT NULL default '0',
- `contrib_version` varchar(15) collate utf8_bin NOT NULL,
- `contrib_revision` mediumint(8) unsigned NOT NULL default '0',
- `contrib_validated_revision` mediumint(8) unsigned NOT NULL default '0',
- `contrib_author_id` mediumint(8) unsigned NOT NULL default '0',
- `contrib_maintainer` mediumint(8) unsigned NOT NULL default '0',
- `contrib_downloads` mediumint(8) unsigned NOT NULL default '0',
- `contrib_views` mediumint(8) unsigned NOT NULL default '0',
- `contrib_phpbb_version` tinyint(2) unsigned NOT NULL default '0',
- `contrib_release_date` int(11) unsigned NOT NULL default '0',
- `contrib_update_date` int(11) unsigned NOT NULL default '0',
- `contrib_visibility` tinyint(1) unsigned NOT NULL default '0',
- `contrib_rating` decimal(11,9) unsigned NOT NULL default '0.000000000',
- `contrib_rating_count` mediumint(8) unsigned NOT NULL default '0',
- `contrib_demo` varchar(255) collate utf8_bin NOT NULL,
- PRIMARY KEY (`contrib_id`),
- KEY `contrib_author_id` (`contrib_author_id`),
- KEY `contrib_status` (`contrib_status`),
- KEY `contrib_visibility` (`contrib_visibility`),
- KEY `contrib_phpbb_version` (`contrib_phpbb_version`),
- KEY `contrib_rating` (`contrib_rating`),
- KEY `contrib_downloads` (`contrib_downloads`),
- KEY `contrib_id` (`contrib_id`),
- CONSTRAINT `fk_author_id` FOREIGN KEY (`contrib_author_id`) REFERENCES `customisation_authors` (`author_id`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-
- insert into `customisation_contribs` values('1','1','ACP Add User MOD',0x416464732061206e6577204d6f64756c65207468617420656e61626c657320616e2041646d696e6973747261746f7220746f206372656174652061206e65772075736572206163636f756e74207468726f756768207468652041646d696e697374726174696f6e20436f6e74726f6c2050616e656c2028414350292e0a4164647320616e206578747261207065726d697373696f6e20746f20616c6c6f772061646d696e6973747261746f7220746f206372656174652061206e65772075736572206163636f756e742e0a4769766573207468652061646d696e6973747261746f7220746865206162696c69747920746f20696e7374616e746c7920617070726f76652061206e6577206d656d626572206166746572206372656174696f6e2e,'','7','','1','1.0.1','1','1','2','0','5','20','3','1220301000','0','1','0.000000000','0','');
-
- CREATE TABLE `customisation_downloads` (
- `download_id` mediumint(8) unsigned NOT NULL auto_increment,
- `revision_id` mediumint(8) unsigned NOT NULL default '0',
- `download_type` tinyint(1) unsigned NOT NULL default '0',
- `download_status` tinyint(1) unsigned NOT NULL default '0',
- `filesize` int(11) unsigned NOT NULL default '0',
- `filetime` int(11) unsigned NOT NULL default '0',
- `physical_filename` varchar(255) collate utf8_bin NOT NULL,
- `real_filename` varchar(255) collate utf8_bin NOT NULL,
- `download_count` mediumint(8) unsigned NOT NULL default '0',
- `extension` varchar(100) collate utf8_bin NOT NULL,
- `mimetype` varchar(100) collate utf8_bin NOT NULL,
- `download_hash` varchar(32) collate utf8_bin NOT NULL,
- `download_url` varchar(255) collate utf8_bin NOT NULL,
- `thumbnail` tinyint(1) unsigned NOT NULL default '0',
- PRIMARY KEY (`download_id`),
- KEY `revision_id` (`revision_id`),
- KEY `download_type` (`download_type`),
- CONSTRAINT `fk_download_revision_id` FOREIGN KEY (`revision_id`) REFERENCES `customisation_revisions` (`revision_id`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-
-
- CREATE TABLE `customisation_queue` (
- `queue_id` mediumint(8) unsigned NOT NULL auto_increment,
- `revision_id` mediumint(8) unsigned NOT NULL default '0',
- `queue_type` tinyint(1) unsigned NOT NULL default '0',
- `queue_status` tinyint(1) unsigned NOT NULL default '0',
- `topic_id` mediumint(8) unsigned NOT NULL default '0',
- `contrib_id` mediumint(8) unsigned NOT NULL default '0',
- `submitter_user_id` mediumint(8) unsigned NOT NULL default '0',
- `queue_notes` mediumtext collate utf8_bin NOT NULL,
- `queue_notes_bitfield` varchar(255) collate utf8_bin NOT NULL,
- `queue_notes_options` int(11) unsigned NOT NULL default '0',
- `queue_notes_uid` varchar(8) collate utf8_bin NOT NULL,
- `queue_progress` tinyint(3) unsigned NOT NULL default '0',
- `queue_submit_time` int(11) unsigned NOT NULL default '0',
- `queue_close_time` int(11) unsigned NOT NULL default '0',
- PRIMARY KEY (`queue_id`),
- KEY `topic_id` (`topic_id`),
- KEY `contrib_id` (`contrib_id`),
- KEY `queue_type` (`queue_type`),
- KEY `queue_status` (`queue_status`),
- KEY `revision_id` (`revision_id`),
- KEY `submitter_user_id` (`submitter_user_id`),
- KEY `queue_id` (`queue_id`),
- CONSTRAINT `fk_queue_contrib_id` FOREIGN KEY (`contrib_id`) REFERENCES `customisation_contribs` (`contrib_id`),
- CONSTRAINT `fk_queue_revision_id` FOREIGN KEY (`revision_id`) REFERENCES `customisation_revisions` (`revision_id`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-
-
- CREATE TABLE `customisation_queue_history` (
- `history_id` mediumint(8) unsigned NOT NULL auto_increment,
- `queue_id` mediumint(8) unsigned NOT NULL default '0',
- `user_id` mediumint(8) unsigned NOT NULL default '0',
- PRIMARY KEY (`history_id`),
- KEY `queue_id` (`queue_id`),
- CONSTRAINT `fk_history_queue_id` FOREIGN KEY (`queue_id`) REFERENCES `customisation_queue` (`queue_id`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-
-
- CREATE TABLE `customisation_reviews` (
- `review_id` mediumint(8) unsigned NOT NULL auto_increment,
- `contrib_id` mediumint(8) unsigned NOT NULL default '0',
- `review_text` mediumtext collate utf8_bin NOT NULL,
- `review_text_bitfield` varchar(255) collate utf8_bin NOT NULL,
- `review_text_uid` varchar(8) collate utf8_bin NOT NULL,
- `review_text_options` int(11) unsigned NOT NULL default '7',
- `review_rating` tinyint(1) unsigned NOT NULL default '3',
- `review_user_id` mediumint(8) unsigned NOT NULL default '0',
- `review_status` tinyint(1) unsigned NOT NULL default '1',
- `review_time` int(11) unsigned NOT NULL default '0',
- PRIMARY KEY (`review_id`),
- KEY `review_user_id` (`review_user_id`),
- KEY `review_status` (`review_status`),
- KEY `contrib_id` (`contrib_id`),
- CONSTRAINT `fk_review_contrib_id` FOREIGN KEY (`contrib_id`) REFERENCES `customisation_contribs` (`contrib_id`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-
-
- CREATE TABLE `customisation_revisions` (
- `revision_id` mediumint(8) unsigned NOT NULL auto_increment,
- `contrib_id` mediumint(8) unsigned NOT NULL default '0',
- `contrib_type` tinyint(1) unsigned NOT NULL default '0',
- `revision_name` varchar(100) collate utf8_bin NOT NULL,
- `revision_time` int(11) unsigned NOT NULL default '0',
- PRIMARY KEY (`revision_id`),
- KEY `contrib_id` (`contrib_id`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-
- insert into `customisation_revisions` values('1','1','1','1.0.0','1220301000');
-
- CREATE TABLE `customisation_tag_fields` (
- `tag_id` mediumint(8) unsigned NOT NULL auto_increment,
- `tag_type_id` mediumint(8) unsigned NOT NULL default '0',
- `tag_field_name` varchar(100) collate utf8_bin NOT NULL,
- `tag_field_desc` varchar(255) collate utf8_bin NOT NULL,
- `tag_clean_name` varchar(100) collate utf8_bin NOT NULL,
- PRIMARY KEY (`tag_id`),
- KEY `tag_type_id` (`tag_type_id`),
- KEY `tag_id` (`tag_id`),
- CONSTRAINT `fk_tag_type_id` FOREIGN KEY (`tag_type_id`) REFERENCES `customisation_tag_types` (`tag_type_id`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-
- insert into `customisation_tag_fields` values('1','1','Add-ons','Add-on MOds','add-ons'),
- ('2','1','ACP Modules','Administration Control Panel Module','acp modules'),
- ('3','1','MCP Modules','Moderator Control Panel Module','mcp modules'),
- ('4','1','UCP Modules','User Control Panel Module','ucp modules'),
- ('5','1','Search','Search plugins and Modifications','search'),
- ('6','1','Anti-Spam','Anti-Spam tools, Add-ons and MODs','anti-spam'),
- ('7','1','Entertainment','Entertainment and Games MODs','entertainment'),
- ('8','1','Syndication','RSS Feed and Syndication MODs','syndication');
-
- CREATE TABLE `customisation_tag_types` (
- `tag_type_id` mediumint(8) unsigned NOT NULL auto_increment,
- `tag_type_name` varchar(255) collate utf8_bin NOT NULL,
- PRIMARY KEY (`tag_type_id`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-
- insert into `customisation_tag_types` values('1','MOD_CATEGORY'),
- ('2','COMPONENT'),
- ('3','COMPLEXITY');
-
- CREATE TABLE `customisation_watch` (
- `contrib_id` mediumint(8) unsigned NOT NULL default '0',
- `user_id` mediumint(8) unsigned NOT NULL default '0',
- `mark_time` int(11) unsigned NOT NULL default '0',
- PRIMARY KEY (`contrib_id`,`user_id`),
- KEY `contrib_id` (`contrib_id`),
- CONSTRAINT `fk_watch_contrib_id` FOREIGN KEY (`contrib_id`) REFERENCES `customisation_contribs` (`contrib_id`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-
-
- SET FOREIGN_KEY_CHECKS = 1;
--- 0 ----
Modified: trunk/titania/language/en/authors.php
==============================================================================
*** trunk/titania/language/en/authors.php (original)
--- trunk/titania/language/en/authors.php Tue Jun 16 21:58:05 2009
***************
*** 59,63 ****
'USER_INFORMATION' => 'âs user information',
));
-
- ?>
\ No newline at end of file
--- 59,61 ----
Modified: trunk/titania/language/en/common.php
==============================================================================
*** trunk/titania/language/en/common.php (original)
--- trunk/titania/language/en/common.php Tue Jun 16 21:58:05 2009
***************
*** 60,64 ****
'DOWNLOAD_ACCESS_DENIED' => 'You are not allowed to download the requested file.',
'DOWNLOAD_NOT_FOUND' => 'The requested file could not be found.',
));
-
- ?>
\ No newline at end of file
--- 60,62 ----
Modified: trunk/titania/language/en/contributions.php
==============================================================================
*** trunk/titania/language/en/contributions.php (original)
--- trunk/titania/language/en/contributions.php Tue Jun 16 21:58:05 2009
***************
*** 60,64 ****
'ERROR_CONTRIB_EMAIL_FRIEND' => 'You are not permitted to recommend this contribution to someone else.',
'ERROR_CONTRIB_NOT_FOUND' => 'The contribution you requested could not be found.',
));
-
- ?>
\ No newline at end of file
--- 60,62 ----
Modified: trunk/titania/language/en/faq.php
==============================================================================
*** trunk/titania/language/en/faq.php (original)
--- trunk/titania/language/en/faq.php Tue Jun 16 21:58:05 2009
***************
*** 66,70 ****
'U_SEARCH_MODS_AUTHOR' => '%1$sOther MODs by %2$s%3$s',
));
-
- ?>
\ No newline at end of file
--- 66,68 ----
Modified: trunk/titania/language/en/install.php
==============================================================================
*** trunk/titania/language/en/install.php (original)
--- trunk/titania/language/en/install.php Tue Jun 16 21:58:05 2009
***************
*** 38,42 ****
$lang = array_merge($lang, array(
'CUSTOMISATION_DATABASE' => 'Customisation Database',
));
-
- ?>
\ No newline at end of file
--- 38,40 ----
Modified: trunk/titania/modules/authors/info/authors_contributions.php
==============================================================================
*** trunk/titania/modules/authors/info/authors_contributions.php (original)
--- trunk/titania/modules/authors/info/authors_contributions.php Tue Jun 16 21:58:05 2009
***************
*** 19,23 ****
);
}
}
-
- ?>
\ No newline at end of file
--- 19,21 ----
Modified: trunk/titania/modules/authors/info/authors_details.php
==============================================================================
*** trunk/titania/modules/authors/info/authors_details.php (original)
--- trunk/titania/modules/authors/info/authors_details.php Tue Jun 16 21:58:05 2009
***************
*** 19,23 ****
);
}
}
-
- ?>
\ No newline at end of file
--- 19,21 ----
Modified: trunk/titania/modules/authors/info/authors_support.php
==============================================================================
*** trunk/titania/modules/authors/info/authors_support.php (original)
--- trunk/titania/modules/authors/info/authors_support.php Tue Jun 16 21:58:05 2009
***************
*** 19,23 ****
);
}
}
-
- ?>
\ No newline at end of file
--- 19,21 ----
Added: trunk/titania/modules/contribs/contribs_details.php
==============================================================================
*** trunk/titania/modules/contribs/contribs_details.php (added)
--- trunk/titania/modules/contribs/contribs_details.php Tue Jun 16 21:58:05 2009
***************
*** 0 ****
--- 1,264 ----
+ <?php
+ /**
+ *
+ * @package titania
+ * @version $Id: mods_details.php 215 2009-06-13 20:40:08Z exreaction $
+ * @copyright (c) 2008 phpBB Customisation Database Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ *
+ */
+
+ /**
+ * @ignore
+ */
+ if (!defined('IN_PHPBB'))
+ {
+ exit;
+ }
+
+ /**
+ * mods_details
+ * Class for Details module
+ * @package details
+ */
+ class contribs_details extends titania_object
+ {
+ public $p_master;
+ public $u_action;
+
+ /**
+ * Constructor
+ */
+ public function __construct($p_master)
+ {
+ $this->p_master = $p_master;
+
+ $this->page = titania::$page;
+ }
+
+ /**
+ * main method for this module
+ *
+ * @param string $id
+ * @param string $mode
+ */
+ public function main($id, $mode)
+ {
+ titania::add_lang('contributions');
+
+ $contrib_id = request_var('c', 0);
+ $submit = isset($_POST['submit']) ? true : false;
+
+ $form_key = 'contrib_details';
+ add_form_key($form_key);
+
+ switch ($mode)
+ {
+ case 'styles':
+ break;
+
+ case 'translations':
+ break;
+
+ case 'email':
+ $this->tpl_name = 'mods/mod_email';
+ $this->page_title = 'MOD_EMAIL';
+
+ $this->mod_email($contrib_id);
+ return;
+ break;
+
+ case 'changes':
+ break;
+
+ case 'preview':
+ break;
+
+ case 'screenshots':
+ break;
+
+ case 'details':
+ default:
+ $this->tpl_name = 'contributions/contribution_details';
+ $this->page_title = 'CONTRIB_DETAILS';
+
+ $this->details($contrib_id);
+ break;
+ }
+ }
+
+ public function details($contrib_id)
+ {
+ titania::load_object('contribution');
+ $contrib = new titania_contribution($contrib_id);
+
+ $contrib->load();
+
+ }
+
+ /**
+ * Email a friend
+ *
+ * @param int $mod_id
+ */
+ public function mod_email($mod_id)
+ {
+ phpbb::$user->add_lang(array('memberlist', 'ucp'));
+
+ if (!phpbb::$config['email_enable'])
+ {
+ titania::error_box('ERROR', phpbb::$user->lang['EMAIL_DISABLED'], TITANIA_ERROR, HEADER_SERVICE_UNAVAILABLE);
+ $this->main('details', 'details');
+ return;
+ }
+
+ if (!phpbb::$user->data['is_registered'] || phpbb::$user->data['is_bot'] || !phpbb::$auth->acl_get('u_sendemail'))
+ {
+ if (phpbb::$user->data['user_id'] == ANONYMOUS)
+ {
+ login_box(TITANIA_ROOT . $this->page . '&mod=' . $mod_id, 'NO_EMAIL_MOD');
+ }
+
+ titania::error_box('ERROR', phpbb::$user->lang['NO_EMAIL_MOD'], TITANIA_ERROR, HEADER_FORBIDDEN);
+ $this->main('details', 'details');
+ return;
+ }
+
+ // Are we trying to abuse the facility?
+ if (time() - phpbb::$user->data['user_emailtime'] < phpbb::$config['flood_interval'])
+ {
+ trigger_error('FLOOD_EMAIL_LIMIT');
+ }
+
+ $sql = 'SELECT c.contrib_id, c.contrib_name
+ FROM ' . TITANIA_CONTRIBS_TABLE . ' c
+ WHERE c.contrib_id = ' . (int) $mod_id . '
+ AND c.contrib_status = ' . TITANIA_STATUS_APPROVED;
+ $result = phpbb::$db->sql_query($sql);
+ $mod = phpbb::$db->sql_fetchrow($result);
+ phpbb::$db->sql_freeresult($result);
+
+ if (!$mod)
+ {
+ titania::trigger_error('MOD_NOT_FOUND', E_USER_NOTICE, HEADER_NOT_FOUND);
+ }
+
+ $error = array();
+
+ $name = utf8_normalize_nfc(request_var('name', '', true));
+ $email = request_var('email', '');
+ $email_lang = request_var('lang', $config['default_lang']);
+ $message = utf8_normalize_nfc(request_var('message', '', true));
+ $cc = (isset($_POST['cc_email'])) ? true : false;
+ $submit = (isset($_POST['submit'])) ? true : false;
+
+ if ($submit)
+ {
+ if (!check_form_key('mods_details'))
+ {
+ $error[] = 'FORM_INVALID';
+ }
+
+ if (!$email || !preg_match('/^' . get_preg_expression('email') . '$/i', $email))
+ {
+ $error[] = $user->lang['EMPTY_ADDRESS_EMAIL'];
+ }
+
+ if (!$name)
+ {
+ $error[] = $user->lang['EMPTY_NAME_EMAIL'];
+ }
+
+ if (!sizeof($error))
+ {
+ $sql = 'UPDATE ' . USERS_TABLE . '
+ SET user_emailtime = ' . time() . '
+ WHERE user_id = ' . phpbb::$user->data['user_id'];
+ $result = phpbb::$db->sql_query($sql);
+
+ include_once(PHPBB_ROOT_PATH . 'includes/functions_messenger.' . PHP_EXT);
+ $messenger = new messenger(false);
+
+ $mail_to_users = array();
+
+ $mail_to_users[] = array(
+ 'email_lang' => $email_lang,
+ 'email' => $email,
+ 'name' => $name,
+ 'username' => '',
+ 'to_name' => $name,
+ 'mod_id' => $mod['contrib_id'],
+ 'mod_title' => $mod['contrib_name'],
+ );
+
+ // Ok, now the same email if CC specified, but without exposing the users email address
+ if ($cc)
+ {
+ $mail_to_users[] = array(
+ 'email_lang' => phpbb::$user->data['user_lang'],
+ 'email' => phpbb::$user->data['user_email'],
+ 'name' => phpbb::$user->data['username'],
+ 'username' => phpbb::$user->data['username'],
+ 'to_name' => $name,
+ 'mod_id' => $mod['contrib_id'],
+ 'mod_title' => $mod['contrib_name'],
+ );
+ }
+
+ foreach ($mail_to_users as $row)
+ {
+ $messenger->template('mod_recommend', $row['email_lang']);
+ $messenger->replyto($user->data['user_email']);
+ $messenger->to($row['email'], $row['name']);
+
+ $messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
+ $messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
+ $messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
+ $messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
+
+ $messenger->assign_vars(array(
+ 'BOARD_CONTACT' => $config['board_contact'],
+ 'TO_USERNAME' => htmlspecialchars_decode($row['to_name']),
+ 'FROM_USERNAME' => htmlspecialchars_decode($user->data['username']),
+ 'MESSAGE' => htmlspecialchars_decode($message),
+
+ 'MOD_TITLE' => htmlspecialchars_decode($row['mod_title']),
+ 'U_MOD' => generate_board_url(true) . $this->page . '?mode=details&mod=' . $mod_id,
+ ));
+
+ $messenger->send(NOTIFY_EMAIL);
+ }
+
+ titania::error_box('SUCCESS', 'EMAIL_SENT', TITANIA_SUCCESS);
+ $this->main('details', 'details');
+ return;
+ }
+ }
+
+ $template->assign_vars(array(
+ 'MOD_TITLE' => $mod['contrib_name'],
+
+ 'ERROR_MESSAGE' => (sizeof($error)) ? implode('<br />', $error) : '',
+
+ 'S_LANG_OPTIONS' => language_select($email_lang),
+ 'S_POST_ACTION' => append_sid($this->page, 'id=details&mode=email&mod=' . $mod_id),
+ ));
+ }
+
+ /**
+ * Increment contrib views, but only if the user just visited the page and they are not a bot.
+ *
+ * @param string $param URL parameter to look for, such as mod, style, mod_id
+ * @param int $contrib_id contrib_id to increment views for
+ */
+ public function increment_contrib_views($param, $contrib_id)
+ {
+ if (isset(phpbb::$user->data['session_page']) && !phpbb::$user->data['is_bot'] && strpos(phpbb::$user->data['session_page'], "&{$param}={$contrib_id}") === false)
+ {
+ $sql = 'UPDATE ' . TITANIA_CONTRIBS_TABLE . ' SET contrib_views = contrib_views + 1 WHERE contrib_id = ' . (int) $contrib_id;
+ phpbb::$db->sql_query($sql);
+ }
+
+ return;
+ }
+ }
\ No newline at end of file
Added: trunk/titania/modules/contribs/contribs_faq.php
==============================================================================
*** trunk/titania/modules/contribs/contribs_faq.php (added)
--- trunk/titania/modules/contribs/contribs_faq.php Tue Jun 16 21:58:05 2009
***************
*** 0 ****
--- 1,155 ----
+ <?php
+ /**
+ *
+ * @package titania
+ * @version $Id: mods_faq.php 215 2009-06-13 20:40:08Z exreaction $
+ * @copyright (c) 2008 Customisation Database Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ *
+ */
+
+ /**
+ * @ignore
+ */
+ if (!defined('IN_PHPBB'))
+ {
+ exit;
+ }
+
+ require(TITANIA_ROOT . 'includes/objects/faq.' . PHP_EXT);
+
+ /**
+ * faq_main
+ * Class for FAQ module
+ * @package mods
+ */
+ class contribs_faq extends titania_object
+ {
+ public $p_master;
+ public $u_action;
+
+ /**
+ * Constructor
+ */
+ public function __construct($p_master)
+ {
+ global $user;
+
+ $this->p_master = $p_master;
+
+ $this->page = $user->page['script_path'] . $user->page['page_name'];
+ }
+
+ /**
+ * main method for this module
+ *
+ * @param string $id
+ * @param string $mode
+ */
+ public function main($id, $mode)
+ {
+ global $user, $template, $cache;
+
+ titania::add_lang(array('contrib', 'contrib_mod'));
+
+ $faq_id = request_var('faq', 0);
+ $action = request_var('action', '');
+
+ $submit = isset($_POST['submit']) ? true : false;
+
+ add_form_key('mods_faq');
+
+ if ($submit && !check_form_key('mods_faq'))
+ {
+ trigger_error('INVALID_FORM');
+ }
+
+ $faq = new titania_faq($faq_id);
+
+ $this->tpl_name = 'faq/faq_manage';
+
+ switch ($mode)
+ {
+ case 'main':
+
+ break;
+
+ case 'manage':
+
+ $faq_ids = request_var('faq_id', array(0));
+
+ if ($submit && $faq_ids)
+ {
+ switch ($action)
+ {
+ case 'delete':
+ $sql = 'DELETE FROM ' . TITANIA_CONTRIB_FAQ_TABLE . ' WHERE ' . $db->sql_in_set('faq_id', $faq_ids);
+ $db->sql_query($sql);
+
+ $message = $user->lang['DELETE_FAQ_MARKED'];
+ break;
+
+ case 'move':
+
+ break;
+ }
+
+ $faq->manage_list();
+ }
+
+ break;
+
+ case 'view':
+ default:
+
+ $mod_id = request_var('mod', 0);
+
+ if ($action && in_array($action, array('create', 'edit')))
+ {
+ if (!$mod_id)
+ {
+ trigger_error('NO_MOD_SELECTED');
+ }
+
+ $this->page_title = ($action == 'edit') ? 'EDIT_FAQ' : 'CREATE_FAQ';
+
+ $faq->submit_faq($mod_id, $action);
+ }
+ else
+ {
+ if ($faq_id)
+ {
+ $this->tpl_name = 'faq/faq_details';
+ $this->page_title = 'MOD_FAQ_DETAILS';
+
+ $found = $faq->faq_details();
+
+ if (!$found)
+ {
+ trigger_error('FAQ_NOT_FOUND');
+ }
+ }
+ else
+ {
+ if (!$mod_id)
+ {
+ trigger_error('NO_MOD_SELECTED');
+ }
+
+ $this->tpl_name = 'faq/faq_list';
+ $this->page_title = 'MOD_FAQ_LIST';
+
+ $found = $faq->faq_list($mod_id);
+
+ if (!$found)
+ {
+ trigger_error('NO_FAQ_FOUND');
+ }
+ }
+ }
+
+ break;
+ }
+ }
+
+ }
Added: trunk/titania/modules/contribs/contribs_main.php
==============================================================================
*** trunk/titania/modules/contribs/contribs_main.php (added)
--- trunk/titania/modules/contribs/contribs_main.php Tue Jun 16 21:58:05 2009
***************
*** 0 ****
--- 1,229 ----
+ <?php
+ /**
+ *
+ * @package titania
+ * @version $Id: mods_main.php 215 2009-06-13 20:40:08Z exreaction $
+ * @copyright (c) 2008 phpBB Customisation Database Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ *
+ */
+
+ /**
+ * @ignore
+ */
+ if (!defined('IN_PHPBB'))
+ {
+ exit;
+ }
+
+ /**
+ * mods_main
+ * MODs Categories
+ * @package mods
+ */
+ class contribs_main extends titania_object
+ {
+ public $p_master;
+ public $u_action;
+
+ /**
+ * Constructor
+ */
+ public function __construct($p_master)
+ {
+ global $user;
+
+ $this->p_master = $p_master;
+
+ $this->page = $user->page['script_path'] . $user->page['page_name'];
+ }
+
+ /**
+ * main method for this module
+ *
+ * @param string $id
+ * @param string $mode
+ */
+ public function main($id, $mode)
+ {
+ global $user, $template, $cache;
+
+ titania::add_lang(array('contrib', 'contrib_mod'));
+
+ $category = request_var('category', 0);
+ $submit = isset($_POST['submit']) ? true : false;
+
+ $form_key = 'mods_main';
+ add_form_key($form_key);
+
+ switch ($mode)
+ {
+ case 'details':
+ $this->tpl_name = 'mods/mod_details';
+ $this->page_title = 'MODS_DETAILS';
+
+ $found = $this->mod_details($category, $mod_id);
+
+ if (!$found)
+ {
+ titania::error_box('ERROR', $user->lang['MOD_NOT_FOUND'], TITANIA_ERROR);
+
+ $mode = ($category) ? 'list' : 'categories';
+ $this->main($id, $mode);
+ return;
+ }
+ break;
+
+ case 'list':
+ case 'search':
+ // Set desired template
+ $this->tpl_name = 'mods/mod_list';
+ $this->page_title = 'MODS_LIST';
+
+ $found = $this->mod_list($category);
+
+ if (!$found)
+ {
+ $categories = titania::$cache->get_categories(TAG_TYPE_MOD_CATEGORY);
+ titania::error_box('ERROR', sprintf($user->lang['NO_MODS'], $categories[$category]['name']), TITANIA_ERROR);
+ $this->main($id, 'categories');
+ return;
+ }
+ break;
+
+ case 'categories':
+ default:
+ // Set desired template
+ $this->tpl_name = 'mods/mod_categories';
+ $this->page_title = 'MODS_CATEGORIES';
+
+ $this->mod_categories();
+ break;
+ }
+ }
+
+ /**
+ * MOD Categories
+ */
+ public function mod_categories()
+ {
+ global $template, $user;
+
+ $categories = titania::$cache->get_categories(TAG_TYPE_MOD_CATEGORY);
+
+ foreach ($categories as $row)
+ {
+ $template->assign_block_vars('category', array(
+ 'U_CATEGORY'=> append_sid($this->page, 'mode=list&category=' . $row['id']),
+ 'ID' => $row['id'],
+ 'TITLE' => $row['name'],
+ 'DESC' => $row['desc'],
+ ));
+ }
+ }
+
+ /**
+ * MOD list and search results
+ */
+ public function mod_list($category)
+ {
+ global $db, $template, $user;
+
+ if (!class_exists('sort'))
+ {
+ require TITANIA_ROOT . 'includes/tools/sort.' . PHP_EXT;
+ }
+
+ if (!class_exists('pagination'))
+ {
+ require TITANIA_ROOT . 'includes/tools/pagination.' . PHP_EXT;
+ }
+
+ $sort = new sort();
+ $pagination = new pagination();
+
+ $sort->set_sort_keys(array(
+ array('SORT_AUTHOR', 'a.author_username_clean', 'default' => true),
+ array('SORT_TIME_ADDED', 'c.contrib_release_date'),
+ array('SORT_TIME_UPDATED', 'c.contrib_update_date'),
+ array('SORT_DOWNLOADS', 'c.contrib_downloads'),
+ array('SORT_RATING', 'c.contrib_rating'),
+ array('SORT_CONTRIB_NAME', 'c.contrib_name'),
+ ));
+
+ $sort->sort_request(false);
+
+ $sql_ary = array(
+ 'SELECT' => 'c.*, a.user_id, a.author_username, u.user_colour',
+ 'FROM' => array(TITANIA_CONTRIBS_TABLE => 'c'),
+ 'LEFT_JOIN' => array(
+ array(
+ 'FROM' => array(TITANIA_CONTRIB_TAGS_TABLE => 't'),
+ 'ON' => 't.contrib_id = c.contrib_id',
+ ),
+ array(
+ 'FROM' => array(TITANIA_AUTHORS_TABLE => 'a'),
+ 'ON' => 'a.user_id = c.contrib_user_id',
+ ),
+ array(
+ 'FROM' => array(USERS_TABLE => 'u'),
+ 'ON' => 'u.user_id = a.user_id',
+ ),
+ ),
+ 'WHERE' => 't.tag_id = ' . $category . '
+ AND c.contrib_status = ' . TITANIA_STATUS_APPROVED,
+ 'ORDER_BY' => $sort->get_order_by(),
+ );
+ $sql = $db->sql_build_query('SELECT', $sql_ary);
+ $result = $db->sql_query_limit($sql, $pagination->get_limit(), $pagination->get_start());
+
+ $results = 0;
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $results++;
+
+ $profile_url = append_sid(TITANIA_ROOT . 'authors/index.' . PHP_EXT, 'mode=profile');
+
+ $template->assign_block_vars('contrib', array(
+ 'ID' => $row['contrib_id'],
+ 'U_CONTRIB' => append_sid($this->page, 'mode=details&mod=' . $row['contrib_id']),
+ 'TITLE' => $row['contrib_name'],
+ 'DESC' => $row['contrib_description'],
+ 'RATING' => round($row['contrib_rating'], 2),
+ 'DOWNLOADS' => $row['contrib_downloads'],
+ 'ADDED' => $user->format_date($row['contrib_release_date']),
+ 'UPDATED' => $user->format_date($row['contrib_update_date']),
+ 'VERSION' => $row['contrib_version'],
+ 'AUTHOR' => sprintf($user->lang['AUTHOR_BY'], get_username_string('full', $row['user_id'], $row['author_username'], $row['user_colour'], false, $profile_url)),
+ ));
+ }
+ $db->sql_freeresult($result);
+
+ if (!$results)
+ {
+ return false;
+ }
+
+ $pagination->sql_total_count($sql_ary, 'c.contrib_id', $results);
+
+ $pagination->set_params(array(
+ 'sk' => $sort->get_sort_key(false),
+ 'sd' => $sort->get_sort_dir(false),
+ 'category' => $category,
+ ));
+
+ $pagination->build_pagination($this->u_action);
+
+ $template->assign_vars(array(
+ 'S_MODE_SELECT' => $sort->get_sort_key_list(),
+ 'S_ORDER_SELECT' => $sort->get_sort_dir_list(),
+ ));
+
+ return true;
+ }
+
+ private function mod_details($category)
+ {
+
+ }
+ }
\ No newline at end of file
Added: trunk/titania/modules/contribs/contribs_reviews.php
==============================================================================
*** trunk/titania/modules/contribs/contribs_reviews.php (added)
--- trunk/titania/modules/contribs/contribs_reviews.php Tue Jun 16 21:58:05 2009
***************
*** 0 ****
--- 1,55 ----
+ <?php
+ /**
+ *
+ * @package titania
+ * @version $Id: mods_reviews.php 187 2009-03-30 14:02:55Z bantu $
+ * @copyright (c) 2008 phpBB Customisation Database Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ *
+ */
+
+ /**
+ * @ignore
+ */
+ if (!defined('IN_PHPBB'))
+ {
+ exit;
+ }
+
+ /**
+ * mods_reviews
+ * Class for Reviews module
+ * @package reviews
+ */
+ class contribs_reviews extends titania_object
+ {
+ public $p_master;
+ public $u_action;
+
+ /**
+ * Constructor
+ */
+ public function __construct($p_master)
+ {
+ global $user;
+
+ $this->p_master = $p_master;
+
+ $this->page = $user->page['script_path'] . $user->page['page_name'];
+ }
+
+ /**
+ * main method for this module
+ *
+ * @param string $id
+ * @param string $mode
+ */
+ public function main($id, $mode)
+ {
+ global $user, $template, $cache;
+
+ $user->add_lang(array('titania_reviews'));
+
+ $submit = isset($_POST['submit']) ? true : false;
+ }
+ }
\ No newline at end of file
Added: trunk/titania/modules/contribs/contribs_support.php
==============================================================================
*** trunk/titania/modules/contribs/contribs_support.php (added)
--- trunk/titania/modules/contribs/contribs_support.php Tue Jun 16 21:58:05 2009
***************
*** 0 ****
--- 1,55 ----
+ <?php
+ /**
+ *
+ * @package titania
+ * @version $Id: mods_support.php 187 2009-03-30 14:02:55Z bantu $
+ * @copyright (c) 2008 phpBB Customisation Database Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ *
+ */
+
+ /**
+ * @ignore
+ */
+ if (!defined('IN_PHPBB'))
+ {
+ exit;
+ }
+
+ /**
+ * mods_support
+ * Class for Support module
+ * @package support
+ */
+ class contribs_support extends titania_object
+ {
+ public $p_master;
+ public $u_action;
+
+ /**
+ * Constructor
+ */
+ public function __construct($p_master)
+ {
+ global $user;
+
+ $this->p_master = $p_master;
+
+ $this->page = $user->page['script_path'] . $user->page['page_name'];
+ }
+
+ /**
+ * main method for this module
+ *
+ * @param string $id
+ * @param string $mode
+ */
+ public function main($id, $mode)
+ {
+ global $user, $template, $cache;
+
+ $user->add_lang(array('titania_support'));
+
+ $submit = isset($_POST['submit']) ? true : false;
+ }
+ }
Added: trunk/titania/modules/contribs/info/contribs_details.php
==============================================================================
*** trunk/titania/modules/contribs/info/contribs_details.php (added)
--- trunk/titania/modules/contribs/info/contribs_details.php Tue Jun 16 21:58:05 2009
***************
*** 0 ****
--- 1,27 ----
+ <?php
+ /**
+ *
+ * @package titania
+ * @version $Id$
+ * @copyright (c) 2008 phpBB Customisation Database Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ *
+ */
+
+ class contribs_details_info
+ {
+ function module()
+ {
+ return array(
+ 'modes' => array(
+ 'details' => array('title' => 'CONTRIB_DETAILS', 'auth' => ''),
+ 'screenshots' => array('title' => 'CONTRIB_SCREENSHOTS', 'auth' => ''),
+ 'preview' => array('title' => 'CONTRIB_PREVIEW', 'auth' => ''),
+ 'changes' => array('title' => 'CONTRIB_CHANGES', 'auth' => ''),
+ 'email' => array('title' => 'CONTRIB_EMAIL_FRIEND', 'auth' => ''),
+ 'styles' => array('title' => 'CONTRIB_STYLES', 'auth' => ''),
+ 'translations' => array('title' => 'CONTRIB_TRANSLATIONS', 'auth' => ''),
+ ),
+ );
+ }
+ }
Added: trunk/titania/modules/contribs/info/contribs_faq.php
==============================================================================
*** trunk/titania/modules/contribs/info/contribs_faq.php (added)
--- trunk/titania/modules/contribs/info/contribs_faq.php Tue Jun 16 21:58:05 2009
***************
*** 0 ****
--- 1,21 ----
+ <?php
+ /**
+ *
+ * @package titania
+ * @version $Id$
+ * @copyright (c) 2008 phpBB Customisation Database Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ *
+ */
+
+ class contribs_faq_info
+ {
+ function module()
+ {
+ return array(
+ 'modes' => array(
+ 'faq' => array('title' => 'CONTRIB_FAQ', 'auth' => ''),
+ ),
+ );
+ }
+ }
Added: trunk/titania/modules/contribs/info/contribs_support.php
==============================================================================
*** trunk/titania/modules/contribs/info/contribs_support.php (added)
--- trunk/titania/modules/contribs/info/contribs_support.php Tue Jun 16 21:58:05 2009
***************
*** 0 ****
--- 1,21 ----
+ <?php
+ /**
+ *
+ * @package titania
+ * @version $Id$
+ * @copyright (c) 2008 phpBB Customisation Database Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ *
+ */
+
+ class contribs_support_info
+ {
+ function module()
+ {
+ return array(
+ 'modes' => array(
+ 'default' => array('title' => 'CONTRIB_SUPPORT', 'auth' => ''),
+ ),
+ );
+ }
+ }
Modified: trunk/titania/modules/titania/info/titania_main.php
==============================================================================
*** trunk/titania/modules/titania/info/titania_main.php (original)
--- trunk/titania/modules/titania/info/titania_main.php Tue Jun 16 21:58:05 2009
***************
*** 19,23 ****
);
}
}
-
- ?>
\ No newline at end of file
--- 19,21 ----
More information about the customisationdb-commits
mailing list