1 | <?php |
||
2 | /** |
||
3 | * Renders a list of discussions, optionally filtered by container type |
||
4 | * |
||
5 | * @uses $vars['container_type'] Container type filter to apply |
||
6 | */ |
||
7 | |||
8 | $options = [ |
||
9 | 'type' => 'object', |
||
10 | 'subtype' => 'discussion', |
||
11 | 'order_by' => 'e.last_action desc', |
||
12 | 'limit' => max(20, elgg_get_config('default_limit')), |
||
13 | 'full_view' => false, |
||
14 | 'no_results' => elgg_echo('discussion:none'), |
||
15 | 'preload_owners' => true, |
||
16 | 'preload_containers' => true, |
||
17 | ]; |
||
18 | |||
19 | $container_type = elgg_extract('container_type', $vars); |
||
20 | if ($container_type) { |
||
21 | $dbprefix = elgg_get_config('dbprefix'); |
||
22 | $container_type = sanitize_string($container_type); |
||
0 ignored issues
–
show
|
|||
23 | $options['joins'][] = "JOIN {$dbprefix}entities ce ON ce.guid = e.container_guid"; |
||
24 | $options['wheres'][] = "ce.type = '$container_type'"; |
||
25 | } |
||
26 | |||
27 | echo elgg_list_entities($options); |
||
28 |
This function has been deprecated. The supplier of the function has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.