* Views are rendered by a template handler and returned as strings.
*
* Views are called with a special $vars variable set,
- * which includes any variables passed as the second parameter,
- * as well as some defaults:
- * - All $_SESSION vars merged to $vars array.
- * - $vars['config'] The $CONFIG global. (Use {@link get_config()} instead).
- * - $vars['url'] The site URL.
+ * which includes any variables passed as the second parameter.
+ * For backward compatbility, the following variables are also set but we
+ * recommend that you do not use them:
+ * - $vars['config'] The $CONFIG global. (Use {@link elgg_get_config()} instead).
+ * - $vars['url'] The site URL. (use {@link elgg_get_site_url()} instead).
+ * - $vars['user'] The logged in user. (use {@link get_loggedin_user()} instead).
*
* Custom template handlers can be set with {@link set_template_handler()}.
*
if (isset($vars['entity']) && $vars['entity'] instanceof ElggEntity) {
$selected_categories = $vars['entity']->universal_categories;
}
-$categories = $vars['config']->site->categories;
+$categories = elgg_get_site_entity()->categories;
if (empty($categories)) {
$categories = array();
}
* @package SitePages
*/
+$db_prefix = elgg_get_config('dbprefix');
+
$only_with_avatars = (isset($vars['only_with_avatars'])) ? $vars['only_with_avatars'] : TRUE;
$list_type = (isset($vars['list_type'])) ? $vars['list_type'] : 'new';
$limit = (isset($vars['limit'])) ? $vars['limit'] : 10;
case 'online':
// show people with a last action of < 10 minutes.
$last_action = time() - 10 * 60;
- $options['joins'] = array("JOIN {$vars['config']->dbprefix}users_entity ue on ue.guid = e.guid");
+ $options['joins'] = array("JOIN {$db_prefix}users_entity ue on ue.guid = e.guid");
$options['wheres'] = array("ue.last_action > $last_action");
break;