| @@ 205-211 (lines=7) @@ | ||
| 202 | 'order_by_metadata' => array(array('name' => 'start_date', 'direction' => 'DESC', 'as' => 'integer')) |
|
| 203 | ); |
|
| 204 | ||
| 205 | if ($from) { |
|
| 206 | $params['metadata_name_value_pairs'][] = array( |
|
| 207 | 'name' => 'start_date', |
|
| 208 | 'value' => strtotime($from), |
|
| 209 | 'operand' => '>=' |
|
| 210 | ); |
|
| 211 | } |
|
| 212 | if ($to) { |
|
| 213 | $params['metadata_name_value_pairs'][] = array( |
|
| 214 | 'name' => 'end_date', |
|
| @@ 212-218 (lines=7) @@ | ||
| 209 | 'operand' => '>=' |
|
| 210 | ); |
|
| 211 | } |
|
| 212 | if ($to) { |
|
| 213 | $params['metadata_name_value_pairs'][] = array( |
|
| 214 | 'name' => 'end_date', |
|
| 215 | 'value' => strtotime($to), |
|
| 216 | 'operand' => '<=' |
|
| 217 | ); |
|
| 218 | } |
|
| 219 | ||
| 220 | $all_events = elgg_list_entities_from_metadata($params); |
|
| 221 | $events = json_decode($all_events); |
|
| @@ 302-308 (lines=7) @@ | ||
| 299 | 'relationship_guid' => $user_entity->entity, |
|
| 300 | ); |
|
| 301 | ||
| 302 | if ($from) { |
|
| 303 | $params['metadata_name_value_pairs'][] = array( |
|
| 304 | 'name' => 'start_date', |
|
| 305 | 'value' => strtotime($from), |
|
| 306 | 'operand' => '>=' |
|
| 307 | ); |
|
| 308 | } |
|
| 309 | if ($to) { |
|
| 310 | $params['metadata_name_value_pairs'][] = array( |
|
| 311 | 'name' => 'end_date', |
|
| @@ 309-315 (lines=7) @@ | ||
| 306 | 'operand' => '>=' |
|
| 307 | ); |
|
| 308 | } |
|
| 309 | if ($to) { |
|
| 310 | $params['metadata_name_value_pairs'][] = array( |
|
| 311 | 'name' => 'end_date', |
|
| 312 | 'value' => strtotime($to), |
|
| 313 | 'operand' => '<=' |
|
| 314 | ); |
|
| 315 | } |
|
| 316 | ||
| 317 | $all_events = elgg_list_entities_from_relationship($params); |
|
| 318 | ||
| @@ 395-401 (lines=7) @@ | ||
| 392 | 'wheres' => array("r.relationship = 'personal_event'","r.guid_one IN ($friend_list)"), |
|
| 393 | ); |
|
| 394 | ||
| 395 | if ($from) { |
|
| 396 | $params['metadata_name_value_pairs'][] = array( |
|
| 397 | 'name' => 'start_date', |
|
| 398 | 'value' => strtotime($from), |
|
| 399 | 'operand' => '>=' |
|
| 400 | ); |
|
| 401 | } |
|
| 402 | if ($to) { |
|
| 403 | $params['metadata_name_value_pairs'][] = array( |
|
| 404 | 'name' => 'end_date', |
|
| @@ 402-408 (lines=7) @@ | ||
| 399 | 'operand' => '>=' |
|
| 400 | ); |
|
| 401 | } |
|
| 402 | if ($to) { |
|
| 403 | $params['metadata_name_value_pairs'][] = array( |
|
| 404 | 'name' => 'end_date', |
|
| 405 | 'value' => strtotime($to), |
|
| 406 | 'operand' => '<=' |
|
| 407 | ); |
|
| 408 | } |
|
| 409 | ||
| 410 | $all_events = elgg_list_entities_from_metadata($params); |
|
| 411 | $events = json_decode($all_events); |
|