Ticket #5781: 5781.mysql2date.patch
| File 5781.mysql2date.patch, 13.3 KB (added by , 10 years ago) |
|---|
-
src/bp-activity/bp-activity-admin.php
763 763 <?php 764 764 // Translators: Publish box date format, see http://php.net/date. 765 765 $datef = __( 'M j, Y @ G:i', 'buddypress' ); 766 $date = date_i18n( $datef, strtotime($item->date_recorded ) );766 $date = date_i18n( $datef, mysql2date( 'G', $item->date_recorded ) ); 767 767 ?> 768 768 <span id="timestamp"><?php printf( __( 'Submitted on: %s', 'buddypress' ), '<strong>' . $date . '</strong>' ); ?></span> <a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" tabindex='4'><?php _e( 'Edit', 'buddypress' ); ?></a> 769 769 -
src/bp-activity/bp-activity-filters.php
546 546 return $classes; 547 547 } 548 548 549 $classes .= ' date-recorded-' . strtotime($activity_date );549 $classes .= ' date-recorded-' . mysql2date( 'G', $activity_date ); 550 550 551 551 return $classes; 552 552 } … … 589 589 while ( bp_activities() ) { 590 590 bp_the_activity(); 591 591 592 $atime = strtotime(bp_get_activity_date_recorded() );592 $atime = mysql2date( 'G', bp_get_activity_date_recorded() ); 593 593 if ( $last_activity_recorded < $atime ) { 594 594 $last_activity_recorded = $atime; 595 595 } -
src/bp-activity/classes/class-bp-activity-activity.php
1765 1765 if ( ! empty( $filter_array['since'] ) ) { 1766 1766 // Validate that this is a proper Y-m-d H:i:s date. 1767 1767 // Trick: parse to UNIX date then translate back. 1768 $translated_date = date( 'Y-m-d H:i:s', strtotime($filter_array['since'] ) );1768 $translated_date = date( 'Y-m-d H:i:s', mysql2date( 'G', $filter_array['since'] ) ); 1769 1769 if ( $translated_date === $filter_array['since'] ) { 1770 1770 $filter_sql[] = "a.date_recorded > '{$translated_date}'"; 1771 1771 } -
src/bp-activity/classes/class-bp-activity-feed.php
334 334 335 335 // Cache-related variables. 336 336 $last_modified = mysql2date( 'D, d M Y H:i:s O', bp_activity_get_last_updated(), false ); 337 $modified_timestamp = strtotime($last_modified );337 $modified_timestamp = mysql2date( 'G', $last_modified ); 338 338 $etag = md5( $last_modified ); 339 339 340 340 // Set cache-related headers. … … 365 365 366 366 // Get client last modified timestamp from supported user agents. 367 367 $client_last_modified = empty( $_SERVER['HTTP_IF_MODIFIED_SINCE'] ) ? '' : trim( $_SERVER['HTTP_IF_MODIFIED_SINCE'] ); 368 $client_modified_timestamp = $client_last_modified ? strtotime($client_last_modified ) : 0;368 $client_modified_timestamp = $client_last_modified ? mysql2date( 'G', $client_last_modified ) : 0; 369 369 370 370 // Set 304 status if feed hasn't been updated since last fetch. 371 371 if ( ( $client_last_modified && $client_etag ) ? -
src/bp-activity/classes/class-bp-activity-list-table.php
630 630 sprintf( 631 631 /* translators: 1: activity date, 2: activity time */ 632 632 __( '%1$s at %2$s', 'buddypress' ), 633 date_i18n( bp_get_option( 'date_format' ), strtotime($item['date_recorded'] ) ),633 date_i18n( bp_get_option( 'date_format' ), mysql2date( 'G', $item['date_recorded'] ) ), 634 634 get_date_from_gmt( $item['date_recorded'], bp_get_option( 'time_format' ) ) 635 635 ) 636 636 ) -
src/bp-activity/classes/class-bp-activity-oembed-extension.php
155 155 protected function set_fallback_html( $item_id ) { 156 156 $activity = new BP_Activity_Activity( $item_id ); 157 157 $mentionname = bp_activity_do_mentions() ? ' (@' . bp_activity_get_user_mentionname( $activity->user_id ) . ')' : ''; 158 $date = date_i18n( get_option( 'date_format' ), strtotime($activity->date_recorded ) );158 $date = date_i18n( get_option( 'date_format' ), mysql2date( 'G', $activity->date_recorded ) ); 159 159 160 160 // Make sure we can use some activity functions that depend on the loop. 161 161 $GLOBALS['activities_template'] = new stdClass; -
src/bp-blogs/bp-blogs-activity.php
596 596 return $open; 597 597 */ 598 598 599 if ( time() - strtotime($activity->date_recorded ) > ( $days_old * DAY_IN_SECONDS ) ) {599 if ( time() - mysql2date( 'G', $activity->date_recorded ) > ( $days_old * DAY_IN_SECONDS ) ) { 600 600 return false; 601 601 } 602 602 -
src/bp-blogs/bp-blogs-functions.php
190 190 } 191 191 192 192 // Update blog last activity timestamp 193 if ( ! empty( $blog->last_updated ) && false !== strtotime($blog->last_updated ) ) {193 if ( ! empty( $blog->last_updated ) && false !== mysql2date( 'G', $blog->last_updated ) ) { 194 194 bp_blogs_update_blogmeta( $blog->blog_id, 'last_activity', $blog->last_updated ); 195 195 } 196 196 } -
src/bp-core/bp-core-functions.php
1438 1438 1439 1439 // Make sure it's numeric. 1440 1440 if ( ! is_numeric( $activity ) ) { 1441 $activity = strtotime($activity );1441 $activity = mysql2date( 'G', $activity ); 1442 1442 } 1443 1443 1444 1444 // Get current time. -
src/bp-friends/classes/class-bp-friends-friendship.php
447 447 return 0; 448 448 } 449 449 450 return ( strtotime( $a["date_recorded"] ) < strtotime($b["date_recorded"] ) ) ? 1 : -1;450 return ( mysql2date( "G", $a["date_recorded"] ) < mysql2date( "G", $b["date_recorded"] ) ) ? 1 : -1; 451 451 ' ) ); 452 452 453 453 $retval = array(); -
src/bp-groups/bp-groups-activity.php
565 565 $membership = new BP_Groups_Member( $user_id, $group_id ); 566 566 567 567 // Check the time period, and maybe delete their recent group activity. 568 if ( time() <= strtotime( '+5 minutes', (int) strtotime($membership->date_modified ) ) ) {568 if ( time() <= strtotime( '+5 minutes', (int) mysql2date( 'G', $membership->date_modified ) ) ) { 569 569 bp_activity_delete( array( 570 570 'component' => buddypress()->groups->id, 571 571 'type' => 'joined_group', -
src/bp-groups/bp-groups-template.php
2219 2219 2220 2220 <h5><?php echo bp_core_get_userlink( $admin->user_id ) ?></h5> 2221 2221 <span class="activity"> 2222 <?php echo bp_core_get_last_activity( strtotime($admin->date_modified ), __( 'joined %s', 'buddypress') ); ?>2222 <?php echo bp_core_get_last_activity( mysql2date( 'G', $admin->date_modified ), __( 'joined %s', 'buddypress') ); ?> 2223 2223 </span> 2224 2224 2225 2225 <?php if ( bp_is_active( 'friends' ) ) : ?> … … 2295 2295 2296 2296 <h5><?php echo bp_core_get_userlink( $mod->user_id ) ?></h5> 2297 2297 2298 <span class="activity"><?php echo bp_core_get_last_activity( strtotime($mod->date_modified ), __( 'joined %s', 'buddypress') ); ?></span>2298 <span class="activity"><?php echo bp_core_get_last_activity( mysql2date( 'G', $mod->date_modified ), __( 'joined %s', 'buddypress') ); ?></span> 2299 2299 2300 2300 <?php if ( bp_is_active( 'friends' ) ) : ?> 2301 2301 -
src/bp-members/bp-members-template.php
611 611 612 612 // Calculate some times. 613 613 $current_time = bp_core_current_time( true, 'timestamp' ); 614 $last_activity = strtotime($members_template->member->last_activity );614 $last_activity = mysql2date( 'G', $members_template->member->last_activity ); 615 615 $still_online = strtotime( '+5 minutes', $last_activity ); 616 616 617 617 // Has the user been active recently? -
src/bp-members/classes/class-bp-members-admin.php
1003 1003 1004 1004 // Translators: Publish box date format, see http://php.net/date. 1005 1005 $datef = __( 'M j, Y @ G:i', 'buddypress' ); 1006 $date = date_i18n( $datef, strtotime($user->user_registered ) );1006 $date = date_i18n( $datef, mysql2date( 'G', $user->user_registered ) ); 1007 1007 ?> 1008 1008 <span id="timestamp"><?php printf( __( 'Registered on: %s', 'buddypress' ), '<strong>' . $date . '</strong>' ); ?></span> 1009 1009 </div> … … 1063 1063 } 1064 1064 1065 1065 $datef = __( 'M j, Y @ G:i', 'buddypress' ); 1066 $date = date_i18n( $datef, strtotime($last_active ) ); ?>1066 $date = date_i18n( $datef, mysql2date( 'G', $last_active ) ); ?> 1067 1067 1068 1068 <ul> 1069 1069 <li class="bp-members-profile-stats"><?php printf( __( 'Last active: %1$s', 'buddypress' ), '<strong>' . $date . '</strong>' ); ?></li> -
src/bp-messages/bp-messages-template.php
632 632 * 633 633 * @param string $value Formatted date of the last post in the current thread. 634 634 */ 635 return apply_filters( 'bp_get_message_thread_last_post_date', bp_format_time( strtotime(bp_get_message_thread_last_post_date_raw() ) ) );635 return apply_filters( 'bp_get_message_thread_last_post_date', bp_format_time( mysql2date( 'G', bp_get_message_thread_last_post_date_raw() ) ) ); 636 636 } 637 637 638 638 /** … … 1081 1081 * 1082 1082 * @param string $value Formatted post date of the current notice in the loop. 1083 1083 */ 1084 return apply_filters( 'bp_get_message_notice_post_date', bp_format_time( strtotime($messages_template->thread->date_sent ) ) );1084 return apply_filters( 'bp_get_message_notice_post_date', bp_format_time( mysql2date( 'G', $messages_template->thread->date_sent ) ) ); 1085 1085 } 1086 1086 1087 1087 /** … … 1968 1968 * 1969 1969 * @param string $value Timestamp of the date sent value for the current message. 1970 1970 */ 1971 return apply_filters( 'bp_get_the_thread_message_date_sent', strtotime($thread_template->message->date_sent ) );1971 return apply_filters( 'bp_get_the_thread_message_date_sent', mysql2date( 'G', $thread_template->message->date_sent ) ); 1972 1972 } 1973 1973 1974 1974 /** -
src/bp-messages/classes/class-bp-messages-thread.php
518 518 519 519 // Sort threads by date_sent. 520 520 foreach( (array) $thread_ids as $thread ) { 521 $sorted_threads[ $thread->thread_id ] = strtotime($thread->date_sent );521 $sorted_threads[ $thread->thread_id ] = mysql2date( 'G', $thread->date_sent ); 522 522 } 523 523 524 524 arsort( $sorted_threads ); -
src/bp-templates/bp-legacy/buddypress/assets/embeds/header-activity.php
21 21 <span class="bp-embed-mentionname">@<?php bp_displayed_user_mentionname(); ?> · </span> 22 22 <?php endif; ?> 23 23 24 <span class="bp-embed-timestamp"><a href="<?php bp_activity_thread_permalink(); ?>"><?php echo date_i18n( get_option( 'time_format' ) . ' - ' . get_option( 'date_format' ), strtotime(bp_get_activity_date_recorded() ) ); ?></a></span>24 <span class="bp-embed-timestamp"><a href="<?php bp_activity_thread_permalink(); ?>"><?php echo date_i18n( get_option( 'time_format' ) . ' - ' . get_option( 'date_format' ), mysql2date( 'G', bp_get_activity_date_recorded() ) ); ?></a></span> 25 25 </p> 26 26 </div> -
src/bp-xprofile/bp-xprofile-activity.php
306 306 * @param int $value Throttle time, in seconds. 307 307 */ 308 308 $throttle_period = apply_filters( 'bp_xprofile_updated_profile_activity_throttle_time', HOUR_IN_SECONDS * 2 ); 309 $then = strtotime($existing['activities'][0]->date_recorded );309 $then = mysql2date( 'G', $existing['activities'][0]->date_recorded ); 310 310 $now = bp_core_current_time( true, 'timestamp' ); 311 311 312 312 // Bail if throttled.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)