Skip to:
Content

BuddyPress.org

Changeset 1733


Ignore:
Timestamp:
08/28/2009 10:00:19 PM (16 years ago)
Author:
apeatling
Message:

Fixes 910 props jjj

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity.php

    r1718 r1733  
    240240    /* Insert the "time-since" placeholder */
    241241    if ( $content ) {
    242         if ( !$pos = strpos( $content, '<blockquote' ) ) {
    243             if ( !$pos = strpos( $content, '<div' ) ) {
    244                 if ( !$pos = strpos( $content, '<ul' ) ) {
    245                     $content .= ' <span class="time-since">%s</span>';
     242       
     243        /* Check a time-since span doesn't already exist */
     244        if ( false === strpos( $content, '<span class="time-since">' ) ) {     
     245            if ( !$pos = strpos( $content, '<blockquote' ) ) {
     246                if ( !$pos = strpos( $content, '<div' ) ) {
     247                    if ( !$pos = strpos( $content, '<ul' ) ) {
     248                        $content .= ' <span class="time-since">%s</span>';
     249                    }
    246250                }
    247251            }
    248252        }
    249253       
    250         if ( $pos ) {
    251             $before = substr( $content, 0, $pos );
    252             $after = substr( $content, $pos, strlen( $content ) );
     254        if ( (int) $pos ) {
     255            $before = substr( $content, 0, (int) $pos );
     256            $after = substr( $content, (int) $pos, strlen( $content ) );
    253257           
    254258            $content = $before . ' <span class="time-since">%s</span>' . $after;
Note: See TracChangeset for help on using the changeset viewer.