diff --git a/phpBB/db/mysql_basic.sql b/phpBB/db/mysql_basic.sql index 0bbfb2a5ee..e808ab78bc 100644 --- a/phpBB/db/mysql_basic.sql +++ b/phpBB/db/mysql_basic.sql @@ -4,47 +4,7 @@ # $Id$ # -- Config -INSERT INTO phpbb_config VALUES ('board_disable','0'); -INSERT INTO phpbb_config VALUES ('board_startdate','994190324'); -INSERT INTO phpbb_config VALUES ('sitename','yourdomain.com'); -INSERT INTO phpbb_config VALUES ('cookie_name','phpbb2mysql'); -INSERT INTO phpbb_config VALUES ('cookie_path','/'); -INSERT INTO phpbb_config VALUES ('cookie_domain',''); -INSERT INTO phpbb_config VALUES ('cookie_secure','0'); -INSERT INTO phpbb_config VALUES ('session_length','900'); -INSERT INTO phpbb_config VALUES ('allow_html','0'); -INSERT INTO phpbb_config VALUES ('allow_html_tags','b,i,u,pre'); -INSERT INTO phpbb_config VALUES ('allow_bbcode','1'); -INSERT INTO phpbb_config VALUES ('allow_smilies','1'); -INSERT INTO phpbb_config VALUES ('allow_sig','1'); -INSERT INTO phpbb_config VALUES ('allow_namechange','0'); -INSERT INTO phpbb_config VALUES ('allow_theme_create','0'); -INSERT INTO phpbb_config VALUES ('allow_avatar_local','0'); -INSERT INTO phpbb_config VALUES ('allow_avatar_remote','1'); -INSERT INTO phpbb_config VALUES ('allow_avatar_upload','1'); -INSERT INTO phpbb_config VALUES ('override_themes','0'); -INSERT INTO phpbb_config VALUES ('posts_per_page','15'); -INSERT INTO phpbb_config VALUES ('topics_per_page','50'); -INSERT INTO phpbb_config VALUES ('hot_threshold','25'); -INSERT INTO phpbb_config VALUES ('max_poll_options','10'); -INSERT INTO phpbb_config VALUES ('email_sig','Thanks, The Management'); -INSERT INTO phpbb_config VALUES ('email_from','youraddress@yourdomain.com'); -INSERT INTO phpbb_config VALUES ('smtp_delivery','0'); -INSERT INTO phpbb_config VALUES ('smtp_host',''); -INSERT INTO phpbb_config VALUES ('require_activation','0'); -INSERT INTO phpbb_config VALUES ('flood_interval','15'); -INSERT INTO phpbb_config VALUES ('avatar_filesize','6144'); -INSERT INTO phpbb_config VALUES ('avatar_max_width','80'); -INSERT INTO phpbb_config VALUES ('avatar_max_height','80'); -INSERT INTO phpbb_config VALUES ('avatar_path','images/avatars'); -INSERT INTO phpbb_config VALUES ('smilies_path','images/smiles'); -INSERT INTO phpbb_config VALUES ('default_theme','2'); -INSERT INTO phpbb_config VALUES ('default_lang','english'); -INSERT INTO phpbb_config VALUES ('default_dateformat','D M d, Y g:i a'); -INSERT INTO phpbb_config VALUES ('board_timezone','-8'); -INSERT INTO phpbb_config VALUES ('board_template','PSO'); -INSERT INTO phpbb_config VALUES ('prune_enable','1'); -INSERT INTO phpbb_config VALUES ('gzip_compress','1'); +INSERT INTO phpbb_config (config_id, board_disable, sitename, cookie_name, cookie_path, cookie_domain, cookie_secure, session_length, allow_html, allow_html_tags, allow_bbcode, allow_smilies, allow_sig, allow_namechange, allow_theme_create, allow_avatar_local, allow_avatar_remote, allow_avatar_upload, override_themes, posts_per_page, topics_per_page, hot_threshold, max_poll_options, email_sig, email_from, require_activation, flood_interval, avatar_filesize, avatar_max_width, avatar_max_height, avatar_path, smilies_path, default_theme, default_lang, default_dateformat, system_timezone, sys_template, prune_enable, gzip_compress, board_startdate, smtp_delivery, smtp_host) VALUES (1,0,'yourdomain.com','phpbb2mysql','/','','',900,'','b,i,u,pre',1,1,1,'','','',1,1,'',15,50,25,10,'Thanks, The Management','youraddress@yourdomain.com','',15,6144,80,80,'images/avatars','images/smiles',2,'english','D M d, Y g:i a',-8,'PSO',1,1,994190324,'',''); # -- Categories INSERT INTO phpbb_categories (cat_id, cat_title, cat_order) VALUES (1, 'Test category 1', 1); @@ -84,17 +44,18 @@ INSERT INTO phpbb_posts (post_id, topic_id, forum_id, poster_id, post_time, post INSERT INTO phpbb_posts_text (post_id, post_subject, post_text) VALUES (1, 'This is the subject', 'This is a demo post in the demo topic, what do you think of it?'); # -- Themes -INSERT INTO phpbb_themes (themes_id, themes_name, head_stylesheet, body_background, body_bgcolor, body_text, body_link, body_vlink, body_alink, body_hlink, tr_color1, tr_color2, tr_color3, tr_class1, tr_class2, tr_class3, th_color1, th_color2, th_color3, th_class1, th_class2, th_class3, td_color1, td_color2, td_color3, td_class1, td_class2, td_class3, fontface1, fontface2, fontface3, fontsize1, fontsize2, fontsize3, fontcolor1, fontcolor2, fontcolor3, span_class1, span_class2, span_class3) VALUES (1,'Default-Default','','','','','','','','','','','','','','','','','','','','','CCCCCC','DDDDDD','','','','','','','',NULL,NULL,NULL,'','','','','',''); +INSERT INTO phpbb_themes (themes_id, themes_name, template_name, head_stylesheet, body_background, body_bgcolor, body_text, body_link, body_vlink, body_alink, body_hlink, tr_color1, tr_color2, tr_color3, tr_class1, tr_class2, tr_class3, th_color1, th_color2, th_color3, th_class1, th_class2, th_class3, td_color1, td_color2, td_color3, td_class1, td_class2, td_class3, fontface1, fontface2, fontface3, fontsize1, fontsize2, fontsize3, fontcolor1, fontcolor2, fontcolor3, span_class1, span_class2, span_class3) VALUES (1,'Default','Default','','','','','','','','','','','','','','','','','','','','','CCCCCC','DDDDDD','','','','','','','',NULL,NULL,NULL,'','','','','',''); -INSERT INTO phpbb_themes (themes_id, themes_name, head_stylesheet, body_background, body_bgcolor, body_text, body_link, body_vlink, body_alink, body_hlink, tr_color1, tr_color2, tr_color3, tr_class1, tr_class2, tr_class3, th_color1, th_color2, th_color3, th_class1, th_class2, th_class3, td_color1, td_color2, td_color3, td_class1, td_class2, td_class3, fontface1, fontface2, fontface3, fontsize1, fontsize2, fontsize3, fontcolor1, fontcolor2, fontcolor3, span_class1, span_class2, span_class3) VALUES (2,'PSO-Default','','','FFFFFF','000000','002266','004411','','','','','','','','','000000','D2D2D2','BCBCBC','','','','EDEDED','DEDEDE','','row1','row2','','verdana,serif','arial,helvetica','courier',1,2,3,'','','','','',''); +INSERT INTO phpbb_themes (themes_id, themes_name, template_name, head_stylesheet, body_background, body_bgcolor, body_text, body_link, body_vlink, body_alink, body_hlink, tr_color1, tr_color2, tr_color3, tr_class1, tr_class2, tr_class3, th_color1, th_color2, th_color3, th_class1, th_class2, th_class3, td_color1, td_color2, td_color3, td_class1, td_class2, td_class3, fontface1, fontface2, fontface3, fontsize1, fontsize2, fontsize3, fontcolor1, fontcolor2, fontcolor3, span_class1, span_class2, span_class3) VALUES (2,'Default','PSO','','','FFFFFF','000000','002266','004411','','','','','','','','','000000','D2D2D2','BCBCBC','','','','EDEDED','DEDEDE','','row1','row2','','verdana,serif','arial,helvetica','courier',1,2,3,'','','','','',''); -INSERT INTO phpbb_themes (themes_id, themes_name, head_stylesheet, body_background, body_bgcolor, body_text, body_link, body_vlink, body_alink, body_hlink, tr_color1, tr_color2, tr_color3, tr_class1, tr_class2, tr_class3, th_color1, th_color2, th_color3, th_class1, th_class2, th_class3, td_color1, td_color2, td_color3, td_class1, td_class2, td_class3, fontface1, fontface2, fontface3, fontsize1, fontsize2, fontsize3, fontcolor1, fontcolor2, fontcolor3, span_class1, span_class2, span_class3) VALUES (3,'PSO-Wheat','','','FFFFFF','000000','002266','004411','','','','','','','','','001100','E5CCA5','D4A294','','','','EBE4D9','DAD1C4','','row1','row2','','verdana,serif','arial,helvetica','courier',1,2,3,'000000','','','','',''); +INSERT INTO phpbb_themes (themes_id, themes_name, template_name, head_stylesheet, body_background, body_bgcolor, body_text, body_link, body_vlink, body_alink, body_hlink, tr_color1, tr_color2, tr_color3, tr_class1, tr_class2, tr_class3, th_color1, th_color2, th_color3, th_class1, th_class2, th_class3, td_color1, td_color2, td_color3, td_class1, td_class2, td_class3, fontface1, fontface2, fontface3, fontsize1, fontsize2, fontsize3, fontcolor1, fontcolor2, fontcolor3, span_class1, span_class2, span_class3) VALUES (3,'Wheat','PSO','','','FFFFFF','000000','002266','004411','','','','','','','','','001100','E5CCA5','D4A294','','','','EBE4D9','DAD1C4','','row1','row2','','verdana,serif','arial,helvetica','courier',1,2,3,'000000','','','','',''); -INSERT INTO phpbb_themes (themes_id, themes_name, head_stylesheet, body_background, body_bgcolor, body_text, body_link, body_vlink, body_alink, body_hlink, tr_color1, tr_color2, tr_color3, tr_class1, tr_class2, tr_class3, th_color1, th_color2, th_color3, th_class1, th_class2, th_class3, td_color1, td_color2, td_color3, td_class1, td_class2, td_class3, fontface1, fontface2, fontface3, fontsize1, fontsize2, fontsize3, fontcolor1, fontcolor2, fontcolor3, span_class1, span_class2, span_class3) VALUES (4,'PSO-Ocean','','','DFF5FF','000000','011001','2100cc','','','','','','','','','000000','A7C1CB','7897A8','','','','83D7CC','A0CCE0','','row1','row2','','verdana,serif','arial,helvetica','courier',1,2,3,'','','','','',''); +INSERT INTO phpbb_themes (themes_id, themes_name, template_name, head_stylesheet, body_background, body_bgcolor, body_text, body_link, body_vlink, body_alink, body_hlink, tr_color1, tr_color2, tr_color3, tr_class1, tr_class2, tr_class3, th_color1, th_color2, th_color3, th_class1, th_class2, th_class3, td_color1, td_color2, td_color3, td_class1, td_class2, td_class3, fontface1, fontface2, fontface3, fontsize1, fontsize2, fontsize3, fontcolor1, fontcolor2, fontcolor3, span_class1, span_class2, span_class3) VALUES (4,'Ocean','PSO','','','DFF5FF','000000','011001','2100cc','','','','','','','','','000000','A7C1CB','7897A8','','','','83D7CC','A0CCE0','','row1','row2','','verdana,serif','arial,helvetica','courier',1,2,3,'','','','','',''); -INSERT INTO phpbb_themes (themes_id, themes_name, head_stylesheet, body_background, body_bgcolor, body_text, body_link, body_vlink, body_alink, body_hlink, tr_color1, tr_color2, tr_color3, tr_class1, tr_class2, tr_class3, th_color1, th_color2, th_color3, th_class1, th_class2, th_class3, td_color1, td_color2, td_color3, td_class1, td_class2, td_class3, fontface1, fontface2, fontface3, fontsize1, fontsize2, fontsize3, fontcolor1, fontcolor2, fontcolor3, span_class1, span_class2, span_class3) VALUES (6,'PSO-Blue','','','FFFFFF','000000','417FB9','4E6172','0000AA','','','','','','','','000000','90BAE2','5195D4','','','','cde3f2','daedFd','','row1','row2','','verdana,serif','arial,helvetica','courier',1,2,3,'000000','','','','',''); +INSERT INTO phpbb_themes (themes_id, themes_name, template_name, head_stylesheet, body_background, body_bgcolor, body_text, body_link, body_vlink, body_alink, body_hlink, tr_color1, tr_color2, tr_color3, tr_class1, tr_class2, tr_class3, th_color1, th_color2, th_color3, th_class1, th_class2, th_class3, td_color1, td_color2, td_color3, td_class1, td_class2, td_class3, fontface1, fontface2, fontface3, fontsize1, fontsize2, fontsize3, fontcolor1, fontcolor2, fontcolor3, span_class1, span_class2, span_class3) VALUES (6,'Blue','PSO','','','FFFFFF','000000','417FB9','4E6172','0000AA','','','','','','','','000000','90BAE2','5195D4','','','','cde3f2','daedFd','','row1','row2','','verdana,serif','arial,helvetica','courier',1,2,3,'000000','','','','',''); -INSERT INTO phpbb_themes (themes_id, themes_name, head_stylesheet, body_background, body_bgcolor, body_text, body_link, body_vlink, body_alink, body_hlink, tr_color1, tr_color2, tr_color3, tr_class1, tr_class2, tr_class3, th_color1, th_color2, th_color3, th_class1, th_class2, th_class3, td_color1, td_color2, td_color3, td_class1, td_class2, td_class3, fontface1, fontface2, fontface3, fontsize1, fontsize2, fontsize3, fontcolor1, fontcolor2, fontcolor3, span_class1, span_class2, span_class3) VALUES (7,'PSO-Cool Midnight','','','444444','ECECEC','EDF2F2','DDEDED','FFFFFF','EDF2F2','','','','','','','000000','80707F','66555F','','','','60707D','667A80','','row1','row2','','Verdana,serif','Arial,Helvetica,sans-serif','courier',NULL,NULL,NULL,'ECECEC','ECECEC','ECECEC','','',''); +INSERT INTO phpbb_themes (themes_id, themes_name, template_name, head_stylesheet, body_background, body_bgcolor, body_text, body_link, body_vlink, body_alink, body_hlink, tr_color1, tr_color2, tr_color3, tr_class1, tr_class2, tr_class3, th_color1, th_color2, th_color3, th_class1, th_class2, th_class3, td_color1, td_color2, td_color3, td_class1, td_class2, td_class3, fontface1, fontface2, fontface3, fontsize1, fontsize2, fontsize3, fontcolor1, fontcolor2, fontcolor3, span_class1, span_class2, span_class3) VALUES +(7,'Cool Midnight','PSO', '','','444444','ECECEC','EDF2F2','DDEDED','FFFFFF','EDF2F2','','','','','','','000000','80707F','66555F','','','','60707D','667A80','','row1','row2','','Verdana,serif','Arial,Helvetica,sans-serif','courier',NULL,NULL,NULL,'ECECEC','ECECEC','ECECEC','','',''); # -- Smilies INSERT INTO phpbb_smilies (smilies_id, code, smile_url, emoticon) VALUES ( '1', ':D', 'icon_biggrin.gif', 'Very Happy'); diff --git a/phpBB/db/mysql_schema.sql b/phpBB/db/mysql_schema.sql index 8baf9d38d8..d3c942d3a0 100644 --- a/phpBB/db/mysql_schema.sql +++ b/phpBB/db/mysql_schema.sql @@ -50,7 +50,6 @@ CREATE TABLE phpbb_groups ( group_name varchar(40) NOT NULL, group_description varchar(255) NOT NULL, group_moderator int(11) DEFAULT '0' NOT NULL, - group_single_user tinyint(1) DEFAULT '0' NOT NULL, PRIMARY KEY (group_id), KEY group_single_user (group_single_user) ); @@ -91,11 +90,52 @@ CREATE TABLE phpbb_categories ( # DROP TABLE IF EXISTS phpbb_config; CREATE TABLE phpbb_config ( - config_name varchar(255) NOT NULL, - config_value varchar(255) NOT NULL, - PRIMARY KEY (config_name) + config_id int(11) NOT NULL auto_increment, + board_disable tinyint(1) DEFAULT '0' NOT NULL, + board_startdate int(11), + sitename varchar(100), + cookie_name char(20), + cookie_path char(25), + cookie_domain char(50), + cookie_secure tinyint(1), + session_length int(11), + allow_html tinyint(1), + allow_html_tags char(255) DEFAULT 'b,u,i,pre,font color' NOT NULL, + allow_bbcode tinyint(1), + allow_smilies tinyint(1), + allow_sig tinyint(1), + allow_namechange tinyint(1), + allow_theme_create tinyint(1), + allow_avatar_local tinyint(1) DEFAULT '0' NOT NULL, + allow_avatar_remote tinyint(1) DEFAULT '0' NOT NULL, + allow_avatar_upload tinyint(1) DEFAULT '0' NOT NULL, + override_themes tinyint(3), + posts_per_page int(11), + topics_per_page int(11), + hot_threshold int(11), + max_poll_options int(11), + email_sig varchar(255), + email_from varchar(100), + smtp_delivery tinyint(1) DEFAULT '0' NOT NULL, + smtp_host varchar(50), + require_activation tinyint(1) DEFAULT '0' NOT NULL, + flood_interval int(4) NOT NULL, + avatar_filesize int(11) DEFAULT '6144' NOT NULL, + avatar_max_width smallint(6) DEFAULT '70' NOT NULL, + avatar_max_height smallint(6) DEFAULT '70' NOT NULL, + avatar_path varchar(255) DEFAULT 'images/avatars' NOT NULL, + smilies_path char(100) DEFAULT 'images/smiles' NOT NULL, + default_theme int(11) DEFAULT '1' NOT NULL, + default_lang varchar(255), + default_dateformat varchar(14) DEFAULT 'd M Y H:i' NOT NULL, + system_timezone int(11) DEFAULT '0' NOT NULL, + sys_template varchar(100) DEFAULT 'Default' NOT NULL, + prune_enable tinyint(1) DEFAULT '1' NOT NULL, + gzip_compress tinyint(1) DEFAULT '0' NOT NULL, + PRIMARY KEY (config_id) ); + # -------------------------------------------------------- # # Table structure for table 'phpbb_disallow' @@ -266,8 +306,8 @@ CREATE TABLE phpbb_ranks ( # competing boards, just that I find it's best not to # look at any code ... ! # -DROP TABLE IF EXISTS phpbb_session; -CREATE TABLE phpbb_session ( +DROP TABLE IF EXISTS phpbb_sessions; +CREATE TABLE phpbb_sessions ( session_id char(32) DEFAULT '' NOT NULL, session_user_id int(11) DEFAULT '0' NOT NULL, session_start int(11) DEFAULT '0' NOT NULL, @@ -302,7 +342,8 @@ CREATE TABLE phpbb_smilies ( # DROP TABLE IF EXISTS phpbb_themes; CREATE TABLE phpbb_themes ( - themes_id int(11) NOT NULL auto_increment, + themes_id int(11) NOT NULL auto_increment, + template_name varchar(30) NOT NULL default '', themes_name varchar(30) NOT NULL default '', head_stylesheet varchar(100) default NULL, body_background varchar(100) default NULL, @@ -529,4 +570,4 @@ CREATE TABLE phpbb_words ( word varchar(100) NOT NULL, replacement varchar(100) NOT NULL, PRIMARY KEY (word_id) -); +); \ No newline at end of file diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 40b7756daa..ecc1727452 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -270,7 +270,7 @@ function init_userprefs($userdata) $template = new Template($phpbb_root_path . "templates/" . $board_config['board_template']); - if($template) + if( $template ) { @include($phpbb_root_path . "templates/" . $board_config['board_template'] . "/" . $board_config['board_template'] . ".cfg"); @@ -454,51 +454,6 @@ function generate_pagination($base_url, $num_items, $per_page, $start_item, $add } -// -// Check to see if email address is banned -// or already present in the DB -// -function validate_email($email) -{ - global $db; - - if($email != "") - { - $sql = "SELECT ban_email - FROM " . BANLIST_TABLE; - if(!$result = $db->sql_query($sql)) - { - message_die(GENERAL_ERROR, "Couldn't obtain email ban information.", "", __LINE__, __FILE__, $sql); - } - $ban_email_list = $db->sql_fetchrowset($result); - for($i = 0; $i < count($ban_email_list); $i++) - { - $match_email = str_replace("*@", ".*@", $ban_email_list[$i]['ban_email']); - if( preg_match("/^" . $match_email . "$/is", $email) ) - { - return(0); - } - } - $sql = "SELECT user_email - FROM " . USERS_TABLE . " - WHERE user_email = '" . $email . "'"; - if(!$result = $db->sql_query($sql)) - { - message_die(GENERAL_ERROR, "Couldn't obtain user email information.", "", __LINE__, __FILE__, $sql); - } - $email_taken = $db->sql_fetchrow($result); - if($email_taken['user_email'] != "") - { - return(0); - } - - return(1); - } - else - { - return(0); - } -} // // Check to see if the username has been taken, or if it is disallowed. @@ -565,6 +520,9 @@ function validate_username($username) } +// +// Synchronise functions for forums/topics +// function sync($type, $id) { global $db; @@ -713,13 +671,17 @@ function sync($type, $id) } -function language_select($default, $select_name, $dirname="language/") + +// +// Pick a language, any language ... +// +function language_select($default, $select_name = "language", $dirname="language/") { global $phpEx; $dir = opendir($dirname); - $lang_select = ""; while ($file = readdir($dir)) { if (ereg("^lang_", $file)) @@ -728,86 +690,65 @@ function language_select($default, $select_name, $dirname="language/") $filename = str_replace(".$phpEx", "", $filename); $displayname = preg_replace("/(.*)_(.*)/", "\\1 [ \\2 ]", $filename); $selected = (strtolower($default) == strtolower($filename)) ? " selected=\"selected\"" : ""; - $lang_select .= " \n"; + $lang_select .= ""; } } - $lang_select .= "\n"; + $lang_select .= ""; closedir($dir); return $lang_select; } -// NOTE: This function should check is_dir($file), however the is_dir function seems to be buggy on my -// system so its not currently implemented that way -// - James -function template_select($default, $select_name = 'template', $dirname = "templates") + +// +// Pick a template/theme combo, personally recommend +// PSO - Blue but then I would ... +// +function style_select($default_template, $default_theme, $select_name = "style", $dirname = "templates") { - $dir = opendir($dirname); + global $db; - $template_select = ""; - - closedir($dir); - - return($template_select); -} - -function theme_select($default, $select_name = 'theme') -{ - global $db, $board_config, $lang; - - $sql = "SELECT themes_id, themes_name - FROM " . THEMES_TABLE . " - WHERE themes_name LIKE '" . $board_config['board_template'] . "-%' - ORDER BY themes_name"; - if($result = $db->sql_query($sql)) - { - $num = $db->sql_numrows($result); - $rowset = $db->sql_fetchrowset($result); - - if($num) - { - $theme_select = "\n"; - } - else - { - $theme_select = ""; - } - } - else + $sql = "SELECT themes_id, template_name, themes_name + FROM " . THEMES_TABLE . " + ORDER BY template_name, themes_id"; + if( !$result = $db->sql_query($sql) ) { message_die(GENERAL_ERROR, "Couldn't query themes table", "", __LINE__, __FILE__, $sql); } - return($theme_select); + + while( $row = $db->sql_fetchrow($result) ) + { + $template_themes[$row['template_name']]['name'][] = $row['themes_name']; + $template_themes[$row['template_name']]['id'][] = $row['themes_id']; + } + + $dir = opendir($dirname); + + $style_select = ""; + + closedir($dir); + + return($style_select); } + +// +// Pick a timezone +// function tz_select($default, $select_name = 'timezone') { global $sys_timezone; @@ -827,47 +768,43 @@ function tz_select($default, $select_name = 'timezone') "-6" => "(GMT -6:00 hours) Central Time (US & Canada), Mexico City", "-5" => "(GMT -5:00 hours) Eastern Time (US & Canada), Bogota, Lima, Quito", "-4" => "(GMT -4:00 hours) Atlantic Time (Canada), Caracas, La Paz", - "-3.5" => "(GMT -3:30 hours) Newfoundland", + "-3.5" => "(GMT -3:30 hours) Newfoundland", "-3" => "(GMT -3:00 hours) Brazil, Buenos Aires, Georgetown", "-2" => "(GMT -2:00 hours) Mid-Atlantic, Ascension Is., St. Helena, ", "-1" => "(GMT -1:00 hours) Azores, Cape Verde Islands", - "0" => "(GMT) Casablanca, Dublin, Edinburgh, London, Lisbon, Monrovia", + "0" => "(GMT) Casablanca, Dublin, Edinburgh, London, Lisbon, Monrovia", "+1" => "(GMT +1:00 hours) Berlin, Brussels, Copenhagen, Madrid, Paris, Rome", "+2" => "(GMT +2:00 hours) Kaliningrad, South Africa, Warsaw", "+3" => "(GMT +3:00 hours) Baghdad, Riyadh, Moscow, Nairobi", - "+3.5" => "(GMT +3:30 hours) Tehran", + "+3.5" => "(GMT +3:30 hours) Tehran", "+4" => "(GMT +4:00 hours) Abu Dhabi, Baku, Muscat, Tbilisi", - "+4.5" => "(GMT +4:30 hours) Kabul", + "+4.5" => "(GMT +4:30 hours) Kabul", "+5" => "(GMT +5:00 hours) Ekaterinburg, Islamabad, Karachi, Tashkent", - "+5.5" => "(GMT +5:30 hours) Bombay, Calcutta, Madras, New Delhi", + "+5.5" => "(GMT +5:30 hours) Bombay, Calcutta, Madras, New Delhi", "+6" => "(GMT +6:00 hours) Almaty, Colombo, Dhaka", "+7" => "(GMT +7:00 hours) Bangkok, Hanoi, Jakarta", "+8" => "(GMT +8:00 hours) Beijing, Hong Kong, Perth, Singapore, Taipei", "+9" => "(GMT +9:00 hours) Osaka, Sapporo, Seoul, Tokyo, Yakutsk", - "+9.5" => "(GMT +9:30 hours) Adelaide, Darwin", + "+9.5" => "(GMT +9:30 hours) Adelaide, Darwin", "+10" => "(GMT +10:00 hours) Melbourne, Papua New Guinea, Sydney, Vladivostok", "+11" => "(GMT +11:00 hours) Magadan, New Caledonia, Solomon Islands", "+12" => "(GMT +12:00 hours) Auckland, Wellington, Fiji, Marshall Island"); - while(list($offset, $zone) = each($tz_array)) + while( list($offset, $zone) = each($tz_array) ) { $selected = ($offset == $default) ? " selected=\"selected\"" : ""; - $tz_select .= "\t\n"; + $tz_select .= "\t"; } - $tz_select .= "\n"; + $tz_select .= ""; return($tz_select); } + // -// Smilies code ... would this be better tagged -// on to the end of bbcode.php? -// +// Smilies code ... would this be better tagged on to the end of bbcode.php? // Probably so and I'll move it before B2 -// The_Systech // - - function smilies_pass($message) { global $db, $board_config; @@ -905,11 +842,11 @@ function smiley_sort($a, $b) return (strlen($a['code']) > strlen($b['code'])) ? -1 : 1; } + // -// Obtain list of naughty words and build preg style -// replacement arrays for use by the calling script, -// note that the vars are passed as references this just makes -// it easier to return both sets of arrays +// Obtain list of naughty words and build preg style replacement arrays for use by the +// calling script, note that the vars are passed as references this just makes it easier +// to return both sets of arrays // function obtain_word_list(&$orig_word, &$replacement_word) { @@ -943,4 +880,4 @@ function obtain_word_list(&$orig_word, &$replacement_word) return(TRUE); } -?> +?> \ No newline at end of file diff --git a/phpBB/language/email/activate_english.tpl b/phpBB/language/email/activate_english.tpl index a29ee1306d..5d9457814e 100755 --- a/phpBB/language/email/activate_english.tpl +++ b/phpBB/language/email/activate_english.tpl @@ -1,6 +1,6 @@ -Your account on {SITENAME} has been deactivated, most likily due to changes -made to your profile. In order to reactivate your account you must click -on the link below: +Hello {USERNAME}, + +Your account on {SITENAME} has been deactivated, most likely due to changes made to your profile. In order to reactivate your account you must click on the link below: {U_ACTIVATE} diff --git a/phpBB/language/email/welcome_inactive_english.tpl b/phpBB/language/email/welcome_inactive_english.tpl index 338fb8d145..81e4d41c12 100755 --- a/phpBB/language/email/welcome_inactive_english.tpl +++ b/phpBB/language/email/welcome_inactive_english.tpl @@ -1,8 +1,6 @@ {WELCOME_MSG} -Please keep this email for your records. - -Your account information is as follows: +Please keep this email for your records. Your account information is as follows: ---------------------------- Username: {USERNAME} @@ -11,10 +9,9 @@ Password: {PASSWORD} Your account is currently inactive. You cannot use it until you visit the following link: -{ACTIVATE_URL} +{U_ACTIVATE} -Please do not forget your password as it has been encrypted in our database and we cannot retrieve it for you. -However, should you forget your password you can request a new one which will be activated in the same way as this account. +Please do not forget your password as it has been encrypted in our database and we cannot retrieve it for you. However, should you forget your password you can request a new one which will be activated in the same way as this account. Thank you for registering. diff --git a/phpBB/language/lang_english.php b/phpBB/language/lang_english.php index 40b119724d..fc9a145512 100755 --- a/phpBB/language/lang_english.php +++ b/phpBB/language/lang_english.php @@ -415,8 +415,7 @@ $lang['Always_add_sig'] = "Always attach my signature"; $lang['Always_notify'] = "Always notify me of replies"; $lang['Always_notify_explain'] = "Sends an email when someone replies to a topic you have posted in. This can be changed whenever you post"; -$lang['Board_template'] = "Board Template"; -$lang['Board_theme'] = "Board Theme"; +$lang['Board_style'] = "Board Style"; $lang['Board_lang'] = "Board Language"; $lang['No_themes'] = "No Themes In database"; $lang['Timezone'] = "Timezone"; @@ -452,7 +451,8 @@ $lang['Current_Image'] = "Current Image"; $lang['Notify_on_privmsg'] = "Notify on Private Message"; $lang['Hide_user'] = "Hide your online status"; -$lang['Profile_updated'] = "Your profile has been updated

