| @@ 184-190 (lines=7) @@ | ||
| 181 | 'order_by_metadata' => array(array('name' => 'start_date', 'direction' => 'DESC', 'as' => 'integer')) |
|
| 182 | ); |
|
| 183 | ||
| 184 | if ($from) { |
|
| 185 | $params['metadata_name_value_pairs'][] = array( |
|
| 186 | 'name' => 'start_date', |
|
| 187 | 'value' => strtotime($from), |
|
| 188 | 'operand' => '>=' |
|
| 189 | ); |
|
| 190 | } |
|
| 191 | if ($to) { |
|
| 192 | $params['metadata_name_value_pairs'][] = array( |
|
| 193 | 'name' => 'end_date', |
|
| @@ 191-197 (lines=7) @@ | ||
| 188 | 'operand' => '>=' |
|
| 189 | ); |
|
| 190 | } |
|
| 191 | if ($to) { |
|
| 192 | $params['metadata_name_value_pairs'][] = array( |
|
| 193 | 'name' => 'end_date', |
|
| 194 | 'value' => strtotime($to), |
|
| 195 | 'operand' => '<=' |
|
| 196 | ); |
|
| 197 | } |
|
| 198 | ||
| 199 | $all_events = elgg_list_entities_from_metadata($params); |
|
| 200 | $events = json_decode($all_events); |
|
| @@ 281-287 (lines=7) @@ | ||
| 278 | 'relationship_guid' => $user_entity->entity, |
|
| 279 | ); |
|
| 280 | ||
| 281 | if ($from) { |
|
| 282 | $params['metadata_name_value_pairs'][] = array( |
|
| 283 | 'name' => 'start_date', |
|
| 284 | 'value' => strtotime($from), |
|
| 285 | 'operand' => '>=' |
|
| 286 | ); |
|
| 287 | } |
|
| 288 | if ($to) { |
|
| 289 | $params['metadata_name_value_pairs'][] = array( |
|
| 290 | 'name' => 'end_date', |
|
| @@ 288-294 (lines=7) @@ | ||
| 285 | 'operand' => '>=' |
|
| 286 | ); |
|
| 287 | } |
|
| 288 | if ($to) { |
|
| 289 | $params['metadata_name_value_pairs'][] = array( |
|
| 290 | 'name' => 'end_date', |
|
| 291 | 'value' => strtotime($to), |
|
| 292 | 'operand' => '<=' |
|
| 293 | ); |
|
| 294 | } |
|
| 295 | ||
| 296 | $all_events = elgg_list_entities_from_relationship($params); |
|
| 297 | ||
| @@ 374-380 (lines=7) @@ | ||
| 371 | 'wheres' => array("r.relationship = 'personal_event'","r.guid_one IN ($friend_list)"), |
|
| 372 | ); |
|
| 373 | ||
| 374 | if ($from) { |
|
| 375 | $params['metadata_name_value_pairs'][] = array( |
|
| 376 | 'name' => 'start_date', |
|
| 377 | 'value' => strtotime($from), |
|
| 378 | 'operand' => '>=' |
|
| 379 | ); |
|
| 380 | } |
|
| 381 | if ($to) { |
|
| 382 | $params['metadata_name_value_pairs'][] = array( |
|
| 383 | 'name' => 'end_date', |
|
| @@ 381-387 (lines=7) @@ | ||
| 378 | 'operand' => '>=' |
|
| 379 | ); |
|
| 380 | } |
|
| 381 | if ($to) { |
|
| 382 | $params['metadata_name_value_pairs'][] = array( |
|
| 383 | 'name' => 'end_date', |
|
| 384 | 'value' => strtotime($to), |
|
| 385 | 'operand' => '<=' |
|
| 386 | ); |
|
| 387 | } |
|
| 388 | ||
| 389 | $all_events = elgg_list_entities_from_metadata($params); |
|
| 390 | $events = json_decode($all_events); |
|