You are here

function og_panels_get_one_by_nid_default in Organic groups 6

Same name and namespace in other branches
  1. 5.8 og_panels.module \og_panels_get_one_by_nid_default()
  2. 5 og_panels.module \og_panels_get_one_by_nid_default()
  3. 5.3 og_panels.module \og_panels_get_one_by_nid_default()
  4. 5.7 og_panels.module \og_panels_get_one_by_nid_default()

Load the default og_panels object, if any, for the given nid.

Parameters

int $nid:

Return value

mixed $og_panel Either returns the og_panel object, or FALSE if no default panel was found for the nid

File

modules/og_panels/og_panels.module, line 383

Code

function og_panels_get_one_by_nid_default($nid) {
  $sql = "SELECT * FROM {og_panels} WHERE nid = %d AND default_page = 1";
  $result = db_query($sql, $nid);
  $og_panel = db_fetch_object($result);
  return is_object($og_panel) ? $og_panel : FALSE;
}