og_get_subscriptions

Versions
5 – 6
og_get_subscriptions($uid, $min_is_active = 1, $reset = FALSE)

▾ 5 functions call og_get_subscriptions()

og_form_add_og_audience in contributions/og/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_nodeapi in contributions/og/og.module
Implementation of hook_nodeapi().
og_node_grants in contributions/og/og.module
og_user in contributions/og/og.module
og_xmlrpc_get_user_groups in contributions/og/og_xmlrpc.inc

Code

contributions/og/og.module, line 848

<?php
function og_get_subscriptions($uid, $min_is_active = 1, $reset = FALSE) {
  static $subscriptions = array();
  
  if ($reset) {
    unset($subscriptions[$uid]);
  }

  if (!isset($subscriptions[$uid][$min_is_active])) {
    $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][$min_is_active][$row['nid']] = $row;
    }

    if (!isset($subscriptions[$uid][$min_is_active])) {
      $subscriptions[$uid][$min_is_active] = array();
    }
  }
  return $subscriptions[$uid][$min_is_active];
}
?>

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.