function &getAllForumIds() {
$result = array () ;
- $res = db_query_params ('SELECT * FROM forum_group_list_vw
-WHERE group_id=$1
+ $res = db_query_params('SELECT group_forum_id FROM forum_group_list
+WHERE group_forum_id NOT IN (
+ SELECT group_forum_id FROM forum_group_list WHERE group_forum_id IN (
+ SELECT forum_id FROM news_bytes))
+AND group_id=$1
ORDER BY group_forum_id',
- array ($this->Group->getID())) ;
+ array ($this->Group->getID()));
+ if (!$res) {
+ return $result ;
+ }
+ while ($arr = db_fetch_array($res)) {
+ $result[] = $arr['group_forum_id'] ;
+ }
+ return $result ;
+ }
+
+ function &getAllForumIdsWithNews() {
+ $result = array () ;
+ $res = db_query_params('SELECT group_forum_id FROM forum_group_list WHERE group_id=$1 ORDER BY group_forum_id',
+ array ($this->Group->getID()));
if (!$res) {
return $result ;
}
$result[] = $arr['group_forum_id'] ;
}
return $result ;
- }
+ }
/**
* getForums - get an array of Forum objects for this Group.
$this->forums = array () ;
$ids = $this->getAllForumIds() ;
-
+
if (!empty($ids) ) {
foreach ($ids as $id) {
if (forge_check_perm ('forum', $id, 'read')) {
}
return $this->forums;
}
-
+
/**
* getForumsAdmin - get an array of all (public, private and suspended) Forum objects for this Group.
*
return $this->forums;
}
-
+
if (session_loggedin()) {
if (!forge_check_perm ('forum_admin', $this->Group->getID())) {
$this->setError(_("You don't have a permission to access this page"));
$this->setError(_("You don't have a permission to access this page"));
$this->forums = false;
}
-
+
$rows = db_numrows($result);
-
+
if (!$result) {
$this->setError(_('Forum not found').' : '.db_error());
$this->forums = false;
/**
* moveThread - move thread in another forum
- *
+ *
* @param string The forum ID
* @param int The thread_id of the tread to change.
* @param string The old forum ID
- *
+ *
* Note:
* old forum ID is useless if forum_agg_msg_count table is no longer used
*
// mode: php
// c-file-style: "bsd"
// End:
-
-?>