Changeset 7213
- Timestamp:
- 06/13/2013 01:33:36 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/admin/bp-core-functions.php
r6845 r7213 366 366 ); 367 367 368 // If forums component is active, add additional tab 369 if ( bp_is_active( 'forums' ) && class_exists( 'BP_Forums_Component' ) ) { 370 // enqueue thickbox 371 wp_enqueue_script( 'thickbox' ); 372 wp_enqueue_style( 'thickbox' ); 373 374 $tabs['3'] = array( 375 'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bb-forums-setup' ), 'admin.php' ) ), 376 'name' => __( 'Forums', 'buddypress' ) 377 ); 378 } 379 368 380 // Loop through tabs and build navigation 369 381 foreach ( array_values( $tabs ) as $tab_data ) { -
trunk/bp-forums/bp-forums-loader.php
r6581 r7213 82 82 if ( !defined( 'BB_PATH' ) ) 83 83 $includes[] = 'bbpress-sa'; 84 85 // Admin-specific code 86 if ( is_admin() ) { 87 $includes[] = 'deprecated/1.6'; 88 $includes[] = 'deprecated/1.7'; 89 } 84 90 85 91 parent::includes( $includes ); -
trunk/bp-forums/deprecated/1.6.php
r6581 r7213 15 15 if ( !defined( 'ABSPATH' ) ) exit; 16 16 17 /** 18 * Outputs the markup for the bb-forums-admin panel 19 */ 17 20 function bp_forums_bbpress_admin() { 21 22 // The text and URL of the Site Wide Forums button differs depending on whether bbPress 23 // is running 24 if ( is_plugin_active( 'bbpress/bbpress.php' ) ) { 25 // The bbPress admin page will always be on the root blog. switch_to_blog() will 26 // pass through if we're already there. 27 switch_to_blog( bp_get_root_blog_id() ); 28 $button_url = admin_url( add_query_arg( array( 'page' => 'bbpress' ), 'options-general.php' ) ); 29 restore_current_blog(); 30 31 $button_text = __( 'Configure bbPress', 'buddypress' ); 32 } else { 33 $button_url = bp_get_admin_url( add_query_arg( array( 'tab' => 'plugin-information', 'plugin' => 'bbpress', 'TB_iframe' => 'true', 'width' => '640', 'height' => '500' ), 'plugin-install.php' ) ); 34 $button_text = __( 'Install bbPress', 'buddypress' ); 35 } 18 36 19 37 $action = bp_get_admin_url( 'admin.php?page=bb-forums-setup&reinstall=1' ); ?> … … 38 56 // Delete the bb-config.php location option 39 57 bp_delete_option( 'bb-config-location' ); 58 59 // Now delete the bb-config.php file 60 @unlink( ABSPATH . 'bb-config.php' ); 61 62 // show the updated wizard 40 63 bp_forums_bbpress_install_wizard(); 41 64 42 65 else : ?> 43 66 44 <div >45 <h3><?php _e( ' Forums for Groups', 'buddypress' ) ?></h3>67 <div style="width: 45%; float: left; margin-top: 20px;"> 68 <h3><?php _e( '(Installed)', 'buddypress' ); ?> <?php _e( 'Forums for Groups', 'buddypress' ) ?></h3> 46 69 47 70 <p><?php _e( 'Give each individual group its own discussion forum. Choose this if you\'d like to keep your members\' conversations separated into distinct areas.' , 'buddypress' ); ?></p> 48 <p class="description"><?php _e( 'You may use an existing bbPress installation if you have one.', 'buddypress' ); ?></p> 71 72 <p><?php _e( 'Note: This component is retired and will not be receiving any updates in the future. Only use this component if your current site relies on it.' , 'buddypress' ); ?></p> 49 73 50 74 <h4 style="margin-bottom: 10px;"><?php _e( 'Features', 'buddypress' ); ?></h4> … … 57 81 58 82 <div> 59 <a class="button button-primary" href="<?php echo $action ?>"><?php _e( 'Reinstall Group Forums', 'buddypress' ) ?></a> 83 <a class="button button-primary confirm" href="<?php echo $action ?>"><?php _e( 'Uninstall Group Forums', 'buddypress' ) ?></a> 84 </div> 85 </div> 86 87 <div style="width: 45%; float: left; margin: 20px 0 20px 20px; padding: 0 20px 20px 20px; border: 1px solid #ddd; background-color: #fff;"> 88 <h3><?php _e( 'New! bbPress', 'buddypress' ) ?></h3> 89 <p><?php _e( 'bbPress is a brand-new forum plugin from one of the lead developers of BuddyPress.', 'buddypress' ) ?></p> 90 91 <p><?php _e( 'It boasts a bunch of cool features that the BP Legacy Discussion Forums does not have including:', 'buddypress' ) ?></p> 92 93 <ul class="description" style="list-style: square; margin-left: 30px;"> 94 <li><?php _e( 'Non-group specific forum creation', 'buddypress' ); ?></p></li> 95 <li><?php _e( 'Moderation via the WP admin dashboard', 'buddypress' ); ?></p></li> 96 <li><?php _e( 'Topic splitting', 'buddypress' ); ?></p></li> 97 <li><?php _e( 'Revisions', 'buddypress' ); ?></p></li> 98 <li><?php _e( 'Spam management', 'buddypress' ); ?></p></li> 99 <li><?php _e( 'Subscriptions', 'buddypress' ); ?></p></li> 100 <li><?php _e( 'And more!', 'buddypress' ); ?></p></li> 101 </ul> 102 103 <p><?php printf( __( 'If you decide to use bbPress, you will need to deactivate the legacy group forum component. For more info, <a href="%s">read this codex article</a>.', 'buddypress' ), 'http://codex.buddypress.org/user/setting-up-a-new-installation/installing-group-and-sitewide-forums/using-bbpress-2-2-with-buddypress/' ) ?></p> 104 105 <div> 106 <a class="button thickbox button-primary" href="<?php echo esc_attr( $button_url ) ?>"><?php echo esc_html( $button_text ) ?></a> 60 107 </div> 61 108 </div> … … 68 115 69 116 function bp_forums_bbpress_install_wizard() { 70 $post_url = bp_get_admin_url( 'admin.php?page=bb-forums-setup' ); 117 $post_url = bp_get_admin_url( 'admin.php?page=bb-forums-setup' ); 118 $bbpress_plugin_is_active = false; 71 119 72 120 $step = isset( $_REQUEST['step'] ) ? $_REQUEST['step'] : ''; 121 122 // The text and URL of the Site Wide Forums button differs depending on whether bbPress 123 // is running 124 if ( is_plugin_active( 'bbpress/bbpress.php' ) ) { 125 $bbpress_plugin_is_active = true; 126 127 // The bbPress admin page will always be on the root blog. switch_to_blog() will 128 // pass through if we're already there. 129 switch_to_blog( bp_get_root_blog_id() ); 130 $button_url = admin_url( add_query_arg( array( 'page' => 'bbpress' ), 'options-general.php' ) ); 131 restore_current_blog(); 132 133 $button_text = __( 'Configure bbPress', 'buddypress' ); 134 } else { 135 $button_url = bp_get_admin_url( add_query_arg( array( 'tab' => 'plugin-information', 'plugin' => 'bbpress', 'TB_iframe' => 'true', 'width' => '640', 'height' => '500' ), 'plugin-install.php' ) ); 136 $button_text = __( 'Install bbPress', 'buddypress' ); 137 } 73 138 74 139 switch( $step ) { … … 99 164 100 165 case 'new': 101 if ( isset( $_REQUEST['doinstall'] ) && 1 == (int) 166 if ( isset( $_REQUEST['doinstall'] ) && 1 == (int)$_REQUEST['doinstall'] ) { 102 167 $result = bp_forums_bbpress_install(); 103 168 … … 142 207 ?> 143 208 144 <div >209 <div style="width: 45%; float: left; margin-top: 20px;"> 145 210 <h3><?php _e( 'Forums for Groups', 'buddypress' ) ?></h3> 146 211 147 212 <p><?php _e( 'Give each individual group its own discussion forum. Choose this if you\'d like to keep your members\' conversations separated into distinct areas.' , 'buddypress' ); ?></p> 148 <p class="description"><?php _e( 'You may use an existing bbPress installation if you have one.', 'buddypress' ); ?></p> 213 214 <p><?php _e( 'Note: This component is retired and will not be receiving any updates in the future. Only use this component if your current site relies on it.' , 'buddypress' ); ?></p> 149 215 150 216 <h4 style="margin-bottom: 10px;"><?php _e( 'Features', 'buddypress' ); ?></h4> … … 162 228 </div> 163 229 230 <div style="width: 45%; float: left; margin: 20px 0 20px 20px; padding: 0 20px 20px 20px; border: 1px solid #ddd; background-color: #fff;"> 231 <h3><?php _e( 'New! bbPress', 'buddypress' ) ?></h3> 232 <p><?php _e( 'bbPress is a brand-new forum plugin from one of the lead developers of BuddyPress.', 'buddypress' ) ?></p> 233 234 <p><?php _e( 'It boasts a bunch of cool features that the BP Legacy Discussion Forums does not have including:', 'buddypress' ) ?></p> 235 236 <ul class="description" style="list-style: square; margin-left: 30px;"> 237 <li><?php _e( 'Non-group specific forum creation', 'buddypress' ); ?></p></li> 238 <li><?php _e( 'Moderation via the WP admin dashboard', 'buddypress' ); ?></p></li> 239 <li><?php _e( 'Topic splitting', 'buddypress' ); ?></p></li> 240 <li><?php _e( 'Revisions', 'buddypress' ); ?></p></li> 241 <li><?php _e( 'Spam management', 'buddypress' ); ?></p></li> 242 <li><?php _e( 'Subscriptions', 'buddypress' ); ?></p></li> 243 <li><?php _e( 'And more!', 'buddypress' ); ?></p></li> 244 </ul> 245 246 <p><?php printf( __( 'If you decide to use bbPress, you will need to deactivate the legacy group forum component. For more info, <a href="%s">read this codex article</a>.', 'buddypress' ), 'http://codex.buddypress.org/user/setting-up-a-new-installation/installing-group-and-sitewide-forums/using-bbpress-2-2-with-buddypress/' ) ?></p> 247 <div> 248 <a class="button button-primary <?php if ( ! $bbpress_plugin_is_active ) { echo esc_attr( 'thickbox' ); }?>" href="<?php echo esc_attr( $button_url ) ?>"><?php echo esc_html( $button_text ) ?></a> 249 </div> 250 </div> 251 164 252 <?php } 165 253 break; -
trunk/bp-forums/deprecated/1.7.php
r6581 r7213 29 29 } 30 30 add_action( bp_core_admin_hook(), 'bp_forums_add_admin_menu' ); 31 32 /**33 * Outputs the markup for the bb-forums-admin panel34 */35 function bp_forums_bbpress_admin() {36 37 // The text and URL of the Site Wide Forums button differs depending on whether bbPress38 // is running39 if ( is_plugin_active( 'bbpress/bbpress.php' ) ) {40 // The bbPress admin page will always be on the root blog. switch_to_blog() will41 // pass through if we're already there.42 switch_to_blog( bp_get_root_blog_id() );43 $button_url = admin_url( add_query_arg( array( 'page' => 'bbpress' ), 'options-general.php' ) );44 restore_current_blog();45 46 $button_text = __( 'Configure Site Wide Forums', 'buddypress' );47 } else {48 $button_url = bp_get_admin_url( add_query_arg( array( 'tab' => 'plugin-information', 'plugin' => 'bbpress', 'TB_iframe' => 'true', 'width' => '640', 'height' => '500' ), 'plugin-install.php' ) );49 $button_text = __( 'Install Site Wide Forums', 'buddypress' );50 }51 52 $action = bp_get_admin_url( 'admin.php?page=bb-forums-setup&reinstall=1' ); ?>53 54 <div class="wrap">55 <?php screen_icon( 'buddypress' ); ?>56 57 <h2 class="nav-tab-wrapper"><?php bp_core_admin_tabs( __( 'Forums', 'buddypress' ) ); ?></h2>58 59 <?php if ( isset( $_POST['submit'] ) ) : ?>60 61 <div id="message" class="updated fade">62 <p><?php _e( 'Settings Saved.', 'buddypress' ) ?></p>63 </div>64 65 <?php endif; ?>66 67 <?php68 69 if ( isset( $_REQUEST['reinstall'] ) || !bp_forums_is_installed_correctly() ) :70 71 // Delete the bb-config.php location option72 bp_delete_option( 'bb-config-location' );73 74 // Now delete the bb-config.php file75 @unlink( ABSPATH . 'bb-config.php' );76 77 // show the updated wizard78 bp_forums_bbpress_install_wizard();79 80 else : ?>81 82 <div style="width: 45%; float: left; margin-top: 20px;">83 <h3><?php _e( '(Installed)', 'buddypress' ); ?> <?php _e( 'Forums for Groups', 'buddypress' ) ?></h3>84 85 <p><?php _e( 'Give each individual group its own discussion forum. Choose this if you\'d like to keep your members\' conversations separated into distinct areas.' , 'buddypress' ); ?></p>86 <p class="description"><?php _e( 'You may use an existing bbPress installation if you have one.', 'buddypress' ); ?></p>87 88 <h4 style="margin-bottom: 10px;"><?php _e( 'Features', 'buddypress' ); ?></h4>89 <ul class="description" style="list-style: square; margin-left: 30px;">90 <li><?php _e( 'Group Integration', 'buddypress' ); ?></p></li>91 <li><?php _e( 'Member Profile Integration', 'buddypress' ); ?></p></li>92 <li><?php _e( 'Activity Stream Integration', 'buddypress' ); ?></p></li>93 <li><?php _e( '@ Mention Integration', 'buddypress' ); ?></p></li>94 </ul>95 96 <div>97 <a class="button button-primary confirm" href="<?php echo $action ?>"><?php _e( 'Uninstall Group Forums', 'buddypress' ) ?></a> 98 </div>99 </div>100 101 <div style="width: 45%; float: left; margin: 20px 0 20px 20px; padding: 0 20px 20px 20px; border: 1px solid #ddd; background-color: #fff;">102 <h3><?php _e( 'New! Site Wide Forums', 'buddypress' ) ?></h3>103 <p><?php _e( 'Your site will have central forums that are not isolated to any specific group. Choose this if you\'d like to have a central forum area for your members.', 'buddypress' ) ?></p>104 <p class="description"><?php _e( 'You may activate both Group and Site Wide forums, but this may create a poor experience for your members.', 'buddypress' ) ?></p>105 106 <h4 style="margin-bottom: 10px;"><?php _e( 'Features', 'buddypress' ); ?></h4>107 <ul class="description" style="list-style: square; margin-left: 30px;">108 <li><?php _e( 'Central Discussion Area', 'buddypress' ); ?></p></li>109 <li><?php _e( 'Forum Plugins Available', 'buddypress' ); ?></p></li>110 <li><?php _e( 'Activity Stream Integration', 'buddypress' ); ?></p></li>111 <li><?php _e( '@ Mention Integration', 'buddypress' ); ?></p></li>112 </ul>113 114 <div>115 <a class="button thickbox button-primary" href="<?php echo esc_attr( $button_url ) ?>"><?php echo esc_html( $button_text ) ?></a> 116 </div>117 </div>118 119 <?php endif; ?>120 121 <p class="clear description"><?php printf( __( 'Need help deciding between Group Forums and Site Wide Forums? Visit <a href="%s">the BuddyPress codex</a> for more information.', 'buddypress' ), 'http://codex.buddypress.org/getting-started/installing-group-and-sitewide-forums/' ) ?></p>122 </div>123 <?php124 }125 126 function bp_forums_bbpress_install_wizard() {127 $post_url = bp_get_admin_url( 'admin.php?page=bb-forums-setup' );128 $bbpress_plugin_is_active = false;129 130 $step = isset( $_REQUEST['step'] ) ? $_REQUEST['step'] : '';131 132 // The text and URL of the Site Wide Forums button differs depending on whether bbPress133 // is running134 if ( is_plugin_active( 'bbpress/bbpress.php' ) ) {135 $bbpress_plugin_is_active = true;136 137 // The bbPress admin page will always be on the root blog. switch_to_blog() will138 // pass through if we're already there.139 switch_to_blog( bp_get_root_blog_id() );140 $button_url = admin_url( add_query_arg( array( 'page' => 'bbpress' ), 'options-general.php' ) );141 restore_current_blog();142 143 $button_text = __( 'Configure Site Wide Forums', 'buddypress' );144 } else {145 $button_url = bp_get_admin_url( add_query_arg( array( 'tab' => 'plugin-information', 'plugin' => 'bbpress', 'TB_iframe' => 'true', 'width' => '640', 'height' => '500' ), 'plugin-install.php' ) );146 $button_text = __( 'Install Site Wide Forums', 'buddypress' );147 }148 149 switch( $step ) {150 case 'existing':151 if ( isset( $_REQUEST['doinstall'] ) && ( 1 == (int) $_REQUEST['doinstall'] ) ) {152 if ( !bp_forums_configure_existing_install() ) {153 _e( 'The bb-config.php file was not found at that location, please try again.', 'buddypress' );154 } else {155 ?>156 <h3><?php _e( 'Forums were set up correctly using your existing bbPress install!', 'buddypress' ) ?></h3>157 <p><?php _e( 'BuddyPress will now use its internal copy of bbPress to run the forums on your site. If you wish, you can remove your old bbPress installation files, as long as you keep the bb-config.php file in the same location.', 'buddypress' ) ?></p><?php158 }159 } else { ?>160 161 <form action="" method="post">162 <h3><?php _e( 'Existing bbPress Installation', 'buddypress' ) ?></h3>163 <p><?php _e( "BuddyPress can make use of your existing bbPress install. Just provide the location of your <code>bb-config.php</code> file, and BuddyPress will do the rest.", 'buddypress' ) ?></p>164 <p><label><code>bb-config.php</code> file location:</label><br /><input style="width: 50%" type="text" name="bbconfigloc" id="bbconfigloc" value="<?php echo str_replace( 'buddypress', '', $_SERVER['DOCUMENT_ROOT'] ) ?>" /></p>165 <p><input type="submit" class="button-primary" value="<?php _e( 'Complete Installation', 'buddypress' ) ?>" /></p>166 <input type="hidden" name="step" value="existing" />167 <input type="hidden" name="doinstall" value="1" />168 <?php wp_nonce_field( 'bp_forums_existing_install_init' ) ?>169 </form>170 171 <?php172 }173 break;174 175 case 'new':176 if ( isset( $_REQUEST['doinstall'] ) && 1 == (int)$_REQUEST['doinstall'] ) {177 $result = bp_forums_bbpress_install();178 179 switch ( $result ) {180 case 1:181 _e( '<p>All done! Configuration settings have been saved to the file <code>bb-config.php</code> in the root of your WordPress install.</p>', 'buddypress' );182 break;183 default:184 // Just write the contents to screen185 _e( '<p>A configuration file could not be created. No problem, but you will need to save the text shown below into a file named <code>bb-config.php</code> in the root directory of your WordPress installation before you can start using the forum functionality.</p>', 'buddypress' ); ?>186 187 <textarea style="display:block; margin-top: 30px; width: 80%;" rows="50"><?php echo htmlspecialchars( $result ); ?></textarea>188 189 <?php190 break;191 }192 } else { ?>193 194 <h3><?php _e( 'New bbPress Installation', 'buddypress' ) ?></h3>195 <p><?php _e( "You've decided to set up a new installation of bbPress for forum management in BuddyPress. This is very simple and is usually just a one click196 process. When you're ready, hit the link below.", 'buddypress' ) ?></p>197 <p><a class="button-primary" href="<?php echo wp_nonce_url( $post_url . '&step=new&doinstall=1', 'bp_forums_new_install_init' ) ?>"><?php _e( 'Complete Installation', 'buddypress' ) ?></a></p>198 199 <?php200 }201 break;202 203 default:204 if ( !file_exists( BP_PLUGIN_DIR . '/bp-forums/bbpress/' ) ) { ?>205 206 <div id="message" class="error">207 <p><?php printf( __( 'bbPress files were not found. To install the forums component you must download a copy of bbPress and make sure it is in the folder: "%s"', 'buddypress' ), 'wp-content/plugins/buddypress/bp-forums/bbpress/' ) ?></p>208 </div>209 210 <?php } else {211 212 // Include the plugin install213 214 add_thickbox();215 wp_enqueue_script( 'plugin-install' );216 wp_admin_css( 'plugin-install' );217 ?>218 219 <div style="width: 45%; float: left; margin-top: 20px;">220 <h3><?php _e( 'Forums for Groups', 'buddypress' ) ?></h3>221 222 <p><?php _e( 'Give each individual group its own discussion forum. Choose this if you\'d like to keep your members\' conversations separated into distinct areas.' , 'buddypress' ); ?></p>223 <p class="description"><?php _e( 'You may use an existing bbPress installation if you have one.', 'buddypress' ); ?></p>224 225 <h4 style="margin-bottom: 10px;"><?php _e( 'Features', 'buddypress' ); ?></h4>226 <ul class="description" style="list-style: square; margin-left: 30px;">227 <li><?php _e( 'Group Integration', 'buddypress' ); ?></p></li>228 <li><?php _e( 'Member Profile Integration', 'buddypress' ); ?></p></li>229 <li><?php _e( 'Activity Stream Integration', 'buddypress' ); ?></p></li>230 <li><?php _e( '@ Mention Integration', 'buddypress' ); ?></p></li>231 </ul>232 233 <div>234 <a class="button button-primary" href="<?php echo $post_url . '&step=new' ?>"><?php _e( 'Install Group Forums', 'buddypress' ) ?></a> 235 <a class="button" href="<?php echo $post_url . '&step=existing' ?>"><?php _e( 'Use Existing Installation', 'buddypress' ) ?></a>236 </div>237 </div>238 239 <div style="width: 45%; float: left; margin: 20px 0 20px 20px; padding: 0 20px 20px 20px; border: 1px solid #ddd; background-color: #fff;">240 <h3><?php _e( 'New! Site Wide Forums', 'buddypress' ) ?></h3>241 <p><?php _e( 'Your site will have central forums that are not isolated to any specific group. Choose this if you\'d like to have a central forum area for your members.', 'buddypress' ) ?></p>242 <p class="description"><?php _e( 'You may activate both Group and Site Wide forums, but this may create a poor experience for your members.', 'buddypress' ) ?></p>243 244 <h4 style="margin-bottom: 10px;"><?php _e( 'Features', 'buddypress' ); ?></h4>245 <ul class="description" style="list-style: square; margin-left: 30px;">246 <li><?php _e( 'Central Discussion Area', 'buddypress' ); ?></p></li>247 <li><?php _e( 'Forum Plugins Available', 'buddypress' ); ?></p></li>248 <li><?php _e( 'Activity Stream Integration', 'buddypress' ); ?></p></li>249 <li><?php _e( '@ Mention Integration', 'buddypress' ); ?></p></li>250 </ul>251 <div>252 <a class="button button-primary <?php if ( ! $bbpress_plugin_is_active ) { echo esc_attr( 'thickbox' ); }?>" href="<?php echo esc_attr( $button_url ) ?>"><?php echo esc_html( $button_text ) ?></a> 253 </div>254 </div>255 256 <?php }257 break;258 }259 }260 31 261 32 function bp_forums_configure_existing_install() {
Note: See TracChangeset
for help on using the changeset viewer.