| @@ 171-177 (lines=7) @@ | ||
| 168 | 'order_by_metadata' => array(array('name' => 'start_date', 'direction' => 'DESC', 'as' => 'integer')) |
|
| 169 | ); |
|
| 170 | ||
| 171 | if ($from) { |
|
| 172 | $params['metadata_name_value_pairs'][] = array( |
|
| 173 | 'name' => 'start_date', |
|
| 174 | 'value' => strtotime($from), |
|
| 175 | 'operand' => '>=' |
|
| 176 | ); |
|
| 177 | } |
|
| 178 | if ($to) { |
|
| 179 | $params['metadata_name_value_pairs'][] = array( |
|
| 180 | 'name' => 'end_date', |
|
| @@ 178-184 (lines=7) @@ | ||
| 175 | 'operand' => '>=' |
|
| 176 | ); |
|
| 177 | } |
|
| 178 | if ($to) { |
|
| 179 | $params['metadata_name_value_pairs'][] = array( |
|
| 180 | 'name' => 'end_date', |
|
| 181 | 'value' => strtotime($to), |
|
| 182 | 'operand' => '<=' |
|
| 183 | ); |
|
| 184 | } |
|
| 185 | ||
| 186 | $all_events = elgg_list_entities_from_metadata($params); |
|
| 187 | $events = json_decode($all_events); |
|
| @@ 251-257 (lines=7) @@ | ||
| 248 | 'relationship_guid' => $user_entity->entity, |
|
| 249 | ); |
|
| 250 | ||
| 251 | if ($from) { |
|
| 252 | $params['metadata_name_value_pairs'][] = array( |
|
| 253 | 'name' => 'start_date', |
|
| 254 | 'value' => strtotime($from), |
|
| 255 | 'operand' => '>=' |
|
| 256 | ); |
|
| 257 | } |
|
| 258 | if ($to) { |
|
| 259 | $params['metadata_name_value_pairs'][] = array( |
|
| 260 | 'name' => 'end_date', |
|
| @@ 258-264 (lines=7) @@ | ||
| 255 | 'operand' => '>=' |
|
| 256 | ); |
|
| 257 | } |
|
| 258 | if ($to) { |
|
| 259 | $params['metadata_name_value_pairs'][] = array( |
|
| 260 | 'name' => 'end_date', |
|
| 261 | 'value' => strtotime($to), |
|
| 262 | 'operand' => '<=' |
|
| 263 | ); |
|
| 264 | } |
|
| 265 | ||
| 266 | $all_events = elgg_list_entities_from_relationship($params); |
|
| 267 | ||
| @@ 344-350 (lines=7) @@ | ||
| 341 | 'wheres' => array("r.relationship = 'personal_event'","r.guid_one IN ($friend_list)"), |
|
| 342 | ); |
|
| 343 | ||
| 344 | if ($from) { |
|
| 345 | $params['metadata_name_value_pairs'][] = array( |
|
| 346 | 'name' => 'start_date', |
|
| 347 | 'value' => strtotime($from), |
|
| 348 | 'operand' => '>=' |
|
| 349 | ); |
|
| 350 | } |
|
| 351 | if ($to) { |
|
| 352 | $params['metadata_name_value_pairs'][] = array( |
|
| 353 | 'name' => 'end_date', |
|
| @@ 351-357 (lines=7) @@ | ||
| 348 | 'operand' => '>=' |
|
| 349 | ); |
|
| 350 | } |
|
| 351 | if ($to) { |
|
| 352 | $params['metadata_name_value_pairs'][] = array( |
|
| 353 | 'name' => 'end_date', |
|
| 354 | 'value' => strtotime($to), |
|
| 355 | 'operand' => '<=' |
|
| 356 | ); |
|
| 357 | } |
|
| 358 | ||
| 359 | $all_events = elgg_list_entities_from_metadata($params); |
|
| 360 | $events = json_decode($all_events); |
|