- // The getTopGroups function returns an array of all active top groups on the server.
- static function getTopGroups() {
- $result = array();
- $mdb2 = getConnection();
-
- $sql = "select id, name, created, lang from tt_groups".
- " where status = 1 and (org_id is NULL or org_id = id) order by id desc";
- $res = $mdb2->query($sql);
- $result = array();
- if (!is_a($res, 'PEAR_Error')) {
- while ($val = $res->fetchRow()) {
- $val['date'] = substr($val['created'], 0, 10); // Strip the time.
- $result[] = $val;
- }
- return $result;
- }
- return false;
- }
-