Skip to:
Content

Changeset 2416


Ignore:
Timestamp:
01/24/10 13:13:15 (4 years ago)
Author:
apeatling
Message:

Fixes #1641

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity.php

    r2405 r2416  
    11<?php 
    22 
    3 define ( 'BP_ACTIVITY_DB_VERSION', '2031' ); 
     3define ( 'BP_ACTIVITY_DB_VERSION', '2040' ); 
    44 
    55/* Define the slug for the component */ 
     
    469469        'item_id' => false, // Optional: The ID of the specific item being recorded, e.g. a blog_id 
    470470        'secondary_item_id' => false, // Optional: A second ID used to further filter e.g. a comment_id 
    471         'recorded_time' => time(), // The time that this activity was recorded 
     471        'recorded_time' => gmdate( "Y-m-d H:i:s" ), // The GMT time that this activity was recorded 
    472472        'hide_sitewide' => false // Should this be hidden on the sitewide activity stream? 
    473473    ); 
  • trunk/bp-activity/bp-activity-classes.php

    r2405 r2416  
    5656        /* If we have an existing ID, update the activity item, otherwise insert it. */ 
    5757        if ( $this->id ) 
    58             $q = $wpdb->prepare( "UPDATE {$bp->activity->table_name} SET user_id = %d, component = %s, type = %s, action = %s, content = %s, primary_link = %s, date_recorded = FROM_UNIXTIME(%d), item_id = %s, secondary_item_id = %s, hide_sitewide = %d WHERE id = %d", $this->user_id, $this->component, $this->type, $this->action, $this->content, $this->primary_link, $this->date_recorded, $this->item_id, $this->secondary_item_id, $this->hide_sitewide, $this->id ); 
     58            $q = $wpdb->prepare( "UPDATE {$bp->activity->table_name} SET user_id = %d, component = %s, type = %s, action = %s, content = %s, primary_link = %s, date_recorded = %s, item_id = %s, secondary_item_id = %s, hide_sitewide = %d WHERE id = %d", $this->user_id, $this->component, $this->type, $this->action, $this->content, $this->primary_link, $this->date_recorded, $this->item_id, $this->secondary_item_id, $this->hide_sitewide, $this->id ); 
    5959        else 
    60             $q = $wpdb->prepare( "INSERT INTO {$bp->activity->table_name} ( user_id, component, type, action, content, primary_link, date_recorded, item_id, secondary_item_id, hide_sitewide ) VALUES ( %d, %s, %s, %s, %s, %s, FROM_UNIXTIME(%d), %s, %s, %d )", $this->user_id, $this->component, $this->type, $this->action, $this->content, $this->primary_link, $this->date_recorded, $this->item_id, $this->secondary_item_id, $this->hide_sitewide ); 
     60            $q = $wpdb->prepare( "INSERT INTO {$bp->activity->table_name} ( user_id, component, type, action, content, primary_link, date_recorded, item_id, secondary_item_id, hide_sitewide ) VALUES ( %d, %s, %s, %s, %s, %s, %s, %s, %s, %d )", $this->user_id, $this->component, $this->type, $this->action, $this->content, $this->primary_link, $this->date_recorded, $this->item_id, $this->secondary_item_id, $this->hide_sitewide ); 
    6161 
    6262        if ( !$wpdb->query( $q ) ) 
  • trunk/bp-activity/bp-activity-templatetags.php

    r2392 r2416  
    530530    $content = urldecode($content); 
    531531 
    532     return apply_filters( 'bp_activity_insert_time_since', @sprintf( $content, @sprintf( __( '&nbsp; %s ago', 'buddypress' ), bp_core_time_since( strtotime( $date ) ) ) ) ); 
     532    return apply_filters( 'bp_activity_insert_time_since', @sprintf( $content, @sprintf( __( '&nbsp; %s ago', 'buddypress' ), bp_core_time_since( $date ) ) ) ); 
    533533} 
    534534 
  • trunk/bp-blogs.php

    r2405 r2416  
    253253        'item_id' => false, 
    254254        'secondary_item_id' => false, 
    255         'recorded_time' => time(), 
    256255        'hide_sitewide' => false 
    257256    ); 
     
    279278    ) ); 
    280279 
    281     return bp_activity_add( array( 'id' => $id, 'user_id' => $user_id, 'action' => $action, 'content' => $content, 'primary_link' => $primary_link, 'component' => $component, 'type' => $type, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, 'recorded_time' => $recorded_time, 'hide_sitewide' => $hide_sitewide ) ); 
     280    return bp_activity_add( array( 'id' => $id, 'user_id' => $user_id, 'action' => $action, 'content' => $content, 'primary_link' => $primary_link, 'component' => $component, 'type' => $type, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, 'hide_sitewide' => $hide_sitewide ) ); 
    282281} 
    283282 
     
    420419                    'item_id' => $blog_id, 
    421420                    'secondary_item_id' => $post_id, 
    422                     'recorded_time' => strtotime( $post->post_date_gmt ) 
     421                    'recorded_time' => $post->post_date_gmt 
    423422                )); 
    424423            } 
     
    455454                'item_id' => $blog_id, 
    456455                'secondary_item_id' => $post_id, 
    457                 'recorded_time' => strtotime( $post->post_date_gmt ) 
     456                'recorded_time' => $post->post_date_gmt 
    458457            ) ); 
    459458        } 
     
    513512            'item_id' => $wpdb->blogid, 
    514513            'secondary_item_id' => $comment_id, 
    515             'recorded_time' => strtotime( $comment->comment_date_gmt ) 
     514            'recorded_time' => $comment->comment_date_gmt 
    516515        ) ); 
    517516    } 
  • trunk/bp-core.php

    r2405 r2416  
    13571357    ); 
    13581358 
    1359     $older_date = strtotime( gmdate( 'Y-m-d H:i:s', $older_date ) ); 
     1359    if ( !is_numeric( $older_date ) ) 
     1360        $older_date = strtotime( $older_date . ' GMT' ); 
    13601361 
    13611362    /* $newer_date will equal false if we want to know the time elapsed between a date and the current time */ 
    13621363    /* $newer_date will have a value if we want to work out time elapsed between two known dates */ 
    1363     $newer_date = ( !$newer_date ) ? ( strtotime( gmdate( 'Y-m-d H:i:s' ) ) + ( 60*60*0 ) ) : $newer_date; 
     1364    $newer_date = ( !$newer_date ) ? gmmktime() : $newer_date; 
    13641365 
    13651366    /* Difference in seconds */ 
     
    13931394        $seconds2 = $chunks[$i + 1][0]; 
    13941395        $name2 = $chunks[$i + 1][1]; 
    1395  
    1396         //if ( $chunks[$i + 1][1] == __( 'second', 'buddypress' ) ) return $output; 
    13971396 
    13981397        if ( ( $count2 = floor( ( $since - ( $seconds * $count ) ) / $seconds2 ) ) != 0 ) { 
  • trunk/bp-friends.php

    r2389 r2416  
    276276        'item_id' => false, 
    277277        'secondary_item_id' => false, 
    278         'recorded_time' => time(), 
    279278        'hide_sitewide' => false 
    280279    ); 
     
    283282    extract( $r, EXTR_SKIP ); 
    284283 
    285     return bp_activity_add( array( 'user_id' => $user_id, 'action' => $action, 'content' => $content, 'primary_link' => $primary_link, 'component' => $component, 'type' => $type, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, 'recorded_time' => $recorded_time, 'hide_sitewide' => $hide_sitewide ) ); 
     284    return bp_activity_add( array( 'user_id' => $user_id, 'action' => $action, 'content' => $content, 'primary_link' => $primary_link, 'component' => $component, 'type' => $type, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, 'hide_sitewide' => $hide_sitewide ) ); 
    286285} 
    287286 
  • trunk/bp-groups.php

    r2411 r2416  
    13261326        'item_id' => false, 
    13271327        'secondary_item_id' => false, 
    1328         'recorded_time' => time(), 
    13291328        'hide_sitewide' => $hide_sitewide 
    13301329    ); 
     
    13331332    extract( $r, EXTR_SKIP ); 
    13341333 
    1335     return bp_activity_add( array( 'user_id' => $user_id, 'action' => $action, 'content' => $content, 'primary_link' => $primary_link, 'component' => $component, 'type' => $type, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, 'recorded_time' => $recorded_time, 'hide_sitewide' => $hide_sitewide ) ); 
     1334    return bp_activity_add( array( 'user_id' => $user_id, 'action' => $action, 'content' => $content, 'primary_link' => $primary_link, 'component' => $component, 'type' => $type, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, 'hide_sitewide' => $hide_sitewide ) ); 
    13361335} 
    13371336 
  • trunk/bp-xprofile.php

    r2409 r2416  
    490490        'item_id' => false, 
    491491        'secondary_item_id' => false, 
    492         'recorded_time' => time(), 
    493492        'hide_sitewide' => false 
    494493    ); 
     
    497496    extract( $r, EXTR_SKIP ); 
    498497 
    499     return bp_activity_add( array( 'user_id' => $user_id, 'action' => $action, 'content' => $content, 'primary_link' => $primary_link, 'component' => $component, 'type' => $type, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, 'recorded_time' => $recorded_time, 'hide_sitewide' => $hide_sitewide ) ); 
     498    return bp_activity_add( array( 'user_id' => $user_id, 'action' => $action, 'content' => $content, 'primary_link' => $primary_link, 'component' => $component, 'type' => $type, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, 'hide_sitewide' => $hide_sitewide ) ); 
    500499} 
    501500 
Note: See TracChangeset for help on using the changeset viewer.