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