You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(193) |
Nov
(393) |
Dec
(347) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(401) |
Feb
(232) |
Mar
(343) |
Apr
(129) |
May
(129) |
Jun
(116) |
Jul
(189) |
Aug
(129) |
Sep
(68) |
Oct
(172) |
Nov
(298) |
Dec
(148) |
2003 |
Jan
(264) |
Feb
(210) |
Mar
(322) |
Apr
(309) |
May
(234) |
Jun
(188) |
Jul
(215) |
Aug
(161) |
Sep
(234) |
Oct
(163) |
Nov
(110) |
Dec
(7) |
2004 |
Jan
(95) |
Feb
(107) |
Mar
(55) |
Apr
(3) |
May
(49) |
Jun
(35) |
Jul
(57) |
Aug
(43) |
Sep
(56) |
Oct
(40) |
Nov
(25) |
Dec
(21) |
2005 |
Jan
(93) |
Feb
(25) |
Mar
(22) |
Apr
(72) |
May
(45) |
Jun
(24) |
Jul
(29) |
Aug
(20) |
Sep
(50) |
Oct
(93) |
Nov
(69) |
Dec
(183) |
2006 |
Jan
(185) |
Feb
(143) |
Mar
(402) |
Apr
(260) |
May
(322) |
Jun
(367) |
Jul
(234) |
Aug
(299) |
Sep
(206) |
Oct
(288) |
Nov
(338) |
Dec
(307) |
2007 |
Jan
(296) |
Feb
(250) |
Mar
(261) |
Apr
(434) |
May
(539) |
Jun
(274) |
Jul
(440) |
Aug
(190) |
Sep
(128) |
Oct
(249) |
Nov
(86) |
Dec
(51) |
2008 |
Jan
(177) |
Feb
(67) |
Mar
(61) |
Apr
(48) |
May
(56) |
Jun
(97) |
Jul
(60) |
Aug
(64) |
Sep
(151) |
Oct
(79) |
Nov
(109) |
Dec
(123) |
2009 |
Jan
(70) |
Feb
(70) |
Mar
(73) |
Apr
(80) |
May
(22) |
Jun
(193) |
Jul
(191) |
Aug
(181) |
Sep
(120) |
Oct
(48) |
Nov
(24) |
Dec
|
From: Meik S. <acy...@ph...> - 2009-07-22 09:07:57
|
Author: acydburn Date: Wed Jul 22 09:07:24 2009 New Revision: 9823 Log: Parse email text files with the template engine. Did not check if this influences styles template cache list/purge/etc. Modified: branches/phpBB-3_0_0/phpBB/docs/CHANGELOG.html branches/phpBB-3_0_0/phpBB/includes/functions_messenger.php Modified: branches/phpBB-3_0_0/phpBB/docs/CHANGELOG.html ============================================================================== *** branches/phpBB-3_0_0/phpBB/docs/CHANGELOG.html (original) --- branches/phpBB-3_0_0/phpBB/docs/CHANGELOG.html Wed Jul 22 09:07:24 2009 *************** *** 219,224 **** --- 219,225 ---- <li>[Feature] Ability to empty a user's outbox from the user ACP quick tools.</li> <li>[Feature] Ability to filter ACP / MCP logs</li> <li>[Feature] Users can report PMs to moderators which are then visible in a new MCP module</li> + <li>[Feature] Parse email text files with the template engine.</li> </ul> <a name="v304"></a><h3>1.ii. Changes since 3.0.4</h3> Modified: branches/phpBB-3_0_0/phpBB/includes/functions_messenger.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/includes/functions_messenger.php (original) --- branches/phpBB-3_0_0/phpBB/includes/functions_messenger.php Wed Jul 22 09:07:24 2009 *************** *** 27,32 **** --- 27,34 ---- var $mail_priority = MAIL_NORMAL_PRIORITY; var $use_queue = true; + + var $tpl_obj = NULL; var $tpl_msg = array(); var $eol = "\n"; *************** *** 177,183 **** if (!trim($template_file)) { ! trigger_error('No template file set', E_USER_ERROR); } if (!trim($template_lang)) --- 179,185 ---- if (!trim($template_file)) { ! trigger_error('No template file for emailing set.', E_USER_ERROR); } if (!trim($template_lang)) *************** *** 185,209 **** $template_lang = basename($config['default_lang']); } ! if (empty($this->tpl_msg[$template_lang . $template_file])) { ! $tpl_file = (!empty($user->lang_path)) ? $user->lang_path : $phpbb_root_path . 'language/'; ! $tpl_file .= $template_lang . "/email/$template_file.txt"; ! if (!file_exists($tpl_file)) ! { ! trigger_error("Could not find email template file [ $tpl_file ]", E_USER_ERROR); ! } ! if (($data = @file_get_contents($tpl_file)) === false) ! { ! trigger_error("Failed opening template file [ $tpl_file ]", E_USER_ERROR); ! } ! $this->tpl_msg[$template_lang . $template_file] = $data; } ! $this->msg = $this->tpl_msg[$template_lang . $template_file]; return true; } --- 187,211 ---- $template_lang = basename($config['default_lang']); } ! // tpl_msg now holds a template object we can use to parse the template file ! if (!isset($this->tpl_msg[$template_lang . $template_file])) { ! $this->tpl_msg[$template_lang . $template_file] = new template(); ! $tpl = &$this->tpl_msg[$template_lang . $template_file]; ! $template_path = (!empty($user->lang_path)) ? $user->lang_path : $phpbb_root_path . 'language/'; ! $template_path .= $template_lang . '/email'; ! $tpl->set_custom_template($template_path, $template_lang . '_email'); ! $tpl->set_filenames(array( ! 'body' => $template_file . '.txt', ! )); } ! $this->tpl_obj = &$this->tpl_msg[$template_lang . $template_file]; ! $this->vars = &$this->tpl_obj->_rootref; ! $this->tpl_msg = ''; return true; } *************** *** 213,219 **** */ function assign_vars($vars) { ! $this->vars = (empty($this->vars)) ? $vars : $this->vars + $vars; } /** --- 215,236 ---- */ function assign_vars($vars) { ! if (!is_object($this->tpl_obj)) ! { ! return; ! } ! ! $this->tpl_obj->assign_vars($vars); ! } ! ! function assign_block_vars($blockname, $vars) ! { ! if (!is_object($this->tpl_obj)) ! { ! return; ! } ! ! $this->tpl_obj->assign_block_vars($blockname, $vars); } /** *************** *** 224,238 **** global $config, $user; // We add some standard variables we always use, no need to specify them always ! $this->vars['U_BOARD'] = (!isset($this->vars['U_BOARD'])) ? generate_board_url() : $this->vars['U_BOARD']; ! $this->vars['EMAIL_SIG'] = (!isset($this->vars['EMAIL_SIG'])) ? str_replace('<br />', "\n", "-- \n" . htmlspecialchars_decode($config['board_email_sig'])) : $this->vars['EMAIL_SIG']; ! $this->vars['SITENAME'] = (!isset($this->vars['SITENAME'])) ? htmlspecialchars_decode($config['sitename']) : $this->vars['SITENAME']; ! // Escape all quotes, else the eval will fail. ! $this->msg = str_replace ("'", "\'", $this->msg); ! $this->msg = preg_replace('#\{([a-z0-9\-_]*?)\}#is', "' . ((isset(\$this->vars['\\1'])) ? \$this->vars['\\1'] : '') . '", $this->msg); ! eval("\$this->msg = '$this->msg';"); // We now try and pull a subject from the email body ... if it exists, // do this here because the subject may contain a variable --- 241,269 ---- global $config, $user; // We add some standard variables we always use, no need to specify them always ! if (!isset($this->vars['U_BOARD'])) ! { ! $this->assign_vars(array( ! 'U_BOARD' => generate_board_url(), ! )); ! } ! if (!isset($this->vars['EMAIL_SIG'])) ! { ! $this->assign_vars(array( ! 'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . htmlspecialchars_decode($config['board_email_sig'])), ! )); ! } ! if (!isset($this->vars['SITENAME'])) ! { ! $this->assign_vars(array( ! 'SITENAME' => htmlspecialchars_decode($config['sitename']), ! )); ! } ! ! // Parse message through template ! $this->msg = trim($this->tpl_obj->assign_display('body')); // We now try and pull a subject from the email body ... if it exists, // do this here because the subject may contain a variable |
From: Andreas F. <ba...@ph...> - 2009-07-22 03:03:12
|
Author: bantu Date: Wed Jul 22 03:02:45 2009 New Revision: 9822 Log: Also fix bug #46295 in ftp_fsock class. Modified: branches/phpBB-3_0_0/phpBB/includes/functions_transfer.php Modified: branches/phpBB-3_0_0/phpBB/includes/functions_transfer.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/includes/functions_transfer.php (original) --- branches/phpBB-3_0_0/phpBB/includes/functions_transfer.php Wed Jul 22 03:02:45 2009 *************** *** 483,489 **** $item = str_replace('\\', '/', $item); $dir = str_replace('\\', '/', $dir); ! if (strpos($item, $dir) === 0) { $item = substr($item, strlen($dir)); } --- 483,489 ---- $item = str_replace('\\', '/', $item); $dir = str_replace('\\', '/', $dir); ! if (!empty($dir) && strpos($item, $dir) === 0) { $item = substr($item, strlen($dir)); } *************** *** 749,754 **** --- 749,768 ---- // Clear buffer $this->_check_command(); + // See bug #46295 - Some FTP daemons don't like './' + if ($dir === './' && empty($list)) + { + // Let's try some alternatives + $list = $this->_ls('.'); + + if (empty($list)) + { + $list = $this->_ls(''); + } + + return $list; + } + // Remove path if prepended foreach ($list as $key => $item) { *************** *** 756,762 **** $item = str_replace('\\', '/', $item); $dir = str_replace('\\', '/', $dir); ! if (strpos($item, $dir) === 0) { $item = substr($item, strlen($dir)); } --- 770,776 ---- $item = str_replace('\\', '/', $item); $dir = str_replace('\\', '/', $dir); ! if (!empty($dir) && strpos($item, $dir) === 0) { $item = substr($item, strlen($dir)); } |
From: Andreas F. <ba...@ph...> - 2009-07-22 02:58:07
|
Author: bantu Date: Wed Jul 22 02:57:36 2009 New Revision: 9821 Log: Fix two potential problems with the ftp_fsock class. Modified: branches/phpBB-3_0_0/phpBB/includes/functions_transfer.php Modified: branches/phpBB-3_0_0/phpBB/includes/functions_transfer.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/includes/functions_transfer.php (original) --- branches/phpBB-3_0_0/phpBB/includes/functions_transfer.php Wed Jul 22 02:57:36 2009 *************** *** 737,743 **** $list = array(); while (!@feof($this->data_connection)) { ! $list[] = preg_replace('#[\r\n]#', '', @fgets($this->data_connection, 512)); } $this->_close_data_connection(); --- 737,748 ---- $list = array(); while (!@feof($this->data_connection)) { ! $filename = preg_replace('#[\r\n]#', '', @fgets($this->data_connection, 512)); ! ! if ($filename !== '') ! { ! $list[] = $filename; ! } } $this->_close_data_connection(); *************** *** 840,846 **** $result = @fgets($this->connection, 512); $response .= $result; } ! while (substr($response, 3, 1) != ' '); if (!preg_match('#^[123]#', $response)) { --- 845,851 ---- $result = @fgets($this->connection, 512); $response .= $result; } ! while (substr($result, 3, 1) !== ' '); if (!preg_match('#^[123]#', $response)) { |
From: Andreas F. <ba...@ph...> - 2009-07-22 01:26:46
|
Author: bantu Date: Wed Jul 22 01:26:09 2009 New Revision: 9820 Log: Fix bug #46295 - Be less strict with FTP daemons when getting directory filelists. Authorised by: bantu ;-) Modified: branches/phpBB-3_0_0/phpBB/docs/CHANGELOG.html branches/phpBB-3_0_0/phpBB/includes/functions_transfer.php Modified: branches/phpBB-3_0_0/phpBB/docs/CHANGELOG.html ============================================================================== *** branches/phpBB-3_0_0/phpBB/docs/CHANGELOG.html (original) --- branches/phpBB-3_0_0/phpBB/docs/CHANGELOG.html Wed Jul 22 01:26:09 2009 *************** *** 169,174 **** --- 169,175 ---- <li>[Fix] Display required fields notice on registration above the custom profile fields. (Bug #39665)</li> <li>[Fix] Copy poll options properly when copying topic. (Bug #39065)</li> <li>[Fix] Preserve newlines in template files (one newline had been always dropped after a template variable due to PHP's handling of closing tags)</li> + <li>[Fix] Be less strict with FTP daemons when getting directory filelists. (Bug #46295)</li> <li>[Change] Change the data format of the default file ACM to be more secure from tampering and have better performance.</li> <li>[Change] Add index on log_time to the log table to prevent slowdown on boards with many log entries. (Bug #44665 - Patch by bantu)</li> <li>[Change] Template engine now permits to a limited extent variable includes.</li> Modified: branches/phpBB-3_0_0/phpBB/includes/functions_transfer.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/includes/functions_transfer.php (original) --- branches/phpBB-3_0_0/phpBB/includes/functions_transfer.php Wed Jul 22 01:26:09 2009 *************** *** 462,467 **** --- 462,475 ---- { $list = @ftp_nlist($this->connection, $dir); + // See bug #46295 - Some FTP daemons don't like './' + if ($dir === './') + { + // Let's try some alternatives + $list = (empty($list)) ? @ftp_nlist($this->connection, '.') : $list; + $list = (empty($list)) ? @ftp_nlist($this->connection, '') : $list; + } + // Return on error if ($list === false) { |
From: Andreas F. <ba...@ph...> - 2009-07-22 01:02:38
|
Author: bantu Date: Wed Jul 22 01:01:55 2009 New Revision: 9819 Log: Do not try to enter passive mode before logging in. Return error if ftp_nlist() returned error. Modified: branches/phpBB-3_0_0/phpBB/includes/functions_transfer.php Modified: branches/phpBB-3_0_0/phpBB/includes/functions_transfer.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/includes/functions_transfer.php (original) --- branches/phpBB-3_0_0/phpBB/includes/functions_transfer.php Wed Jul 22 01:01:55 2009 *************** *** 316,330 **** return 'ERR_CONNECTING_SERVER'; } - // attempt to turn pasv mode on - @ftp_pasv($this->connection, true); - // login to the server if (!@ftp_login($this->connection, $this->username, $this->password)) { return 'ERR_UNABLE_TO_LOGIN'; } // change to the root directory if (!$this->_chdir($this->root_path)) { --- 316,330 ---- return 'ERR_CONNECTING_SERVER'; } // login to the server if (!@ftp_login($this->connection, $this->username, $this->password)) { return 'ERR_UNABLE_TO_LOGIN'; } + // attempt to turn pasv mode on + @ftp_pasv($this->connection, true); + // change to the root directory if (!$this->_chdir($this->root_path)) { *************** *** 462,467 **** --- 462,473 ---- { $list = @ftp_nlist($this->connection, $dir); + // Return on error + if ($list === false) + { + return false; + } + // Remove path if prepended foreach ($list as $key => $item) { |
From: Nils A. <nad...@ph...> - 2009-07-22 00:12:34
|
Author: naderman Date: Wed Jul 22 00:11:46 2009 New Revision: 9818 Log: - Added install_id to data collector - config variable whitelist, so sensitive MOD info is not transmitted, currently mostly bool/int values - should we reduce the amount of data? Modified: branches/phpBB-3_0_0/phpBB/adm/style/acp_send_statistics.html branches/phpBB-3_0_0/phpBB/includes/acp/acp_send_statistics.php branches/phpBB-3_0_0/phpBB/includes/questionnaire/questionnaire.php Modified: branches/phpBB-3_0_0/phpBB/adm/style/acp_send_statistics.html ============================================================================== *** branches/phpBB-3_0_0/phpBB/adm/style/acp_send_statistics.html (original) --- branches/phpBB-3_0_0/phpBB/adm/style/acp_send_statistics.html Wed Jul 22 00:11:46 2009 *************** *** 17,24 **** return; } ! //dE('questionnaire-form', -1); ! //dE('questionnaire-thanks', 1); } //]]> </script> --- 17,24 ---- return; } ! dE('questionnaire-form', -1); ! dE('questionnaire-thanks', 1); } //]]> </script> *************** *** 59,66 **** <script type="text/javascript"> //<![CDATA[ ! dE('configlist', false); ! dE('questionnaire-thanks', false); //]]> </script> --- 59,66 ---- <script type="text/javascript"> //<![CDATA[ ! dE('configlist', -1); ! dE('questionnaire-thanks', -1); //]]> </script> Modified: branches/phpBB-3_0_0/phpBB/includes/acp/acp_send_statistics.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/includes/acp/acp_send_statistics.php (original) --- branches/phpBB-3_0_0/phpBB/includes/acp/acp_send_statistics.php Wed Jul 22 00:11:46 2009 *************** *** 29,40 **** { global $config, $template; ! $collect_url = "http://www.phpbb.com/stats/getstatdata.php"; $this->tpl_name = 'acp_send_statistics'; $this->page_title = 'ACP_SEND_STATISTICS'; ! $collector = new phpbb_questionnaire_data_collector(); // Add data provider $collector->add_data_provider(new phpbb_questionnaire_php_data_provider()); --- 29,51 ---- { global $config, $template; ! $collect_url = "http://www.phpbb.com/stats/receive_stats.php"; $this->tpl_name = 'acp_send_statistics'; $this->page_title = 'ACP_SEND_STATISTICS'; ! // generate a unique id if necessary ! if (!isset($config['questionnaire_unique_id'])) ! { ! $install_id = unique_id(); ! set_config('questionnaire_unique_id', $install_id); ! } ! else ! { ! $install_id = $config['questionnaire_unique_id']; ! } ! ! $collector = new phpbb_questionnaire_data_collector($install_id); // Add data provider $collector->add_data_provider(new phpbb_questionnaire_php_data_provider()); Modified: branches/phpBB-3_0_0/phpBB/includes/questionnaire/questionnaire.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/includes/questionnaire/questionnaire.php (original) --- branches/phpBB-3_0_0/phpBB/includes/questionnaire/questionnaire.php Wed Jul 22 00:11:46 2009 *************** *** 30,44 **** { var $providers; var $data = null; /** * Constructor. * - * @param array * @param string */ ! function phpbb_questionnaire_data_collector() { $this->providers = array(); } --- 30,45 ---- { var $providers; var $data = null; + var $install_id = ''; /** * Constructor. * * @param string */ ! function phpbb_questionnaire_data_collector($install_id) { + $this->install_id = $install_id; $this->providers = array(); } *************** *** 79,84 **** --- 80,86 ---- $provider = &$this->providers[$key]; $this->data[$provider->get_identifier()] = $provider->get_data(); } + $this->data['install_id'] = $this->install_id; } } *************** *** 229,290 **** */ function get_data() { ! // Exclude certain config vars ! $exclude_config_vars = array( ! 'avatar_gallery_path' => true, ! 'avatar_path' => true, ! 'avatar_salt' => true, ! 'board_contact' => true, ! 'board_disable_msg' => true, ! 'board_email' => true, ! 'board_email_sig' => true, ! 'cookie_name' => true, ! 'icons_path' => true, ! 'icons_path' => true, ! 'jab_host' => true, ! 'jab_password' => true, ! 'jab_port' => true, ! 'jab_username' => true, ! 'ldap_base_dn' => true, ! 'ldap_email' => true, ! 'ldap_password' => true, ! 'ldap_port' => true, ! 'ldap_server' => true, ! 'ldap_uid' => true, ! 'ldap_user' => true, ! 'ldap_user_filter' => true, ! 'ranks_path' => true, ! 'script_path' => true, ! 'server_name' => true, ! 'server_port' => true, ! 'server_protocol' => true, ! 'site_desc' => true, ! 'sitename' => true, ! 'smilies_path' => true, ! 'smtp_host' => true, ! 'smtp_password' => true, ! 'smtp_port' => true, ! 'smtp_username' => true, ! 'upload_icons_path' => true, ! 'upload_path' => true, ! 'newest_user_colour' => true, ! 'newest_user_id' => true, ! 'newest_username' => true, ! 'rand_seed' => true, ); $result = array(); foreach ($this->config as $name => $value) { ! // Mods may add columns for storing passwords - we do not want to grab them ! if (isset($exclude_config_vars[$name]) || strpos($name, 'password') !== false) { ! continue; } - - $result['config.' . $name] = $value; } return $result; } } --- 231,452 ---- */ function get_data() { ! global $phpbb_root_path, $phpEx; ! include("{$phpbb_root_path}config.$phpEx"); ! ! // Only send certain config vars ! $config_vars = array( ! 'active_sessions' => true, ! 'allow_attachments' => true, ! 'allow_autologin' => true, ! 'allow_avatar' => true, ! 'allow_avatar_local' => true, ! 'allow_avatar_remote' => true, ! 'allow_avatar_upload' => true, ! 'allow_bbcode' => true, ! 'allow_birthdays' => true, ! 'allow_bookmarks' => true, ! 'allow_emailreuse' => true, ! 'allow_forum_notify' => true, ! 'allow_mass_pm' => true, ! 'allow_name_chars' => true, ! 'allow_namechange' => true, ! 'allow_nocensors' => true, ! 'allow_pm_attach' => true, ! 'allow_post_flash' => true, ! 'allow_post_links' => true, ! 'allow_privmsg' => true, ! 'allow_quick_reply' => true, ! 'allow_sig' => true, ! 'allow_sig_bbcode' => true, ! 'allow_sig_flash' => true, ! 'allow_sig_img' => true, ! 'allow_sig_links' => true, ! 'allow_sig_pm' => true, ! 'allow_sig_smilies' => true, ! 'allow_smilies' => true, ! 'allow_topic_notify' => true, ! 'attachment_quota' => true, ! 'auth_bbcode_pm' => true, ! 'auth_flash_pm' => true, ! 'auth_img_pm' => true, ! 'auth_method' => true, ! 'auth_smilies_pm' => true, ! 'avatar_filesize' => true, ! 'avatar_max_height' => true, ! 'avatar_max_width' => true, ! 'avatar_min_height' => true, ! 'avatar_min_width' => true, ! 'board_dst' => true, ! 'board_email_form' => true, ! 'board_hide_emails' => true, ! 'board_timezone' => true, ! 'browser_check' => true, ! 'bump_interval' => true, ! 'bump_type' => true, ! 'cache_gc' => true, ! 'captcha_plugin' => true, ! 'captcha_gd' => true, ! 'captcha_gd_foreground_noise' => true, ! 'captcha_gd_x_grid' => true, ! 'captcha_gd_y_grid' => true, ! 'captcha_gd_wave' => true, ! 'captcha_gd_3d_noise' => true, ! 'captcha_gd_fonts' => true, ! 'confirm_refresh' => true, ! 'check_attachment_content' => true, ! 'check_dnsbl' => true, ! 'chg_passforce' => true, ! 'cookie_secure' => true, ! 'coppa_enable' => true, ! 'database_gc' => true, ! 'dbms_version' => true, ! 'default_dateformat' => true, ! 'display_last_edited' => true, ! 'display_order' => true, ! 'edit_time' => true, ! 'email_check_mx' => true, ! 'email_enable' => true, ! 'email_function_name' => true, ! 'email_package_size' => true, ! 'enable_confirm' => true, ! 'enable_pm_icons' => true, ! 'enable_post_confirm' => true, ! 'feed_enable' => true, ! 'feed_limit' => true, ! 'feed_overall_forums' => true, ! 'feed_overall_forums_limit' => true, ! 'feed_overall_topics' => true, ! 'feed_overall_topics_limit' => true, ! 'feed_forum' => true, ! 'feed_topic' => true, ! 'feed_item_statistics' => true, ! 'flood_interval' => true, ! 'force_server_vars' => true, ! 'form_token_lifetime' => true, ! 'form_token_mintime' => true, ! 'form_token_sid_guests' => true, ! 'forward_pm' => true, ! 'forwarded_for_check' => true, ! 'full_folder_action' => true, ! 'fulltext_native_common_thres' => true, ! 'fulltext_native_load_upd' => true, ! 'fulltext_native_max_chars' => true, ! 'fulltext_native_min_chars' => true, ! 'gzip_compress' => true, ! 'hot_threshold' => true, ! 'img_create_thumbnail' => true, ! 'img_display_inlined' => true, ! 'img_imagick' => true, ! 'img_link_height' => true, ! 'img_link_width' => true, ! 'img_max_height' => true, ! 'img_max_thumb_width' => true, ! 'img_max_width' => true, ! 'img_min_thumb_filesize' => true, ! 'ip_check' => true, ! 'jab_enable' => true, ! 'jab_package_size' => true, ! 'jab_use_ssl' => true, ! 'limit_load' => true, ! 'limit_search_load' => true, ! 'load_anon_lastread' => true, ! 'load_birthdays' => true, ! 'load_cpf_memberlist' => true, ! 'load_cpf_viewprofile' => true, ! 'load_cpf_viewtopic' => true, ! 'load_db_lastread' => true, ! 'load_db_track' => true, ! 'load_jumpbox' => true, ! 'load_moderators' => true, ! 'load_online' => true, ! 'load_online_guests' => true, ! 'load_online_time' => true, ! 'load_onlinetrack' => true, ! 'load_search' => true, ! 'load_tplcompile' => true, ! 'load_user_activity' => true, ! 'max_attachments' => true, ! 'max_attachments_pm' => true, ! 'max_autologin_time' => true, ! 'max_filesize' => true, ! 'max_filesize_pm' => true, ! 'max_login_attempts' => true, ! 'max_name_chars' => true, ! 'max_num_search_keywords' => true, ! 'max_pass_chars' => true, ! 'max_poll_options' => true, ! 'max_post_chars' => true, ! 'max_post_font_size' => true, ! 'max_post_img_height' => true, ! 'max_post_img_width' => true, ! 'max_post_smilies' => true, ! 'max_post_urls' => true, ! 'max_quote_depth' => true, ! 'max_reg_attempts' => true, ! 'max_sig_chars' => true, ! 'max_sig_font_size' => true, ! 'max_sig_img_height' => true, ! 'max_sig_img_width' => true, ! 'max_sig_smilies' => true, ! 'max_sig_urls' => true, ! 'min_name_chars' => true, ! 'min_pass_chars' => true, ! 'min_post_chars' => true, ! 'min_search_author_chars' => true, ! 'mime_triggers' => true, ! 'new_member_post_limit' => true, ! 'new_member_group_default' => true, ! 'override_user_style' => true, ! 'pass_complex' => true, ! 'pm_edit_time' => true, ! 'pm_max_boxes' => true, ! 'pm_max_msgs' => true, ! 'pm_max_recipients' => true, ! 'posts_per_page' => true, ! 'print_pm' => true, ! 'queue_interval' => true, ! 'require_activation' => true, ! 'referer_validation' => true, ! 'search_block_size' => true, ! 'search_gc' => true, ! 'search_interval' => true, ! 'search_anonymous_interval' => true, ! 'search_type' => true, ! 'search_store_results' => true, ! 'secure_allow_deny' => true, ! 'secure_allow_empty_referer' => true, ! 'secure_downloads' => true, ! 'session_gc' => true, ! 'session_length' => true, ! 'smtp_auth_method' => true, ! 'smtp_delivery' => true, ! 'topics_per_page' => true, ! 'tpl_allow_php' => true, ! 'version' => true, ! 'warnings_expire_days' => true, ! 'warnings_gc' => true, ! ! 'num_files' => true, ! 'num_posts' => true, ! 'num_topics' => true, ! 'num_users' => true, ! 'record_online_users' => true, ); $result = array(); foreach ($this->config as $name => $value) { ! if (!isset($exclude_config_vars[$name])) { ! $result['config.' . $name] = $value; } } + $result['dbms'] = $dbms; + $result['acm_type'] = $acm_type; + $result['load_extensions'] = $load_extensions; + return $result; } } |
From: Nils A. <nad...@ph...> - 2009-07-21 22:52:05
|
Author: naderman Date: Tue Jul 21 22:51:39 2009 New Revision: 9817 Log: Adding info on the VCS to coding guidelines Modified: branches/phpBB-3_0_0/phpBB/docs/coding-guidelines.html Modified: branches/phpBB-3_0_0/phpBB/docs/coding-guidelines.html ============================================================================== *** branches/phpBB-3_0_0/phpBB/docs/coding-guidelines.html (original) --- branches/phpBB-3_0_0/phpBB/docs/coding-guidelines.html Tue Jul 21 22:51:39 2009 *************** *** 86,91 **** --- 86,97 ---- <li><a href="#writingstyle">Writing Style</a></li> </ol> </li> + <li><a href="#vcs">VCS Guidelines</a> + <ol style="list-style-type: lower-roman;"> + <li><a href="#repostruct">Repository structure</a></li> + <li><a href="#commitmessage">Commit messages</a></li> + </ol> + </li> <li><a href="#changes">Guidelines Changelog</a></li> <li><a href="#disclaimer">Copyright and disclaimer</a></li> </ol> *************** *** 2252,2263 **** <hr /> ! <a name="changes"></a><h2>7. Guidelines Changelog</h2> <div class="paragraph"> <div class="inner"><span class="corners-top"><span></span></span> <div class="content"> <h3>Revision 8732</h3> --- 2258,2324 ---- <hr /> ! <a name="vcs"></a><h2>7. VCS Guidelines</h2> ! <div class="paragraph"> <div class="inner"><span class="corners-top"><span></span></span> <div class="content"> + <p>The version control system for phpBB3 is subversion. The repository is available at <a href="http://code.phpbb.com/svn/phpbb" title="repository">http://code.phpbb.com/svn/phpbb</a>. + + <a name="repostruct"></a><h3>7.i. Repository Structure</h3> + + <ul> + <li><strong>trunk</strong><br />The latest unstable development version with new features etc. Contains the actual board in <code>/trunk/phpBB</code></li> + <li><strong>branches</strong><br />Development branches of stable phpBB releases. Copied from <code>/trunk</code> at the time of release. + <ul> + <li><strong>phpBB3.0</strong><code>/branches/phpBB-3_0_0/phpBB</code><br />Development branch of the stable 3.0 line. Bug fixes are applied here.</li> + <li><strong>phpBB2</strong><code>/branches/phpBB-2_0_0/phpBB</code><br />Old phpBB2 development branch.</li> + </ul> + </li> + <li><strong>tags</strong><br />Released versions. Copies of trunk or the respective branch, made at the time of release. + <ul> + <li><code>/tags/release_3_0_BX</code><br />Beta release X of the 3.0 line.</li> + <li><code>/tags/release_3_0_RCX</code><br />Release candidate X of the 3.0 line.</li> + <li><code>/tags/release_3_0_X-RCY</code><br />Release candidate Y of the stable 3.0.X release.</li> + <li><code>/tags/release_3_0_X</code><br />Stable <strong>3.0.X</strong> release.</li> + <li><code>/tags/release_2_0_X</code><br />Old stable 2.0.X release.</li> + </ul> + </li> + </ul> + + <a name="commitmessage"></a><h3>7.ii. Commit Messages</h3> + + <p>The commit message should contain a brief explanation of all changes made within the commit. Often identical to the changelog entry. A bug ticket can be referenced by specifying the ticket ID with a hash, e.g. #12345. A reference to another revision should simply be prefixed with r, e.g. r12345.</p> + + <p>Junior Developers need to have their patches approved by a development team member first. The commit message must end in a line with the following format:</p> + + <div class="codebox"><pre> + Authorised by: developer1[, developer2[, ...]] + </pre></div> + + </div> + + <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> + + <span class="corners-bottom"><span></span></span></div> + </div> + + <hr /> + + <a name="changes"></a><h2>8. Guidelines Changelog</h2> + <div class="paragraph"> + <div class="inner"><span class="corners-top"><span></span></span> + + <div class="content"> + + + <h3>Revision 9817</h3> + + <ul> + <li>Added VCS section.</li> + </ul> <h3>Revision 8732</h3> *************** *** 2330,2336 **** <hr /> ! <a name="disclaimer"></a><h2>8. Copyright and disclaimer</h2> <div class="paragraph"> <div class="inner"><span class="corners-top"><span></span></span> --- 2391,2397 ---- <hr /> ! <a name="disclaimer"></a><h2>9. Copyright and disclaimer</h2> <div class="paragraph"> <div class="inner"><span class="corners-top"><span></span></span> |
From: Andreas F. <ba...@ph...> - 2009-07-21 21:21:41
|
Author: bantu Date: Tue Jul 21 21:21:11 2009 New Revision: 9816 Log: Props Modified: branches/phpBB-3_0_0/phpBB/includes/mcp/info/mcp_pm_reports.php (props changed) branches/phpBB-3_0_0/phpBB/includes/mcp/mcp_pm_reports.php (props changed) Propchange: branches/phpBB-3_0_0/phpBB/includes/mcp/info/mcp_pm_reports.php ------------------------------------------------------------------------------ svn:eol-style = LF Propchange: branches/phpBB-3_0_0/phpBB/includes/mcp/info/mcp_pm_reports.php ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Propchange: branches/phpBB-3_0_0/phpBB/includes/mcp/mcp_pm_reports.php ------------------------------------------------------------------------------ svn:eol-style = LF Propchange: branches/phpBB-3_0_0/phpBB/includes/mcp/mcp_pm_reports.php ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision |
From: Nils A. <nad...@ph...> - 2009-07-21 21:12:04
|
Author: naderman Date: Tue Jul 21 21:11:45 2009 New Revision: 9815 Log: and add the properties ... Modified: branches/phpBB-3_0_0/phpBB/language/en/email/pm_report_closed.txt (props changed) branches/phpBB-3_0_0/phpBB/language/en/email/pm_report_deleted.txt (props changed) Propchange: branches/phpBB-3_0_0/phpBB/language/en/email/pm_report_closed.txt ------------------------------------------------------------------------------ svn:eol-style = LF Propchange: branches/phpBB-3_0_0/phpBB/language/en/email/pm_report_closed.txt ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Propchange: branches/phpBB-3_0_0/phpBB/language/en/email/pm_report_deleted.txt ------------------------------------------------------------------------------ svn:eol-style = LF Propchange: branches/phpBB-3_0_0/phpBB/language/en/email/pm_report_deleted.txt ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision |
From: Nils A. <nad...@ph...> - 2009-07-21 21:03:54
|
Modified: branches/phpBB-3_0_0/phpBB/styles/subsilver2/template/mcp_front.html ============================================================================== *** branches/phpBB-3_0_0/phpBB/styles/subsilver2/template/mcp_front.html (original) --- branches/phpBB-3_0_0/phpBB/styles/subsilver2/template/mcp_front.html Tue Jul 21 20:59:11 2009 *************** *** 85,90 **** --- 85,127 ---- <br clear="all" /><br /> <!-- ENDIF --> + <!-- IF S_SHOW_PM_REPORTS --> + <table class="tablebg" width="100%" cellspacing="1"> + <tr> + <td class="row3" colspan="6" align="center"><b class="gen">{L_LATEST_REPORTED_PMS}</b></td> + </tr> + <tr> + <th> {L_PM_SUBJECT} </th> + <th> {L_PM_FROM} </th> + <th> {L_TO} & {L_BCC} </th> + <th> {L_SENT_AT} </th> + <th> {L_REPORTER} </th> + <th> {L_REPORT_TIME} </th> + </tr> + <!-- BEGIN pm_report --> + <tr> + <td class="row1" valign="top"><span class="gen">{pm_report.PM_SUBJECT}</span><br /><span class="gensmall">[ <a href="{pm_report.U_PM_DETAILS}">{L_VIEW_DETAILS}</a> ]</span></td> + <td class="row2" align="center" width="15%" nowrap="nowrap" valign="top"><span class="gen">{pm_report.PM_AUTHOR_FULL}</span></td> + <td class="row1" align="center" width="15%" nowrap="nowrap" valign="top"><span class="gen">{pm_report.RECIPIENTS}</span></td> + <td class="row2" align="center" width="10%" nowrap="nowrap" valign="top"><span class="gensmall">{pm_report.PM_TIME}</span></td> + <td class="row1" align="center" width="15%" nowrap="nowrap" valign="top"><span class="gen">{pm_report.REPORTER_FULL}</span></td> + <td class="row2" align="center" width="10%" nowrap="nowrap" valign="top"><span class="gensmall">{pm_report.REPORT_TIME}</span></td> + </tr> + <!-- BEGINELSE --> + <tr> + <td class="row1" colspan="6" align="center"><span class="gen">{L_PM_REPORTS_ZERO_TOTAL}</span></td> + </tr> + <!-- END pm_report --> + <!-- IF S_HAS_PM_REPORTS --> + <tr> + <td class="row3" colspan="6"><span class="gensmall">{L_PM_REPORTS_TOTAL}</span></td> + </tr> + <!-- ENDIF --> + </table> + + <br clear="all" /><br /> + <!-- ENDIF --> + <!-- IF S_SHOW_LOGS --> <table class="tablebg" width="100%" cellspacing="1" cellpadding="4" border="0" align="{S_CONTENT_FLOW_END}"> <tr> Modified: branches/phpBB-3_0_0/phpBB/styles/subsilver2/template/mcp_post.html ============================================================================== *** branches/phpBB-3_0_0/phpBB/styles/subsilver2/template/mcp_post.html (original) --- branches/phpBB-3_0_0/phpBB/styles/subsilver2/template/mcp_post.html Tue Jul 21 20:59:11 2009 *************** *** 5,11 **** <table width="100%" cellpadding="3" cellspacing="1" border="0" class="tablebg"> <tr> ! <th colspan="2" align="center">{L_REPORT_DETAILS}</th> </tr> <tr> <td class="row1"><b class="gen">{L_REPORT_REASON}: </b></td> --- 5,11 ---- <table width="100%" cellpadding="3" cellspacing="1" border="0" class="tablebg"> <tr> ! <th colspan="2" align="center"><!-- IF S_PM -->{L_PM_REPORT_DETAILS}<!-- ELSE -->{L_REPORT_DETAILS}<!-- ENDIF --></th> </tr> <tr> <td class="row1"><b class="gen">{L_REPORT_REASON}: </b></td> *************** *** 43,59 **** <table width="100%" cellpadding="3" cellspacing="1" border="0" class="tablebg"> <tr> ! <th colspan="2" align="center">{L_POST_DETAILS}</th> </tr> <tr> ! <td class="row3" colspan="2" align="center"><span class="gensmall"><!-- IF S_MCP_QUEUE -->{RETURN_QUEUE} | {RETURN_TOPIC_SIMPLE} | {RETURN_POST}<!-- ELSEIF S_MCP_REPORT -->{RETURN_REPORTS} | <a href="{U_VIEW_POST}">{L_VIEW_POST}</a> | <a href="{U_VIEW_TOPIC}">{L_VIEW_TOPIC}</a> | <a href="{U_VIEW_FORUM}">{L_VIEW_FORUM}</a><!-- ELSE -->{RETURN_TOPIC}<!-- ENDIF --></span></td> </tr> <tr> ! <td class="row1"><b class="gen">{L_POST_SUBJECT}: </b></td> <td class="row2"><span class="gen">{POST_SUBJECT}</span> <!-- IF S_POST_UNAPPROVED --><span class="postapprove">{UNAPPROVED_IMG} <a href="{U_MCP_APPROVE}">{L_POST_UNAPPROVED}</a></span> <!-- ENDIF --> <!-- IF S_POST_REPORTED and not S_MCP_REPORT --><span class="postreported">{REPORTED_IMG} <a href="{U_MCP_REPORT}">{L_POST_REPORTED}</a></span><!-- ENDIF --></td> </tr> <tr> ! <td class="row1" width="20%"><b class="gen">{L_POSTER}: </b></td> <td class="row2" width="80%"><span class="gen"<!-- IF POST_AUTHOR_COLOUR --> style="font-weight: bold; color: {POST_AUTHOR_COLOUR}"<!-- ENDIF -->>{POST_AUTHOR}</span><span class="gen"> [ <!-- IF U_POST_AUTHOR --><a href="{U_POST_AUTHOR}">{L_READ_PROFILE}</a><!-- ENDIF --><!-- IF S_USER_NOTES --><!-- IF U_POST_AUTHOR --> | <!-- ENDIF --><a href="{U_MCP_USER_NOTES}">{L_VIEW_NOTES}</a> <!-- IF U_MCP_WARN_USER -->| <a href="{U_MCP_WARN_USER}">{L_WARN_USER}</a><!-- ENDIF --><!-- ENDIF --> ]</span></td> </tr> <!-- IF S_CAN_VIEWIP --> --- 43,59 ---- <table width="100%" cellpadding="3" cellspacing="1" border="0" class="tablebg"> <tr> ! <th colspan="2" align="center"><!-- IF S_PM -->{L_PM}<!-- ELSE -->{L_POST_DETAILS}<!-- ENDIF --></th> </tr> <tr> ! <td class="row3" colspan="2" align="center"><span class="gensmall"><!-- IF S_MCP_QUEUE -->{RETURN_QUEUE} | {RETURN_TOPIC_SIMPLE} | {RETURN_POST}<!-- ELSEIF S_MCP_REPORT -->{RETURN_REPORTS} | <!-- IF S_PM --><a href="{U_VIEW_POST}">{L_VIEW_PM}</a><!-- ELSE --><a href="{U_VIEW_POST}">{L_VIEW_POST}</a> | <a href="{U_VIEW_TOPIC}">{L_VIEW_TOPIC}</a> | <a href="{U_VIEW_FORUM}">{L_VIEW_FORUM}</a><!-- ENDIF --><!-- ELSE -->{RETURN_TOPIC}<!-- ENDIF --></span></td> </tr> <tr> ! <td class="row1"><b class="gen"><!-- IF S_PM -->{L_PM_SUBJECT}<!-- ELSE -->{L_POST_SUBJECT}<!-- ENDIF -->: </b></td> <td class="row2"><span class="gen">{POST_SUBJECT}</span> <!-- IF S_POST_UNAPPROVED --><span class="postapprove">{UNAPPROVED_IMG} <a href="{U_MCP_APPROVE}">{L_POST_UNAPPROVED}</a></span> <!-- ENDIF --> <!-- IF S_POST_REPORTED and not S_MCP_REPORT --><span class="postreported">{REPORTED_IMG} <a href="{U_MCP_REPORT}">{L_POST_REPORTED}</a></span><!-- ENDIF --></td> </tr> <tr> ! <td class="row1" width="20%"><b class="gen"><!-- IF S_PM -->{L_PM_FROM}<!-- ELSE -->{L_POSTER}<!-- ENDIF -->: </b></td> <td class="row2" width="80%"><span class="gen"<!-- IF POST_AUTHOR_COLOUR --> style="font-weight: bold; color: {POST_AUTHOR_COLOUR}"<!-- ENDIF -->>{POST_AUTHOR}</span><span class="gen"> [ <!-- IF U_POST_AUTHOR --><a href="{U_POST_AUTHOR}">{L_READ_PROFILE}</a><!-- ENDIF --><!-- IF S_USER_NOTES --><!-- IF U_POST_AUTHOR --> | <!-- ENDIF --><a href="{U_MCP_USER_NOTES}">{L_VIEW_NOTES}</a> <!-- IF U_MCP_WARN_USER -->| <a href="{U_MCP_WARN_USER}">{L_WARN_USER}</a><!-- ENDIF --><!-- ENDIF --> ]</span></td> </tr> <!-- IF S_CAN_VIEWIP --> *************** *** 69,77 **** </tr> <!-- ENDIF --> <tr> ! <td class="row1"><b class="gen">{L_POSTED}: </b></td> <td class="row2"><span class="postdetails">{POST_DATE}</span></td> </tr> <tr> <th colspan="2" align="center">{L_PREVIEW}</th> </tr> --- 69,98 ---- </tr> <!-- ENDIF --> <tr> ! <td class="row1"><b class="gen"><!-- IF S_PM -->{L_SENT_AT}<!-- ELSE -->{L_POSTED}<!-- ENDIF -->: </b></td> <td class="row2"><span class="postdetails">{POST_DATE}</span></td> </tr> + <!-- IF S_TO_RECIPIENT --> + <tr> + <td class="row1" nowrap="nowrap" width="150"><b class="gen">{L_TO}:</b></td> + <td class="row2 gen"> + <!-- BEGIN to_recipient --> + <!-- IF to_recipient.IS_GROUP --><span class="sep"><a href="{to_recipient.U_VIEW}">{to_recipient.NAME}</a></span><!-- ELSE -->{to_recipient.NAME_FULL} <!-- ENDIF --> + <!-- END to_recipient --> + </td> + </tr> + <!-- ENDIF --> + + <!-- IF S_BCC_RECIPIENT --> + <tr> + <td class="row1" nowrap="nowrap" width="150"><b class="gen">{L_BCC}:</b></td> + <td class="row2 gen"> + <!-- BEGIN bcc_recipient --> + <!-- IF bcc_recipient.IS_GROUP --><span class="sep"><a href="{bcc_recipient.U_VIEW}">{bcc_recipient.NAME}</a></span><!-- ELSE -->{bcc_recipient.NAME_FULL} <!-- ENDIF --> + <!-- END bcc_recipient --> + </td> + </tr> + <!-- ENDIF --> <tr> <th colspan="2" align="center">{L_PREVIEW}</th> </tr> Modified: branches/phpBB-3_0_0/phpBB/styles/subsilver2/template/mcp_reports.html ============================================================================== *** branches/phpBB-3_0_0/phpBB/styles/subsilver2/template/mcp_reports.html (original) --- branches/phpBB-3_0_0/phpBB/styles/subsilver2/template/mcp_reports.html Tue Jul 21 20:59:11 2009 *************** *** 7,17 **** <th colspan="5" nowrap="nowrap">{L_DISPLAY_OPTIONS}</th> </tr> <tr> ! <td colspan="5" class="cat" align="center"><span class="gensmall">{L_DISPLAY_POSTS}:</span> {S_SELECT_SORT_DAYS} <span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR} <span class="gensmall">{L_FORUM}</span> <select name="f">{S_FORUM_OPTIONS}</select> <!-- IF TOPIC_ID --><input type="checkbox" class="radio" name="t" value="{TOPIC_ID}" checked="checked" /> <b>{L_ONLY_TOPIC}</b> <!-- ENDIF --><input class="btnlite" type="submit" name="sort" value="{L_GO}" /></td> </tr> <tr> <th> {L_POST} </th> <th> {L_AUTHOR} </th> <th> {L_REPORTER} </th> <th> {L_REPORT_TIME} </th> <th width="5%"> {L_SELECT} </th> --- 7,22 ---- <th colspan="5" nowrap="nowrap">{L_DISPLAY_OPTIONS}</th> </tr> <tr> ! <td colspan="5" class="cat" align="center"><span class="gensmall">{L_DISPLAY_POSTS}:</span> {S_SELECT_SORT_DAYS} <span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}<!-- IF not S_PM --> <span class="gensmall">{L_FORUM}</span> <select name="f">{S_FORUM_OPTIONS}</select> <!-- IF TOPIC_ID --><input type="checkbox" class="radio" name="t" value="{TOPIC_ID}" checked="checked" /> <b>{L_ONLY_TOPIC}</b> <!-- ENDIF --><!-- ENDIF --><input class="btnlite" type="submit" name="sort" value="{L_GO}" /></td> </tr> <tr> + <!-- IF S_PM --> + <th> {L_PM} </th> + <th> {L_TO} & {L_BCC} </th> + <!-- ELSE --> <th> {L_POST} </th> <th> {L_AUTHOR} </th> + <!-- ENDIF --> <th> {L_REPORTER} </th> <th> {L_REPORT_TIME} </th> <th width="5%"> {L_SELECT} </th> *************** *** 19,28 **** --- 24,40 ---- <!-- BEGIN postrow --> <!-- IF postrow.S_ROW_ is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF --> + <!-- IF S_PM --> + <td style="padding: 4px;"><p class="topictitle"><a href="{postrow.U_VIEW_DETAILS}">{postrow.PM_SUBJECT}</a></p> + <span class="gensmall">{L_PM_FROM}: {postrow.PM_AUTHOR_FULL}</span></td> + <td style="padding: 4px;" align="{S_CONTENT_FLOW_BEGIN}" valign="top"><span class="gen">{postrow.RECIPIENTS}</span><br /> + <span class="gensmall">{L_SENT_AT}: {postrow.PM_TIME}</span></td> + <!-- ELSE --> <td style="padding: 4px;"><p class="topictitle"><a href="{postrow.U_VIEWPOST}">{postrow.POST_SUBJECT}</a></p> <span class="gensmall"><!-- IF postrow.U_VIEWFORUM -->{L_FORUM}: <a href="{postrow.U_VIEWFORUM}">{postrow.FORUM_NAME}</a><!-- ELSE -->{postrow.FORUM_NAME}<!-- ENDIF --></span></td> <td style="padding: 4px;" align="{S_CONTENT_FLOW_BEGIN}" valign="top" nowrap="nowrap"><span class="gen">{postrow.POST_AUTHOR_FULL}</span><br /> <span class="gensmall">{postrow.POST_TIME}</span></td> + <!-- ENDIF --> <td style="padding: 4px;" align="{S_CONTENT_FLOW_BEGIN}" valign="top" nowrap="nowrap"><span class="gen">{postrow.REPORTER_FULL}</span></td> <td style="padding: 4px;" align="{S_CONTENT_FLOW_BEGIN}" valign="top" nowrap="nowrap"><span class="gen">{postrow.REPORT_TIME}</span><br /> <span class="gensmall">[ <a href="{postrow.U_VIEW_DETAILS}">{L_VIEW_DETAILS}</a> ]</span></td> Modified: branches/phpBB-3_0_0/phpBB/styles/subsilver2/template/report_body.html ============================================================================== *** branches/phpBB-3_0_0/phpBB/styles/subsilver2/template/report_body.html (original) --- branches/phpBB-3_0_0/phpBB/styles/subsilver2/template/report_body.html Tue Jul 21 20:59:11 2009 *************** *** 4,13 **** <table class="tablebg" width="100%" cellspacing="1"> <tr> ! <th colspan="2">{L_REPORT_POST}</th> </tr> <tr> ! <td class="row3" colspan="2"><span class="gensmall">{L_REPORT_POST_EXPLAIN}</span></td> </tr> <tr> <td class="row1" width="22%"><b class="gen">{L_REASON}:</b></td> --- 4,13 ---- <table class="tablebg" width="100%" cellspacing="1"> <tr> ! <th colspan="2"><!-- IF S_REPORT_POST -->{L_REPORT_POST}<!-- ELSE -->{L_REPORT_MESSAGE}<!-- ENDIF --></th> </tr> <tr> ! <td class="row3" colspan="2"><span class="gensmall"><!-- IF S_REPORT_POST -->{L_REPORT_POST_EXPLAIN}<!-- ELSE -->{L_REPORT_MESSAGE_EXPLAIN}<!-- ENDIF --></span></td> </tr> <tr> <td class="row1" width="22%"><b class="gen">{L_REASON}:</b></td> Modified: branches/phpBB-3_0_0/phpBB/styles/subsilver2/template/ucp_pm_viewmessage.html ============================================================================== *** branches/phpBB-3_0_0/phpBB/styles/subsilver2/template/ucp_pm_viewmessage.html (original) --- branches/phpBB-3_0_0/phpBB/styles/subsilver2/template/ucp_pm_viewmessage.html Tue Jul 21 20:59:11 2009 *************** *** 93,99 **** <table width="100%" cellspacing="0"> <tr valign="middle"> ! <td class="gensmall" align="{S_CONTENT_FLOW_END}"> <!-- IF U_DELETE --><a href="{U_DELETE}">{DELETE_IMG}</a> <!-- ENDIF --></td> </tr> </table> --- 93,99 ---- <table width="100%" cellspacing="0"> <tr valign="middle"> ! <td class="gensmall" align="{S_CONTENT_FLOW_END}"> <!-- IF U_REPORT --><a href="{U_REPORT}">{REPORT_IMG}</a> <!-- ENDIF --><!-- IF U_DELETE --><a href="{U_DELETE}">{DELETE_IMG}</a> <!-- ENDIF --></td> </tr> </table> |
From: Nils A. <nad...@ph...> - 2009-07-21 21:03:49
|
Author: naderman Date: Tue Jul 21 20:59:11 2009 New Revision: 9814 Log: Users can report PMs to moderators which are then visible in a new MCP module Added: branches/phpBB-3_0_0/phpBB/includes/mcp/info/mcp_pm_reports.php branches/phpBB-3_0_0/phpBB/includes/mcp/mcp_pm_reports.php branches/phpBB-3_0_0/phpBB/language/en/email/pm_report_closed.txt branches/phpBB-3_0_0/phpBB/language/en/email/pm_report_deleted.txt Modified: branches/phpBB-3_0_0/phpBB/develop/create_schema_files.php branches/phpBB-3_0_0/phpBB/docs/CHANGELOG.html branches/phpBB-3_0_0/phpBB/includes/acp/acp_board.php branches/phpBB-3_0_0/phpBB/includes/functions_privmsgs.php branches/phpBB-3_0_0/phpBB/includes/mcp/mcp_front.php branches/phpBB-3_0_0/phpBB/includes/mcp/mcp_reports.php branches/phpBB-3_0_0/phpBB/includes/ucp/ucp_pm_viewfolder.php branches/phpBB-3_0_0/phpBB/includes/ucp/ucp_pm_viewmessage.php branches/phpBB-3_0_0/phpBB/install/database_update.php branches/phpBB-3_0_0/phpBB/install/schemas/firebird_schema.sql branches/phpBB-3_0_0/phpBB/install/schemas/mssql_schema.sql branches/phpBB-3_0_0/phpBB/install/schemas/mysql_40_schema.sql branches/phpBB-3_0_0/phpBB/install/schemas/mysql_41_schema.sql branches/phpBB-3_0_0/phpBB/install/schemas/oracle_schema.sql branches/phpBB-3_0_0/phpBB/install/schemas/postgres_schema.sql branches/phpBB-3_0_0/phpBB/install/schemas/schema_data.sql branches/phpBB-3_0_0/phpBB/install/schemas/sqlite_schema.sql branches/phpBB-3_0_0/phpBB/language/en/acp/board.php branches/phpBB-3_0_0/phpBB/language/en/acp/common.php branches/phpBB-3_0_0/phpBB/language/en/mcp.php branches/phpBB-3_0_0/phpBB/mcp.php branches/phpBB-3_0_0/phpBB/report.php branches/phpBB-3_0_0/phpBB/styles/prosilver/template/mcp_front.html branches/phpBB-3_0_0/phpBB/styles/prosilver/template/mcp_post.html branches/phpBB-3_0_0/phpBB/styles/prosilver/template/mcp_reports.html branches/phpBB-3_0_0/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html branches/phpBB-3_0_0/phpBB/styles/subsilver2/template/mcp_front.html branches/phpBB-3_0_0/phpBB/styles/subsilver2/template/mcp_post.html branches/phpBB-3_0_0/phpBB/styles/subsilver2/template/mcp_reports.html branches/phpBB-3_0_0/phpBB/styles/subsilver2/template/report_body.html branches/phpBB-3_0_0/phpBB/styles/subsilver2/template/ucp_pm_viewmessage.html Modified: branches/phpBB-3_0_0/phpBB/develop/create_schema_files.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/develop/create_schema_files.php (original) --- branches/phpBB-3_0_0/phpBB/develop/create_schema_files.php Tue Jul 21 20:59:11 2009 *************** *** 1332,1337 **** --- 1332,1338 ---- 'message_edit_count' => array('USINT', 0), 'to_address' => array('TEXT_UNI', ''), 'bcc_address' => array('TEXT_UNI', ''), + 'message_reported' => array('BOOL', 0), ), 'PRIMARY_KEY' => 'msg_id', 'KEYS' => array( *************** *** 1465,1470 **** --- 1466,1472 ---- 'report_id' => array('UINT', NULL, 'auto_increment'), 'reason_id' => array('USINT', 0), 'post_id' => array('UINT', 0), + 'pm_id' => array('UINT', 0), 'user_id' => array('UINT', 0), 'user_notify' => array('BOOL', 0), 'report_closed' => array('BOOL', 0), *************** *** 1472,1477 **** --- 1474,1483 ---- 'report_text' => array('MTEXT_UNI', ''), ), 'PRIMARY_KEY' => 'report_id', + 'KEYS' => array( + 'post_id' => array('INDEX', 'post_id'), + 'pm_id' => array('INDEX', 'pm_id'), + ), ); $schema_data['phpbb_reports_reasons'] = array( Modified: branches/phpBB-3_0_0/phpBB/docs/CHANGELOG.html ============================================================================== *** branches/phpBB-3_0_0/phpBB/docs/CHANGELOG.html (original) --- branches/phpBB-3_0_0/phpBB/docs/CHANGELOG.html Tue Jul 21 20:59:11 2009 *************** *** 217,222 **** --- 217,223 ---- <li>[Feature] Ability to delete warnings and keep warnings permanently (Bug #43375 - Patch by nickvergessen)</li> <li>[Feature] Ability to empty a user's outbox from the user ACP quick tools.</li> <li>[Feature] Ability to filter ACP / MCP logs</li> + <li>[Feature] Users can report PMs to moderators which are then visible in a new MCP module</li> </ul> <a name="v304"></a><h3>1.ii. Changes since 3.0.4</h3> Modified: branches/phpBB-3_0_0/phpBB/includes/acp/acp_board.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/includes/acp/acp_board.php (original) --- branches/phpBB-3_0_0/phpBB/includes/acp/acp_board.php Tue Jul 21 20:59:11 2009 *************** *** 81,86 **** --- 81,87 ---- 'allow_namechange' => array('lang' => 'ALLOW_NAME_CHANGE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'allow_attachments' => array('lang' => 'ALLOW_ATTACHMENTS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'allow_pm_attach' => array('lang' => 'ALLOW_PM_ATTACHMENTS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'allow_pm_report' => array('lang' => 'ALLOW_PM_REPORT', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'allow_bbcode' => array('lang' => 'ALLOW_BBCODE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'allow_smilies' => array('lang' => 'ALLOW_SMILIES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'allow_sig' => array('lang' => 'ALLOW_SIG', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), Modified: branches/phpBB-3_0_0/phpBB/includes/functions_privmsgs.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/includes/functions_privmsgs.php (original) --- branches/phpBB-3_0_0/phpBB/includes/functions_privmsgs.php Tue Jul 21 20:59:11 2009 *************** *** 1405,1411 **** 'bbcode_bitfield' => $data['bbcode_bitfield'], 'bbcode_uid' => $data['bbcode_uid'], 'to_address' => implode(':', $to), ! 'bcc_address' => implode(':', $bcc) ); break; --- 1405,1412 ---- 'bbcode_bitfield' => $data['bbcode_bitfield'], 'bbcode_uid' => $data['bbcode_uid'], 'to_address' => implode(':', $to), ! 'bcc_address' => implode(':', $bcc), ! 'message_reported' => 0, ); break; *************** *** 1880,1883 **** --- 1881,1973 ---- $user->data['message_limit'] = (!$message_limit) ? $config['pm_max_msgs'] : $message_limit; } + /** + * Generates an array of coloured recipient names from a list of PMs - (groups & users) + * + * @param array $pm_by_id An array of rows from PRIVMSGS_TABLE, keys are the msg_ids. + * + * @return array 2D Array: array(msg_id => array('username or group string', ...), ...) + * Usernames are generated with {@link get_username_string get_username_string} + * Groups are coloured and have a link to the membership page + */ + function get_recipient_strings($pm_by_id) + { + global $user, $db; + + $address_list = $recipient_list = $address = array(); + + $_types = array('u', 'g'); + + foreach ($pm_by_id as $message_id => $row) + { + $address[$message_id] = rebuild_header(array('to' => $row['to_address'], 'bcc' => $row['bcc_address'])); + + foreach ($_types as $ug_type) + { + if (isset($address[$message_id][$ug_type]) && sizeof($address[$message_id][$ug_type])) + { + foreach ($address[$message_id][$ug_type] as $ug_id => $in_to) + { + $recipient_list[$ug_type][$ug_id] = array('name' => $user->lang['NA'], 'colour' => ''); + } + } + } + } + + foreach ($_types as $ug_type) + { + if (!empty($recipient_list[$ug_type])) + { + if ($ug_type == 'u') + { + $sql = 'SELECT user_id as id, username as name, user_colour as colour + FROM ' . USERS_TABLE . ' + WHERE '; + } + else + { + $sql = 'SELECT group_id as id, group_name as name, group_colour as colour, group_type + FROM ' . GROUPS_TABLE . ' + WHERE '; + } + $sql .= $db->sql_in_set(($ug_type == 'u') ? 'user_id' : 'group_id', array_map('intval', array_keys($recipient_list[$ug_type]))); + + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + if ($ug_type == 'g') + { + $row['name'] = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['name']] : $row['name']; + } + + $recipient_list[$ug_type][$row['id']] = array('name' => $row['name'], 'colour' => $row['colour']); + } + $db->sql_freeresult($result); + } + } + + foreach ($address as $message_id => $adr_ary) + { + foreach ($adr_ary as $type => $id_ary) + { + foreach ($id_ary as $ug_id => $_id) + { + if ($type == 'u') + { + $address_list[$message_id][] = get_username_string('full', $ug_id, $recipient_list[$type][$ug_id]['name'], $recipient_list[$type][$ug_id]['colour']); + } + else + { + $user_colour = ($recipient_list[$type][$ug_id]['colour']) ? ' style="font-weight: bold; color:#' . $recipient_list[$type][$ug_id]['colour'] . '"' : ''; + $link = '<a href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $ug_id) . '"' . $user_colour . '>'; + $address_list[$message_id][] = $link . $recipient_list[$type][$ug_id]['name'] . (($link) ? '</a>' : ''); + } + } + } + } + + return $address_list; + } + ?> \ No newline at end of file Added: branches/phpBB-3_0_0/phpBB/includes/mcp/info/mcp_pm_reports.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/includes/mcp/info/mcp_pm_reports.php (added) --- branches/phpBB-3_0_0/phpBB/includes/mcp/info/mcp_pm_reports.php Tue Jul 21 20:59:11 2009 *************** *** 0 **** --- 1,39 ---- + <?php + /** + * + * @package mcp + * @version $Id$ + * @copyright (c) 2005 phpBB Group + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * + */ + + /** + * @package module_install + */ + class mcp_pm_reports_info + { + function module() + { + return array( + 'filename' => 'mcp_pm_reports', + 'title' => 'MCP_PM_REPORTS', + 'version' => '1.0.0', + 'modes' => array( + 'pm_reports' => array('title' => 'MCP_PM_REPORTS_OPEN', 'auth' => 'aclf_m_report', 'cat' => array('MCP_REPORTS')), + 'pm_reports_closed' => array('title' => 'MCP_PM_REPORTS_CLOSED', 'auth' => 'aclf_m_report', 'cat' => array('MCP_REPORTS')), + 'pm_report_details' => array('title' => 'MCP_PM_REPORT_DETAILS', 'auth' => 'aclf_m_report', 'cat' => array('MCP_REPORTS')), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } + } + + ?> \ No newline at end of file Modified: branches/phpBB-3_0_0/phpBB/includes/mcp/mcp_front.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/includes/mcp/mcp_front.php (original) --- branches/phpBB-3_0_0/phpBB/includes/mcp/mcp_front.php Tue Jul 21 20:59:11 2009 *************** *** 152,157 **** --- 152,158 ---- $sql = 'SELECT COUNT(r.report_id) AS total FROM ' . REPORTS_TABLE . ' r, ' . POSTS_TABLE . ' p WHERE r.post_id = p.post_id + AND r.pm_id = 0 AND r.report_closed = 0 AND p.forum_id IN (0, ' . implode(', ', $forum_list) . ')'; $result = $db->sql_query($sql); *************** *** 181,186 **** --- 182,188 ---- ), 'WHERE' => 'r.post_id = p.post_id + AND r.pm_id = 0 AND r.report_closed = 0 AND r.reason_id = rr.reason_id AND p.topic_id = t.topic_id *************** *** 243,248 **** --- 245,340 ---- } } + // Latest 5 reported PMs + if ($module->loaded('pm_reports') && $auth->acl_getf_global('m_report')) + { + $template->assign_var('S_SHOW_PM_REPORTS', true); + + $sql = 'SELECT COUNT(r.report_id) AS total + FROM ' . REPORTS_TABLE . ' r, ' . PRIVMSGS_TABLE . ' p + WHERE r.post_id = 0 + AND r.pm_id = p.msg_id + AND r.report_closed = 0'; + $result = $db->sql_query($sql); + $total = (int) $db->sql_fetchfield('total'); + $db->sql_freeresult($result); + + if ($total) + { + include($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx); + $user->add_lang(array('ucp')); + + $sql = $db->sql_build_query('SELECT', array( + 'SELECT' => 'r.report_id, r.report_time, p.msg_id, p.message_subject, p.message_time, p.to_address, p.bcc_address, u.username, u.username_clean, u.user_colour, u.user_id, u2.username as author_name, u2.username_clean as author_name_clean, u2.user_colour as author_colour, u2.user_id as author_id', + + 'FROM' => array( + REPORTS_TABLE => 'r', + REPORTS_REASONS_TABLE => 'rr', + USERS_TABLE => array('u', 'u2'), + PRIVMSGS_TABLE => 'p' + ), + + 'WHERE' => 'r.pm_id = p.msg_id + AND r.post_id = 0 + AND r.report_closed = 0 + AND r.reason_id = rr.reason_id + AND r.user_id = u.user_id + AND p.author_id = u2.user_id', + + 'ORDER_BY' => 'p.message_time DESC' + )); + $result = $db->sql_query_limit($sql, 5); + + $pm_by_id = $pm_list = array(); + while ($row = $db->sql_fetchrow($result)) + { + $pm_by_id[(int) $row['msg_id']] = $row; + $pm_list[] = (int) $row['msg_id']; + } + + $address_list = get_recipient_strings($pm_by_id); + + foreach ($pm_list as $message_id) + { + $row = $pm_by_id[$message_id]; + + $template->assign_block_vars('pm_report', array( + 'U_PM_DETAILS' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'r=' . $row['report_id'] . "&i=pm_reports&mode=pm_report_details"), + + 'REPORTER_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']), + 'REPORTER' => get_username_string('username', $row['user_id'], $row['username'], $row['user_colour']), + 'REPORTER_COLOUR' => get_username_string('colour', $row['user_id'], $row['username'], $row['user_colour']), + 'U_REPORTER' => get_username_string('profile', $row['user_id'], $row['username'], $row['user_colour']), + + 'PM_AUTHOR_FULL' => get_username_string('full', $row['author_id'], $row['author_name'], $row['author_colour']), + 'PM_AUTHOR' => get_username_string('username', $row['author_id'], $row['author_name'], $row['author_colour']), + 'PM_AUTHOR_COLOUR' => get_username_string('colour', $row['author_id'], $row['author_name'], $row['author_colour']), + 'U_PM_AUTHOR' => get_username_string('profile', $row['author_id'], $row['author_name'], $row['author_colour']), + + 'PM_SUBJECT' => $row['message_subject'], + 'REPORT_TIME' => $user->format_date($row['report_time']), + 'PM_TIME' => $user->format_date($row['message_time']), + 'RECIPIENTS' => implode(', ', $address_list[$row['msg_id']]), + )); + } + } + + if ($total == 0) + { + $template->assign_vars(array( + 'L_REPORTS_TOTAL' => $user->lang['REPORTS_ZERO_TOTAL'], + 'S_HAS_PM_REPORTS' => false) + ); + } + else + { + $template->assign_vars(array( + 'L_REPORTS_TOTAL' => ($total == 1) ? $user->lang['REPORT_TOTAL'] : sprintf($user->lang['REPORTS_TOTAL'], $total), + 'S_HAS_REPORTS' => true) + ); + } + } + // Latest 5 logs if ($module->loaded('logs')) { Added: branches/phpBB-3_0_0/phpBB/includes/mcp/mcp_pm_reports.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/includes/mcp/mcp_pm_reports.php (added) --- branches/phpBB-3_0_0/phpBB/includes/mcp/mcp_pm_reports.php Tue Jul 21 20:59:11 2009 *************** *** 0 **** --- 1,323 ---- + <?php + /** + * + * @package mcp + * @version $Id$ + * @copyright (c) 2005 phpBB Group + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * + */ + + /** + * @ignore + */ + if (!defined('IN_PHPBB')) + { + exit; + } + + /** + * mcp_reports + * Handling the reports queue + * @package mcp + */ + class mcp_pm_reports + { + var $p_master; + var $u_action; + + function mcp_pm_reports(&$p_master) + { + $this->p_master = &$p_master; + } + + function main($id, $mode) + { + global $auth, $db, $user, $template, $cache; + global $config, $phpbb_root_path, $phpEx, $action; + + include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx); + include_once($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx); + + $start = request_var('start', 0); + + $this->page_title = 'MCP_PM_REPORTS'; + + switch ($action) + { + case 'close': + case 'delete': + include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx); + + $report_id_list = request_var('report_id_list', array(0)); + + if (!sizeof($report_id_list)) + { + trigger_error('NO_REPORT_SELECTED'); + } + + if (!function_exists('close_report')) + { + include($phpbb_root_path . 'includes/mcp/mcp_reports.' . $phpEx); + } + + close_report($report_id_list, $mode, $action, true); + + break; + } + + switch ($mode) + { + case 'pm_report_details': + + $user->add_lang(array('posting', 'viewforum', 'viewtopic', 'ucp')); + + $report_id = request_var('r', 0); + + $sql = 'SELECT r.pm_id, r.user_id, r.report_id, r.report_closed, report_time, r.report_text, rr.reason_title, rr.reason_description, u.username, u.username_clean, u.user_colour + FROM ' . REPORTS_TABLE . ' r, ' . REPORTS_REASONS_TABLE . ' rr, ' . USERS_TABLE . ' u + WHERE r.report_id = ' . $report_id . ' + AND rr.reason_id = r.reason_id + AND r.user_id = u.user_id + AND r.post_id = 0 + ORDER BY report_closed ASC'; + $result = $db->sql_query_limit($sql, 1); + $report = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$report_id || !$report) + { + trigger_error('NO_REPORT'); + } + + $pm_id = $report['pm_id']; + $report_id = $report['report_id']; + + $pm_info = get_pm_data(array($pm_id)); + + if (!sizeof($pm_info)) + { + trigger_error('NO_REPORT_SELECTED'); + } + + $pm_info = $pm_info[$pm_id]; + + write_pm_addresses(array('to' => $pm_info['to_address'], 'bcc' => $pm_info['bcc_address']), (int) $pm_info['author_id']); + + $reason = array('title' => $report['reason_title'], 'description' => $report['reason_description']); + if (isset($user->lang['report_reasons']['TITLE'][strtoupper($reason['title'])]) && isset($user->lang['report_reasons']['DESCRIPTION'][strtoupper($reason['title'])])) + { + $reason['description'] = $user->lang['report_reasons']['DESCRIPTION'][strtoupper($reason['title'])]; + $reason['title'] = $user->lang['report_reasons']['TITLE'][strtoupper($reason['title'])]; + } + + // Process message, leave it uncensored + $message = $pm_info['message_text']; + + if ($pm_info['bbcode_bitfield']) + { + include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx); + $bbcode = new bbcode($pm_info['bbcode_bitfield']); + $bbcode->bbcode_second_pass($message, $pm_info['bbcode_uid'], $pm_info['bbcode_bitfield']); + } + + $message = bbcode_nl2br($message); + $message = smiley_text($message); + + if ($pm_info['message_attachment'] && $auth->acl_get('u_pm_download')) + { + $sql = 'SELECT * + FROM ' . ATTACHMENTS_TABLE . ' + WHERE post_msg_id = ' . $pm_id . ' + AND in_message = 1 + ORDER BY filetime DESC'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $attachments[] = $row; + } + $db->sql_freeresult($result); + + if (sizeof($attachments)) + { + $update_count = array(); + parse_attachments(0, $message, $attachments, $update_count); + } + + // Display not already displayed Attachments for this post, we already parsed them. ;) + if (!empty($attachments)) + { + $template->assign_var('S_HAS_ATTACHMENTS', true); + + foreach ($attachments as $attachment) + { + $template->assign_block_vars('attachment', array( + 'DISPLAY_ATTACHMENT' => $attachment) + ); + } + } + } + + $template->assign_vars(array( + 'S_MCP_REPORT' => true, + 'S_PM' => true, + 'S_CLOSE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=pm_reports&mode=pm_report_details&r=' . $report_id), + 'S_CAN_VIEWIP' => $auth->acl_getf_global('m_info'), + 'S_POST_REPORTED' => $pm_info['message_reported'], + 'S_USER_NOTES' => true, + + 'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=pm_reports&mode=pm_report_details&r=' . $report_id), + 'U_MCP_REPORTER_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $report['user_id']), + 'U_MCP_USER_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $pm_info['author_id']), + 'U_MCP_WARN_REPORTER' => ($auth->acl_get('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&mode=warn_user&u=' . $report['user_id']) : '', + 'U_MCP_WARN_USER' => ($auth->acl_get('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&mode=warn_user&u=' . $pm_info['author_id']) : '', + + 'EDIT_IMG' => $user->img('icon_post_edit', $user->lang['EDIT_POST']), + 'MINI_POST_IMG' => $user->img('icon_post_target', 'POST'), + + 'RETURN_REPORTS' => sprintf($user->lang['RETURN_REPORTS'], '<a href="' . append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=pm_reports' . (($pm_info['message_reported']) ? '&mode=pm_reports' : '&mode=pm_reports_closed') . '&start=' . $start) . '">', '</a>'), + 'REPORTED_IMG' => $user->img('icon_topic_reported', $user->lang['POST_REPORTED']), + 'REPORT_DATE' => $user->format_date($report['report_time']), + 'REPORT_ID' => $report_id, + 'REPORT_REASON_TITLE' => $reason['title'], + 'REPORT_REASON_DESCRIPTION' => $reason['description'], + 'REPORT_TEXT' => $report['report_text'], + + 'POST_AUTHOR_FULL' => get_username_string('full', $pm_info['author_id'], $pm_info['username'], $pm_info['user_colour']), + 'POST_AUTHOR_COLOUR' => get_username_string('colour', $pm_info['author_id'], $pm_info['username'], $pm_info['user_colour']), + 'POST_AUTHOR' => get_username_string('username', $pm_info['author_id'], $pm_info['username'], $pm_info['user_colour']), + 'U_POST_AUTHOR' => get_username_string('profile', $pm_info['author_id'], $pm_info['username'], $pm_info['user_colour']), + + 'REPORTER_FULL' => get_username_string('full', $report['user_id'], $report['username'], $report['user_colour']), + 'REPORTER_COLOUR' => get_username_string('colour', $report['user_id'], $report['username'], $report['user_colour']), + 'REPORTER_NAME' => get_username_string('username', $report['user_id'], $report['username'], $report['user_colour']), + 'U_VIEW_REPORTER_PROFILE' => get_username_string('profile', $report['user_id'], $report['username'], $report['user_colour']), + + 'POST_PREVIEW' => $message, + 'POST_SUBJECT' => ($pm_info['message_subject']) ? $pm_info['message_subject'] : $user->lang['NO_SUBJECT'], + 'POST_DATE' => $user->format_date($pm_info['message_time']), + 'POST_IP' => $pm_info['author_ip'], + 'POST_IPADDR' => ($auth->acl_getf_global('m_info') && request_var('lookup', '')) ? @gethostbyaddr($pm_info['author_ip']) : '', + 'POST_ID' => $pm_info['msg_id'], + + 'U_LOOKUP_IP' => ($auth->acl_getf_global('m_info')) ? $this->u_action . '&r=' . $report_id . '&pm=' . $pm_id . '&lookup=' . $pm_info['author_ip'] . '#ip' : '', + )); + + $this->tpl_name = 'mcp_post'; + + break; + + case 'pm_reports': + case 'pm_reports_closed': + $user->add_lang(array('ucp')); + + $sort_days = $total = 0; + $sort_key = $sort_dir = ''; + $sort_by_sql = $sort_order_sql = array(); + mcp_sorting($mode, $sort_days, $sort_key, $sort_dir, $sort_by_sql, $sort_order_sql, $total); + + $limit_time_sql = ($sort_days) ? 'AND r.report_time >= ' . (time() - ($sort_days * 86400)) : ''; + + if ($mode == 'pm_reports') + { + $report_state = 'pm.message_reported = 1 AND r.report_closed = 0'; + } + else + { + $report_state = 'r.report_closed = 1'; + } + + $sql = 'SELECT r.report_id + FROM ' . PRIVMSGS_TABLE . ' pm, ' . REPORTS_TABLE . ' r ' . (($sort_order_sql[0] == 'u') ? ', ' . USERS_TABLE . ' u' : '') . (($sort_order_sql[0] == 'r') ? ', ' . USERS_TABLE . ' ru' : '') . " + WHERE $report_state + AND r.pm_id = pm.msg_id + " . (($sort_order_sql[0] == 'u') ? 'AND u.user_id = pm.author_id' : '') . ' + ' . (($sort_order_sql[0] == 'r') ? 'AND ru.user_id = r.user_id' : '') . " + AND r.post_id = 0 + $limit_time_sql + ORDER BY $sort_order_sql"; + $result = $db->sql_query_limit($sql, $config['topics_per_page'], $start); + + $i = 0; + $report_ids = array(); + while ($row = $db->sql_fetchrow($result)) + { + $report_ids[] = $row['report_id']; + $row_num[$row['report_id']] = $i++; + } + $db->sql_freeresult($result); + + if (sizeof($report_ids)) + { + $sql = 'SELECT p.*, u.username, u.username_clean, u.user_colour, r.user_id as reporter_id, ru.username as reporter_name, ru.user_colour as reporter_colour, r.report_time, r.report_id + FROM ' . REPORTS_TABLE . ' r, ' . PRIVMSGS_TABLE . ' p, ' . USERS_TABLE . ' u, ' . USERS_TABLE . ' ru + WHERE ' . $db->sql_in_set('r.report_id', $report_ids) . " + AND r.pm_id = p.msg_id + AND p.author_id = u.user_id + AND ru.user_id = r.user_id + ORDER BY $sort_order_sql"; + $result = $db->sql_query($sql); + + $pm_list = $pm_by_id = array(); + while ($row = $db->sql_fetchrow($result)) + { + $pm_by_id[(int) $row['msg_id']] = $row; + $pm_list[] = (int) $row['msg_id']; + } + $db->sql_freeresult($result); + + if (sizeof($pm_list)) + { + $address_list = get_recipient_strings($pm_by_id); + + foreach ($pm_list as $message_id) + { + $row = $pm_by_id[$message_id]; + $template->assign_block_vars('postrow', array( + 'U_VIEW_DETAILS' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=pm_reports&mode=pm_report_details&r={$row['report_id']}"), + + 'PM_AUTHOR_FULL' => get_username_string('full', $row['author_id'], $row['username'], $row['user_colour']), + 'PM_AUTHOR_COLOUR' => get_username_string('colour', $row['author_id'], $row['username'], $row['user_colour']), + 'PM_AUTHOR' => get_username_string('username', $row['author_id'], $row['username'], $row['user_colour']), + 'U_PM_AUTHOR' => get_username_string('profile', $row['author_id'], $row['username'], $row['user_colour']), + + 'REPORTER_FULL' => get_username_string('full', $row['reporter_id'], $row['reporter_name'], $row['reporter_colour']), + 'REPORTER_COLOUR' => get_username_string('colour', $row['reporter_id'], $row['reporter_name'], $row['reporter_colour']), + 'REPORTER' => get_username_string('username', $row['reporter_id'], $row['reporter_name'], $row['reporter_colour']), + 'U_REPORTER' => get_username_string('profile', $row['reporter_id'], $row['reporter_name'], $row['reporter_colour']), + + 'PM_SUBJECT' => ($row['message_subject']) ? $row['message_subject'] : $user->lang['NO_SUBJECT'], + 'PM_TIME' => $user->format_date($row['message_time']), + 'REPORT_ID' => $row['report_id'], + 'REPORT_TIME' => $user->format_date($row['report_time']), + + 'RECIPIENTS' => implode(', ', $address_list[$row['msg_id']]), + )); + } + } + } + + // Now display the page + $template->assign_vars(array( + 'L_EXPLAIN' => ($mode == 'pm_reports') ? $user->lang['MCP_PM_REPORTS_OPEN_EXPLAIN'] : $user->lang['MCP_PM_REPORTS_CLOSED_EXPLAIN'], + 'L_TITLE' => ($mode == 'pm_reports') ? $user->lang['MCP_PM_REPORTS_OPEN'] : $user->lang['MCP_PM_REPORTS_CLOSED'], + + 'S_PM' => true, + 'S_MCP_ACTION' => $this->u_action, + 'S_CLOSED' => ($mode == 'pm_reports_closed') ? true : false, + + 'PAGINATION' => generate_pagination($this->u_action . "&st=$sort_days&sk=$sort_key&sd=$sort_dir", $total, $config['topics_per_page'], $start), + 'PAGE_NUMBER' => on_page($total, $config['topics_per_page'], $start), + 'TOTAL' => $total, + 'TOTAL_REPORTS' => ($total == 1) ? $user->lang['LIST_REPORT'] : sprintf($user->lang['LIST_REPORTS'], $total), + ) + ); + + $this->tpl_name = 'mcp_reports'; + break; + } + } + } + + ?> \ No newline at end of file Modified: branches/phpBB-3_0_0/phpBB/includes/mcp/mcp_reports.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/includes/mcp/mcp_reports.php (original) --- branches/phpBB-3_0_0/phpBB/includes/mcp/mcp_reports.php Tue Jul 21 20:59:11 2009 *************** *** 77,82 **** --- 77,83 ---- WHERE ' . (($report_id) ? 'r.report_id = ' . $report_id : "r.post_id = $post_id") . ' AND rr.reason_id = r.reason_id AND r.user_id = u.user_id + AND r.pm_id = 0 ORDER BY report_closed ASC'; $result = $db->sql_query_limit($sql, 1); $report = $db->sql_fetchrow($result); *************** *** 149,161 **** if ($post_info['post_attachment'] && $auth->acl_get('u_download') && $auth->acl_get('f_download', $post_info['forum_id'])) { - $extensions = $cache->obtain_attach_extensions($post_info['forum_id']); - $sql = 'SELECT * FROM ' . ATTACHMENTS_TABLE . ' WHERE post_msg_id = ' . $post_id . ' AND in_message = 0 ! ORDER BY filetime DESC, post_msg_id ASC'; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) --- 150,160 ---- if ($post_info['post_attachment'] && $auth->acl_get('u_download') && $auth->acl_get('f_download', $post_info['forum_id'])) { $sql = 'SELECT * FROM ' . ATTACHMENTS_TABLE . ' WHERE post_msg_id = ' . $post_id . ' AND in_message = 0 ! ORDER BY filetime DESC'; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) *************** *** 332,338 **** mcp_sorting($mode, $sort_days, $sort_key, $sort_dir, $sort_by_sql, $sort_order_sql, $total, $forum_id, $topic_id); $forum_topics = ($total == -1) ? $forum_info['forum_topics'] : $total; ! $limit_time_sql = ($sort_days) ? 'AND t.topic_last_post_time >= ' . (time() - ($sort_days * 86400)) : ''; if ($mode == 'reports') { --- 331,337 ---- mcp_sorting($mode, $sort_days, $sort_key, $sort_dir, $sort_by_sql, $sort_order_sql, $total, $forum_id, $topic_id); $forum_topics = ($total == -1) ? $forum_info['forum_topics'] : $total; ! $limit_time_sql = ($sort_days) ? 'AND r.report_time >= ' . (time() - ($sort_days * 86400)) : ''; if ($mode == 'reports') { *************** *** 349,357 **** $report_state AND r.post_id = p.post_id " . (($sort_order_sql[0] == 'u') ? 'AND u.user_id = p.poster_id' : '') . ' ! ' . (($sort_order_sql[0] == 'r') ? 'AND ru.user_id = p.poster_id' : '') . ' ' . (($topic_id) ? 'AND p.topic_id = ' . $topic_id : '') . " AND t.topic_id = p.topic_id $limit_time_sql ORDER BY $sort_order_sql"; $result = $db->sql_query_limit($sql, $config['topics_per_page'], $start); --- 348,357 ---- $report_state AND r.post_id = p.post_id " . (($sort_order_sql[0] == 'u') ? 'AND u.user_id = p.poster_id' : '') . ' ! ' . (($sort_order_sql[0] == 'r') ? 'AND ru.user_id = r.user_id' : '') . ' ' . (($topic_id) ? 'AND p.topic_id = ' . $topic_id : '') . " AND t.topic_id = p.topic_id + AND r.pm_id = 0 $limit_time_sql ORDER BY $sort_order_sql"; $result = $db->sql_query_limit($sql, $config['topics_per_page'], $start); *************** *** 374,379 **** --- 374,380 ---- AND r.post_id = p.post_id AND u.user_id = p.poster_id AND ru.user_id = r.user_id + AND r.pm_id = 0 ORDER BY ' . $sort_order_sql; $result = $db->sql_query($sql); *************** *** 441,475 **** /** * Closes a report */ ! function close_report($report_id_list, $mode, $action) { ! global $db, $template, $user, $config; global $phpEx, $phpbb_root_path; ! $sql = 'SELECT r.post_id ! FROM ' . REPORTS_TABLE . ' r ! WHERE ' . $db->sql_in_set('r.report_id', $report_id_list); $result = $db->sql_query($sql); $post_id_list = array(); while ($row = $db->sql_fetchrow($result)) { ! $post_id_list[] = $row['post_id']; } $post_id_list = array_unique($post_id_list); ! if (!check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_report'))) { ! trigger_error('NOT_AUTHORISED'); } if ($action == 'delete' && strpos($user->data['session_page'], 'mode=report_details') !== false) { $redirect = request_var('redirect', build_url(array('mode', 'r', 'quickmod')) . '&mode=reports'); } else if ($action == 'close' && !request_var('r', 0)) { ! $redirect = request_var('redirect', build_url(array('mode', 'p', 'quickmod')) . '&mode=reports'); } else { --- 442,495 ---- /** * Closes a report */ ! function close_report($report_id_list, $mode, $action, $pm = false) { ! global $db, $template, $user, $config, $auth; global $phpEx, $phpbb_root_path; ! $pm_where = ($pm) ? ' AND r.post_id = 0 ' : ' AND r.pm_id = 0 '; ! $id_column = ($pm) ? 'pm_id' : 'post_id'; ! $module = ($pm) ? 'pm_reports' : 'reports'; ! $pm_prefix = ($pm) ? 'PM_' : ''; ! ! $sql = "SELECT r.$id_column ! FROM " . REPORTS_TABLE . ' r ! WHERE ' . $db->sql_in_set('r.report_id', $report_id_list) . $pm_where; $result = $db->sql_query($sql); $post_id_list = array(); while ($row = $db->sql_fetchrow($result)) { ! $post_id_list[] = $row[$id_column]; } $post_id_list = array_unique($post_id_list); ! if ($pm) { ! if (!$auth->acl_getf_global('m_report')) ! { ! trigger_error('NOT_AUTHORISED'); ! } ! } ! else ! { ! if (!check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_report'))) ! { ! trigger_error('NOT_AUTHORISED'); ! } } if ($action == 'delete' && strpos($user->data['session_page'], 'mode=report_details') !== false) { $redirect = request_var('redirect', build_url(array('mode', 'r', 'quickmod')) . '&mode=reports'); } + elseif ($action == 'delete' && strpos($user->data['session_page'], 'mode=pm_report_details') !== false) + { + $redirect = request_var('redirect', build_url(array('mode', 'r', 'quickmod')) . '&mode=pm_reports'); + } else if ($action == 'close' && !request_var('r', 0)) { ! $redirect = request_var('redirect', build_url(array('mode', 'p', 'quickmod')) . '&mode=' . $module); } else { *************** *** 480,486 **** $topic_ids = array(); $s_hidden_fields = build_hidden_fields(array( ! 'i' => 'reports', 'mode' => $mode, 'report_id_list' => $report_id_list, 'action' => $action, --- 500,506 ---- $topic_ids = array(); $s_hidden_fields = build_hidden_fields(array( ! 'i' => $module, 'mode' => $mode, 'report_id_list' => $report_id_list, 'action' => $action, *************** *** 489,501 **** if (confirm_box(true)) { ! $post_info = get_post_data($post_id_list, 'm_report'); ! $sql = 'SELECT r.report_id, r.post_id, r.report_closed, r.user_id, r.user_notify, u.username, u.username_clean, u.user_email, u.user_jabber, u.user_lang, u.user_notify_type ! FROM ' . REPORTS_TABLE . ' r, ' . USERS_TABLE . ' u WHERE ' . $db->sql_in_set('r.report_id', $report_id_list) . ' ' . (($action == 'close') ? 'AND r.report_closed = 0' : '') . ' ! AND r.user_id = u.user_id'; $result = $db->sql_query($sql); $reports = $close_report_posts = $close_report_topics = $notify_reporters = $report_id_list = array(); --- 509,521 ---- if (confirm_box(true)) { ! $post_info = ($pm) ? get_pm_data($post_id_list) : get_post_data($post_id_list, 'm_report'); ! $sql = "SELECT r.report_id, r.$id_column, r.report_closed, r.user_id, r.user_notify, u.username, u.username_clean, u.user_email, u.user_jabber, u.user_lang, u.user_notify_type ! FROM " . REPORTS_TABLE . ' r, ' . USERS_TABLE . ' u WHERE ' . $db->sql_in_set('r.report_id', $report_id_list) . ' ' . (($action == 'close') ? 'AND r.report_closed = 0' : '') . ' ! AND r.user_id = u.user_id' . $pm_where; $result = $db->sql_query($sql); $reports = $close_report_posts = $close_report_topics = $notify_reporters = $report_id_list = array(); *************** *** 506,513 **** if (!$report['report_closed']) { ! $close_report_posts[] = $report['post_id']; ! $close_report_topics[] = $post_info[$report['post_id']]['topic_id']; } if ($report['user_notify'] && !$report['report_closed']) --- 526,537 ---- if (!$report['report_closed']) { ! $close_report_posts[] = $report[$id_column]; ! ! if (!$pm) ! { ! $close_report_topics[] = $post_info[$report['post_id']]['topic_id']; ! } } if ($report['user_notify'] && !$report['report_closed']) *************** *** 522,528 **** $close_report_posts = array_unique($close_report_posts); $close_report_topics = array_unique($close_report_topics); ! if (sizeof($close_report_posts)) { // Get a list of topics that still contain reported posts $sql = 'SELECT DISTINCT topic_id --- 546,552 ---- $close_report_posts = array_unique($close_report_posts); $close_report_topics = array_unique($close_report_topics); ! if (!$pm && sizeof($close_report_posts)) { // Get a list of topics that still contain reported posts $sql = 'SELECT DISTINCT topic_id *************** *** 561,578 **** if (sizeof($close_report_posts)) { ! $sql = 'UPDATE ' . POSTS_TABLE . ' ! SET post_reported = 0 ! WHERE ' . $db->sql_in_set('post_id', $close_report_posts); ! $db->sql_query($sql); ! if (sizeof($close_report_topics)) { ! $sql = 'UPDATE ' . TOPICS_TABLE . ' ! SET topic_reported = 0 ! WHERE ' . $db->sql_in_set('topic_id', $close_report_topics) . ' ! OR ' . $db->sql_in_set('topic_moved_id', $close_report_topics); $db->sql_query($sql); } } --- 585,617 ---- if (sizeof($close_report_posts)) { ! if ($pm) ! { ! $sql = 'UPDATE ' . PRIVMSGS_TABLE . ' ! SET message_reported = 0 ! WHERE ' . $db->sql_in_set('msg_id', $close_report_posts); ! $db->sql_query($sql); ! if ($action == 'delete') ! {echo "aha"; ! delete_pm(ANONYMOUS, $close_report_posts, PRIVMSGS_INBOX); ! } ! } ! else { ! $sql = 'UPDATE ' . POSTS_TABLE . ' ! SET post_reported = 0 ! WHERE ' . $db->sql_in_set('post_id', $close_report_posts); $db->sql_query($sql); + + if (sizeof($close_report_topics)) + { + $sql = 'UPDATE ' . TOPICS_TABLE . ' + SET topic_reported = 0 + WHERE ' . $db->sql_in_set('topic_id', $close_report_topics) . ' + OR ' . $db->sql_in_set('topic_moved_id', $close_report_topics); + $db->sql_query($sql); + } } } *************** *** 582,588 **** foreach ($reports as $report) { ! add_log('mod', $post_info[$report['post_id']]['forum_id'], $post_info[$report['post_id']]['topic_id'], 'LOG_REPORT_' . strtoupper($action) . 'D', $post_info[$report['post_id']]['post_subject']); } $messenger = new messenger(); --- 621,634 ---- foreach ($reports as $report) { ! if ($pm) ! { ! add_log('mod', 0, 0, 'LOG_PM_REPORT_' . strtoupper($action) . 'D', $post_info[$report['pm_id']]['message_subject']); ! } ! else ! { ! add_log('mod', $post_info[$report['post_id']]['forum_id'], $post_info[$report['post_id']]['topic_id'], 'LOG_REPORT_' . strtoupper($action) . 'D', $post_info[$report['post_id']]['post_subject']); ! } } $messenger = new messenger(); *************** *** 597,635 **** continue; } ! $post_id = $reporter['post_id']; ! $messenger->template('report_' . $action . 'd', $reporter['user_lang']); $messenger->to($reporter['user_email'], $reporter['username']); $messenger->im($reporter['user_jabber'], $reporter['username']); ! $messenger->assign_vars(array( ! 'USERNAME' => htmlspecialchars_decode($reporter['username']), ! 'CLOSER_NAME' => htmlspecialchars_decode($user->data['username']), ! 'POST_SUBJECT' => htmlspecialchars_decode(censor_text($post_info[$post_id]['post_subject'])), ! 'TOPIC_TITLE' => htmlspecialchars_decode(censor_text($post_info[$post_id]['topic_title']))) ! ); $messenger->send($reporter['user_notify_type']); } } ! foreach ($post_info as $post) { ! $forum_ids[$post['forum_id']] = $post['forum_id']; ! $topic_ids[$post['topic_id']] = $post['topic_id']; } ! unset($notify_reporters, $post_info, $reports); $messenger->save_queue(); ! $success_msg = (sizeof($report_id_list) == 1) ? 'REPORT_' . strtoupper($action) . 'D_SUCCESS' : 'REPORTS_' . strtoupper($action) . 'D_SUCCESS'; } else { ! confirm_box(false, $user->lang[strtoupper($action) . '_REPORT' . ((sizeof($report_id_list) == 1) ? '' : 'S') . '_CONFIRM'], $s_hidden_fields); } $redirect = request_var('redirect', "index.$phpEx"); --- 643,695 ---- continue; } ! $post_id = $reporter[$id_column]; ! $messenger->template((($pm) ? 'pm_report_' : 'report_') . $action . 'd', $reporter['user_lang']); $messenger->to($reporter['user_email'], $reporter['username']); $messenger->im($reporter['user_jabber'], $reporter['username']); ! if ($pm) ! { ! $messenger->assign_vars(array( ! 'USERNAME' => htmlspecialchars_decode($reporter['username']), ! 'CLOSER_NAME' => htmlspecialchars_decode($user->data['username']), ! 'PM_SUBJECT' => htmlspecialchars_decode(censor_text($post_info[$post_id]['message_subject'])), ! )); ! } ! else ! { ! $messenger->assign_vars(array( ! 'USERNAME' => htmlspecialchars_decode($reporter['username']), ! 'CLOSER_NAME' => htmlspecialchars_decode($user->data['username']), ! 'POST_SUBJECT' => htmlspecialchars_decode(censor_text($post_info[$post_id]['post_subject'])), ! 'TOPIC_TITLE' => htmlspecialchars_decode(censor_text($post_info[$post_id]['topic_title']))) ! ); ! } $messenger->send($reporter['user_notify_type']); } } ! if (!$pm) { ! foreach ($post_info as $post) ! { ! $forum_ids[$post['forum_id']] = $post['forum_id']; ! $topic_ids[$post['topic_id']] = $post['topic_id']; ! } } ! unset($notify_reporters, $post_info, $reports); $messenger->save_queue(); ! $success_msg = (sizeof($report_id_list) == 1) ? "{$pm_prefix}REPORT_" . strtoupper($action) . 'D_SUCCESS' : "{$pm_prefix}REPORTS_" . strtoupper($action) . 'D_SUCCESS'; } else { ! confirm_box(false, $user->lang[strtoupper($action) . "_{$pm_prefix}REPORT" . ((sizeof($report_id_list) == 1) ? '' : 'S') . '_CONFIRM'], $s_hidden_fields); } $redirect = request_var('redirect', "index.$phpEx"); *************** *** 642,656 **** else { meta_refresh(3, $redirect); $return_forum = ''; - if (sizeof($forum_ids == 1)) - { - $return_forum = sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . current($forum_ids)) . '">', '</a>') . '<br /><br />'; - } $return_topic = ''; ! if (sizeof($topic_ids == 1)) { ! $return_topic = sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=' . current($topic_ids) . '&f=' . current($forum_ids)) . '">', '</a>') . '<br /><br />'; } trigger_error($user->lang[$success_msg] . '<br /><br />' . $return_forum . $return_topic . sprintf($user->lang['RETURN_PAGE'], "<a href=\"$redirect\">", '</a>')); --- 702,722 ---- else { meta_refresh(3, $redirect); + $return_forum = ''; $return_topic = ''; ! ! if (!$pm) { ! if (sizeof($forum_ids) === 1) ! { ! $return_forum = sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . current($forum_ids)) . '">', '</a>') . '<br /><br />'; ! } ! ! if (sizeof($topic_ids) === 1) ! { ! $return_topic = sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=' . current($topic_ids) . '&f=' . current($forum_ids)) . '">', '</a>') . '<br /><br />'; ! } } trigger_error($user->lang[$success_msg] . '<br /><br />' . $return_forum . $return_topic . sprintf($user->lang['RETURN_PAGE'], "<a href=\"$redirect\">", '</a>')); Modified: branches/phpBB-3_0_0/phpBB/includes/ucp/ucp_pm_viewfolder.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/includes/ucp/ucp_pm_viewfolder.php (original) --- branches/phpBB-3_0_0/phpBB/includes/ucp/ucp_pm_viewfolder.php Tue Jul 21 20:59:11 2009 *************** *** 115,192 **** // Build Recipient List if in outbox/sentbox - max two additional queries if ($folder_id == PRIVMSGS_OUTBOX || $folder_id == PRIVMSGS_SENTBOX) { ! $recipient_list = $address = array(); ! ! foreach ($folder_info['rowset'] as $message_id => $row) ! { ! $address[$message_id] = rebuild_header(array('to' => $row['to_address'], 'bcc' => $row['bcc_address'])); ! $_save = array('u', 'g'); ! foreach ($_save as $save) ! { ! if (isset($address[$message_id][$save]) && sizeof($address[$message_id][$save])) ! { ! foreach (array_keys($address[$message_id][$save]) as $ug_id) ! { ! $recipient_list[$save][$ug_id] = array('name' => $user->lang['NA'], 'colour' => ''); ! } ! } ! } ! } ! ! $_types = array('u', 'g'); ! foreach ($_types as $ug_type) ! { ! if (!empty($recipient_list[$ug_type])) ! { ! if ($ug_type == 'u') ! { ! $sql = 'SELECT user_id as id, username as name, user_colour as colour ! FROM ' . USERS_TABLE . ' ! WHERE '; ! } ! else ! { ! $sql = 'SELECT group_id as id, group_name as name, group_colour as colour, group_type ! FROM ' . GROUPS_TABLE . ' ! WHERE '; ! } ! $sql .= $db->sql_in_set(($ug_type == 'u') ? 'user_id' : 'group_id', array_map('intval', array_keys($recipient_list[$ug_type]))); ! ! $result = $db->sql_query($sql); ! ! while ($row = $db->sql_fetchrow($result)) ! { ! if ($ug_type == 'g') ! { ! $row['name'] = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['name']] : $row['name']; ! } ! ! $recipient_list[$ug_type][$row['id']] = array('name' => $row['name'], 'colour' => $row['colour']); ! } ! $db->sql_freeresult($result); ! } ! } ! ! foreach ($address as $message_id => $adr_ary) ! { ! foreach ($adr_ary as $type => $id_ary) ! { ! foreach ($id_ary as $ug_id => $_id) ! { ! if ($type == 'u') ! { ! $address_list[$message_id][] = get_username_string('full', $ug_id, $recipient_list[$type][$ug_id]['name'], $recipient_list[$type][$ug_id]['colour']); ! } ! else ! { ! $user_colour = ($recipient_list[$type][$ug_id]['colour']) ? ' style="font-weight: bold; color:#' . $recipient_list[$type][$ug_id]['colour'] . '"' : ''; ! $link = '<a href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $ug_id) . '"' . $user_colour . '>'; ! $address_list[$message_id][] = $link . $recipient_list[$type][$ug_id]['name'] . (($link) ? '</a>' : ''); ! } ! } ! } ! } ! unset($recipient_list, $address); } $data = array(); --- 115,121 ---- // Build Recipient List if in outbox/sentbox - max two additional queries if ($folder_id == PRIVMSGS_OUTBOX || $folder_id == PRIVMSGS_SENTBOX) { ! $address_list = get_recipient_strings($folder_info['rowset']); } $data = array(); Modified: branches/phpBB-3_0_0/phpBB/includes/ucp/ucp_pm_viewmessage.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/includes/ucp/ucp_pm_viewmessage.php (original) --- branches/phpBB-3_0_0/phpBB/includes/ucp/ucp_pm_viewmessage.php Tue Jul 21 20:59:11 2009 *************** *** 190,195 **** --- 190,196 ---- 'EMAIL_IMG' => $user->img('icon_contact_email', $user->lang['SEND_EMAIL']), 'QUOTE_IMG' => $user->img('icon_post_quote', $user->lang['POST_QUOTE_PM']), 'REPLY_IMG' => $user->img('button_pm_reply', $user->lang['POST_REPLY_PM']), + 'REPORT_IMG' => $user->img('icon_post_report', 'REPORT_POST'), 'EDIT_IMG' => $user->img('icon_post_edit', $user->lang['POST_EDIT_PM']), 'MINI_POST_IMG' => $user->img('icon_post_target', $user->lang['PM']), *************** *** 210,215 **** --- 211,217 ---- 'U_DELETE' => ($auth->acl_get('u_pm_delete')) ? "$url&mode=compose&action=delete&f=$folder_id&p=" . $message_row['msg_id'] : '', 'U_EMAIL' => $user_info['email'], + 'U_REPORT' => ($config['allow_pm_report']) ? append_sid("{$phpbb_root_path}report.$phpEx", "pm=" . $message_row['msg_id']) : '', 'U_QUOTE' => ($auth->acl_get('u_sendpm') && $author_id != ANONYMOUS) ? "$url&mode=compose&action=quote&f=$folder_id&p=" . $message_row['msg_id'] : '', 'U_EDIT' => (($message_row['message_time'] > time() - ($config['pm_edit_time'] * 60) || !$config['pm_edit_time']) && $folder_id == PRIVMSGS_OUTBOX && $auth->acl_get('u_pm_edit')) ? "$url&mode=compose&action=edit&f=$folder_id&p=" . $message_row['msg_id'] : '', 'U_POST_REPLY_PM' => ($auth->acl_get('u_sendpm') && $author_id != ANONYMOUS) ? "$url&mode=compose&action=reply&f=$folder_id&p=" . $message_row['msg_id'] : '', Modified: branches/phpBB-3_0_0/phpBB/install/database_update.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/install/database_update.php (original) --- branches/phpBB-3_0_0/phpBB/install/database_update.php Tue Jul 21 20:59:11 2009 *************** *** 701,711 **** --- 701,721 ---- GROUPS_TABLE => array( 'group_skip_auth' => array('BOOL', 0, 'after' => 'group_founder_manage'), ), + PRIVMSGS_TABLE => array( + 'message_reported' => array('BOOL', 0), + ), + REPORTS_TABLE => array( + 'pm_id' => array('UINT', 0), + ), ), 'add_index' => array( LOG_TABLE => array( 'log_time' => array('log_time'), ), + REPORTS_TABLE => array( + 'post_id' => array('post_id'), + 'pm_id' => array('pm_id'), + ), ), ), ); *************** *** 1076,1081 **** --- 1086,1094 ---- // Entries for smiley pagination set_config('smilies_per_page', '50'); + // Entry for reporting PMs + set_config('allow_pm_report', '1'); + include_once($phpbb_root_path . 'includes/acp/acp_modules.' . $phpEx); $_module = new acp_modules(); *************** *** 1168,1173 **** --- 1181,1238 ---- } $db->sql_freeresult($result); + + // Also install the "PM Reports" module + $sql = 'SELECT module_id + FROM ' . MODULES_TABLE . " + WHERE module_class = 'mcp' + AND module_langname = 'MCP_REPORTS' + AND module_mode = '' + AND module_basename = ''"; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $category_id = (int) $row['module_id']; + + $modes = array( + 'pm_reports' => array('title' => 'MCP_PM_REPORTS_OPEN', 'auth' => 'aclf_m_report'), + 'pm_reports_closed' => array('title' => 'MCP_PM_REPORTS_CLOSED', 'auth' => 'aclf_m_report'), + 'pm_report_details' => array('title' => 'MCP_PM_REPORT_DETAILS', 'auth' => 'aclf_m_report'), + ); + + foreach ($modes as $mode => $data) + { + // Check if we actually need to add the module or if it is already added. ;) + $sql = 'SELECT * + FROM ' . MODULES_TABLE . " + WHERE module_class = 'mcp' + AND module_langname = '{$data['title']}' + AND module_mode = '$mode' + AND parent_id = {$category_id}"; + $result2 = $db->sql_query($sql); + $row2 = $db->sql_fetchrow($result2); + $db->sql_freeresult($result2); + + if (!$row2) + { + $module_data = array( + 'module_basename' => 'users', + 'module_enabled' => 1, + 'module_display' => 1, + 'parent_id' => $category_id, + 'module_class' => 'mcp', + 'module_langname' => $data['title'], + 'module_mode' => $mode, + 'module_auth' => $data['auth'], + ); + + $_module->update_module_data($module_data, true); + } + } + } + $db->sql_freeresult($result); + $_module->remove_cache_file(); // Add newly_registered group... but check if it already exists (we always supported running the updater on any schema) Modified: branches/phpBB-3_0_0/phpBB/install/schemas/firebird_schema.sql ============================================================================== *** branches/phpBB-3_0_0/phpBB/install/schemas/firebird_schema.sql (original) --- branches/phpBB-3_0_0/phpBB/install/schemas/firebird_schema.sql Tue Jul 21 20:59:11 2009 *************** *** 685,691 **** message_edit_time INTEGER DEFAULT 0 NOT NULL, message_edit_count INTEGER DEFAULT 0 NOT NULL, to_address BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, ! bcc_address BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL );; ALTER TABLE phpbb_privmsgs ADD PRIMARY KEY (msg_id);; --- 685,692 ---- message_edit_time INTEGER DEFAULT 0 NOT NULL, message_edit_count INTEGER DEFAULT 0 NOT NULL, to_address BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, ! bcc_address BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, ! message_reported INTEGER DEFAULT 0 NOT NULL );; ALTER TABLE phpbb_privmsgs ADD PRIMARY KEY (msg_id);; *************** *** 872,877 **** --- 873,879 ---- report_id INTEGER NOT NULL, reason_id INTEGER DEFAULT 0 NOT NULL, post_id INTEGER DEFAULT 0 NOT NULL, + pm_id INTEGER DEFAULT 0 NOT NULL, user_id INTEGER DEFAULT 0 NOT NULL, user_notify INTEGER DEFAULT 0 NOT NULL, report_closed INTEGER DEFAULT 0 NOT NULL, *************** *** 881,886 **** --- 883,890 ---- ALTER TABLE phpbb_reports ADD PRIMARY KEY (report_id);; + CREATE INDEX phpbb_reports_post_id ON phpbb_reports(post_id);; + CREATE INDEX phpbb_reports_pm_id ON phpbb_reports(pm_id);; CREATE GENERATOR phpbb_reports_gen;; SET GENERATOR phpbb_reports_gen TO 0;; Modified: branches/phpBB-3_0_0/phpBB/install/schemas/mssql_schema.sql ============================================================================== *** branches/phpBB-3_0_0/phpBB/install/schemas/mssql_schema.sql (original) --- branches/phpBB-3_0_0/phpBB/install/schemas/mssql_schema.sql Tue Jul 21 20:59:11 2009 *************** *** 831,837 **** [message_edit_time] [int] DEFAULT (0) NOT NULL , [message_edit_count] [int] DEFAULT (0) NOT NULL , [to_address] [varchar] (4000) DEFAULT ('') NOT NULL , ! [bcc_address] [varchar] (4000) DEFAULT ('') NOT NULL ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO --- 831,838 ---- [message_edit_time] [int] DEFAULT (0) NOT NULL , [message_edit_count] [int] DEFAULT (0) NOT NULL , [to_address] [varchar] (4000) DEFAULT ('') NOT NULL , ! [bcc_address] [varchar] (4000) DEFAULT ('') NOT NULL , ! [message_reported] [int] DEFAULT (0) NOT NULL ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO *************** *** 1055,1060 **** --- 1056,1062 ---- [report_id] [int] IDENTITY (1, 1) NOT NULL , [reason_id] [int] DEFAULT (0) NOT NULL , [post_id] [int] DEFAULT (0) NOT NULL , + [pm_id] [int] DEFAULT (0) NOT NULL , [user_id] [int] DEFAULT (0) NOT NULL , [user_notify] [int] DEFAULT (0) NOT NULL , [report_closed] [int] DEFAULT (0) NOT NULL , *************** *** 1070,1075 **** --- 1072,1083 ---- ) ON [PRIMARY] GO + CREATE INDEX [post_id] ON [phpbb_reports]([post_id]) ON [PRIMARY] + GO + + CREATE INDEX [pm_id] ON [phpbb_reports]([pm_id]) ON [PRIMARY] + GO + /* Table: 'phpbb_reports_reasons' Modified: branches/phpBB-3_0_0/phpBB/install/schemas/mysql_40_schema.sql ============================================================================== *** branches/phpBB-3_0_0/phpBB/install/schemas/mysql_40_schema.sql (original) --- branches/phpBB-3_0_0/phpBB/install/schemas/mysql_40_schema.sql Tue Jul 21 20:59:11 2009 *************** *** 486,491 **** --- 486,492 ---- message_edit_count smallint(4) UNSIGNED DEFAULT '0' NOT NULL, to_address blob NOT NULL, bcc_address blob NOT NULL, + message_reported tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, PRIMARY KEY (msg_id), KEY author_ip (author_ip), KEY message_time (message_time), *************** *** 609,620 **** report_id mediumint(8) UNSIGNED NOT NULL auto_increment, reason_id smallint(4) UNSIGNED DEFAULT '0' NOT NULL, post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, user_notify tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, report_closed tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, report_time int(11) UNSIGNED DEFAULT '0' NOT NULL, report_text mediumblob NOT NULL, ! PRIMARY KEY (report_id) ); --- 610,624 ---- report_id mediumint(8) UNSIGNED NOT NULL auto_increment, reason_id smallint(4) UNSIGNED DEFAULT '0' NOT NULL, post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + pm_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, user_notify tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, report_closed tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, report_time int(11) UNSIGNED DEFAULT '0' NOT NULL, report_text mediumblob NOT NULL, ! PRIMARY KEY (report_id), ! KEY post_id (post_id), ! KEY pm_id (pm_id) ); Modified: branches/phpBB-3_0_0/phpBB/install/schemas/mysql_41_schema.sql ============================================================================== *** branches/phpBB-3_0_0/phpBB/install/schemas/mysql_41_schema.sql (original) --- branches/phpBB-3_0_0/phpBB/install/schemas/mysql_41_schema.sql Tue Jul 21 20:59:11 2009 *************** *** 486,491 **** --- 486,492 ---- message_edit_count smallint(4) UNSIGNED DEFAULT '0' NOT NULL, to_address text NOT NULL, bcc_address text NOT NULL, + message_reported tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, PRIMARY KEY (msg_id), KEY author_ip (author_ip), KEY message_time (message_time), *************** *** 609,620 **** report_id mediumint(8) UNSIGNED NOT NULL auto_increment, reason_id smallint(4) UNSIGNED DEFAULT '0' NOT NULL, post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, user_notify tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, report_closed tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, report_time int(11) UNSIGNED DEFAULT '0' NOT NULL, report_text mediumtext NOT NULL, ! PRIMARY KEY (report_id) ) CHARACTER SET `utf8` COLLATE `utf8_bin`; --- 610,624 ---- report_id mediumint(8) UNSIGNED NOT NULL auto_increment, reason_id smallint(4) UNSIGNED DEFAULT '0' NOT NULL, post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + pm_id mediumin... [truncated message content] |
From: Nils A. <nad...@ph...> - 2009-07-21 20:31:20
|
Author: naderman Date: Tue Jul 21 20:30:50 2009 New Revision: 9813 Log: increase default maximum pass chars to 100 Modified: branches/phpBB-3_0_0/phpBB/install/schemas/schema_data.sql Modified: branches/phpBB-3_0_0/phpBB/install/schemas/schema_data.sql ============================================================================== *** branches/phpBB-3_0_0/phpBB/install/schemas/schema_data.sql (original) --- branches/phpBB-3_0_0/phpBB/install/schemas/schema_data.sql Tue Jul 21 20:30:50 2009 *************** *** 175,181 **** INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_login_attempts', '3'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_name_chars', '20'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_num_search_keywords', '10'); ! INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_pass_chars', '30'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_poll_options', '10'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_post_chars', '60000'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_post_font_size', '200'); --- 175,181 ---- INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_login_attempts', '3'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_name_chars', '20'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_num_search_keywords', '10'); ! INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_pass_chars', '100'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_poll_options', '10'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_post_chars', '60000'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_post_font_size', '200'); |
From: Andreas F. <ba...@ph...> - 2009-07-21 15:52:13
|
Author: bantu Date: Tue Jul 21 15:51:55 2009 New Revision: 9812 Log: Properties ... Modified: branches/phpBB-3_0_0/phpBB/feed.php (props changed) Propchange: branches/phpBB-3_0_0/phpBB/feed.php ------------------------------------------------------------------------------ svn:eol-style = LF Propchange: branches/phpBB-3_0_0/phpBB/feed.php ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision |
From: Meik S. <acy...@ph...> - 2009-07-21 10:59:07
|
Author: acydburn Date: Tue Jul 21 10:58:31 2009 New Revision: 9811 Log: Preserve newlines in template files (one newline had been always dropped after a template variable due to PHP's handling of closing tags) Modified: branches/phpBB-3_0_0/phpBB/docs/CHANGELOG.html branches/phpBB-3_0_0/phpBB/includes/functions_template.php branches/phpBB-3_0_0/phpBB/includes/template.php Modified: branches/phpBB-3_0_0/phpBB/docs/CHANGELOG.html ============================================================================== *** branches/phpBB-3_0_0/phpBB/docs/CHANGELOG.html (original) --- branches/phpBB-3_0_0/phpBB/docs/CHANGELOG.html Tue Jul 21 10:58:31 2009 *************** *** 168,173 **** --- 168,174 ---- <li>[Fix] Allow changing forum from select box under certain circumstances. (Bug #37525)</li> <li>[Fix] Display required fields notice on registration above the custom profile fields. (Bug #39665)</li> <li>[Fix] Copy poll options properly when copying topic. (Bug #39065)</li> + <li>[Fix] Preserve newlines in template files (one newline had been always dropped after a template variable due to PHP's handling of closing tags)</li> <li>[Change] Change the data format of the default file ACM to be more secure from tampering and have better performance.</li> <li>[Change] Add index on log_time to the log table to prevent slowdown on boards with many log entries. (Bug #44665 - Patch by bantu)</li> <li>[Change] Template engine now permits to a limited extent variable includes.</li> Modified: branches/phpBB-3_0_0/phpBB/includes/functions_template.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/includes/functions_template.php (original) --- branches/phpBB-3_0_0/phpBB/includes/functions_template.php Tue Jul 21 10:58:31 2009 *************** *** 251,265 **** $template_php .= (!$no_echo) ? (($trim_check_text != '') ? $text_blocks[$i] : '') . ((isset($compile_blocks[$i])) ? $compile_blocks[$i] : '') : (($trim_check_text != '') ? $text_blocks[$i] : '') . ((isset($compile_blocks[$i])) ? $compile_blocks[$i] : ''); } // There will be a number of occasions where we switch into and out of // PHP mode instantaneously. Rather than "burden" the parser with this // we'll strip out such occurences, minimising such switching if ($no_echo) { ! return "\$$echo_var .= '" . str_replace(' ?><?php ', ' ', $template_php) . "'"; } ! return str_replace(' ?><?php ', ' ', $template_php); } /** --- 251,272 ---- $template_php .= (!$no_echo) ? (($trim_check_text != '') ? $text_blocks[$i] : '') . ((isset($compile_blocks[$i])) ? $compile_blocks[$i] : '') : (($trim_check_text != '') ? $text_blocks[$i] : '') . ((isset($compile_blocks[$i])) ? $compile_blocks[$i] : ''); } + // Remove unused opening/closing tags + $template_php = str_replace(' ?><?php ', ' ', $template_php); + + // Now add a newline after each php closing tag which already has a newline + // PHP itself strips a newline if a closing tag is used (this is documented behaviour) and it is mostly not intended by style authors to remove newlines + $template_php = preg_replace('#\?\>([\r\n])#', '?>\1\1', $template_php); + // There will be a number of occasions where we switch into and out of // PHP mode instantaneously. Rather than "burden" the parser with this // we'll strip out such occurences, minimising such switching if ($no_echo) { ! return "\$$echo_var .= '" . $template_php . "'"; } ! return $template_php; } /** Modified: branches/phpBB-3_0_0/phpBB/includes/template.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/includes/template.php (original) --- branches/phpBB-3_0_0/phpBB/includes/template.php Tue Jul 21 10:58:31 2009 *************** *** 82,87 **** --- 82,89 ---- $this->root = $template_path; $this->cachepath = $phpbb_root_path . 'cache/ctpl_' . str_replace('_', '-', $template_name) . '_'; + $this->_rootref = &$this->_tpldata['.'][0]; + return true; } |
From: Henry S. <kel...@ph...> - 2009-07-21 10:53:13
|
Author: Kellanved Date: Tue Jul 21 10:52:38 2009 New Revision: 9810 Log: fix back link Modified: branches/phpBB-3_0_0/phpBB/adm/style/captcha_qa_acp.html Modified: branches/phpBB-3_0_0/phpBB/adm/style/captcha_qa_acp.html ============================================================================== *** branches/phpBB-3_0_0/phpBB/adm/style/captcha_qa_acp.html (original) --- branches/phpBB-3_0_0/phpBB/adm/style/captcha_qa_acp.html Tue Jul 21 10:52:38 2009 *************** *** 3,9 **** <a name="maincontent"></a> ! <a href="<!-- IF U_LIST -->{U_LIST}<!-- ELSE -->{U_BACK}<!-- ENDIF -->" style="float: {S_CONTENT_FLOW_END};">« {L_BACK}</a> <h1>{L_QUESTIONS}</h1> --- 3,9 ---- <a name="maincontent"></a> ! <a href="<!-- IF U_LIST -->{U_LIST}<!-- ELSE -->{U_ACTION}<!-- ENDIF -->" style="float: {S_CONTENT_FLOW_END};">« {L_BACK}</a> <h1>{L_QUESTIONS}</h1> *************** *** 57,63 **** <!-- ENDIF --> <form id="captcha_qa" method="post" action="{U_ACTION}"> <fieldset> ! <legend>{L_QUESTIONS}</legend> <dl> <dt><label for="strict">{L_QUESTION_STRICT}:</label><br /><span>{L_QUESTION_STRICT_EXPLAIN}</span></dt> <dd><label><input type="radio" class="radio" name="strict" value="1"<!-- IF STRICT --> id="strict" checked="checked"<!-- ENDIF --> /> {L_YES}</label> --- 57,63 ---- <!-- ENDIF --> <form id="captcha_qa" method="post" action="{U_ACTION}"> <fieldset> ! <legend>{L_EDIT_QUESTION}</legend> <dl> <dt><label for="strict">{L_QUESTION_STRICT}:</label><br /><span>{L_QUESTION_STRICT_EXPLAIN}</span></dt> <dd><label><input type="radio" class="radio" name="strict" value="1"<!-- IF STRICT --> id="strict" checked="checked"<!-- ENDIF --> /> {L_YES}</label> |
From: Henry S. <kel...@ph...> - 2009-07-21 10:27:06
|
Author: Kellanved Date: Tue Jul 21 10:26:18 2009 New Revision: 9809 Log: copy regiustration attempt setting to acp_captcha - although the setting is pointless Modified: branches/phpBB-3_0_0/phpBB/adm/style/acp_captcha.html branches/phpBB-3_0_0/phpBB/includes/acp/acp_captcha.php branches/phpBB-3_0_0/phpBB/language/en/acp/board.php branches/phpBB-3_0_0/phpBB/language/en/acp/common.php Modified: branches/phpBB-3_0_0/phpBB/adm/style/acp_captcha.html ============================================================================== *** branches/phpBB-3_0_0/phpBB/adm/style/acp_captcha.html (original) --- branches/phpBB-3_0_0/phpBB/adm/style/acp_captcha.html Tue Jul 21 10:26:18 2009 *************** *** 18,23 **** --- 18,27 ---- <label><input type="radio" class="radio" name="enable_confirm" value="0"<!-- IF not REG_ENABLE --> checked="checked"<!-- ENDIF --> /> {L_DISABLED}</label></dd> </dl> <dl> + <dt><label for="max_reg_attempts">{L_REG_LIMIT}:</label><br /><span>{L_REG_LIMIT_EXPLAIN}</span></dt> + <dd><input id="max_reg_attempts" type="text" size="4" maxlength="4" name="max_reg_attempts" value="{REG_LIMIT}" /></dd> + </dl> + <dl> <dt><label for="enable_post_confirm">{L_VISUAL_CONFIRM_POST}:</label><br /><span>{L_VISUAL_CONFIRM_POST_EXPLAIN}</span></dt> <dd><label><input type="radio" class="radio" id="enable_post_confirm" name="enable_post_confirm" value="1"<!-- IF POST_ENABLE --> checked="checked"<!-- ENDIF --> /> {L_ENABLED}</label> <label><input type="radio" class="radio" name="enable_post_confirm" value="0"<!-- IF not POST_ENABLE --> checked="checked"<!-- ENDIF --> /> {L_DISABLED}</label></dd> Modified: branches/phpBB-3_0_0/phpBB/includes/acp/acp_captcha.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/includes/acp/acp_captcha.php (original) --- branches/phpBB-3_0_0/phpBB/includes/acp/acp_captcha.php Tue Jul 21 10:26:18 2009 *************** *** 52,60 **** $captchas = phpbb_captcha_factory::get_captcha_types(); $config_vars = array( ! 'enable_confirm' => 'REG_ENABLE', ! 'enable_post_confirm' => 'POST_ENABLE', ! 'confirm_refresh' => 'CONFIRM_REFRESH', ); $this->tpl_name = 'acp_captcha'; --- 52,61 ---- $captchas = phpbb_captcha_factory::get_captcha_types(); $config_vars = array( ! 'enable_confirm' => array('tpl' => 'REG_ENABLE', 'default' => false), ! 'enable_post_confirm' => array('tpl' => 'POST_ENABLE', 'default' => false), ! 'confirm_refresh' => array('tpl' => 'CONFIRM_REFRESH', 'default' => false), ! 'max_reg_attempts' => array('tpl' => 'REG_LIMIT', 'default' => 0), ); $this->tpl_name = 'acp_captcha'; *************** *** 67,76 **** if ($submit && check_form_key($form_key)) { $config_vars = array_keys($config_vars); ! ! foreach ($config_vars as $config_var) { ! set_config($config_var, request_var($config_var, false)); } if ($selected !== $config['captcha_plugin']) --- 68,76 ---- if ($submit && check_form_key($form_key)) { $config_vars = array_keys($config_vars); ! foreach ($config_vars as $config_var => $options) { ! set_config($config_var, request_var($config_var, $options['default'])); } if ($selected !== $config['captcha_plugin']) *************** *** 115,123 **** $demo_captcha =& phpbb_captcha_factory::get_instance($selected); ! foreach ($config_vars as $config_var => $template_var) { ! $template->assign_var($template_var, (isset($_REQUEST[$config_var])) ? request_var($config_var, '') : $config[$config_var]) ; } $template->assign_vars(array( --- 115,123 ---- $demo_captcha =& phpbb_captcha_factory::get_instance($selected); ! foreach ($config_vars as $config_var => $options) { ! $template->assign_var($options['tpl'], (isset($_POST[$config_var])) ? request_var($config_var, $options['default']) : $config[$config_var]) ; } $template->assign_vars(array( Modified: branches/phpBB-3_0_0/phpBB/language/en/acp/board.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/language/en/acp/board.php (original) --- branches/phpBB-3_0_0/phpBB/language/en/acp/board.php Tue Jul 21 10:26:18 2009 *************** *** 274,280 **** // Visual Confirmation Settings $lang = array_merge($lang, array( ! 'ACP_VC_SETTINGS_EXPLAIN' => 'Here you are able to define visual confirmation defaults and CAPTCHA settings.', 'AVAILABLE_CAPTCHAS' => 'Available plugins', 'CAPTCHA_UNAVAILABLE' => 'The CAPTCHA cannot be selected as its requirements are not met.', 'CAPTCHA_GD' => 'GD CAPTCHA', --- 274,280 ---- // Visual Confirmation Settings $lang = array_merge($lang, array( ! 'ACP_VC_SETTINGS_EXPLAIN' => 'Here you can select and configure CAPTCHA plugins, which implement various ways to reject registration attempts from so-called spambots.', 'AVAILABLE_CAPTCHAS' => 'Available plugins', 'CAPTCHA_UNAVAILABLE' => 'The CAPTCHA cannot be selected as its requirements are not met.', 'CAPTCHA_GD' => 'GD CAPTCHA', Modified: branches/phpBB-3_0_0/phpBB/language/en/acp/common.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/language/en/acp/common.php (original) --- branches/phpBB-3_0_0/phpBB/language/en/acp/common.php Tue Jul 21 10:26:18 2009 *************** *** 188,194 **** 'ACP_USER_SIG' => 'Signature', 'ACP_USER_WARNINGS' => 'Warnings', ! 'ACP_VC_SETTINGS' => 'Visual confirmation settings', 'ACP_VC_CAPTCHA_DISPLAY' => 'CAPTCHA image preview', 'ACP_VERSION_CHECK' => 'Check for updates', 'ACP_VIEW_ADMIN_PERMISSIONS' => 'View administrative permissions', --- 188,194 ---- 'ACP_USER_SIG' => 'Signature', 'ACP_USER_WARNINGS' => 'Warnings', ! 'ACP_VC_SETTINGS' => 'CAPTCHA module settings', 'ACP_VC_CAPTCHA_DISPLAY' => 'CAPTCHA image preview', 'ACP_VERSION_CHECK' => 'Check for updates', 'ACP_VIEW_ADMIN_PERMISSIONS' => 'View administrative permissions', *************** *** 493,499 **** 'LOG_CONFIG_SERVER' => '<strong>Altered server settings</strong>', 'LOG_CONFIG_SETTINGS' => '<strong>Altered board settings</strong>', 'LOG_CONFIG_SIGNATURE' => '<strong>Altered signature settings</strong>', ! 'LOG_CONFIG_VISUAL' => '<strong>Altered visual confirmation settings</strong>', 'LOG_APPROVE_TOPIC' => '<strong>Approved topic</strong><br />» %s', 'LOG_BUMP_TOPIC' => '<strong>User bumped topic</strong><br />» %s', --- 493,499 ---- 'LOG_CONFIG_SERVER' => '<strong>Altered server settings</strong>', 'LOG_CONFIG_SETTINGS' => '<strong>Altered board settings</strong>', 'LOG_CONFIG_SIGNATURE' => '<strong>Altered signature settings</strong>', ! 'LOG_CONFIG_VISUAL' => '<strong>Altered antibot settings</strong>', 'LOG_APPROVE_TOPIC' => '<strong>Approved topic</strong><br />» %s', 'LOG_BUMP_TOPIC' => '<strong>User bumped topic</strong><br />» %s', |
From: Henry S. <kel...@ph...> - 2009-07-20 18:28:07
|
Author: Kellanved Date: Mon Jul 20 18:27:26 2009 New Revision: 9808 Log: rename variables to avoid name clashes in aggregating plugins Modified: branches/phpBB-3_0_0/phpBB/includes/captcha/plugins/phpbb_captcha_qa_plugin.php branches/phpBB-3_0_0/phpBB/styles/prosilver/template/captcha_qa.html branches/phpBB-3_0_0/phpBB/styles/subsilver2/template/captcha_qa.html Modified: branches/phpBB-3_0_0/phpBB/includes/captcha/plugins/phpbb_captcha_qa_plugin.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/includes/captcha/plugins/phpbb_captcha_qa_plugin.php (original) --- branches/phpBB-3_0_0/phpBB/includes/captcha/plugins/phpbb_captcha_qa_plugin.php Mon Jul 20 18:27:26 2009 *************** *** 50,59 **** { global $config, $db, $user; $user->add_lang('captcha_qa'); // read input ! $this->confirm_id = request_var('confirm_id', ''); ! $this->answer = request_var('answer', ''); $this->type = (int) $type; $this->question_lang = $user->data['user_lang']; --- 50,60 ---- { global $config, $db, $user; + // load our language file $user->add_lang('captcha_qa'); // read input ! $this->confirm_id = request_var('qa_confirm_id', ''); ! $this->answer = request_var('qa_answer', ''); $this->type = (int) $type; $this->question_lang = $user->data['user_lang']; *************** *** 118,123 **** --- 119,125 ---- { global $config, $db, $phpbb_root_path, $phpEx, $user; + // load language file for pretty display in the ACP dropdown $user->add_lang('captcha_qa'); if (!self::is_installed()) *************** *** 170,177 **** global $template; $template->assign_vars(array( ! 'CONFIRM_QUESTION' => $this->question_text, ! 'CONFIRM_ID' => $this->confirm_id, 'S_CONFIRM_CODE' => true, 'S_TYPE' => $this->type, )); --- 172,179 ---- global $template; $template->assign_vars(array( ! 'QA_CONFIRM_QUESTION' => $this->question_text, ! 'QA_CONFIRM_ID' => $this->confirm_id, 'S_CONFIRM_CODE' => true, 'S_TYPE' => $this->type, )); *************** *** 197,205 **** // this is required - otherwise we would forget about the captcha being already solved if ($this->solved) { ! $hidden_fields['answer'] = $this->answer; } ! $hidden_fields['confirm_id'] = $this->confirm_id; return $hidden_fields; } --- 199,207 ---- // this is required - otherwise we would forget about the captcha being already solved if ($this->solved) { ! $hidden_fields['qa_answer'] = $this->answer; } ! $hidden_fields['qa_confirm_id'] = $this->confirm_id; return $hidden_fields; } *************** *** 447,453 **** { global $db; ! $answer = ($this->question_strict) ? request_var('answer', '') : utf8_clean_string(request_var('answer', '')); $sql = 'SELECT answer_text FROM ' . ANSWERS_TABLE . ' --- 449,455 ---- { global $db; ! $answer = ($this->question_strict) ? request_var('qa_answer', '') : utf8_clean_string(request_var('qa_answer', '')); $sql = 'SELECT answer_text FROM ' . ANSWERS_TABLE . ' *************** *** 509,515 **** */ function is_solved() { ! if (request_var('answer', false) && $this->solved === 0) { $this->validate(); } --- 511,517 ---- */ function is_solved() { ! if (request_var('qa_answer', false) && $this->solved === 0) { $this->validate(); } Modified: branches/phpBB-3_0_0/phpBB/styles/prosilver/template/captcha_qa.html ============================================================================== *** branches/phpBB-3_0_0/phpBB/styles/prosilver/template/captcha_qa.html (original) --- branches/phpBB-3_0_0/phpBB/styles/prosilver/template/captcha_qa.html Mon Jul 20 18:27:26 2009 *************** *** 7,16 **** <!-- ENDIF --> <dl> ! <dt><label>{CONFIRM_QUESTION}</label>:<br /><span>{L_CONFIRM_QUESTION_EXPLAIN}</span></dt> <dd> ! <input type="text" tabindex="10" name="answer" id="answer" size="45" class="inputbox autowidth" title="{L_ANSWER}" /> ! <input type="hidden" name="confirm_id" id="confirm_id" value="{CONFIRM_ID}" /> </dd> </dl> --- 7,16 ---- <!-- ENDIF --> <dl> ! <dt><label>{QA_CONFIRM_QUESTION}</label>:<br /><span>{L_CONFIRM_QUESTION_EXPLAIN}</span></dt> <dd> ! <input type="text" tabindex="10" name="qa_answer" id="answer" size="45" class="inputbox autowidth" title="{L_ANSWER}" /> ! <input type="hidden" name="confirm_id" id="qa_confirm_id" value="{QA_CONFIRM_ID}" /> </dd> </dl> Modified: branches/phpBB-3_0_0/phpBB/styles/subsilver2/template/captcha_qa.html ============================================================================== *** branches/phpBB-3_0_0/phpBB/styles/subsilver2/template/captcha_qa.html (original) --- branches/phpBB-3_0_0/phpBB/styles/subsilver2/template/captcha_qa.html Mon Jul 20 18:27:26 2009 *************** *** 1,5 **** <tr> ! <td class="row1"><b class="genmed">{CONFIRM_QUESTION}: </b><br /></td> ! <td class="row2"><input class="post" type="text" name="answer" size="80" /></td> ! <input type="hidden" name="confirm_id" id="confirm_id" value="{CONFIRM_ID}" /></td> </tr> \ No newline at end of file --- 1,5 ---- <tr> ! <td class="row1"><b class="genmed">{QA_CONFIRM_QUESTION}: </b><br /></td> ! <td class="row2"><input class="post" type="text" name="qa_answer" size="80" /></td> ! <input type="hidden" name="qa_confirm_id" id="confirm_id" value="{QA_CONFIRM_ID}" /></td> </tr> \ No newline at end of file |
From: Henry S. <kel...@ph...> - 2009-07-20 12:48:10
|
Author: Kellanved Date: Mon Jul 20 12:47:45 2009 New Revision: 9807 Log: cleaning Modified: branches/phpBB-3_0_0/phpBB/adm/style/captcha_qa_acp.html Modified: branches/phpBB-3_0_0/phpBB/adm/style/captcha_qa_acp.html ============================================================================== *** branches/phpBB-3_0_0/phpBB/adm/style/captcha_qa_acp.html (original) --- branches/phpBB-3_0_0/phpBB/adm/style/captcha_qa_acp.html Mon Jul 20 12:47:45 2009 *************** *** 70,76 **** </dl> <dl> <dt><label for="question_text">{L_QUESTION_TEXT}</label><br /><span>{L_QUESTION_TEXT_EXPLAIN}</span></dt> ! <dd><input id="question_text" name="question_text" type="text" value="{QUESTION_TEXT}" /></dd> </dl> <dl> <dt><label for="answers">{L_QUESTION_ANSWERS}</label><br /><span>{L_ANSWERS_EXPLAIN}</span></dt> --- 70,76 ---- </dl> <dl> <dt><label for="question_text">{L_QUESTION_TEXT}</label><br /><span>{L_QUESTION_TEXT_EXPLAIN}</span></dt> ! <dd><input id="question_text" maxlength="255" size="60" name="question_text" type="text" value="{QUESTION_TEXT}" /></dd> </dl> <dl> <dt><label for="answers">{L_QUESTION_ANSWERS}</label><br /><span>{L_ANSWERS_EXPLAIN}</span></dt> |
From: Henry S. <kel...@ph...> - 2009-07-20 12:46:52
|
Author: Kellanved Date: Mon Jul 20 12:46:24 2009 New Revision: 9806 Log: cleaning Modified: branches/phpBB-3_0_0/phpBB/adm/style/captcha_qa_acp.html Modified: branches/phpBB-3_0_0/phpBB/adm/style/captcha_qa_acp.html ============================================================================== *** branches/phpBB-3_0_0/phpBB/adm/style/captcha_qa_acp.html (original) --- branches/phpBB-3_0_0/phpBB/adm/style/captcha_qa_acp.html Mon Jul 20 12:46:24 2009 *************** *** 52,58 **** <!-- IF S_ERROR --> <div class="errorbox"> <h3>{L_WARNING}</h3> ! <p>{QA_ERROR_MSG}</p> </div> <!-- ENDIF --> <form id="captcha_qa" method="post" action="{U_ACTION}"> --- 52,58 ---- <!-- IF S_ERROR --> <div class="errorbox"> <h3>{L_WARNING}</h3> ! <p>{L_QA_ERROR_MSG}</p> </div> <!-- ENDIF --> <form id="captcha_qa" method="post" action="{U_ACTION}"> |
From: Henry S. <kel...@ph...> - 2009-07-20 11:07:33
|
Author: Kellanved Date: Mon Jul 20 11:07:10 2009 New Revision: 9805 Log: cleaning Modified: branches/phpBB-3_0_0/phpBB/adm/style/captcha_qa_acp.html Modified: branches/phpBB-3_0_0/phpBB/adm/style/captcha_qa_acp.html ============================================================================== *** branches/phpBB-3_0_0/phpBB/adm/style/captcha_qa_acp.html (original) --- branches/phpBB-3_0_0/phpBB/adm/style/captcha_qa_acp.html Mon Jul 20 11:07:10 2009 *************** *** 74,80 **** </dl> <dl> <dt><label for="answers">{L_QUESTION_ANSWERS}</label><br /><span>{L_ANSWERS_EXPLAIN}</span></dt> ! <dd><textarea id="answers" name="answers" rows="15" cols="80" >{ANSWERS}</textarea></dd> </dl> </fieldset> <fieldset class="quick"> --- 74,80 ---- </dl> <dl> <dt><label for="answers">{L_QUESTION_ANSWERS}</label><br /><span>{L_ANSWERS_EXPLAIN}</span></dt> ! <dd><textarea id="answers" style="word-wrap: normal; overflow-x: scroll;" name="answers" rows="15" cols="800" >{ANSWERS}</textarea></dd> </dl> </fieldset> <fieldset class="quick"> |
From: Henry S. <kel...@ph...> - 2009-07-20 10:47:50
|
Author: Kellanved Date: Mon Jul 20 10:47:28 2009 New Revision: 9804 Log: cleaning Modified: branches/phpBB-3_0_0/phpBB/language/en/captcha_qa.php Modified: branches/phpBB-3_0_0/phpBB/language/en/captcha_qa.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/language/en/captcha_qa.php (original) --- branches/phpBB-3_0_0/phpBB/language/en/captcha_qa.php Mon Jul 20 10:47:28 2009 *************** *** 46,52 **** 'ANSWER' => 'Answer', 'QUESTIONS' => 'Questions', ! 'QUESTIONS_EXPLAIN' => 'Here you can add enter and edit questions to be asked on registration to ward against automatted installs.', 'QUESTION_DELETED' => 'Question deleted', 'QUESTION_LANG' => 'Language', 'QUESTION_LANG_EXPLAIN' => 'The language this question and its answers is written in.', --- 46,52 ---- 'ANSWER' => 'Answer', 'QUESTIONS' => 'Questions', ! 'QUESTIONS_EXPLAIN' => 'Here you can add and edit questions to be asked on registration. You have to provide at least one question in the default board language to use this plugin. Questions should be easy for your target audience, but beyond the ability of google. Also, remember to change the questions regularly. If your question relies on punctuation, spelling or capitalisation, use the strict setting.', 'QUESTION_DELETED' => 'Question deleted', 'QUESTION_LANG' => 'Language', 'QUESTION_LANG_EXPLAIN' => 'The language this question and its answers is written in.', |
From: Henry S. <kel...@ph...> - 2009-07-20 10:42:51
|
Author: Kellanved Date: Mon Jul 20 10:42:27 2009 New Revision: 9803 Log: cleaning Modified: branches/phpBB-3_0_0/phpBB/includes/captcha/plugins/phpbb_captcha_qa_plugin.php Modified: branches/phpBB-3_0_0/phpBB/includes/captcha/plugins/phpbb_captcha_qa_plugin.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/includes/captcha/plugins/phpbb_captcha_qa_plugin.php (original) --- branches/phpBB-3_0_0/phpBB/includes/captcha/plugins/phpbb_captcha_qa_plugin.php Mon Jul 20 10:42:27 2009 *************** *** 24,29 **** --- 24,30 ---- /** + * And now to something completely different. Let's make a captcha without extending the abstract class. * QA CAPTCHA sample implementation * * @package VC *************** *** 39,47 **** var $question_strict; var $attempts = 0; var $type; var $solved = 0; - var $captcha_vars = false; function init($type) { global $config, $db, $user; --- 40,51 ---- var $question_strict; var $attempts = 0; var $type; + // dirty trick: 0 is false, but can still encode that the captcha is not yet validated var $solved = 0; + /** + * @param int $type as per the CAPTCHA API docs, the type + */ function init($type) { global $config, $db, $user; *************** *** 53,59 **** $this->type = (int) $type; $this->question_lang = $user->data['user_lang']; ! $sql = 'SELECT question_id FROM ' . QUESTIONS_TABLE . ' WHERE lang_iso = \'' . $db->sql_escape($user->data['user_lang']) . '\''; $result = $db->sql_query($sql, 3600); while ($row = $db->sql_fetchrow($result)) --- 57,64 ---- $this->type = (int) $type; $this->question_lang = $user->data['user_lang']; ! // we need all defined questions - shouldn't be too many, so we can just grab them ! // try the user's lang first $sql = 'SELECT question_id FROM ' . QUESTIONS_TABLE . ' WHERE lang_iso = \'' . $db->sql_escape($user->data['user_lang']) . '\''; $result = $db->sql_query($sql, 3600); while ($row = $db->sql_fetchrow($result)) *************** *** 61,66 **** --- 66,72 ---- $this->question_ids[$row['question_id']] = $row['question_id']; } $db->sql_freeresult($result); + // fallback to the board default lang if (!sizeof($this->question_ids)) { $this->question_lang = $config['default_lang']; *************** *** 73,93 **** $db->sql_freeresult($result); } if (!strlen($this->confirm_id) || !$this->load_answer()) { ! // we have no confirm ID, better get ready to display something $this->select_question(); } } ! function &get_instance() { $instance =& new phpbb_captcha_qa(); return $instance; } ! function is_installed() { global $db, $phpbb_root_path, $phpEx; --- 79,104 ---- $db->sql_freeresult($result); } + // okay, if there is a confirm_id, we try to load that confirm's state if (!strlen($this->confirm_id) || !$this->load_answer()) { ! // we have no valid confirm ID, better get ready to ask something $this->select_question(); } } ! /** ! * API function ! */ function &get_instance() { $instance =& new phpbb_captcha_qa(); return $instance; } ! /** ! * See if the captcha has created its tables. ! */ function is_installed() { global $db, $phpbb_root_path, $phpEx; *************** *** 100,105 **** --- 111,119 ---- return $db_tool->sql_table_exists(QUESTIONS_TABLE); } + /** + * API function - for the captcha to be available, it must have installed itself and there has to be at least one question in the board's default lang + */ function is_available() { global $config, $db, $phpbb_root_path, $phpEx, $user; *************** *** 117,144 **** return ((bool) $row['count']); } function get_name() { return 'CAPTCHA_QA'; } function get_class_name() { return 'phpbb_captcha_qa'; } function execute_demo() { } function execute() { } function get_template() { ! global $config, $user, $template, $phpEx, $phpbb_root_path; $template->assign_vars(array( 'CONFIRM_QUESTION' => $this->question_text, --- 131,173 ---- return ((bool) $row['count']); } + /** + * API function + */ function get_name() { return 'CAPTCHA_QA'; } + /** + * API function + */ function get_class_name() { return 'phpbb_captcha_qa'; } + /** + * API function - not needed as we don't display an image + */ function execute_demo() { } + /** + * API function - not needed as we don't display an image + */ function execute() { } + /** + * API function - send the question to the template + */ function get_template() { ! global $template; $template->assign_vars(array( 'CONFIRM_QUESTION' => $this->question_text, *************** *** 150,160 **** return 'captcha_qa.html'; } ! function get_demo_template($id) { return 'captcha_qa_acp_demo.html'; } function get_hidden_fields() { $hidden_fields = array(); --- 179,195 ---- return 'captcha_qa.html'; } ! /** ! * API function - we just display a mockup so that the captcha doesn't need to be installed ! */ ! function get_demo_template() { return 'captcha_qa_acp_demo.html'; } + /** + * API function + */ function get_hidden_fields() { $hidden_fields = array(); *************** *** 168,173 **** --- 203,211 ---- return $hidden_fields; } + /** + * API function + */ function garbage_collect($type) { global $db, $config; *************** *** 198,208 **** --- 236,252 ---- $db->sql_freeresult($result); } + /** + * API function - we don't drop the tables here, as that would cause the loss of all entered questions. + */ function uninstall() { $this->garbage_collect(0); } + /** + * API function - set up shop + */ function install() { global $db, $phpbb_root_path, $phpEx; *************** *** 226,231 **** --- 270,276 ---- 'PRIMARY_KEY' => 'question_id', 'KEYS' => array( 'question_id' => array('INDEX', array('question_id', 'lang_iso')), + 'lang_iso' => array('INDEX', 'lang_iso'), ), ), ANSWERS_TABLE => array ( *************** *** 254,260 **** ), ); - foreach($schemas as $table => $schema) { if (!$db_tool->sql_table_exists($table)) --- 299,304 ---- *************** *** 265,270 **** --- 309,317 ---- } + /** + * API function - see what has to be done to validate + */ function validate() { global $config, $db, $user; *************** *** 342,353 **** } /** ! * New Question, if desired. */ function new_attempt() { global $db, $user; $this->question = (int) array_rand($this->question_ids); $this->solved = 0; // compute $seed % 0x7fffffff --- 389,401 ---- } /** ! * Wrong answer, so we increase the attempts and use a different question. */ function new_attempt() { global $db, $user; + // yah, I would prefer a stronger rand, but this should work $this->question = (int) array_rand($this->question_ids); $this->solved = 0; // compute $seed % 0x7fffffff *************** *** 363,369 **** } /** ! * Look up everything we need. */ function load_answer() { --- 411,417 ---- } /** ! * Look up everything we need and populate the instance variables. */ function load_answer() { *************** *** 392,397 **** --- 440,448 ---- return false; } + /** + * The actual validation + */ function check_answer() { global $db; *************** *** 415,420 **** --- 466,474 ---- return $this->solved; } + /** + * API function - clean the entry + */ function delete_code() { global $db, $user; *************** *** 426,436 **** --- 480,496 ---- $db->sql_query($sql); } + /** + * API function + */ function get_attempt_count() { return $this->attempts; } + /** + * API function + */ function reset() { global $db, $user; *************** *** 443,449 **** // we leave the class usable by generating a new question $this->generate_code(); } ! function is_solved() { if (request_var('answer', false) && $this->solved === 0) --- 503,512 ---- // we leave the class usable by generating a new question $this->generate_code(); } ! ! /** ! * API function ! */ function is_solved() { if (request_var('answer', false) && $this->solved === 0) *************** *** 453,458 **** --- 516,525 ---- return (bool) $this->solved; } + + /** + * API function - The ACP backend, this marks the end of the easy methods + */ function acp_page($id, &$module) { global $db, $user, $auth, $template; *************** *** 474,479 **** --- 541,547 ---- $question_id = request_var('question_id', 0); $action = request_var('action', ''); + // we have two pages, so users might want to navigate from one to the other $list_url = $module->u_action . "&configure=1&select_captcha=" . $this->get_class_name(); $template->assign_vars(array( *************** *** 481,487 **** 'QUESTION_ID' => $question_id , 'CLASS' => $this->get_class_name(), )); ! if (!$question_id && $action != 'add') { $this->acp_question_list($module); --- 549,556 ---- 'QUESTION_ID' => $question_id , 'CLASS' => $this->get_class_name(), )); ! ! // show the list? if (!$question_id && $action != 'add') { $this->acp_question_list($module); *************** *** 506,512 **** } else { ! $error = false; $input_question = request_var('question_text', ''); $input_answers = request_var('answers', ''); --- 575,581 ---- } else { ! // okay, show the editor $error = false; $input_question = request_var('question_text', ''); $input_answers = request_var('answers', ''); *************** *** 582,587 **** --- 651,660 ---- } } + + /** + * This handles the list overview + */ function acp_question_list(&$module) { global $db, $template; *************** *** 606,612 **** } $db->sql_freeresult($result); } ! function acp_get_question_data($question_id) { global $db; --- 679,688 ---- } $db->sql_freeresult($result); } ! ! /** ! * Grab a question and bring it into a format the editor understands ! */ function acp_get_question_data($question_id) { global $db; *************** *** 639,644 **** --- 715,723 ---- } + /** + * Grab a question from input and bring it into a format the editor understands + */ function acp_get_question_input() { global $db; *************** *** 653,664 **** return $question; } ! ! function acp_update_question($data, $question_id) { global $db; $sql = "DELETE FROM " . ANSWERS_TABLE . " WHERE question_id = $question_id"; $db->sql_query($sql); $langs = $this->get_languages(); --- 732,746 ---- return $question; } ! /** ! * Update a question. ! * param mixed $data : an array as created from acp_get_question_input or acp_get_question_data ! */ function acp_update_question($data, $question_id) { global $db; + // easier to delete all answers than to figure out which to update $sql = "DELETE FROM " . ANSWERS_TABLE . " WHERE question_id = $question_id"; $db->sql_query($sql); $langs = $this->get_languages(); *************** *** 671,676 **** --- 753,762 ---- $this->acp_insert_answers($data, $question_id); } + /** + * Insert a question. + * param mixed $data : an array as created from acp_get_question_input or acp_get_question_data + */ function acp_add_question($data) { global $db; *************** *** 686,691 **** --- 772,781 ---- $this->acp_insert_answers($data, $question_id); } + /** + * Insert the answers. + * param mixed $data : an array as created from acp_get_question_input or acp_get_question_data + */ function acp_insert_answers($data, $question_id) { global $db; *************** *** 702,708 **** } ! function acp_delete_question($question_id) { global $db; --- 792,800 ---- } ! /** ! * Delete a question. ! */ function acp_delete_question($question_id) { global $db; *************** *** 716,721 **** --- 808,817 ---- } + /** + * Check if the entered data can be inserted/used + * param mixed $data : an array as created from acp_get_question_input or acp_get_question_data + */ function validate_input($question_data) { $langs = $this->get_languages(); *************** *** 736,741 **** --- 832,840 ---- return true; } + /** + * List the installed language packs + */ function get_languages() { global $db; |
From: Henry S. <kel...@ph...> - 2009-07-20 10:23:11
|
Author: Kellanved Date: Mon Jul 20 10:22:54 2009 New Revision: 9802 Log: fixing back links Modified: branches/phpBB-3_0_0/phpBB/adm/style/captcha_qa_acp.html Modified: branches/phpBB-3_0_0/phpBB/adm/style/captcha_qa_acp.html ============================================================================== *** branches/phpBB-3_0_0/phpBB/adm/style/captcha_qa_acp.html (original) --- branches/phpBB-3_0_0/phpBB/adm/style/captcha_qa_acp.html Mon Jul 20 10:22:54 2009 *************** *** 3,10 **** <a name="maincontent"></a> ! ! <a href="{U_BACK}" style="float: {S_CONTENT_FLOW_END};">« {L_BACK}</a> <h1>{L_QUESTIONS}</h1> --- 3,9 ---- <a name="maincontent"></a> ! <a href="<!-- IF U_LIST -->{U_LIST}<!-- ELSE -->{U_BACK}<!-- ENDIF -->" style="float: {S_CONTENT_FLOW_END};">« {L_BACK}</a> <h1>{L_QUESTIONS}</h1> |
Author: Kellanved Date: Mon Jul 20 10:22:13 2009 New Revision: 9801 Log: fixing back links Added: branches/phpBB-3_0_0/phpBB/language/en/captcha_recaptcha.php - copied unchanged from r9800, branches/phpBB-3_0_0/phpBB/language/en/recaptcha.php Removed: branches/phpBB-3_0_0/phpBB/language/en/recaptcha.php Modified: branches/phpBB-3_0_0/phpBB/includes/captcha/plugins/phpbb_captcha_qa_plugin.php branches/phpBB-3_0_0/phpBB/includes/captcha/plugins/phpbb_recaptcha_plugin.php Modified: branches/phpBB-3_0_0/phpBB/includes/captcha/plugins/phpbb_captcha_qa_plugin.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/includes/captcha/plugins/phpbb_captcha_qa_plugin.php (original) --- branches/phpBB-3_0_0/phpBB/includes/captcha/plugins/phpbb_captcha_qa_plugin.php Mon Jul 20 10:22:13 2009 *************** *** 474,479 **** --- 474,480 ---- $question_id = request_var('question_id', 0); $action = request_var('action', ''); + $list_url = $module->u_action . "&configure=1&select_captcha=" . $this->get_class_name(); $template->assign_vars(array( 'U_ACTION' => $module->u_action, *************** *** 490,496 **** if (confirm_box(true)) { $this->acp_delete_question($question_id); ! trigger_error($user->lang['QUESTION_DELETED'] . adm_back_link($module->u_action)); } else { --- 491,497 ---- if (confirm_box(true)) { $this->acp_delete_question($question_id); ! trigger_error($user->lang['QUESTION_DELETED'] . adm_back_link($list_url)); } else { *************** *** 520,525 **** --- 521,529 ---- )); } + $template->assign_vars(array( + 'U_LIST' => $list_url, + )); if ($question_id) { if ($question = $this->acp_get_question_data($question_id)) *************** *** 534,540 **** } else { ! trigger_error($user->lang['FORM_INVALID'] . adm_back_link($module->u_action)); } } else --- 538,544 ---- } else { ! trigger_error($user->lang['FORM_INVALID'] . adm_back_link($list_url)); } } else *************** *** 568,579 **** $this->acp_add_question($data); } ! trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($module->u_action . "&configure=1&select_captcha=" . $this->get_class_name())); } } else if ($submit) { ! trigger_error($user->lang['FORM_INVALID'] . adm_back_link($module->u_action)); } } } --- 572,583 ---- $this->acp_add_question($data); } ! trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($list_url)); } } else if ($submit) { ! trigger_error($user->lang['FORM_INVALID'] . adm_back_link($list_url)); } } } Modified: branches/phpBB-3_0_0/phpBB/includes/captcha/plugins/phpbb_recaptcha_plugin.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/includes/captcha/plugins/phpbb_recaptcha_plugin.php (original) --- branches/phpBB-3_0_0/phpBB/includes/captcha/plugins/phpbb_recaptcha_plugin.php Mon Jul 20 10:22:13 2009 *************** *** 36,42 **** { global $config, $db, $user; ! $user->add_lang('recaptcha'); parent::init($type); $this->challenge = request_var('recaptcha_challenge_field', ''); $this->response = request_var('recaptcha_response_field', ''); --- 36,42 ---- { global $config, $db, $user; ! $user->add_lang('captcha_recaptcha'); parent::init($type); $this->challenge = request_var('recaptcha_challenge_field', ''); $this->response = request_var('recaptcha_response_field', ''); *************** *** 51,57 **** function is_available() { global $config, $user; ! $user->add_lang('recaptcha'); return (isset($config['recaptcha_pubkey']) && !empty($config['recaptcha_pubkey'])); } --- 51,57 ---- function is_available() { global $config, $user; ! $user->add_lang('captcha_recaptcha'); return (isset($config['recaptcha_pubkey']) && !empty($config['recaptcha_pubkey'])); } Removed: branches/phpBB-3_0_0/phpBB/language/en/recaptcha.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/language/en/recaptcha.php (original) --- branches/phpBB-3_0_0/phpBB/language/en/recaptcha.php (removed) *************** *** 1,52 **** - <?php - /** - * - * recaptcha [English] - * - * @package language - * @version $Id$ - * @copyright (c) 2009 phpBB Group - * @license http://opensource.org/licenses/gpl-license.php GNU Public License - * - */ - - /** - * DO NOT CHANGE - */ - if (!defined('IN_PHPBB')) - { - exit; - } - - if (empty($lang) || !is_array($lang)) - { - $lang = array(); - } - - // DEVELOPERS PLEASE NOTE - // - // All language files should use UTF-8 as their encoding and the files must not contain a BOM. - // - // Placeholders can now contain order information, e.g. instead of - // 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows - // translators to re-order the output of data while ensuring it remains correct - // - // You do not need this where single placeholders are used, e.g. 'Message %d' is fine - // equally where a string contains only two placeholders which are used to wrap text - // in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine - - $lang = array_merge($lang, array( - 'RECAPTCHA_LANG' => 'en', - 'RECAPTCHA_NOT_AVAILABLE' => 'You have to register for reCaptcha at <a href="http://recaptcha.net">reCaptcha.net</a>.', - 'CAPTCHA_RECAPTCHA' => 'reCaptcha', - 'RECAPTCHA_INCORRECT' => 'The entered visual confirmation was incorrect', - - 'RECAPTCHA_PUBLIC' => 'Public reCaptcha key', - 'RECAPTCHA_PUBLIC_EXPLAIN' => 'Your public reCaptcha key. You can obtain keys from <a href="http://recaptcha.net">reCaptcha.net</a>.', - 'RECAPTCHA_PRIVATE' => 'Private reCaptcha key', - 'RECAPTCHA_PRIVATE_EXPLAIN' => 'Your private reCaptcha key. You can obtain keys from <a href="http://recaptcha.net">reCaptcha.net</a>.', - - 'RECAPTCHA_EXPLAIN' => 'To avoid spam postings, please enter the two words shown in the picture into the text field underneath.', - )); - - ?> \ No newline at end of file --- 0 ---- |
From: Jim W. <ter...@ph...> - 2009-07-20 00:58:51
|
Author: terrafrost Date: Mon Jul 20 00:57:18 2009 New Revision: 9800 Log: - added filtration ability to MCP - added missing lang variable - fixed a pagination bug in filtration routines Modified: branches/phpBB-3_0_0/phpBB/docs/CHANGELOG.html branches/phpBB-3_0_0/phpBB/includes/acp/acp_logs.php branches/phpBB-3_0_0/phpBB/includes/functions_admin.php branches/phpBB-3_0_0/phpBB/includes/mcp/mcp_logs.php branches/phpBB-3_0_0/phpBB/includes/mcp/mcp_notes.php branches/phpBB-3_0_0/phpBB/language/en/acp/common.php branches/phpBB-3_0_0/phpBB/styles/prosilver/template/mcp_logs.html branches/phpBB-3_0_0/phpBB/styles/prosilver/template/mcp_notes_user.html branches/phpBB-3_0_0/phpBB/styles/subsilver2/template/mcp_logs.html branches/phpBB-3_0_0/phpBB/styles/subsilver2/template/mcp_notes_user.html Modified: branches/phpBB-3_0_0/phpBB/docs/CHANGELOG.html ============================================================================== *** branches/phpBB-3_0_0/phpBB/docs/CHANGELOG.html (original) --- branches/phpBB-3_0_0/phpBB/docs/CHANGELOG.html Mon Jul 20 00:57:18 2009 *************** *** 215,221 **** <li>[Feature] Add option to disable remote upload avatars (Bug #45375 - Patch by nickvergessen)</li> <li>[Feature] Ability to delete warnings and keep warnings permanently (Bug #43375 - Patch by nickvergessen)</li> <li>[Feature] Ability to empty a user's outbox from the user ACP quick tools.</li> ! <li>[Feature] Ability to filter ACP logs</li> </ul> <a name="v304"></a><h3>1.ii. Changes since 3.0.4</h3> --- 215,221 ---- <li>[Feature] Add option to disable remote upload avatars (Bug #45375 - Patch by nickvergessen)</li> <li>[Feature] Ability to delete warnings and keep warnings permanently (Bug #43375 - Patch by nickvergessen)</li> <li>[Feature] Ability to empty a user's outbox from the user ACP quick tools.</li> ! <li>[Feature] Ability to filter ACP / MCP logs</li> </ul> <a name="v304"></a><h3>1.ii. Changes since 3.0.4</h3> Modified: branches/phpBB-3_0_0/phpBB/includes/acp/acp_logs.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/includes/acp/acp_logs.php (original) --- branches/phpBB-3_0_0/phpBB/includes/acp/acp_logs.php Mon Jul 20 00:57:18 2009 *************** *** 158,165 **** $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { $selected = ($log_operation == $row['log_operation']) ? ' selected="selected"' : ''; ! $s_lang_keys .= '<option value="' . $row['log_operation'] . '"' . $selected . '>' . $user->lang[$row['log_operation']] . '</option>'; } $db->sql_freeresult($result); --- 158,169 ---- $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { + if (empty($row['log_operation'])) + { + continue; + } $selected = ($log_operation == $row['log_operation']) ? ' selected="selected"' : ''; ! $s_lang_keys .= '<option value="' . $row['log_operation'] . '"' . $selected . '>' . htmlspecialchars(strip_tags($user->lang[$row['log_operation']]), ENT_COMPAT, 'UTF-8') . '</option>'; } $db->sql_freeresult($result); Modified: branches/phpBB-3_0_0/phpBB/includes/functions_admin.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/includes/functions_admin.php (original) --- branches/phpBB-3_0_0/phpBB/includes/functions_admin.php Mon Jul 20 00:57:18 2009 *************** *** 2499,2505 **** $sql = 'SELECT COUNT(l.log_id) AS total_entries FROM ' . LOG_TABLE . " l WHERE l.log_type = $log_type ! AND l.log_time >= $limit_days $sql_forum"; $result = $db->sql_query($sql); $log_count = (int) $db->sql_fetchfield('total_entries'); --- 2499,2506 ---- $sql = 'SELECT COUNT(l.log_id) AS total_entries FROM ' . LOG_TABLE . " l WHERE l.log_type = $log_type ! AND l.log_time >= $limit_days " . ! (!empty($log_operation) ? "AND l.log_operation = '" . $db->sql_escape($log_operation) . "'" : '') . " $sql_forum"; $result = $db->sql_query($sql); $log_count = (int) $db->sql_fetchfield('total_entries'); Modified: branches/phpBB-3_0_0/phpBB/includes/mcp/mcp_logs.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/includes/mcp/mcp_logs.php (original) --- branches/phpBB-3_0_0/phpBB/includes/mcp/mcp_logs.php Mon Jul 20 00:57:18 2009 *************** *** 164,173 **** $sql_where = ($sort_days) ? (time() - ($sort_days * 86400)) : 0; $sql_sort = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC'); // Grab log data $log_data = array(); $log_count = 0; ! view_log('mod', $log_data, $log_count, $config['topics_per_page'], $start, $forum_list, $topic_id, 0, $sql_where, $sql_sort); $template->assign_vars(array( 'PAGE_NUMBER' => on_page($log_count, $config['topics_per_page'], $start), --- 164,206 ---- $sql_where = ($sort_days) ? (time() - ($sort_days * 86400)) : 0; $sql_sort = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC'); + $log_operation = request_var('log_operation', ''); + $s_lang_keys = '<option value="">' . $user->lang['SHOW_ALL_OPERATIONS'] . '</option>'; + + if ($topic_id) + { + $sql_forum = 'AND topic_id = ' . intval($topic_id); + } + else if (is_array($forum_id)) + { + $sql_forum = 'AND ' . $db->sql_in_set('forum_id', array_map('intval', $forum_id)); + } + else + { + $sql_forum = ($forum_id) ? 'AND forum_id = ' . intval($forum_id) : ''; + } + + $sql = "SELECT DISTINCT log_operation + FROM " . LOG_TABLE . ' + WHERE log_type = ' . LOG_MOD . ' + ' . (($limit_days) ? "AND log_time >= $sql_where " : ' ') . + $sql_forum; + $result = $db->sql_query($sql); + while ($row = $db->sql_fetchrow($result)) + { + if (empty($row['log_operation'])) + { + continue; + } + $selected = ($log_operation == $row['log_operation']) ? ' selected="selected"' : ''; + $s_lang_keys .= '<option value="' . $row['log_operation'] . '"' . $selected . '>' . htmlspecialchars(strip_tags($user->lang[$row['log_operation']]), ENT_COMPAT, 'UTF-8') . '</option>'; + } + $db->sql_freeresult($result); + // Grab log data $log_data = array(); $log_count = 0; ! view_log('mod', $log_data, $log_count, $config['topics_per_page'], $start, $forum_list, $topic_id, 0, $sql_where, $sql_sort, $log_operation); $template->assign_vars(array( 'PAGE_NUMBER' => on_page($log_count, $config['topics_per_page'], $start), *************** *** 181,186 **** --- 214,220 ---- 'S_SELECT_SORT_DIR' => $s_sort_dir, 'S_SELECT_SORT_KEY' => $s_sort_key, 'S_SELECT_SORT_DAYS' => $s_limit_days, + 'S_LANG_KEYS' => $s_lang_keys, 'S_LOGS' => ($log_count > 0), ) ); Modified: branches/phpBB-3_0_0/phpBB/includes/mcp/mcp_notes.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/includes/mcp/mcp_notes.php (original) --- branches/phpBB-3_0_0/phpBB/includes/mcp/mcp_notes.php Mon Jul 20 00:57:18 2009 *************** *** 193,201 **** $sql_where = ($st) ? (time() - ($st * 86400)) : 0; $sql_sort = $sort_by_sql[$sk] . ' ' . (($sd == 'd') ? 'DESC' : 'ASC'); $log_data = array(); $log_count = 0; ! view_log('user', $log_data, $log_count, $config['posts_per_page'], $start, 0, 0, $user_id, $sql_where, $sql_sort); if ($log_count) { --- 193,220 ---- $sql_where = ($st) ? (time() - ($st * 86400)) : 0; $sql_sort = $sort_by_sql[$sk] . ' ' . (($sd == 'd') ? 'DESC' : 'ASC'); + $log_operation = request_var('log_operation', ''); + $s_lang_keys = '<option value="">' . $user->lang['SHOW_ALL_OPERATIONS'] . '</option>'; + + $sql = "SELECT DISTINCT log_operation + FROM " . LOG_TABLE . ' + WHERE log_type = ' . LOG_USERS . + (($limit_days) ? " AND log_time >= $sql_where" : ''); + $result = $db->sql_query($sql); + while ($row = $db->sql_fetchrow($result)) + { + if (empty($row['log_operation'])) + { + continue; + } + $selected = ($log_operation == $row['log_operation']) ? ' selected="selected"' : ''; + $s_lang_keys .= '<option value="' . $row['log_operation'] . '"' . $selected . '>' . htmlspecialchars(strip_tags($user->lang[$row['log_operation']]), ENT_COMPAT, 'UTF-8') . '</option>'; + } + $db->sql_freeresult($result); + $log_data = array(); $log_count = 0; ! view_log('user', $log_data, $log_count, $config['posts_per_page'], $start, 0, 0, $user_id, $sql_where, $sql_sort, $log_operation); if ($log_count) { *************** *** 219,224 **** --- 238,244 ---- 'S_SELECT_SORT_DIR' => $s_sort_dir, 'S_SELECT_SORT_KEY' => $s_sort_key, 'S_SELECT_SORT_DAYS' => $s_limit_days, + 'S_LANG_KEYS' => $s_lang_keys, 'L_TITLE' => $user->lang['MCP_NOTES_USER'], Modified: branches/phpBB-3_0_0/phpBB/language/en/acp/common.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/language/en/acp/common.php (original) --- branches/phpBB-3_0_0/phpBB/language/en/acp/common.php Mon Jul 20 00:57:18 2009 *************** *** 281,286 **** --- 281,288 ---- 'SETTING_TOO_LONG' => 'The entered value for the setting â%1$sâ is too long. The maximal allowed length is %2$d.', 'SETTING_TOO_SHORT' => 'The entered value for the setting â%1$sâ is not long enough. The minimal allowed length is %2$d.', + 'SHOW_ALL_OPERATIONS' => 'Show all operations', + 'UCP' => 'User Control Panel', 'USERNAMES_EXPLAIN' => 'Place each username on a separate line.', 'USER_CONTROL_PANEL' => 'User Control Panel', Modified: branches/phpBB-3_0_0/phpBB/styles/prosilver/template/mcp_logs.html ============================================================================== *** branches/phpBB-3_0_0/phpBB/styles/prosilver/template/mcp_logs.html (original) --- branches/phpBB-3_0_0/phpBB/styles/prosilver/template/mcp_logs.html Mon Jul 20 00:57:18 2009 *************** *** 8,13 **** --- 8,16 ---- <div class="inner"><span class="corners-top"><span></span></span> <ul class="linklist"> + <li class="leftside"> + {L_SELECT_LANG_KEY}: <select name="log_operation">{S_LANG_KEYS}</select> <input type="submit" class="button2" name="filter" value="{L_FILTER}" /> + </li> <li class="rightside pagination"> <!-- IF TOTAL -->{TOTAL} <!-- ENDIF --> <!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> • <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> • <span>{PAGINATION}</span><!-- ELSE --> • {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF --> Modified: branches/phpBB-3_0_0/phpBB/styles/prosilver/template/mcp_notes_user.html ============================================================================== *** branches/phpBB-3_0_0/phpBB/styles/prosilver/template/mcp_notes_user.html (original) --- branches/phpBB-3_0_0/phpBB/styles/prosilver/template/mcp_notes_user.html Mon Jul 20 00:57:18 2009 *************** *** 51,56 **** --- 51,59 ---- <div class="inner"><span class="corners-top"><span></span></span> <ul class="linklist"> + <li class="leftside"> + {L_SELECT_LANG_KEY}: <select name="log_operation">{S_LANG_KEYS}</select> <input type="submit" class="button2" name="filter" value="{L_FILTER}" /> + </li> <li class="rightside pagination"> <!-- IF TOTAL_REPORTS -->{TOTAL_REPORTS} <!-- ENDIF --> <!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> • <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> • <span>{PAGINATION}</span><!-- ELSE --> • {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF --> Modified: branches/phpBB-3_0_0/phpBB/styles/subsilver2/template/mcp_logs.html ============================================================================== *** branches/phpBB-3_0_0/phpBB/styles/subsilver2/template/mcp_logs.html (original) --- branches/phpBB-3_0_0/phpBB/styles/subsilver2/template/mcp_logs.html Mon Jul 20 00:57:18 2009 *************** *** 22,27 **** --- 22,30 ---- </tr> <!-- END log --> <tr align="center"> + <td class="row3" colspan="<!-- IF S_CLEAR_ALLOWED -->5<!-- ELSE -->4<!-- ENDIF -->"><span class="gensmall">{L_SELECT_LANG_KEY}:</span> <select name="log_operation">{S_LANG_KEYS}</select> <input type="submit" class="button2" name="filter" value="{L_FILTER}" /></td> + </tr> + <tr align="center"> <td class="row3" colspan="<!-- IF S_CLEAR_ALLOWED -->5<!-- ELSE -->4<!-- ENDIF -->"><span class="gensmall">{L_DISPLAY_LOG}:</span> {S_SELECT_SORT_DAYS} <span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR} <input class="btnlite" type="submit" value="{L_GO}" name="sort" /></td> </tr> <!-- IF S_CLEAR_ALLOWED --> Modified: branches/phpBB-3_0_0/phpBB/styles/subsilver2/template/mcp_notes_user.html ============================================================================== *** branches/phpBB-3_0_0/phpBB/styles/subsilver2/template/mcp_notes_user.html (original) --- branches/phpBB-3_0_0/phpBB/styles/subsilver2/template/mcp_notes_user.html Mon Jul 20 00:57:18 2009 *************** *** 55,60 **** --- 55,63 ---- <!-- IF S_USER_NOTES --> <tr align="center"> + <td colspan="5" class="row3"><span class="gensmall">{L_SELECT_LANG_KEY}:</span> <select name="log_operation">{S_LANG_KEYS}</select> <input type="submit" class="button2" name="filter" value="{L_FILTER}" /></td> + </tr> + <tr align="center"> <td colspan="5" class="row3"><span class="gensmall">{L_DISPLAY_LOG}:</span> {S_SELECT_SORT_DAYS} <span class="gensmall">{L_SORT_BY}:</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR} <input class="btnlite" type="submit" value="{L_GO}" name="sort" /></td> </tr> <tr> |