| @@ 278-307 (lines=30) @@ | ||
| 275 | return $blogs; |
|
| 276 | } |
|
| 277 | ||
| 278 | function get_blogposts_by_colleague($user, $limit, $offset, $lang, $target) |
|
| 279 | { |
|
| 280 | $user_entity = is_numeric($user) ? get_user($user) : (strpos($user, '@') !== false ? get_user_by_email($user)[0] : get_user_by_username($user)); |
|
| 281 | if (!$user_entity) { |
|
| 282 | return "User was not found. Please try a different GUID, username, or email address"; |
|
| 283 | } |
|
| 284 | if (!$user_entity instanceof ElggUser) { |
|
| 285 | return "Invalid user. Please try a different GUID, username, or email address"; |
|
| 286 | } |
|
| 287 | ||
| 288 | if (!elgg_is_logged_in()) { |
|
| 289 | login($user_entity); |
|
| 290 | } |
|
| 291 | ||
| 292 | $all_blog_posts = elgg_list_entities_from_relationship(array( |
|
| 293 | 'type' => 'object', |
|
| 294 | 'subtype' => 'blog', |
|
| 295 | 'relationship' => 'friend', |
|
| 296 | 'relationship_guid' => $user_entity->guid, |
|
| 297 | 'relationship_join_on' => 'container_guid', |
|
| 298 | 'limit' => $limit, |
|
| 299 | 'offset' => $offset |
|
| 300 | )); |
|
| 301 | ||
| 302 | $blog_posts = json_decode($all_blog_posts); |
|
| 303 | ||
| 304 | $blogs = foreach_blogs($blog_posts, $user_entity, $lang); |
|
| 305 | ||
| 306 | return $blogs; |
|
| 307 | } |
|
| 308 | ||
| 309 | ||
| 310 | function get_blogposts_by_container($user, $guid, $limit, $offset, $lang) |
|
| @@ 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 | { |
|