" . $lang['Click_index']; +$lang['Profile_updated'] = "Your profile has been updated"; +$lang['to_return_index'] = "to return to the index"; $lang['Password_mismatch'] = "The passwords you entered did not match"; $lang['Invalid_username'] = "The username you requested has been taken or disallowed"; diff --git a/phpBB/profile.php b/phpBB/profile.php index c2c9bf8d9b..45ea1d1209 100644 --- a/phpBB/profile.php +++ b/phpBB/profile.php @@ -33,6 +33,61 @@ init_userprefs($userdata); // End session management // + +// +// Page specific functions +// + +// +// Check to see if email address is banned +// or already present in the DB +// +function validate_email($email) +{ + global $db; + + if($email != "") + { + $sql = "SELECT ban_email + FROM " . BANLIST_TABLE; + if(!$result = $db->sql_query($sql)) + { + message_die(GENERAL_ERROR, "Couldn't obtain email ban information.", "", __LINE__, __FILE__, $sql); + } + $ban_email_list = $db->sql_fetchrowset($result); + for($i = 0; $i < count($ban_email_list); $i++) + { + $match_email = str_replace("*@", ".*@", $ban_email_list[$i]['ban_email']); + if( preg_match("/^" . $match_email . "$/is", $email) ) + { + return(0); + } + } + $sql = "SELECT user_email + FROM " . USERS_TABLE . " + WHERE user_email = '" . $email . "'"; + if(!$result = $db->sql_query($sql)) + { + message_die(GENERAL_ERROR, "Couldn't obtain user email information.", "", __LINE__, __FILE__, $sql); + } + $email_taken = $db->sql_fetchrow($result); + if($email_taken['user_email'] != "") + { + return(0); + } + + return(1); + } + else + { + return(0); + } +} +// +// End page specific functions +// + + // // Start of program proper // @@ -197,10 +252,7 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode'])) header(append_sid("Location: login.$phpEx?forward_page=$PHP_SELF&mode=editprofile")); } - $pagetype = ($mode == "edit") ? "editprofile" : "register"; - $page_title = ($mode == "edit") ? $lang['Edit_profile'] : $lang['Register']; - - include($phpbb_root_path . 'includes/page_header.'.$phpEx); + $page_title = ($mode == "editprofile") ? $lang['Edit_profile'] : $lang['Register']; // // Start processing for output @@ -213,6 +265,8 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode'])) // Load agreement template since user has not yet // agreed to registration conditions/coppa // + include($phpbb_root_path . 'includes/page_header.'.$phpEx); + $template->set_filenames(array( "body" => "agreement.tpl", "jumpbox" => "jumpbox.tpl") @@ -281,10 +335,11 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode'])) $allowbbcode = (isset($HTTP_POST_VARS['allowbbcode'])) ? ( ($HTTP_POST_VARS['allowbbcode']) ? 1 : 0 ) : $board_config['allow_bbcode']; $allowsmilies = (isset($HTTP_POST_VARS['allowsmilies'])) ? ( ($HTTP_POST_VARS['allowsmilies']) ? 1 : 0 ) : $board_config['allow_smilies']; - $user_theme = ($HTTP_POST_VARS['theme']) ? $HTTP_POST_VARS['theme'] : $board_config['default_theme']; + $user_template = ( isset($HTTP_POST_VARS['style']) ) ? substr($HTTP_POST_VARS['style'], 0, strrpos($HTTP_POST_VARS['style'], "_")) : $board_config['board_template']; + $user_theme = ( isset($HTTP_POST_VARS['style']) ) ? substr($HTTP_POST_VARS['style'], strrpos($HTTP_POST_VARS['style'], "_") + 1) : $board_config['default_theme']; + $user_lang = ($HTTP_POST_VARS['language']) ? $HTTP_POST_VARS['language'] : $board_config['default_lang']; $user_timezone = (isset($HTTP_POST_VARS['timezone'])) ? $HTTP_POST_VARS['timezone'] : $board_config['board_timezone']; - $user_template = ($HTTP_POST_VARS['template']) ? $HTTP_POST_VARS['template'] : $board_config['board_template']; $user_dateformat = ($HTTP_POST_VARS['dateformat']) ? trim($HTTP_POST_VARS['dateformat']) : $board_config['default_dateformat']; $user_avatar_remoteurl = (!empty($HTTP_POST_VARS['avatarremoteurl'])) ? $HTTP_POST_VARS['avatarremoteurl'] : ""; @@ -704,20 +759,31 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode'])) // $email_headers = "From: " . $board_config['board_email'] . "\r\n"; + $path = (dirname($HTTP_SERVER_VARS['REQUEST_URI']) == "/") ? "" : dirname($HTTP_SERVER_VARS['REQUEST_URI']); + $emailer->use_template("activate"); $emailer->email_address($email); $emailer->set_subject($lang['Reactivate']); $emailer->extra_headers($email_headers); $emailer->assign_vars(array( - "SITENAME" => $board_config['sitename'], - "U_ACTIVATE" => "http://".$SERVER_NAME.$PHP_SELF."?mode=activate&act_key=$user_actkey", - "EMAIL_SIG" => $board_config['email_sig']) + "SITENAME" => $board_config['sitename'], + "USERNAME" => $username, + "EMAIL_SIG" => $board_config['email_sig'], + + "U_ACTIVATE" => "http://" . $HTTP_SERVER_VARS['SERVER_NAME'] . $path . "/profile.$phpEx?mode=activate&act_key=$user_actkey") ); $emailer->send(); $emailer->reset(); } - message_die(GENERAL_MESSAGE, $lang['Profile_updated']); + + $template->assign_vars(array( + "META" => '') + ); + + $message = $lang['Profile_updated'] . "

