| @@ 220-226 (lines=7) @@ | ||
| 217 | 'order_by_metadata' => array(array('name' => 'start_date', 'direction' => 'DESC', 'as' => 'integer')) |
|
| 218 | ); |
|
| 219 | ||
| 220 | if ($from) { |
|
| 221 | $params['metadata_name_value_pairs'][] = array( |
|
| 222 | 'name' => 'start_date', |
|
| 223 | 'value' => strtotime($from), |
|
| 224 | 'operand' => '>=' |
|
| 225 | ); |
|
| 226 | } |
|
| 227 | if ($to) { |
|
| 228 | $params['metadata_name_value_pairs'][] = array( |
|
| 229 | 'name' => 'end_date', |
|
| @@ 227-233 (lines=7) @@ | ||
| 224 | 'operand' => '>=' |
|
| 225 | ); |
|
| 226 | } |
|
| 227 | if ($to) { |
|
| 228 | $params['metadata_name_value_pairs'][] = array( |
|
| 229 | 'name' => 'end_date', |
|
| 230 | 'value' => strtotime($to), |
|
| 231 | 'operand' => '<=' |
|
| 232 | ); |
|
| 233 | } |
|
| 234 | ||
| 235 | $all_events = elgg_list_entities_from_metadata($params); |
|
| 236 | $events = json_decode($all_events); |
|
| @@ 317-323 (lines=7) @@ | ||
| 314 | 'relationship_guid' => $user_entity->entity, |
|
| 315 | ); |
|
| 316 | ||
| 317 | if ($from) { |
|
| 318 | $params['metadata_name_value_pairs'][] = array( |
|
| 319 | 'name' => 'start_date', |
|
| 320 | 'value' => strtotime($from), |
|
| 321 | 'operand' => '>=' |
|
| 322 | ); |
|
| 323 | } |
|
| 324 | if ($to) { |
|
| 325 | $params['metadata_name_value_pairs'][] = array( |
|
| 326 | 'name' => 'end_date', |
|
| @@ 324-330 (lines=7) @@ | ||
| 321 | 'operand' => '>=' |
|
| 322 | ); |
|
| 323 | } |
|
| 324 | if ($to) { |
|
| 325 | $params['metadata_name_value_pairs'][] = array( |
|
| 326 | 'name' => 'end_date', |
|
| 327 | 'value' => strtotime($to), |
|
| 328 | 'operand' => '<=' |
|
| 329 | ); |
|
| 330 | } |
|
| 331 | ||
| 332 | $all_events = elgg_list_entities_from_relationship($params); |
|
| 333 | ||
| @@ 410-416 (lines=7) @@ | ||
| 407 | 'wheres' => array("r.relationship = 'personal_event'","r.guid_one IN ($friend_list)"), |
|
| 408 | ); |
|
| 409 | ||
| 410 | if ($from) { |
|
| 411 | $params['metadata_name_value_pairs'][] = array( |
|
| 412 | 'name' => 'start_date', |
|
| 413 | 'value' => strtotime($from), |
|
| 414 | 'operand' => '>=' |
|
| 415 | ); |
|
| 416 | } |
|
| 417 | if ($to) { |
|
| 418 | $params['metadata_name_value_pairs'][] = array( |
|
| 419 | 'name' => 'end_date', |
|
| @@ 417-423 (lines=7) @@ | ||
| 414 | 'operand' => '>=' |
|
| 415 | ); |
|
| 416 | } |
|
| 417 | if ($to) { |
|
| 418 | $params['metadata_name_value_pairs'][] = array( |
|
| 419 | 'name' => 'end_date', |
|
| 420 | 'value' => strtotime($to), |
|
| 421 | 'operand' => '<=' |
|
| 422 | ); |
|
| 423 | } |
|
| 424 | ||
| 425 | $all_events = elgg_list_entities_from_metadata($params); |
|
| 426 | $events = json_decode($all_events); |
|