Changeset 5908 for trunk/src/includes/common/functions.php
- Timestamp:
- 08/11/2015 08:17:53 PM (11 years ago)
- File:
-
- 1 edited
-
trunk/src/includes/common/functions.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/common/functions.php
r5907 r5908 152 152 // Step one: the first chunk 153 153 for ( $i = 0, $j = count( $chunks ); $i < $j; ++$i ) { 154 $seconds = $chunks[ $i][0];154 $seconds = $chunks[ $i ][0]; 155 155 156 156 // Finding the biggest chunk (if the chunk fits, break) … … 162 162 163 163 // If $i iterates all the way to $j, then the event happened 0 seconds ago 164 if ( ! isset( $chunks[ $i] ) ) {164 if ( ! isset( $chunks[ $i ] ) ) { 165 165 $output = $right_now_text; 166 166 … … 168 168 169 169 // Set output var 170 $output = ( 1 == $count ) ? '1 '. $chunks[ $i][1] : $count . ' ' . $chunks[$i][2];170 $output = ( 1 == $count ) ? '1 '. $chunks[ $i ][1] : $count . ' ' . $chunks[ $i ][2]; 171 171 172 172 // Step two: the second chunk 173 173 if ( $i + 2 < $j ) { 174 $seconds2 = $chunks[ $i + 1][0];175 $name2 = $chunks[ $i + 1][1];174 $seconds2 = $chunks[ $i + 1 ][0]; 175 $name2 = $chunks[ $i + 1 ][1]; 176 176 $count2 = floor( ( $since - ( $seconds * $count ) ) / $seconds2 ); 177 177 178 178 // Add to output var 179 179 if ( 0 != $count2 ) { 180 $output .= ( 1 == $count2 ) ? _x( ',', 'Separator in time since', 'bbpress' ) . ' 1 '. $name2 : _x( ',', 'Separator in time since', 'bbpress' ) . ' ' . $count2 . ' ' . $chunks[ $i + 1][2];180 $output .= ( 1 == $count2 ) ? _x( ',', 'Separator in time since', 'bbpress' ) . ' 1 '. $name2 : _x( ',', 'Separator in time since', 'bbpress' ) . ' ' . $count2 . ' ' . $chunks[ $i + 1 ][2]; 181 181 } 182 182 } … … 1882 1882 // Setup matched variables to select 1883 1883 foreach ( $query_vars as $key => $value ) { 1884 if ( isset( $select_query_vars[ $key] ) ) {1885 $select_query_vars[ $key] = $value;1884 if ( isset( $select_query_vars[ $key ] ) ) { 1885 $select_query_vars[ $key ] = $value; 1886 1886 } 1887 1887 }
Note: See TracChangeset
for help on using the changeset viewer.