function og_get_subscriptions in Organic groups 5.2
Same name and namespace in other branches
- 5.8 og.module \og_get_subscriptions()
- 5 og.module \og_get_subscriptions()
- 5.3 og.module \og_get_subscriptions()
- 5.7 og.module \og_get_subscriptions()
- 6.2 og.module \og_get_subscriptions()
- 6 og.module \og_get_subscriptions()
4 calls to og_get_subscriptions()
- og_form_add_og_audience in ./
og.module - Helper method to add OG audience fields to a given form. This is lives in a separate function from og_form_alter() so it can be shared by other OG contrib modules.
- og_node_grants in ./
og.module - og_user in ./
og.module - og_xmlrpc_get_user_groups in ./
og_xmlrpc.inc
File
- ./
og.module, line 830
Code
function og_get_subscriptions($uid, $min_is_active = 1) {
static $subscriptions = array();
if (!isset($subscriptions[$uid])) {
$sql = "SELECT n.title, n.type, n.status, ou.* FROM {og_uid} ou INNER JOIN {node} n ON ou.nid = n.nid WHERE ou.uid = %d AND ou.is_active >= %d ORDER BY n.title";
$result = db_query($sql, $uid, $min_is_active);
while ($row = db_fetch_array($result)) {
$subscriptions[$uid][$row['nid']] = $row;
}
if (!isset($subscriptions[$uid])) {
$subscriptions[$uid] = array();
}
}
return $subscriptions[$uid];
}