-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpopularity.php
46 lines (39 loc) · 1.32 KB
/
popularity.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
/**
* Copyright Obala d.o.o. (www.obala.si)
*
* See the enclosed file LICENSE for license information (GPL). If you
* did not receive this file, see http://www.horde.org/licenses/gpl.
*
* @author Duck <[email protected]>
* @package Folks
*/
require_once __DIR__ . '/lib/base.php';
$title = _("Popularity");
$count = $folks_driver->countUsers();
if ($count instanceof PEAR_Error) {
$notification->push($count);
$count = 0;
}
$page = Horde_Util::getGet('page', 0);
$perpage = $prefs->getValue('per_page');
$criteria = array('sort_by' => 'popularity', 'sort_dir' => 0);
$users = $folks_driver->getUsers($criteria, $page * $perpage, $perpage);
if ($users instanceof PEAR_Error) {
$notification->push($users);
$users = array();
}
$vars = Horde_Variables::getDefaultVariables();
$pager = new Horde_Core_Ui_Pager('page',
$vars, array('num' => $count,
'url' => 'popularity.php',
'perpage' => $perpage));
$pager->preserve($criteria);
$list_url = Folks::getUrlFor('list', 'popularity');
$page_output->addScriptFile('stripe.js', 'horde');
$page_output->header(array(
'title' => $title
));
$page_output->footer();
$notification->notify(array('listeners' => 'status'));
require FOLKS_TEMPLATES . '/list/list.php';