Ticket #5500: 5500_update.patch
| File 5500_update.patch, 21.8 KB (added by , 11 years ago) |
|---|
-
src/bp-xprofile/bp-xprofile-admin.php
diff --git a/src/bp-xprofile/bp-xprofile-admin.php b/src/bp-xprofile/bp-xprofile-admin.php index 541a105..cf24b56 100644
a b function xprofile_admin_delete_group( $group_id ) { 333 333 xprofile_admin( $message, $type ); 334 334 } 335 335 336 function xprofile_admin_manage_datebox_option($message) 337 { 338 if(empty($_POST['datebox_option'])) return; 339 340 $_POST['datebox_option'][0] = isset($_POST['datebox_option'][0]) ? 'yes' : 'no'; 341 $_POST['datebox_option'][1] = (isset($_POST['datebox_option'][1]) || $_POST['datebox_option'][7] == 'elapsed') ? 'yes' : 'no'; 342 343 $_POST['datebox_option'][2] = (isset($_POST['datebox_option'][2]) && $_POST['datebox_option'][2] == 'year') ? 'year' : 'ago'; 344 345 $message .= ($_POST['datebox_option'][3] == '') ? __( 'Field "Max years ago" - required! ', 'buddypress' ) : ''; 346 $_POST['datebox_option'][3] = 347 isset($_POST['datebox_option'][3]) ? mb_substr(abs(intval($_POST['datebox_option'][3])), 0, 4, 'UTF-8') : 100; 348 349 $message .= ($_POST['datebox_option'][4] == '') ? __( 'Field "Min years ago" - required! ', 'buddypress' ) : ''; 350 $_POST['datebox_option'][4] = 351 isset($_POST['datebox_option'][4]) ? mb_substr(intval($_POST['datebox_option'][4]), 0, 5, 'UTF-8') : 18; 352 353 if (isset($_POST['datebox_option_3_from_type']) && $_POST['datebox_option_3_from_type']) { 354 $test_from = intval(date('Y') + $_POST['datebox_option'][3]); 355 } else { 356 $test_from = intval(date('Y') - $_POST['datebox_option'][3]); 357 $_POST['datebox_option'][3] = -intval($_POST['datebox_option'][3]); 358 } 359 360 if (isset($_POST['datebox_option_3_to_type']) && $_POST['datebox_option_3_to_type']) { 361 $test_to = intval(date('Y') + $_POST['datebox_option'][4]); 362 } else { 363 $test_to = intval(date('Y') - $_POST['datebox_option'][4]); 364 $_POST['datebox_option'][4] = -intval($_POST['datebox_option'][4]); 365 } 366 367 $message .= ($test_from < $test_to) ? __( 'Wrong year range! ', 'buddypress' ) : ''; 368 369 $message .= ($_POST['datebox_option'][5] == '') ? __( 'Field "Erliest" - required! ', 'buddypress' ) : ''; 370 $_POST['datebox_option'][5] = (isset($_POST['datebox_option'][5])) 371 ? mb_substr(intval($_POST['datebox_option'][5]), 0, 5, 'UTF-8') : date("Y") - 100; 372 373 $message .= ($_POST['datebox_option'][5] == '') ? __( 'Field "Latest" - required! ', 'buddypress' ) : ''; 374 $_POST['datebox_option'][6] = (isset($_POST['datebox_option'][6])) 375 ? mb_substr(abs(intval($_POST['datebox_option'][6])), 0, 4, 'UTF-8') : date("Y") - 18; 376 377 $message .= ($_POST['datebox_option'][5] > $_POST['datebox_option'][6]) ? __( 'Wrong Erliest/Latest range! ', 'buddypress' ) : ''; 378 379 ksort($_POST['datebox_option'], SORT_NUMERIC); 380 reset($_POST['datebox_option']); 381 382 if(!empty($message)){ 383 $GLOBALS['message'] = $message; 384 } 385 } 386 336 387 /** 337 388 * Handles the adding or editing of profile field data for a user. 338 389 * … … function xprofile_admin_manage_field( $group_id, $field_id = null ) { 353 404 $field->group_id = $group_id; 354 405 355 406 if ( isset( $_POST['saveField'] ) ) { 407 408 xprofile_admin_manage_datebox_option($message); 409 356 410 if ( BP_XProfile_Field::admin_validate() ) { 357 411 $field->is_required = $_POST['required']; 358 412 $field->type = $_POST['fieldtype']; -
src/bp-xprofile/bp-xprofile-functions.php
diff --git a/src/bp-xprofile/bp-xprofile-functions.php b/src/bp-xprofile/bp-xprofile-functions.php index 0996257..1b059f7 100644
a b function xprofile_set_field_data( $field, $user_id, $value, $is_required = false 434 434 } 435 435 436 436 // For certain fields, only certain parameters are acceptable, so add them to the whitelist. 437 if ( $field_type_obj->supports_options ) {437 if ( $field_type_obj->supports_options && $field_type_obj->name != 'Date Selector' ) { 438 438 $field_type_obj->set_whitelist_values( wp_list_pluck( $field->get_children(), 'name' ) ); 439 439 } 440 440 -
src/bp-xprofile/bp-xprofile-screens.php
diff --git a/src/bp-xprofile/bp-xprofile-screens.php b/src/bp-xprofile/bp-xprofile-screens.php index 103e24e..6401e98 100644
a b function xprofile_screen_edit_profile() { 65 65 return; 66 66 } 67 67 68 68 69 // No errors. 69 70 $errors = false; 70 71 … … function xprofile_screen_edit_profile() { 90 91 if ( !isset( $_POST['field_' . $field_id] ) ) { 91 92 92 93 if ( !empty( $_POST['field_' . $field_id . '_day'] ) && !empty( $_POST['field_' . $field_id . '_month'] ) && !empty( $_POST['field_' . $field_id . '_year'] ) ) { 94 93 95 // Concatenate the values. 94 $date_value = $_POST['field_' . $field_id . '_day'] . ' ' . $_POST['field_' . $field_id . '_month'] . ' ' . $_POST['field_' . $field_id . '_year']; 96 $eng_months = array( 1=>'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ); 97 $_POST['field_' . $field_id . '_month'] = array_search($_POST['field_' . $field_id . '_month'], $eng_months); 98 $date_value = $_POST['field_' . $field_id . '_year'] . '-' . $_POST['field_' . $field_id . '_month'] . '-' . $_POST['field_' . $field_id . '_day']; 95 99 96 100 // Turn the concatenated value into a timestamp. 97 $_POST['field_' . $field_id] = date( 'Y-m-d H:i:s', strtotime( $date_value ) ); 101 $date = new DateTime($date_value); 102 $_POST['field_' . $field_id] = $date->getTimestamp(); 98 103 } 99 104 100 105 } … … function xprofile_screen_edit_profile() { 114 119 115 120 // Reset the errors var. 116 121 $errors = false; 117 118 122 // Now we've checked for required fields, lets save the values. 119 123 $old_values = $new_values = array(); 120 124 foreach ( (array) $posted_field_ids as $field_id ) { -
src/bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php
diff --git a/src/bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php b/src/bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php index 2098cb9..52ceb58 100644
a b class BP_XProfile_Field_Type_Datebox extends BP_XProfile_Field_Type { 28 28 $this->category = _x( 'Single Fields', 'xprofile field type category', 'buddypress' ); 29 29 $this->name = _x( 'Date Selector', 'xprofile field type', 'buddypress' ); 30 30 31 $this->supports_options = true; # This parameter - added 32 31 33 $this->set_format( '/^\d{4}-\d{1,2}-\d{1,2} 00:00:00$/', 'replace' ); // "Y-m-d 00:00:00" 32 34 33 35 /** … … class BP_XProfile_Field_Type_Datebox extends BP_XProfile_Field_Type { 41 43 do_action( 'bp_xprofile_field_type_datebox', $this ); 42 44 } 43 45 46 public function is_valid($value) { 47 if ($value) { 48 return true; 49 } 50 return false; 51 } 52 44 53 /** 45 54 * Output the edit field HTML for this field type. 46 55 * … … class BP_XProfile_Field_Type_Datebox extends BP_XProfile_Field_Type { 162 171 163 172 // If MySQL timestamp. 164 173 } else { 165 $day = mysql2date( 'j', $date ); 166 $month = mysql2date( 'F', $date, false ); // Not localized, so that selected() works below. 167 $year = mysql2date( 'Y', $date ); 174 $DT = new DateTime($date); // problem 2038 year http://php.net/manual/en/class.datetime.php 175 $day = $DT->format('j'); 176 $month = $DT->format('F'); 177 $year = $DT->format('Y'); 168 178 } 169 179 } 170 180 … … class BP_XProfile_Field_Type_Datebox extends BP_XProfile_Field_Type { 226 236 case 'year': 227 237 $html = sprintf( '<option value="" %1$s>%2$s</option>', selected( $year, 0, false ), /* translators: no option picked in select box */ __( '----', 'buddypress' ) ); 228 238 229 for ( $i = 2037; $i > 1901; $i-- ) { 230 $html .= sprintf( '<option value="%1$s" %2$s>%3$s</option>', (int) $i, selected( $year, $i, false ), (int) $i ); 239 240 $ord = get_option('BPOptRegData'); 241 $ord = unserialize($ord); 242 $opt = $this->field_obj->get_children(); 243 244 245 if(isset($opt[2]->name)){ 246 $ord['range-curr'] = ($opt[2]->name == 'year') ? 'year' : 'ago'; 247 } else { 248 $ord['range-curr'] = 'ago'; 249 } 250 251 if(isset($opt[3]->name)) { 252 $ord['range-year']['ago']['max'] = $opt[3]->name; 253 } 254 255 if(isset($opt[4]->name)){ 256 $ord['range-year']['ago']['min'] = $opt[4]->name; 231 257 } 258 259 if(isset($opt[5]->name)){ 260 $ord['range-year']['year']['earliest'] = $opt[5]->name; 261 } 262 263 if(isset($opt[6]->name)){ 264 $ord['range-year']['year']['latest'] = $opt[6]->name; 265 } 266 267 if($ord['range-curr'] == 'ago'){ 268 $ord['range-year']['year']['latest'] = date("Y") + $ord['range-year']['ago']['min']; 269 $ord['range-year']['year']['earliest'] = date("Y") + $ord['range-year']['ago']['max']; 270 } 271 272 for ( $i = $ord['range-year']['year']['latest']; $i > ($ord['range-year']['year']['earliest']-1); $i-- ) { 273 $html .= sprintf( '<option value="%1$s" %2$s>%3$s</option>', (int) $i, selected( $year, $i, false ), (int) $i ); 274 } 232 275 break; 233 276 } 234 277 … … class BP_XProfile_Field_Type_Datebox extends BP_XProfile_Field_Type { 272 315 $year_r = bp_parse_args( $raw_properties, array( 273 316 'id' => bp_get_the_profile_field_input_name() . '_year', 274 317 'name' => bp_get_the_profile_field_input_name() . '_year' 275 ) ); ?>318 ) ); 276 319 277 <label for="<?php bp_the_profile_field_input_name(); ?>_day" class="screen-reader-text"><?php esc_html_e( 'Select day', 'buddypress' ); ?></label> 278 <select <?php echo $this->get_edit_field_html_elements( $day_r ); ?>> 279 <?php bp_the_profile_field_options( array( 'type' => 'day' ) ); ?> 280 </select> 320 // Change the location of selects, depending on the "date_format" 321 322 ob_start(); 323 ?> 324 <select <?php echo $this->get_edit_field_html_elements( $day_r ); ?>> 325 <?php bp_the_profile_field_options( array( 'type' => 'day' ) ); ?> 326 </select> 327 <?php 328 $selectDay = ob_get_contents(); 329 ob_end_clean(); 330 331 ob_start(); 332 ?> 333 <select <?php echo $this->get_edit_field_html_elements( $month_r ); ?>> 334 <?php bp_the_profile_field_options( array( 'type' => 'month' ) ); ?> 335 </select> 336 <?php 337 $selectMonth = ob_get_contents(); 338 ob_end_clean(); 339 340 ob_start(); 341 ?> 342 <select <?php echo $this->get_edit_field_html_elements( $year_r ); ?>> 343 <?php bp_the_profile_field_options( array( 'type' => 'year' ) ); ?> 344 </select> 345 <?php 346 $selectYear = ob_get_contents(); 347 ob_end_clean(); 348 349 // Change the location of selects, depending on the "date_format" 350 351 $format = get_option('date_format', 'd/m/Y'); 352 353 switch($format) 354 { 355 case 'm/d/Y';#m/d/Y 356 case 'm-d-Y'; 357 case 'm.d.Y'; 358 echo $selectMonth; 359 echo $selectDay; 360 echo $selectYear; 361 break; 362 363 case 'd/m/Y'; #d/m/Y 364 case 'd-m-Y'; 365 case 'd.m.Y'; 366 echo $selectDay; 367 echo $selectMonth; 368 echo $selectYear; 369 break; 370 371 default; #Y-m-d 372 echo $selectYear; 373 echo $selectMonth; 374 echo $selectDay; 375 break; 376 } 281 377 282 <label for="<?php bp_the_profile_field_input_name(); ?>_month" class="screen-reader-text"><?php esc_html_e( 'Select month', 'buddypress' ); ?></label> 283 <select <?php echo $this->get_edit_field_html_elements( $month_r ); ?>> 284 <?php bp_the_profile_field_options( array( 'type' => 'month' ) ); ?> 285 </select> 378 ?> 286 379 287 <label for="<?php bp_the_profile_field_input_name(); ?>_year" class="screen-reader-text"><?php esc_html_e( 'Select year', 'buddypress' ); ?></label>288 <select <?php echo $this->get_edit_field_html_elements( $year_r ); ?>>289 <?php bp_the_profile_field_options( array( 'type' => 'year' ) ); ?>290 </select>291 380 292 381 <?php 293 382 } … … class BP_XProfile_Field_Type_Datebox extends BP_XProfile_Field_Type { 302 391 * @param string $control_type Optional. HTML input type used to render the current 303 392 * field's child options. 304 393 */ 305 public function admin_new_field_html( BP_XProfile_Field $current_field, $control_type = '' ) {} 394 public function admin_new_field_html( BP_XProfile_Field $current_field, $control_type = '' ) { 395 //parent::admin_new_field_html( $current_field, 'checkbox' ); 396 $type = array_search( get_class( $this ), bp_xprofile_get_field_types() ); 397 398 if ( false === $type ) { 399 return; 400 } 401 402 $class = $current_field->type != $type ? 'display: none;' : ''; 403 $current_type_obj = bp_xprofile_create_field_type( $type ); 404 $SET = $current_field->BPOptRegData; 405 $SET = unserialize($SET); 406 $OPT = $current_field->get_children( true ); 407 408 409 ?> 410 411 <div id="<?php echo esc_attr( $type ); ?>" class="postbox bp-options-box" style="<?php echo esc_attr( $class ); ?> margin-top: 15px;"> 412 <h3><?php esc_html_e( 'Please enter options for this Field:', 'buddypress' ); ?></h3> 413 414 <div class="inside"> 415 416 <div id="datebox_div1" class="bp-option sortable"> 417 418 <h2 style="font-size: 23px;">Date field</h2> 419 420 <table class="form-table" style="margin: 8px 13px;"> 421 <tr> 422 <th style="width: 100px;">Date format</th> 423 <td> 424 <fieldset> 425 426 <legend class="screen-reader-text"><span>Date format</span></legend> 427 <?php 428 $date_formats = array_unique( apply_filters( 'date_formats', array( __( 'F j, Y' ), 'Y-m-d', 'm/d/Y', 'd/m/Y' ) ) ); 429 ?> 430 <?php if(!empty($date_formats)): ?> 431 <?php foreach ( $date_formats as $key => $format ): ?> 432 <?php 433 $checked = ''; 434 if($OPT[7]->name == $format || (!$OPT[7]->name && !$key)) { 435 $checked = 'checked'; 436 $custom_format = false; 437 } 438 ?> 439 440 <label title='<?=esc_attr($format); ?>'> 441 <input <?=$checked; ?> type='radio' name='datebox_option[7]' value='<?= esc_attr($format); ?>' /> 442 <span class="date-time-text format-i18n"><?=date_i18n( $format );?></span> 443 <code><?=$format?></code> 444 </label><br/> 445 446 <?php endforeach;?> 447 <?php endif; ?> 448 449 <label> 450 <input type="radio" <?= ($SET['show-time'] == 'yes' OR $OPT[1]->name == 'yes') ? ' checked="checked" ' : ''; ?> value="elapsed" id="date_format_elapsed_radio" name="datebox_option[7]"> 451 Time elapsed 452 <span style="padding-left: 15px;"> Examples: </span> 453 <code>4 years ago</code>, 454 <code>4 years from now</code> 455 </label> 456 457 <label> 458 <input type="radio" <?=($custom_format)? 'checked': ''; ?> value="custom" id="date_format_custom_radio" name="datebox_option[7]"> 459 Arbitrarily: 460 <input type="text" style="width: 80px;" class="small-text" value='<?= esc_attr($OPT[7]->name); ?>' id="date_format_custom" name="date_format_custom"> 461 <span style="padding-left: 15px;"> Example: </span> 462 <code>d.m.Y</code> 463 </label><br/> 464 465 </fieldset> 466 </td> 467 </tr> 468 <tr> 469 <th style="width: 100px;">Year range</th> 470 <td> 471 <fieldset> 472 <legend class="screen-reader-text"><span>Year range</span></legend> 473 474 <label> 475 <input type="radio" name="datebox_option[2]" value="year" 476 <?= ($SET['range-curr'] == 'year' || $OPT[2]->name == 'year') ? ' checked="checked" ' : ''; ?> /> 477 478 <span class="date-time-text format-i18n">From</span> 479 <input type="text" name="datebox_option[5]" size="3" maxlength="5" 480 value="<?= isset($OPT[5]->name) ? $OPT[5]->name : $SET['range-year']['year']['earliest']; ?>" /> 481 482 <span class="date-time-text format-i18n" style="padding-left:7px;padding-right:7px;">to</span> 483 <input type="text" name="datebox_option[6]" size="3" maxlength="4" 484 value="<?= isset($OPT[6]->name) ? $OPT[6]->name : $SET['range-year']['year']['latest']; ?>" /> 485 </label><br/> 486 487 <label> 488 <input type="radio" name="datebox_option[2]" value="ago" 489 <?= ($SET['range-curr'] == 'ago' || $OPT[2]->name == 'ago') ? ' checked="checked" ' : ''; ?> /> 490 491 <span class="date-time-text format-i18n">From</span> 492 <input type="text" name="datebox_option[3]" size="3" maxlength="4" 493 value="<?= isset($OPT[3]->name) ? abs($OPT[3]->name) : $SET['range-year']['ago']['max']; ?>" /> 494 <select name="datebox_option_3_from_type"> 495 <option value="0" <?php if (isset($OPT[3]->name) && intval($OPT[3]->name) < 0) echo 'selected="selected"'; ?>>years ago</option> 496 <option value="1" <?php if (isset($OPT[3]->name) && intval($OPT[3]->name) > 0) echo 'selected="selected"'; ?>>years from now</option> 497 </select> 498 499 <span class="date-time-text format-i18n" style="padding-left:7px;padding-right:7px;">to</span> 500 <input type="text" name="datebox_option[4]" size="3" maxlength="5" 501 value="<?= isset($OPT[4]->name) ? abs($OPT[4]->name) : $SET['range-year']['ago']['min']; ?>" /> 502 <select name="datebox_option_3_to_type"> 503 <option value="0" <?php if (isset($OPT[4]->name) && intval($OPT[4]->name) < 0) echo 'selected="selected"'; ?>>years ago</option> 504 <option value="1" <?php if (isset($OPT[4]->name) && intval($OPT[4]->name) > 0) echo 'selected="selected"'; ?>>years from now</option> 505 </select> 506 </label><br/> 507 508 </fieldset> 509 </td> 510 </tr> 511 <tr> 512 <td></td> 513 <td colspan="3"><b>Note</b>: Year range is allowed between 1902 and 2037 years only.</td> 514 </tr> 515 </table> 516 </div> 517 518 <input type="hidden" name="datebox_option_number" id="datebox_option_number" value="8"/> 519 <input type="hidden" name="sort_order_datebox" id="sort_order_datebox" value="custom"/> 520 521 <?php /*div id="datebox_more"></div> 522 <p><a href="javascript:add_option('datebox')">Add Another Option</a></p*/ ?> 523 </div> 524 </div> 525 <script> 526 jQuery(document).ready(function($) { 527 $("input[name='date_format']").click(function(){ 528 if ( "date_format_custom_radio" != $(this).attr("id") ) 529 $( "input[name='date_format_custom']" ).val( $( this ).val() ).siblings( '.example' ).text( $( this ).parent( 'label' ).text() ); 530 }); 531 532 $("input[name='date_format_custom']").focus(function(){ 533 $( '#date_format_custom_radio' ).prop( 'checked', true ); 534 }); 535 536 $("input[name='date_format_custom'], input[name='time_format_custom']").change( function() { 537 var format = $(this); 538 $('#date_format_custom_radio' ).val(format.val()); 539 format.siblings( '.spinner' ).addClass( 'is-active' ); 540 $.post(ajaxurl, { 541 action: 'date_format_custom' == format.attr('name') ? 'date_format' : 'time_format', 542 date : format.val() 543 }, function(d) { 544 format.siblings( '.spinner' ).removeClass( 'is-active' ); format.siblings('.example').text(d); 545 546 } ); 547 }); 548 }); 549 </script> 550 551 <?php 552 } 306 553 307 554 /** 308 555 * Format Date values for display. … … class BP_XProfile_Field_Type_Datebox extends BP_XProfile_Field_Type { 322 569 $field_value = strtotime( $field_value ); 323 570 } 324 571 325 return bp_format_time( $field_value, true, false ); 572 global $wpdb, $bp; 573 $option = unserialize(get_option( 'BPOptRegData')); 574 //$uid = bp_displayed_user_id(); 575 $parent_id = isset($GLOBALS['field']->id) ? $GLOBALS['field']->id : $field_id; 576 $sort_sql = 'ORDER BY option_order ASC'; 577 $sql = $wpdb->prepare( "SELECT * FROM {$bp->profile->table_name_fields} WHERE parent_id = %d $sort_sql", $parent_id); 578 $opt = $wpdb->get_results( $sql ); 579 580 $option['date-format'] = $opt[7]->name; 581 582 if(isset($opt[0]) && isset($opt[1])){ 583 $option['show-year'] = $opt[0]->name; 584 $option['show-time'] = $opt[1]->name; 585 } 586 587 588 if($option['show-time'] == 'yes'){ 589 $field_value = self::formatDateByBPOptRegData($field_value,$option, true, true); 590 591 }else { 592 $field_value = self::formatDateByBPOptRegData($field_value,$option, true, false); 593 } 594 595 return $field_value; 326 596 } 597 598 private function formatDateByBPOptRegData( $time, $option,$localize_time = true, $show) { 599 600 if ( ! isset( $time ) || ! is_numeric( $time ) ) { 601 return false; 602 } 603 604 if ( ! empty( $localize_time ) ) { 605 $root_blog_offset = get_blog_option( bp_get_root_blog_id(), 'gmt_offset' ); 606 }else{ 607 $root_blog_offset = false; 608 } 609 610 $time_offset = $time + ( $root_blog_offset * 3600 ); 611 612 if($show === false){ 613 $date = date_i18n($option['date-format'], $time_offset ); 614 } else { // Here we calculate the number of years 615 $current_year = intval(date("Y")); 616 $selected_year = intval(date("Y", $time_offset)); 617 if ($selected_year > $current_year) { 618 $date = ' ' . ($selected_year - $current_year) . __(' years from now', 'buddypress'); 619 } else { 620 $date = ' ' . ($current_year - $selected_year) . __(' years ago', 'buddypress'); 621 } 622 } 623 624 return $date; 625 } 327 626 } -
src/bp-xprofile/classes/class-bp-xprofile-field.php
diff --git a/src/bp-xprofile/classes/class-bp-xprofile-field.php b/src/bp-xprofile/classes/class-bp-xprofile-field.php index 43155e1..ace0ccb 100644
a b class BP_XProfile_Field { 162 162 */ 163 163 protected $member_types; 164 164 165 166 167 public $BPOptRegData = array(); 168 165 169 /** 166 170 * Initialize and/or populate profile field. 167 171 * … … class BP_XProfile_Field { 181 185 $this->type_obj = bp_xprofile_create_field_type( 'textbox' ); 182 186 $this->type_obj->field_obj = $this; 183 187 } 188 189 $this->BPOptRegData = $this->runCheckBPOptRegDate(); 190 } 191 192 193 public function runCheckBPOptRegDate() 194 { 195 196 197 $BPOptRegData = get_option('BPOptRegData'); 198 199 //if($BPOptRegData === false){ 200 201 $serialize = serialize( 202 array( 203 'show-year' => 'yes', 204 'show-time' => 'no', 205 'range-curr' => 'year', 206 'range-year' => array( 207 'ago' => array('min' => 18, 'max' => 100), 208 'year' => array('earliest' => (date("Y")-101), 'latest' => (date("Y")-18)) 209 ), 210 'date-format' => "Y-m-d", 211 ) 212 ); 213 214 add_option('BPOptRegData', $serialize, '', 'no'); 215 216 return $serialize; 217 218 //} else { 219 // return $BPOptRegData; 220 //} 184 221 } 185 222 186 223 /**
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)