Changeset 8251 for trunk/bp-activity/bp-activity-classes.php
- Timestamp:
- 04/08/2014 06:55:30 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-classes.php
r8249 r8251 1190 1190 * 1191 1191 * @param array $filter_array { 1192 * Fields and values to filter by. Each can be either a single 1193 * string, a comma-separated list, or an array of values. 1192 * Fields and values to filter by. 1194 1193 * @type array|string|id $user_id User ID(s). 1195 1194 * @type array|string $object Corresponds to the 'component' … … 1201 1200 * @type array|string|int $secondary_id Corresponds to the 1202 1201 * 'secondary_item_id' column in the database. 1202 * @type int $offset Return only those items with an ID greater 1203 * than the offset value. 1204 * @type string $since Return only those items that have a 1205 * date_recorded value greater than a given MySQL-formatted 1206 * date. 1203 1207 * } 1204 1208 * @return string The filter clause, for use in a SQL query. … … 1241 1245 $sid_sql = absint( $filter_array['offset'] ); 1242 1246 $filter_sql[] = "a.id >= {$sid_sql}"; 1247 } 1248 1249 if ( ! empty( $filter_array['since'] ) ) { 1250 // Validate that this is a proper Y-m-d H:i:s date 1251 // Trick: parse to UNIX date then translate back 1252 $translated_date = date( 'Y-m-d H:i:s', strtotime( $filter_array['since'] ) ); 1253 if ( $translated_date === $filter_array['since'] ) { 1254 $filter_sql[] = "a.date_recorded > '{$translated_date}'"; 1255 } 1243 1256 } 1244 1257
Note: See TracChangeset
for help on using the changeset viewer.