Changeset 1324553
- Timestamp:
- 01/09/2016 10:46:05 AM (10 years ago)
- Location:
- bbpress-new-ui/branches/3.5
- Files:
-
- 5 edited
-
bbpress-new-ui.php (modified) (11 diffs)
-
inc/forumui/new-forum.php (modified) (1 diff)
-
inc/online-status/online.php (modified) (1 diff)
-
inc/replyui/lock.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
bbpress-new-ui/branches/3.5/bbpress-new-ui.php
r1319832 r1324553 3 3 Plugin Name: bbPress New UI 4 4 Description: A great plugin completely changes the entire design of bbpress in light or dark color 5 Version: 3.5 5 Version: 3.5.0.1 6 6 Author: Daniel 4000 7 7 Author URI: http://dk4000.com 8 8 Contributors: daniluk4000 9 Text Domain: bbp -new-ui9 Text Domain: bbpress-new-ui 10 10 Domain Path: /languages 11 11 */ 12 12 //---------------------------------------- 13 13 // Constructor 14 $val2 = get_option('bbp _new_ui_option');14 $val2 = get_option('bbpress_new_ui_option'); 15 15 $val2 = $val2['3']; 16 $val3 = get_option('bbp _new_ui_option');16 $val3 = get_option('bbpress_new_ui_option'); 17 17 $val3 = $val3['4']; 18 18 if ( $val2 == '1'){ … … 35 35 return $actions; 36 36 37 $settings_link = '<a href="options-general.php?page=bbp _new_ui">'.__( 'Settings', 'bbpress' ).'</a>';37 $settings_link = '<a href="options-general.php?page=bbpress_new_ui">'.__( 'Settings', 'bbpress' ).'</a>'; 38 38 array_unshift( $actions, $settings_link ); 39 39 return $actions; … … 42 42 //---------------------------------------- 43 43 // Iniciate our plugin class 44 class BBP_NEW_UI{44 class bbpress_new_ui { 45 45 function __construct() { 46 46 add_action( 'wp_enqueue_scripts', array( $this, 'bbpui_register_plugin_styles' ) ); … … 48 48 } 49 49 public function bbpui_register_plugin_styles() { 50 $val = get_option('bbp _new_ui_option');50 $val = get_option('bbpress_new_ui_option'); 51 51 $val = $val['1']; 52 52 if ( $val == '1'){ 53 53 $css_path = plugin_dir_path( __FILE__ ) . '/inc/css/dark.css'; 54 wp_enqueue_style( 'bbp _new_ui', plugin_dir_url( __FILE__ ) . '/inc/css/dark.css', filemtime( $css_path ) );54 wp_enqueue_style( 'bbpress_new_ui', plugin_dir_url( __FILE__ ) . '/inc/css/dark.css', filemtime( $css_path ) ); 55 55 } 56 56 else { 57 57 $css_path = plugin_dir_path( __FILE__ ) . '/inc/css/light.css'; 58 wp_enqueue_style( 'bbp _new_ui', plugin_dir_url( __FILE__ ) . '/inc/css/light.css', filemtime( $css_path ) );58 wp_enqueue_style( 'bbpress_new_ui', plugin_dir_url( __FILE__ ) . '/inc/css/light.css', filemtime( $css_path ) ); 59 59 } 60 60 } 61 61 62 62 public function bbpui_hide_the_copirytht() { 63 $valnew = get_option('bbp _new_ui_option');63 $valnew = get_option('bbpress_new_ui_option'); 64 64 $valnew = $valnew['2']; 65 65 if ( $valnew == '1') { … … 81 81 // Notice 82 82 //---------------------------------------- 83 add_action('admin_notices', 'bbp _new_ui_admin_notice');84 85 function bbp _new_ui_admin_notice() {83 add_action('admin_notices', 'bbpress_new_ui_admin_notice'); 84 85 function bbpress_new_ui_admin_notice() { 86 86 global $current_user ; 87 87 $user_id = $current_user->ID; 88 88 /* Check that the user hasn't already clicked to ignore the message */ 89 if ( ! get_user_meta($user_id, 'bbp _new_ui_ignore_notice') ) {89 if ( ! get_user_meta($user_id, 'bbpress_new_ui_ignore_notice') ) { 90 90 echo '<div class="updated"><p>'; 91 printf(__('Want to test the new versions of BBP New UI plugin or to add your translation or have an idea/suggestion? Write me in admin@dk4000.com! | <a href="%1$s">Hide notice</a>', 'bbp -new-ui'), '?bbp_new_ui_nag_ignore=0');91 printf(__('Want to test the new versions of BBP New UI plugin or to add your translation or have an idea/suggestion? Write me in admin@dk4000.com! | <a href="%1$s">Hide notice</a>', 'bbpress-new-ui'), '?bbpress_new_ui_nag_ignore=0'); 92 92 echo "</p></div>"; 93 93 } 94 94 } 95 95 96 add_action('admin_init', 'bbp _new_ui_nag_ignore');97 98 function bbp _new_ui_nag_ignore() {96 add_action('admin_init', 'bbpress_new_ui_nag_ignore'); 97 98 function bbpress_new_ui_nag_ignore() { 99 99 global $current_user; 100 100 $user_id = $current_user->ID; 101 101 /* If user clicks to ignore the notice, add that to their user meta */ 102 if ( isset($_GET['bbp _new_ui_nag_ignore']) && '0' == $_GET['bbp_new_ui_nag_ignore'] ) {103 add_user_meta($user_id, 'bbp _new_ui_ignore_notice', 'true', true);102 if ( isset($_GET['bbpress_new_ui_nag_ignore']) && '0' == $_GET['bbpress_new_ui_nag_ignore'] ) { 103 add_user_meta($user_id, 'bbpress_new_ui_ignore_notice', 'true', true); 104 104 } 105 105 } … … 107 107 // Notice 108 108 //---------------------------------------- 109 add_action('admin_notices', 'bbp _new_ui_admin_notice_2');110 111 function bbp _new_ui_admin_notice_2() {109 add_action('admin_notices', 'bbpress_new_ui_admin_notice_2'); 110 111 function bbpress_new_ui_admin_notice_2() { 112 112 global $current_user ; 113 113 $user_id = $current_user->ID; 114 114 /* Check that the user hasn't already clicked to ignore the message */ 115 if ( ! get_user_meta($user_id, 'bbp _new_ui_ignore_notice_2') ) {115 if ( ! get_user_meta($user_id, 'bbpress_new_ui_ignore_notice_2') ) { 116 116 echo '<div class="updated"><p>'; 117 printf(__('Please try our new plugin - <a href="https://wordpress.org/plugins/bp-new-ui/">BuddyPress New UI</a> | <a href="%1$s">Hide notice</a>', 'bbp -new-ui'), '?bbp_new_ui_nag_ignore_2=0');117 printf(__('Please try our new plugin - <a href="https://wordpress.org/plugins/bp-new-ui/">BuddyPress New UI</a> | <a href="%1$s">Hide notice</a>', 'bbpress-new-ui'), '?bbpress_new_ui_nag_ignore_2=0'); 118 118 echo "</p></div>"; 119 119 } 120 120 } 121 121 122 add_action('admin_init', 'bbp _new_ui_nag_ignore_2');123 124 function bbp _new_ui_nag_ignore_2() {122 add_action('admin_init', 'bbpress_new_ui_nag_ignore_2'); 123 124 function bbpress_new_ui_nag_ignore_2() { 125 125 global $current_user; 126 126 $user_id = $current_user->ID; 127 127 /* If user clicks to ignore the notice, add that to their user meta */ 128 if ( isset($_GET['bbp _new_ui_nag_ignore_2']) && '0' == $_GET['bbp_new_ui_nag_ignore_2'] ) {129 add_user_meta($user_id, 'bbp _new_ui_ignore_notice_2', 'true', true);128 if ( isset($_GET['bbpress_new_ui_nag_ignore_2']) && '0' == $_GET['bbpress_new_ui_nag_ignore_2'] ) { 129 add_user_meta($user_id, 'bbpress_new_ui_ignore_notice_2', 'true', true); 130 130 } 131 131 } … … 134 134 // Load 135 135 //---------------------------------------- 136 function bbp _new_ui_load_plugin_textdomain() {137 load_plugin_textdomain( 'bbp -new-ui', FALSE, basename( dirname( __FILE__ ) ) . '/languages/' );138 } 139 add_action( 'plugins_loaded', 'bbp _new_ui_load_plugin_textdomain' );136 function bbpress_new_ui_load_plugin_textdomain() { 137 load_plugin_textdomain( 'bbpress-new-ui', FALSE, basename( dirname( __FILE__ ) ) . '/languages/' ); 138 } 139 add_action( 'plugins_loaded', 'bbpress_new_ui_load_plugin_textdomain' ); 140 140 141 141 //---------------------------------------- … … 144 144 145 145 function bbpui_add_plugin_page(){ 146 add_options_page( ''.__('Settings').' bbPress New UI', ' bbPress New UI', 'manage_options', 'bbp _new_ui', 'bbp_new_ui_options_page_output' );147 } 148 149 function bbp _new_ui_options_page_output(){146 add_options_page( ''.__('Settings').' bbPress New UI', ' bbPress New UI', 'manage_options', 'bbpress_new_ui', 'bbpress_new_ui_options_page_output' ); 147 } 148 149 function bbpress_new_ui_options_page_output(){ 150 150 ?> 151 151 <div class="wrap bbpress-new-ui-wrap" id="bbpui"> … … 212 212 <h2><?php echo get_admin_page_title() ?></h2> 213 213 <form action="options.php" method="POST"> 214 <?php settings_fields( 'bbp _new_ui_group' ); ?>215 <?php do_settings_sections( 'bbp _new_ui_page' ); ?>214 <?php settings_fields( 'bbpress_new_ui_group' ); ?> 215 <?php do_settings_sections( 'bbpress_new_ui_page' ); ?> 216 216 <?php submit_button(); ?> 217 217 </form> … … 225 225 $pluginname = __( 'bbPress New UI' ); 226 226 $settingsname = __( 'Settings' ); 227 $changestylename = __( ''.__('Change').' '.__('Style').'', 'bbp -new-ui' );228 $hidename = __( ''.__('Hide').' '.__('the Copyright', 'bbp -new-ui').'', 'bbp-new-ui' );229 $bbpaaname = __( ''.__('Settings').' bbPress Admin Answers', 'bbp -new-ui');230 $bbpreplylock = __( ''.__('Advanced').' '.__('Settings').'', 'bbp -new-ui');231 register_setting( 'bbp _new_ui_group', 'bbp_new_ui_option' );232 add_settings_section( 'bbp _new_ui_id', '', '', 'bbp_new_ui_page' );233 add_settings_field('bbp _new_ui_field', $changestylename, 'fill_bbp_new_ui_field', 'bbp_new_ui_page', 'bbp_new_ui_id' );234 add_settings_field('bbp _new_ui_field_1', $hidename, 'fill_bbp_new_ui_field_1', 'bbp_new_ui_page', 'bbp_new_ui_id' );235 add_settings_field('bbp _new_ui_field_2', $bbpaaname, 'fill_bbp_new_ui_field_2', 'bbp_new_ui_page', 'bbp_new_ui_id' );236 add_settings_field('bbp _new_ui_field_3', $bbpreplylock, 'fill_bbp_new_ui_field_3', 'bbp_new_ui_page', 'bbp_new_ui_id' );227 $changestylename = __( ''.__('Change').' '.__('Style').'', 'bbpress-new-ui' ); 228 $hidename = __( ''.__('Hide').' '.__('the Copyright', 'bbpress-new-ui').'', 'bbpress-new-ui' ); 229 $bbpaaname = __( ''.__('Settings').' bbPress Admin Answers', 'bbpress-new-ui'); 230 $bbpreplylock = __( ''.__('Advanced').' '.__('Settings').'', 'bbpress-new-ui'); 231 register_setting( 'bbpress_new_ui_group', 'bbpress_new_ui_option' ); 232 add_settings_section( 'bbpress_new_ui_id', '', '', 'bbpress_new_ui_page' ); 233 add_settings_field('bbpress_new_ui_field', $changestylename, 'fill_bbpress_new_ui_field', 'bbpress_new_ui_page', 'bbpress_new_ui_id' ); 234 add_settings_field('bbpress_new_ui_field_1', $hidename, 'fill_bbpress_new_ui_field_1', 'bbpress_new_ui_page', 'bbpress_new_ui_id' ); 235 add_settings_field('bbpress_new_ui_field_2', $bbpaaname, 'fill_bbpress_new_ui_field_2', 'bbpress_new_ui_page', 'bbpress_new_ui_id' ); 236 add_settings_field('bbpress_new_ui_field_3', $bbpreplylock, 'fill_bbpress_new_ui_field_3', 'bbpress_new_ui_page', 'bbpress_new_ui_id' ); 237 237 } 238 238 add_action('admin_init', 'bbpui_plugin_settings'); 239 239 240 function fill_bbp _new_ui_field(){241 $val = get_option('bbp _new_ui_option');240 function fill_bbpress_new_ui_field(){ 241 $val = get_option('bbpress_new_ui_option'); 242 242 $locale = get_locale(); 243 243 $val = $val['1']; … … 245 245 ?> 246 246 <label> 247 <input type="checkbox" name="bbp _new_ui_option[1]" value="1" <?php checked( 1, $val ) ?> /> <?php _e( 'Change style to Dark color', 'bbp-new-ui'); ?></label> <br>247 <input type="checkbox" name="bbpress_new_ui_option[1]" value="1" <?php checked( 1, $val ) ?> /> <?php _e( 'Change style to Dark color', 'bbpress-new-ui'); ?></label> <br> 248 248 <?php 249 249 if ( $val == '1') { 250 echo'<status class="dark">';_e( 'Now active Dark Theme', 'bbp -new-ui' );echo'</status>';250 echo'<status class="dark">';_e( 'Now active Dark Theme', 'bbpress-new-ui' );echo'</status>'; 251 251 } 252 252 else { 253 echo'<status class="light">';_e( 'Now active Light Theme', 'bbp -new-ui' );echo'</status>';254 } 255 } 256 257 function fill_bbp _new_ui_field_2(){258 $val2 = get_option('bbp _new_ui_option');253 echo'<status class="light">';_e( 'Now active Light Theme', 'bbpress-new-ui' );echo'</status>'; 254 } 255 } 256 257 function fill_bbpress_new_ui_field_2(){ 258 $val2 = get_option('bbpress_new_ui_option'); 259 259 $val2 = $val2['3']; 260 260 ?> 261 261 <label> 262 262 263 <input type="checkbox" name="bbp _new_ui_option[3]" value="1" <?php checked( 1, $val2 ) ?> /> <?php _e( 'Deactivate' ); ?> bbP New UI Admin Answers <div class="desc"><?php _e( 'If you have <code>call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, BBP_Admin_Replies::update_reply</code> error and same and if you have all blue posts if you check "this <strong>topic</strong> of keymaster/moderator check this checkbox', 'bbp-new-ui' ); ?></div> </label><br>264 <?php 265 } 266 267 function fill_bbp _new_ui_field_1(){268 $valnew = get_option('bbp _new_ui_option');263 <input type="checkbox" name="bbpress_new_ui_option[3]" value="1" <?php checked( 1, $val2 ) ?> /> <?php _e( 'Deactivate' ); ?> bbP New UI Admin Answers <div class="desc"><?php _e( 'If you have <code>call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, BBP_Admin_Replies::update_reply</code> error and same and if you have all blue posts if you check "this <strong>topic</strong> of keymaster/moderator check this checkbox', 'bbpress-new-ui' ); ?></div> </label><br> 264 <?php 265 } 266 267 function fill_bbpress_new_ui_field_1(){ 268 $valnew = get_option('bbpress_new_ui_option'); 269 269 $valnew = $valnew['2']; 270 270 ?> 271 271 <label> 272 272 273 <input type="checkbox" name="bbp _new_ui_option[2]" value="1" <?php checked( 1, $valnew ) ?> /> <?php _e( 'Hide'); ?> </label></div><br>274 <?php 275 } 276 277 function fill_bbp _new_ui_field_3(){278 $val3 = get_option('bbp _new_ui_option');273 <input type="checkbox" name="bbpress_new_ui_option[2]" value="1" <?php checked( 1, $valnew ) ?> /> <?php _e( 'Hide'); ?> </label></div><br> 274 <?php 275 } 276 277 function fill_bbpress_new_ui_field_3(){ 278 $val3 = get_option('bbpress_new_ui_option'); 279 279 $val3 = $val3['4']; 280 280 ?> 281 281 <label> 282 282 283 <input type="checkbox" name="bbp _new_ui_option[4]" value="1" <?php checked( 1, $val3 ) ?> /> <?php _e( 'Deactivate' ); ?> User reply spam block </label><br>283 <input type="checkbox" name="bbpress_new_ui_option[4]" value="1" <?php checked( 1, $val3 ) ?> /> <?php _e( 'Deactivate' ); ?> User reply spam block </label><br> 284 284 <?php 285 285 } 286 286 287 287 // instantiate our plugin's class 288 $GLOBALS['bbp _new_ui'] = new BBP_NEW_UI();289 ?> 288 $GLOBALS['bbpress_new_ui'] = new bbpress_new_ui(); 289 ?> -
bbpress-new-ui/branches/3.5/inc/forumui/new-forum.php
r1319832 r1324553 49 49 <li class="bbp-forum-topic-count"><?php _e( 'Topics', 'bbpress' ); ?></li> 50 50 <li class="bbp-forum-reply-count"><?php bbp_show_lead_topic() ? _e( 'Replies', 'bbpress' ) : _e( 'Posts', 'bbpress' ); ?></li> 51 <li class="bbp-forum-freshness"><?php _e( 'Latest activity', 'bbp -new-ui' ); ?></li>51 <li class="bbp-forum-freshness"><?php _e( 'Latest activity', 'bbpress-new-ui' ); ?></li> 52 52 </ul> 53 53 -
bbpress-new-ui/branches/3.5/inc/online-status/online.php
r1319832 r1324553 36 36 echo '<li>'; 37 37 if (bbpui_is_user_online($user_id)) { 38 echo '<div class="status_online is_online">'.__('Online', 'bbp -new-ui').'</div>';38 echo '<div class="status_online is_online">'.__('Online', 'bbpress-new-ui').'</div>'; 39 39 } else { 40 echo '<div class="status_online is_not_online">'.__('Offline', 'bbp -new-ui').'</div>';40 echo '<div class="status_online is_not_online">'.__('Offline', 'bbpress-new-ui').'</div>'; 41 41 } 42 42 echo '</li>'; -
bbpress-new-ui/branches/3.5/inc/replyui/lock.php
r1319832 r1324553 21 21 var d = document.createElement('DIV'); 22 22 d.className = "dk-no-reply"; 23 var t = document.createTextNode("<?php _e('You cannot post more replies as long as you are the last poster. Please edit your post instead.', 'bbp -new-ui'); ?>");23 var t = document.createTextNode("<?php _e('You cannot post more replies as long as you are the last poster. Please edit your post instead.', 'bbpress-new-ui'); ?>"); 24 24 d.appendChild(t); 25 25 c.appendChild(d); -
bbpress-new-ui/branches/3.5/readme.txt
r1319832 r1324553 4 4 Tags: bbPress, new UI, UI, Forums, daniluk4000, Forum, Interface, Redesign, plugin, online, online status, design, lock, spam, spam lock 5 5 Tested up to: 4.5 6 Stable Tag: 3.5 6 Stable Tag: 3.5.0.1 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 80 80 81 81 == Changelog == 82 83 = 3.5.0.1 = 84 * Fixed GlotPress translations 82 85 83 86 = 3.5 =
Note: See TracChangeset
for help on using the changeset viewer.