Changeset 610390
- Timestamp:
- 10/10/2012 02:53:28 PM (13 years ago)
- Location:
- wp-bulletin-board
- Files:
-
- 4 edited
- 1 copied
-
tags/1.0.3 (copied) (copied from wp-bulletin-board/trunk)
-
tags/1.0.3/readme.txt (modified) (3 diffs)
-
tags/1.0.3/wp-bb.php (modified) (11 diffs)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/wp-bb.php (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-bulletin-board/tags/1.0.3/readme.txt
r607181 r610390 2 2 Contributors: codebycarter 3 3 Donate link: http://codebycarter.x10.mx/wp/donate/ 4 Tags: forum, bulletin board, twitter, facebook, discussion, discussion board, messaging, private message, topic, post, pagination, profile 4 Tags: forum, bulletin board, twitter, facebook, discussion, discussion board, messaging, private message, topic, post, pagination, profile, subforum, wpbb 5 5 Requires at least: 3.3 6 6 Tested up to: 3.4.2 7 Stable tag: 1.0. 27 Stable tag: 1.0.3 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 56 56 None whatsoever. When you deactivate the plugin, WPBB will stop working and will notify you that the plugin is deactivated. This can be disabled by deleting or editing the page that WPBB creates for you. When you reactivate the plugin, WPBB resumes as normal. If you do decide to delete the plugin, everything is removed for you, so do take care that you don't remove the plugin by accident. 57 57 58 = Something doesn't work, what should I do? = 59 60 Firstly always download the plugin again as the plugin is constantly updated. It is likely the problem you're having has been fixed already. If that doesn't work, create a topic here: http://wordpress.org/support/plugin/wp-bulletin-board 61 58 62 == Screenshots == 59 63 … … 67 71 68 72 == Changelog == 73 74 = 1.0.3 = 75 * Fixed duplicate go back link when replying to a topic 76 * Fixed being able to reply to a locked topic, now only excludes admins and lock permission granted users 77 * Users now have the option to lock or sticky a topic when creating a reply (if they have required permissions) 78 * Fixed being able to choose topic status regardless of permission when creating a topic 79 * Fixed being able to edit another users signature from the view profile page 80 * Fixed bug where you couldn't delete a forum or subforum via the admin area 81 * Now when deleting a category it affects everything inside it so if deleting a category you delete all forums/subforums/topics/posts within that category, if a subforum only that subforum, topics and posts etc. 82 * Creating a topic and posting a reply now correctly checks the user has waited the required delay between posting 83 * If enabled you will be able to set permissions for guests for forums and the posting delay works for guests as well 84 * Moderator links e.g. edit, lock, delete etc are now only displayed if you have the required permissions. 85 * Permissions should now work. Now checks users roles against all WP roles. 86 * Other, minor bug fixes 69 87 70 88 = 1.0.2 = -
wp-bulletin-board/tags/1.0.3/wp-bb.php
r607181 r610390 4 4 Plugin URI: http://wordpress.org/extend/plugins/wp-bulletin-board/ 5 5 Description: An easy to use Bulletin board for Wordpress with Facebook and Twitter integration. 6 Version: 1.0. 26 Version: 1.0.3 7 7 Author: Jay Carter 8 8 Author URI: http://codebycarter.com … … 45 45 define('MESSAGE_TABLE', $wpdb->prefix.'wpbb_messages'); 46 46 // Define current version 47 define('WPBB_VERSION', 'v1.0. 2');47 define('WPBB_VERSION', 'v1.0.3'); 48 48 // Define plugin url (wp plugin page) 49 49 define('WPBB_PLUGIN_URL', 'http://wordpress.org/support/plugin/wp-bulletin-board'); … … 71 71 add_action('switch_theme', 'wpbb_create_template_file'); 72 72 add_action('wp_enqueue_scripts', 'wpbb_register_styles'); 73 /*add_action('init', 'wpbb_setup_rewrite_rules');74 add_action('init', 'wpbb_setup_rewrite_tags');75 76 function wpbb_setup_rewrite_rules() {77 add_rewrite_rule('forum(/([^\d]+))?', 'index.php/forums/?forum=$1', 'top');78 }79 function wpbb_setup_rewrite_tags() {80 global $wp;81 $wp->add_query_var('forum');82 }*/83 84 /*85 Could've used this, overwritten _http_build_query to set the value seperator to / aswell, but its not pluggable or hookable.86 */87 //var_dump(_http_build_query(array('forum', 'page'), null, '/', '/', false));88 89 function wpbb_setup_rewrite_rules() {90 91 //add_rewrite_rule('carpage(/([^/]+))?(/([^/]+))?/?','index.php?pagename=carpage&var1=$matches[2]&var2=$matches[4]','top');92 }93 94 add_action('init', 'wpbb_setup_rewrite_rules');95 96 73 97 74 /* … … 108 85 109 86 function wpbb_activate() { 110 // Create table 'wpbb'87 // Create all neccessary database tables 111 88 wpbb_create_db_table(); 112 89 // Create options in DB for our settings … … 132 109 // Delete twitter options 133 110 delete_option('wpbb_twitter_options'); 111 // Delete guest options 112 delete_option('wpbb_guest_options'); 134 113 // Delete the user meta 135 114 wpbb_delete_user_meta(); … … 164 143 165 144 global $wpdb; 166 167 $roles = wpbb_admin_get_all_roles('string', true); 168 169 $perms = "SET($roles) NOT NULL"; 170 171 $create_category_query = "CREATE TABLE IF NOT EXISTS ".CATEGORY_TABLE." ( 172 `id` TINYINT(1) UNSIGNED NOT NULL AUTO_INCREMENT, 173 `name` VARCHAR(25) NOT NULL, 174 `description` VARCHAR(200) NOT NULL, 175 `forum` TINYINT(1) NOT NULL, 176 `subforum` TINYINT(1) NOT NULL, 177 `view` $perms, 178 `read` $perms, 179 `post` $perms, 180 `reply` $perms, 181 `edit` $perms, 182 `lock` $perms, 183 `delete` $perms, 184 `sticky` $perms, 185 `order` TINYINT(1) UNSIGNED NOT NULL, 186 PRIMARY KEY (`id`) 187 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1; 188 "; 189 $create_topic_query = "CREATE TABLE IF NOT EXISTS ".TOPICS_TABLE." ( 190 `id` INT(1) NOT NULL AUTO_INCREMENT, 191 `author` SMALLINT(1) NOT NULL, 192 `name` VARCHAR(25) NOT NULL, 193 `content` TEXT NULL, 194 `forum` TINYINT(1) NOT NULL, 195 `subforum` TINYINT(1) NOT NULL, 196 `status` SET('locked', 'sticky') NOT NULL, 197 `created` DATETIME NOT NULL, 198 `last_reply` DATETIME NOT NULL, 199 `read` TINYINT(1) NOT NULL DEFAULT '0', 200 PRIMARY KEY (`id`) 201 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1; 202 "; 203 $create_post_query = "CREATE TABLE IF NOT EXISTS ".POSTS_TABLE." ( 204 `id` INT(1) NOT NULL AUTO_INCREMENT, 205 `author` SMALLINT(1) NOT NULL, 206 `topic` INT(1) NOT NULL, 207 `text` TEXT NOT NULL, 208 `created` TIMESTAMP NOT NULL, 209 PRIMARY KEY (`id`) 210 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1; 211 "; 145 146 $options = get_option('wpbb_options'); 147 148 // This is not being activated the first time 149 //if (isset($options['version']) && $options['version'] != WPBB_VERSION) { 150 if ($options) { 151 152 wpbb_refresh_roles(); 153 154 } else { 155 156 $roles = wpbb_admin_get_all_roles('string', true); 157 158 $perms = "SET($roles) NOT NULL"; 159 160 $create_category_query = "CREATE TABLE ".CATEGORY_TABLE." ( 161 `id` TINYINT(1) UNSIGNED NOT NULL AUTO_INCREMENT, 162 `name` VARCHAR(25) NOT NULL, 163 `description` VARCHAR(200) NOT NULL, 164 `forum` TINYINT(1) NOT NULL, 165 `subforum` TINYINT(1) NOT NULL, 166 `view` $perms, 167 `read` $perms, 168 `post` $perms, 169 `reply` $perms, 170 `edit` $perms, 171 `lock` $perms, 172 `delete` $perms, 173 `sticky` $perms, 174 `order` TINYINT(1) UNSIGNED NOT NULL, 175 PRIMARY KEY (`id`) 176 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1; 177 "; 212 178 213 $create_messages_query = "CREATE TABLE IF NOT EXISTS ".MESSAGE_TABLE." ( 214 `id` INT(1) NOT NULL AUTO_INCREMENT, 215 `to` INT(1) NOT NULL, 216 `from` INT(1) NOT NULL, 217 `subject` TINYTEXT NOT NULL, 218 `content` TEXT NOT NULL, 219 `read` TINYINT(1) NOT NULL, 220 `sent` DATETIME NOT NULL, 221 PRIMARY KEY (`id`) 222 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1; 223 "; 179 $create_topic_query = "CREATE TABLE ".TOPICS_TABLE." ( 180 `id` INT(1) NOT NULL AUTO_INCREMENT, 181 `author` SMALLINT(1) NOT NULL, 182 `name` VARCHAR(25) NOT NULL, 183 `content` TEXT NULL, 184 `forum` TINYINT(1) NOT NULL, 185 `subforum` TINYINT(1) NOT NULL, 186 `status` SET('locked', 'sticky') NOT NULL, 187 `created` DATETIME NOT NULL, 188 `last_reply` DATETIME NOT NULL, 189 `read` TINYINT(1) NOT NULL DEFAULT '0', 190 PRIMARY KEY (`id`) 191 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1; 192 "; 193 $create_post_query = "CREATE TABLE ".POSTS_TABLE." ( 194 `id` INT(1) NOT NULL AUTO_INCREMENT, 195 `author` SMALLINT(1) NOT NULL, 196 `topic` INT(1) NOT NULL, 197 `text` TEXT NOT NULL, 198 `created` TIMESTAMP NOT NULL, 199 PRIMARY KEY (`id`) 200 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1; 201 "; 202 203 $create_messages_query = "CREATE TABLE ".MESSAGE_TABLE." ( 204 `id` INT(1) NOT NULL AUTO_INCREMENT, 205 `to` INT(1) NOT NULL, 206 `from` INT(1) NOT NULL, 207 `subject` TINYTEXT NOT NULL, 208 `content` TEXT NOT NULL, 209 `read` TINYINT(1) NOT NULL, 210 `sent` DATETIME NOT NULL, 211 PRIMARY KEY (`id`) 212 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1; 213 "; 224 214 225 $create_category_table = $wpdb->query($create_category_query);226 $create_topic_table = $wpdb->query($create_topic_query);227 $create_post_table = $wpdb->query($create_post_query);228 $create_message_table = $wpdb->query($create_messages_query);215 $create_category_table = $wpdb->query($create_category_query); 216 $create_topic_table = $wpdb->query($create_topic_query); 217 $create_post_table = $wpdb->query($create_post_query); 218 $create_message_table = $wpdb->query($create_messages_query); 229 219 230 if ($create_category_table === false || $create_topic_table === false || $create_post_table === false || $create_message_table === false) { 231 printf(__('There was an error creating the required WPBB tables. The error was: %s'), $wpdb->print_error()); 232 } 220 if ($create_category_table === false) { 221 $create_category_table_err = __('There was an error creating the table wpbb_categorie', 'wp-bb'); 222 error_log($create_category_table_err); 223 } 224 if ($create_topic_table === false) { 225 $create_topic_table_err = __('There was an error creating the table wpbb_topics', 'wp-bb'); 226 error_log($create_topic_table_err); 227 } 228 if ($create_post_table === false) { 229 $create_post_table_err = __('There was an error creating the table wpbb_posts', 'wp-bb'); 230 error_log($create_post_table_err); 231 } 232 if ($create_message_table === false) { 233 $create_message_table_err = __('There was an error creating the table wpbb_messages', 'wp-bb'); 234 error_log($create_message_table_err); 235 } 236 } 233 237 } 234 238 … … 257 261 'post_cutoff' => 15, 258 262 'post_to_forum' => 'yes', 259 'show_footer' => 'no' 263 'show_footer' => 'no', 264 'version' => WPBB_VERSION 260 265 ); 261 266 $add_wpbb_options = add_option('wpbb_options', $options); 267 } else { 268 if (!isset($old_options['version'])) { 269 // Attempting to update a key in the options value will remove all the other keys so we must 270 // set all the other keys as well 271 $options = array( 272 'maintenance_mode' => $old_options['maintenance_mode'], 273 'maintenance_message' => $old_options['maintenance_message'], 274 'forum_name' => $old_options['forum_name'], 275 'forum_prefix' => $old_options['forum_prefix'], 276 'allow_guests' => $old_options['allow_guests'], 277 'allow_subforums' => $old_options['allow_subforums'], 278 'enable_quick_reply' => $old_options['enable_quick_reply'], 279 'topics_per_page' => $old_options['topics_per_page'], 280 'posts_per_page' => $old_options['posts_per_page'], 281 'topic_cutoff' => $old_options['topic_cutoff'], 282 'post_cutoff' => $old_options['post_cutoff'], 283 'post_to_forum' => $old_options['post_to_forum'], 284 'show_footer' => $old_options['show_footer'], 285 'version' => WPBB_VERSION 286 ); 287 update_option('wpbb_options', $options); 288 } 262 289 } 263 290 /* Theme Options */ … … 294 321 $add_wpbb_twitter_options = add_option('wpbb_twitter_options', $twitter_options); 295 322 } 323 $old_guest_options = get_option('wpbb_guest_options'); 324 if (!$old_guest_options) { 325 $guest_options = array( 326 'guest_last_post' => '0000-00-00 00:00:00' 327 ); 328 $add_wpbb_guest_options = add_option('wpbb_guest_options', $guest_options); 329 } 296 330 } 297 331 … … 306 340 $create_subforum = __('Create Subforum', 'wp-bb'); 307 341 $create_topic = __('Create Topic', 'wp-bb'); 342 $create_tools = __('Tools', 'wp-bb'); 308 343 $faq_support = __('FAQ & Support', 'wp-bb'); 309 344 $settings = __('WPBB Settings', 'wp-bb'); … … 323 358 // Create/Edit Topics 324 359 add_submenu_page('wpbb_admin', 'WPBB Topics', $create_topic, 'manage_options', 'wpbb_admin_topics', 'wpbb_admin_topics'); 360 361 // Create Tools page 362 add_submenu_page('wpbb_admin', 'WPBB Tools', $create_tools, 'manage_options', 'wpbb_admin_tools', 'wpbb_admin_tools'); 325 363 326 364 // FAQ / First Installation Page … … 428 466 } 429 467 468 /* 469 Tools page 470 */ 471 472 function wpbb_admin_tools() { 473 require_once('php/admin/wpbb-admin-tools.php'); 474 } 475 430 476 /* 431 477 FAQ / Support page -
wp-bulletin-board/trunk/readme.txt
r607181 r610390 2 2 Contributors: codebycarter 3 3 Donate link: http://codebycarter.x10.mx/wp/donate/ 4 Tags: forum, bulletin board, twitter, facebook, discussion, discussion board, messaging, private message, topic, post, pagination, profile 4 Tags: forum, bulletin board, twitter, facebook, discussion, discussion board, messaging, private message, topic, post, pagination, profile, subforum, wpbb 5 5 Requires at least: 3.3 6 6 Tested up to: 3.4.2 7 Stable tag: 1.0. 27 Stable tag: 1.0.3 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 56 56 None whatsoever. When you deactivate the plugin, WPBB will stop working and will notify you that the plugin is deactivated. This can be disabled by deleting or editing the page that WPBB creates for you. When you reactivate the plugin, WPBB resumes as normal. If you do decide to delete the plugin, everything is removed for you, so do take care that you don't remove the plugin by accident. 57 57 58 = Something doesn't work, what should I do? = 59 60 Firstly always download the plugin again as the plugin is constantly updated. It is likely the problem you're having has been fixed already. If that doesn't work, create a topic here: http://wordpress.org/support/plugin/wp-bulletin-board 61 58 62 == Screenshots == 59 63 … … 67 71 68 72 == Changelog == 73 74 = 1.0.3 = 75 * Fixed duplicate go back link when replying to a topic 76 * Fixed being able to reply to a locked topic, now only excludes admins and lock permission granted users 77 * Users now have the option to lock or sticky a topic when creating a reply (if they have required permissions) 78 * Fixed being able to choose topic status regardless of permission when creating a topic 79 * Fixed being able to edit another users signature from the view profile page 80 * Fixed bug where you couldn't delete a forum or subforum via the admin area 81 * Now when deleting a category it affects everything inside it so if deleting a category you delete all forums/subforums/topics/posts within that category, if a subforum only that subforum, topics and posts etc. 82 * Creating a topic and posting a reply now correctly checks the user has waited the required delay between posting 83 * If enabled you will be able to set permissions for guests for forums and the posting delay works for guests as well 84 * Moderator links e.g. edit, lock, delete etc are now only displayed if you have the required permissions. 85 * Permissions should now work. Now checks users roles against all WP roles. 86 * Other, minor bug fixes 69 87 70 88 = 1.0.2 = -
wp-bulletin-board/trunk/wp-bb.php
r607181 r610390 4 4 Plugin URI: http://wordpress.org/extend/plugins/wp-bulletin-board/ 5 5 Description: An easy to use Bulletin board for Wordpress with Facebook and Twitter integration. 6 Version: 1.0. 26 Version: 1.0.3 7 7 Author: Jay Carter 8 8 Author URI: http://codebycarter.com … … 45 45 define('MESSAGE_TABLE', $wpdb->prefix.'wpbb_messages'); 46 46 // Define current version 47 define('WPBB_VERSION', 'v1.0. 2');47 define('WPBB_VERSION', 'v1.0.3'); 48 48 // Define plugin url (wp plugin page) 49 49 define('WPBB_PLUGIN_URL', 'http://wordpress.org/support/plugin/wp-bulletin-board'); … … 71 71 add_action('switch_theme', 'wpbb_create_template_file'); 72 72 add_action('wp_enqueue_scripts', 'wpbb_register_styles'); 73 /*add_action('init', 'wpbb_setup_rewrite_rules');74 add_action('init', 'wpbb_setup_rewrite_tags');75 76 function wpbb_setup_rewrite_rules() {77 add_rewrite_rule('forum(/([^\d]+))?', 'index.php/forums/?forum=$1', 'top');78 }79 function wpbb_setup_rewrite_tags() {80 global $wp;81 $wp->add_query_var('forum');82 }*/83 84 /*85 Could've used this, overwritten _http_build_query to set the value seperator to / aswell, but its not pluggable or hookable.86 */87 //var_dump(_http_build_query(array('forum', 'page'), null, '/', '/', false));88 89 function wpbb_setup_rewrite_rules() {90 91 //add_rewrite_rule('carpage(/([^/]+))?(/([^/]+))?/?','index.php?pagename=carpage&var1=$matches[2]&var2=$matches[4]','top');92 }93 94 add_action('init', 'wpbb_setup_rewrite_rules');95 96 73 97 74 /* … … 108 85 109 86 function wpbb_activate() { 110 // Create table 'wpbb'87 // Create all neccessary database tables 111 88 wpbb_create_db_table(); 112 89 // Create options in DB for our settings … … 132 109 // Delete twitter options 133 110 delete_option('wpbb_twitter_options'); 111 // Delete guest options 112 delete_option('wpbb_guest_options'); 134 113 // Delete the user meta 135 114 wpbb_delete_user_meta(); … … 164 143 165 144 global $wpdb; 166 167 $roles = wpbb_admin_get_all_roles('string', true); 168 169 $perms = "SET($roles) NOT NULL"; 170 171 $create_category_query = "CREATE TABLE IF NOT EXISTS ".CATEGORY_TABLE." ( 172 `id` TINYINT(1) UNSIGNED NOT NULL AUTO_INCREMENT, 173 `name` VARCHAR(25) NOT NULL, 174 `description` VARCHAR(200) NOT NULL, 175 `forum` TINYINT(1) NOT NULL, 176 `subforum` TINYINT(1) NOT NULL, 177 `view` $perms, 178 `read` $perms, 179 `post` $perms, 180 `reply` $perms, 181 `edit` $perms, 182 `lock` $perms, 183 `delete` $perms, 184 `sticky` $perms, 185 `order` TINYINT(1) UNSIGNED NOT NULL, 186 PRIMARY KEY (`id`) 187 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1; 188 "; 189 $create_topic_query = "CREATE TABLE IF NOT EXISTS ".TOPICS_TABLE." ( 190 `id` INT(1) NOT NULL AUTO_INCREMENT, 191 `author` SMALLINT(1) NOT NULL, 192 `name` VARCHAR(25) NOT NULL, 193 `content` TEXT NULL, 194 `forum` TINYINT(1) NOT NULL, 195 `subforum` TINYINT(1) NOT NULL, 196 `status` SET('locked', 'sticky') NOT NULL, 197 `created` DATETIME NOT NULL, 198 `last_reply` DATETIME NOT NULL, 199 `read` TINYINT(1) NOT NULL DEFAULT '0', 200 PRIMARY KEY (`id`) 201 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1; 202 "; 203 $create_post_query = "CREATE TABLE IF NOT EXISTS ".POSTS_TABLE." ( 204 `id` INT(1) NOT NULL AUTO_INCREMENT, 205 `author` SMALLINT(1) NOT NULL, 206 `topic` INT(1) NOT NULL, 207 `text` TEXT NOT NULL, 208 `created` TIMESTAMP NOT NULL, 209 PRIMARY KEY (`id`) 210 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1; 211 "; 145 146 $options = get_option('wpbb_options'); 147 148 // This is not being activated the first time 149 //if (isset($options['version']) && $options['version'] != WPBB_VERSION) { 150 if ($options) { 151 152 wpbb_refresh_roles(); 153 154 } else { 155 156 $roles = wpbb_admin_get_all_roles('string', true); 157 158 $perms = "SET($roles) NOT NULL"; 159 160 $create_category_query = "CREATE TABLE ".CATEGORY_TABLE." ( 161 `id` TINYINT(1) UNSIGNED NOT NULL AUTO_INCREMENT, 162 `name` VARCHAR(25) NOT NULL, 163 `description` VARCHAR(200) NOT NULL, 164 `forum` TINYINT(1) NOT NULL, 165 `subforum` TINYINT(1) NOT NULL, 166 `view` $perms, 167 `read` $perms, 168 `post` $perms, 169 `reply` $perms, 170 `edit` $perms, 171 `lock` $perms, 172 `delete` $perms, 173 `sticky` $perms, 174 `order` TINYINT(1) UNSIGNED NOT NULL, 175 PRIMARY KEY (`id`) 176 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1; 177 "; 212 178 213 $create_messages_query = "CREATE TABLE IF NOT EXISTS ".MESSAGE_TABLE." ( 214 `id` INT(1) NOT NULL AUTO_INCREMENT, 215 `to` INT(1) NOT NULL, 216 `from` INT(1) NOT NULL, 217 `subject` TINYTEXT NOT NULL, 218 `content` TEXT NOT NULL, 219 `read` TINYINT(1) NOT NULL, 220 `sent` DATETIME NOT NULL, 221 PRIMARY KEY (`id`) 222 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1; 223 "; 179 $create_topic_query = "CREATE TABLE ".TOPICS_TABLE." ( 180 `id` INT(1) NOT NULL AUTO_INCREMENT, 181 `author` SMALLINT(1) NOT NULL, 182 `name` VARCHAR(25) NOT NULL, 183 `content` TEXT NULL, 184 `forum` TINYINT(1) NOT NULL, 185 `subforum` TINYINT(1) NOT NULL, 186 `status` SET('locked', 'sticky') NOT NULL, 187 `created` DATETIME NOT NULL, 188 `last_reply` DATETIME NOT NULL, 189 `read` TINYINT(1) NOT NULL DEFAULT '0', 190 PRIMARY KEY (`id`) 191 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1; 192 "; 193 $create_post_query = "CREATE TABLE ".POSTS_TABLE." ( 194 `id` INT(1) NOT NULL AUTO_INCREMENT, 195 `author` SMALLINT(1) NOT NULL, 196 `topic` INT(1) NOT NULL, 197 `text` TEXT NOT NULL, 198 `created` TIMESTAMP NOT NULL, 199 PRIMARY KEY (`id`) 200 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1; 201 "; 202 203 $create_messages_query = "CREATE TABLE ".MESSAGE_TABLE." ( 204 `id` INT(1) NOT NULL AUTO_INCREMENT, 205 `to` INT(1) NOT NULL, 206 `from` INT(1) NOT NULL, 207 `subject` TINYTEXT NOT NULL, 208 `content` TEXT NOT NULL, 209 `read` TINYINT(1) NOT NULL, 210 `sent` DATETIME NOT NULL, 211 PRIMARY KEY (`id`) 212 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1; 213 "; 224 214 225 $create_category_table = $wpdb->query($create_category_query);226 $create_topic_table = $wpdb->query($create_topic_query);227 $create_post_table = $wpdb->query($create_post_query);228 $create_message_table = $wpdb->query($create_messages_query);215 $create_category_table = $wpdb->query($create_category_query); 216 $create_topic_table = $wpdb->query($create_topic_query); 217 $create_post_table = $wpdb->query($create_post_query); 218 $create_message_table = $wpdb->query($create_messages_query); 229 219 230 if ($create_category_table === false || $create_topic_table === false || $create_post_table === false || $create_message_table === false) { 231 printf(__('There was an error creating the required WPBB tables. The error was: %s'), $wpdb->print_error()); 232 } 220 if ($create_category_table === false) { 221 $create_category_table_err = __('There was an error creating the table wpbb_categorie', 'wp-bb'); 222 error_log($create_category_table_err); 223 } 224 if ($create_topic_table === false) { 225 $create_topic_table_err = __('There was an error creating the table wpbb_topics', 'wp-bb'); 226 error_log($create_topic_table_err); 227 } 228 if ($create_post_table === false) { 229 $create_post_table_err = __('There was an error creating the table wpbb_posts', 'wp-bb'); 230 error_log($create_post_table_err); 231 } 232 if ($create_message_table === false) { 233 $create_message_table_err = __('There was an error creating the table wpbb_messages', 'wp-bb'); 234 error_log($create_message_table_err); 235 } 236 } 233 237 } 234 238 … … 257 261 'post_cutoff' => 15, 258 262 'post_to_forum' => 'yes', 259 'show_footer' => 'no' 263 'show_footer' => 'no', 264 'version' => WPBB_VERSION 260 265 ); 261 266 $add_wpbb_options = add_option('wpbb_options', $options); 267 } else { 268 if (!isset($old_options['version'])) { 269 // Attempting to update a key in the options value will remove all the other keys so we must 270 // set all the other keys as well 271 $options = array( 272 'maintenance_mode' => $old_options['maintenance_mode'], 273 'maintenance_message' => $old_options['maintenance_message'], 274 'forum_name' => $old_options['forum_name'], 275 'forum_prefix' => $old_options['forum_prefix'], 276 'allow_guests' => $old_options['allow_guests'], 277 'allow_subforums' => $old_options['allow_subforums'], 278 'enable_quick_reply' => $old_options['enable_quick_reply'], 279 'topics_per_page' => $old_options['topics_per_page'], 280 'posts_per_page' => $old_options['posts_per_page'], 281 'topic_cutoff' => $old_options['topic_cutoff'], 282 'post_cutoff' => $old_options['post_cutoff'], 283 'post_to_forum' => $old_options['post_to_forum'], 284 'show_footer' => $old_options['show_footer'], 285 'version' => WPBB_VERSION 286 ); 287 update_option('wpbb_options', $options); 288 } 262 289 } 263 290 /* Theme Options */ … … 294 321 $add_wpbb_twitter_options = add_option('wpbb_twitter_options', $twitter_options); 295 322 } 323 $old_guest_options = get_option('wpbb_guest_options'); 324 if (!$old_guest_options) { 325 $guest_options = array( 326 'guest_last_post' => '0000-00-00 00:00:00' 327 ); 328 $add_wpbb_guest_options = add_option('wpbb_guest_options', $guest_options); 329 } 296 330 } 297 331 … … 306 340 $create_subforum = __('Create Subforum', 'wp-bb'); 307 341 $create_topic = __('Create Topic', 'wp-bb'); 342 $create_tools = __('Tools', 'wp-bb'); 308 343 $faq_support = __('FAQ & Support', 'wp-bb'); 309 344 $settings = __('WPBB Settings', 'wp-bb'); … … 323 358 // Create/Edit Topics 324 359 add_submenu_page('wpbb_admin', 'WPBB Topics', $create_topic, 'manage_options', 'wpbb_admin_topics', 'wpbb_admin_topics'); 360 361 // Create Tools page 362 add_submenu_page('wpbb_admin', 'WPBB Tools', $create_tools, 'manage_options', 'wpbb_admin_tools', 'wpbb_admin_tools'); 325 363 326 364 // FAQ / First Installation Page … … 428 466 } 429 467 468 /* 469 Tools page 470 */ 471 472 function wpbb_admin_tools() { 473 require_once('php/admin/wpbb-admin-tools.php'); 474 } 475 430 476 /* 431 477 FAQ / Support page
Note: See TracChangeset
for help on using the changeset viewer.