" . $lang['Click'] . " " . $lang['Here'] . " " . $lang['to_return_index']; + + message_die(GENERAL_MESSAGE, $message); } else { @@ -729,10 +795,8 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode'])) // // Get current date // - $regdate = get_gmt_ts(); - $sql = "INSERT INTO " . USERS_TABLE . " (user_id, username, user_regdate, user_password, user_email, user_icq, user_website, user_occ, user_from, user_interests, user_sig, user_avatar, user_viewemail, user_aim, user_yim, user_msnm, user_attachsig, user_allowsmile, user_allowhtml, user_allowbbcode, user_allow_viewonline, user_notify, user_notify_pm, user_timezone, user_dateformat, user_lang, user_template, user_theme, user_level, user_allow_pm, user_active, user_actkey) - VALUES ($new_user_id, '" . addslashes($username) ."', $regdate, '" . addslashes($password) ."', '" . addslashes($email) ."', '" . addslashes($icq) ."', '" . addslashes($website) ."', '" . addslashes($occupation) ."', '" . addslashes($location) ."', '" . addslashes($interests) ."', '" . addslashes($signature) ."', '$avatar_filename', $viewemail, '" . addslashes($aim) ."', '" . addslashes($yim) ."', '" . addslashes($msn) ."', $attachsig, $allowsmilies, $allowhtml, $allowbbcode, $allowviewonline, $notifyreply, $notifypm, $user_timezone, '" . addslashes($user_dateformat) ."', '" . addslashes($user_lang) ."', '" . addslashes($user_template) ."', $user_theme, 0, 1, "; + VALUES ($new_user_id, '$username', " . time() . ", '$password .', '$email', '$icq .', '$website', '$occupation', '$location', '$interests', '$signature', '$avatar_filename', $viewemail, '$aim', '$yim', '$msn', $attachsig, $allowsmilies, $allowhtml, $allowbbcode, $allowviewonline, $notifyreply, $notifypm, $user_timezone, '$user_dateformat', '$user_lang', '$user_template', $user_theme, 0, 1, "; if($board_config['require_activation'] || $coppa == 1) { @@ -756,17 +820,17 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode'])) { if($board_config['require_activation']) { - $msg = $lang['Account_inactive']; + $message = $lang['Account_inactive']; $email_msg = "welcome_inactive"; } else if($coppa) { - $msg = $lang['COPPA']; + $message = $lang['COPPA']; $email_msg = $lang['Welcome_COPPA']; } else { - $msg = $lang['Account_added']; + $message = $lang['Account_added']; $email_msg = "welcome"; } @@ -774,6 +838,8 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode'])) { $email_headers = "From: " . $board_config['board_email'] . "\r\n"; + $path = (dirname($HTTP_SERVER_VARS['REQUEST_URI']) == "/") ? "" : dirname($HTTP_SERVER_VARS['REQUEST_URI']); + $emailer->use_template($email_msg); $emailer->email_address($email); $emailer->set_subject($lang['Welcome_subject']); @@ -783,14 +849,21 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode'])) "WELCOME_MSG" => $lang['Welcome_subject'], "USERNAME" => $username, "PASSWORD" => $password_confirm, - "ACTIVATE_URL" => "http://".$SERVER_NAME.$PHP_SELF."?mode=activate&act_key=$act_key", - "EMAIL_SIG" => $board_config['email_sig']) + "EMAIL_SIG" => $board_config['email_sig'], + + "U_ACTIVATE" => "http://" . $HTTP_SERVER_VARS['SERVER_NAME'] . $path . "/profile.$phpEx?mode=activate&act_key=$user_actkey") ); $emailer->send(); $emailer->reset(); } - message_die(GENERAL_MESSAGE, $msg); + $template->assign_vars(array( + "META" => '') + ); + + $message = $message . "

" . $lang['Click'] . " " . $lang['Here'] . " " . $lang['to_return_index']; + + message_die(GENERAL_MESSAGE, $message); } else { @@ -808,17 +881,6 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode'])) } } // if mode == register } - else - { - $template->set_filenames(array( - "reg_header" => "error_body.tpl") - ); - $template->assign_vars(array( - "ERROR_MESSAGE" => $error_msg) - ); - $template->pparse("reg_header"); - } - } else if($mode == "editprofile") { @@ -888,6 +950,19 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode'])) $s_hidden_fields .= ''; } + include($phpbb_root_path . 'includes/page_header.'.$phpEx); + + if( $error ) + { + $template->set_filenames(array( + "reg_header" => "error_body.tpl") + ); + $template->assign_vars(array( + "ERROR_MESSAGE" => $error_msg) + ); + $template->pparse("reg_header"); + } + $template->set_filenames(array( "body" => "profile_add_body.tpl", "jumpbox" => "jumpbox.tpl") @@ -936,10 +1011,9 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode'])) "AVATAR" => $avatar_img, "AVATAR_SIZE" => $board_config['avatar_filesize'], "LANGUAGE_SELECT" => language_select(stripslashes($user_lang), 'language'), - "THEME_SELECT" => theme_select($user_theme, 'theme'), + "STYLE_SELECT" => style_select($user_template, $user_theme, 'style'), "TIMEZONE_SELECT" => tz_select($user_timezone, 'timezone'), "DATE_FORMAT" => stripslashes($user_dateformat), - "TEMPLATE_SELECT" => template_select(stripslashes($user_template), 'template'), "HTML_STATUS" => $html_status, "BBCODE_STATUS" => $bbcode_status, "SMILIES_STATUS" => $smilies_status, @@ -956,8 +1030,7 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode'])) "L_LOCATION" => $lang['From'], "L_OCCUPATION" => $lang['Occupation'], "L_BOARD_LANGUAGE" => $lang['Board_lang'], - "L_BOARD_THEME" => $lang['Board_theme'], - "L_BOARD_TEMPLATE" => $lang['Board_template'], + "L_BOARD_STYLE" => $lang['Board_style'], "L_TIMEZONE" => $lang['Timezone'], "L_DATE_FORMAT" => $lang['Date_format'], "L_DATE_FORMAT_EXPLAIN" => $lang['Date_format_explain'], @@ -1038,8 +1111,8 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode'])) else if($mode == "activate") { $sql = "SELECT user_id - FROM " . USERS_TABLE . " - WHERE user_actkey = '$act_key'"; + FROM " . USERS_TABLE . " + WHERE user_actkey = '$act_key'"; if($result = $db->sql_query($sql)) { if($num = $db->sql_numrows($result)) diff --git a/phpBB/templates/PSO/profile_add_body.tpl b/phpBB/templates/PSO/profile_add_body.tpl index 1c3c5e9118..1b93490080 100644 --- a/phpBB/templates/PSO/profile_add_body.tpl +++ b/phpBB/templates/PSO/profile_add_body.tpl @@ -106,12 +106,8 @@ {LANGUAGE_SELECT} - {L_BOARD_THEME}: - {THEME_SELECT} - - - {L_BOARD_TEMPLATE}: - {TEMPLATE_SELECT} + {L_BOARD_STYLE}: + {STYLE_SELECT} {L_TIMEZONE}: