| @@ 273-301 (lines=29) @@ | ||
| 270 | return $wire_posts; |
|
| 271 | } |
|
| 272 | ||
| 273 | function get_wirepostsbycolleagues($user, $limit, $offset, $lang) |
|
| 274 | { |
|
| 275 | $user_entity = is_numeric($user) ? get_user($user) : (strpos($user, '@') !== false ? get_user_by_email($user)[0] : get_user_by_username($user)); |
|
| 276 | if (!$user_entity) { |
|
| 277 | return "User was not found. Please try a different GUID, username, or email address"; |
|
| 278 | } |
|
| 279 | if (!$user_entity instanceof ElggUser) { |
|
| 280 | return "Invalid user. Please try a different GUID, username, or email address"; |
|
| 281 | } |
|
| 282 | ||
| 283 | if (!elgg_is_logged_in()) { |
|
| 284 | login($user_entity); |
|
| 285 | } |
|
| 286 | ||
| 287 | $all_wire_posts = elgg_list_entities_from_relationship(array( |
|
| 288 | 'type' => 'object', |
|
| 289 | 'subtype' => 'thewire', |
|
| 290 | 'relationship' => 'friend', |
|
| 291 | 'relationship_guid' => $user_entity->guid, |
|
| 292 | 'relationship_join_on' => 'container_guid', |
|
| 293 | 'limit' => $limit, |
|
| 294 | 'offset' => $offset |
|
| 295 | )); |
|
| 296 | $wire_posts = json_decode($all_wire_posts); |
|
| 297 | ||
| 298 | $wire_posts = wires_foreach($wire_posts, $user_entity); |
|
| 299 | ||
| 300 | return $wire_posts; |
|
| 301 | } |
|
| 302 | ||
| 303 | function get_wirepostsbyuser($profileemail, $user, $limit, $offset, $lang) |
|
| 304 | { |
|
| @@ 292-321 (lines=30) @@ | ||
| 289 | return $blogs; |
|
| 290 | } |
|
| 291 | ||
| 292 | function get_blogposts_by_colleague($user, $limit, $offset, $lang, $target) |
|
| 293 | { |
|
| 294 | $user_entity = is_numeric($user) ? get_user($user) : (strpos($user, '@') !== false ? get_user_by_email($user)[0] : get_user_by_username($user)); |
|
| 295 | if (!$user_entity) { |
|
| 296 | return "User was not found. Please try a different GUID, username, or email address"; |
|
| 297 | } |
|
| 298 | if (!$user_entity instanceof ElggUser) { |
|
| 299 | return "Invalid user. Please try a different GUID, username, or email address"; |
|
| 300 | } |
|
| 301 | ||
| 302 | if (!elgg_is_logged_in()) { |
|
| 303 | login($user_entity); |
|
| 304 | } |
|
| 305 | ||
| 306 | $all_blog_posts = elgg_list_entities_from_relationship(array( |
|
| 307 | 'type' => 'object', |
|
| 308 | 'subtype' => 'blog', |
|
| 309 | 'relationship' => 'friend', |
|
| 310 | 'relationship_guid' => $user_entity->guid, |
|
| 311 | 'relationship_join_on' => 'container_guid', |
|
| 312 | 'limit' => $limit, |
|
| 313 | 'offset' => $offset |
|
| 314 | )); |
|
| 315 | ||
| 316 | $blog_posts = json_decode($all_blog_posts); |
|
| 317 | ||
| 318 | $blogs = foreach_blogs($blog_posts, $user_entity, $lang); |
|
| 319 | ||
| 320 | return $blogs; |
|
| 321 | } |
|
| 322 | ||
| 323 | ||
| 324 | function get_blogposts_by_container($user, $guid, $limit, $offset, $lang) |
|