Changeset 6160
- Timestamp:
- 12/12/2016 01:59:44 PM (8 years ago)
- Location:
- branches/0.9
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/0.9/bb-admin/admin-functions.php
r2348 r6160 248 248 var $search_errors; 249 249 250 function BB_User_Search($search_term = false, $page = 1 ) { // constructor250 function __construct ($search_term = false, $page = 1 ) { // constructor 251 251 $this->search_term = $search_term ? stripslashes($search_term) : false; 252 252 $this->raw_page = ( '' == $page ) ? false : (int) $page; … … 258 258 $this->prepare_vars_for_template_usage(); 259 259 $this->do_paging(); 260 } 261 262 function BB_User_Search ($search_term = false, $page = 1 ) { 263 $this->__construct( $search_term, $page ); 260 264 } 261 265 … … 403 407 var $title = ''; 404 408 405 function BB_Users_By_Role($role = '', $page = '') { // constructor409 function __construct($role = '', $page = '') { // constructor 406 410 $this->role = $role ? $role : 'member'; 407 411 $this->raw_page = ( '' == $page ) ? false : (int) $page; … … 411 415 $this->query(); 412 416 $this->do_paging(); 417 } 418 419 function BB_Users_By_Role($role = '', $page = '') { 420 $this->__construct($role, $page); 413 421 } 414 422 … … 435 443 return false; 436 444 445 $_args = func_get_args(); 437 446 $defaults = array( 'forum_name' => '', 'forum_desc' => '', 'forum_parent' => 0, 'forum_order' => false ); 438 447 $args = wp_parse_args( $args, $defaults ); 439 448 if ( 1 < func_num_args() ) : // For back compat 440 $args['forum_name'] = func_get_arg(0);441 $args['forum_desc'] = func_get_arg(1);442 $args['forum_order'] = 2 < func_num_args() ? func_get_arg(2): 0;449 $args['forum_name'] = $_args[0]; 450 $args['forum_desc'] = $_args[1]; 451 $args['forum_order'] = 2 < func_num_args() ? $_args[2] : 0; 443 452 endif; 444 453 … … 480 489 return false; 481 490 491 $_args = func_get_args(); 482 492 $defaults = array( 'forum_id' => 0, 'forum_name' => '', 'forum_desc' => '', 'forum_parent' => 0, 'forum_order' => 0 ); 483 493 $args = wp_parse_args( $args, $defaults ); 484 494 if ( 1 < func_num_args() ) : // For back compat 485 $args['forum_id'] = func_get_arg(0);486 $args['forum_name'] = func_get_arg(1);487 $args['forum_desc'] = 2 < func_num_args() ? func_get_arg(2): '';488 $args['forum_order'] = 3 < func_num_args() && is_numeric( func_get_arg(3)) ? func_get_arg(3): 0;495 $args['forum_id'] = $_args[0]; 496 $args['forum_name'] = $_args[1]; 497 $args['forum_desc'] = 2 < func_num_args() ? $_args[2] : ''; 498 $args['forum_order'] = 3 < func_num_args() && is_numeric($_args[3]) ? $_args[3] : 0; 489 499 endif; 490 500 -
branches/0.9/bb-includes/capabilities.php
r1173 r6160 8 8 var $role_key; 9 9 10 function BB_Roles() {10 function __construct() { 11 11 global $bbdb; 12 12 $this->role_key = $bbdb->prefix . 'user_roles'; … … 21 21 $this->role_names[$role] = $this->roles[$role]['name']; 22 22 } 23 } 24 25 function BB_Roles() { 26 $this->__construct(); 23 27 } 24 28 … … 214 218 var $capabilities; 215 219 216 function BB_Role($role, $capabilities) {220 function __construct($role, $capabilities) { 217 221 $this->name = $role; 218 222 $this->capabilities = $capabilities; 223 } 224 225 function BB_Role($role, $capabilities) { 226 $this->__construct($role, $capabilities); 219 227 } 220 228 … … 251 259 var $allcaps = array(); 252 260 253 function BB_User($id) {261 function __construct($id) { 254 262 global $bb_roles, $bbdb; 255 263 … … 268 276 } 269 277 $this->get_role_caps(); 278 } 279 280 function BB_User($id) { 281 $this->__construct($id); 270 282 } 271 283 -
branches/0.9/bb-includes/functions.php
r3517 r6160 67 67 68 68 function get_forums( $args = null ) { 69 $_args = func_get_args(); 69 70 if ( is_numeric($args) ) { 70 71 $args = array( 'child_of' => $args, 'hierarchical' => 1, 'depth' => 0 ); … … 72 73 $args = array( 'callback' => $args ); 73 74 if ( 1 < func_num_args() ) 74 $args['callback_args'] = func_get_arg(1);75 $args['callback_args'] = $_args[1]; 75 76 } 76 77 -
branches/0.9/bb-includes/gettext.php
r1363 r6160 102 102 * @param boolean enable_cache Enable or disable caching of strings (default on) 103 103 */ 104 function gettext_reader($Reader, $enable_cache = true) {104 function __construct($Reader, $enable_cache = true) { 105 105 // If there isn't a StreamReader, turn on short circuit mode. 106 106 if (! $Reader || isset($Reader->error) ) { … … 136 136 $this->originals = $this->readint(); 137 137 $this->translations = $this->readint(); 138 } 139 140 function gettext_reader($Reader, $enable_cache = true) { 141 $this->__construct($Reader, $enable_cache); 138 142 } 139 143 … … 292 296 } 293 297 $header .= "\n"; //make sure our regex matches 294 if ( eregi("plural-forms: ([^\n]*)\n", $header, $regs))298 if (preg_match("/plural-forms: ([^\n]*)\n/i", $header, $regs)) 295 299 $expr = $regs[1]; 296 300 else
Note: See TracChangeset
for help on using the changeset viewer.