You are here

function skinr_rule_load in Skinr 6.2

Load a skinr page rule object.

6 calls to skinr_rule_load()
page_skinr_preprocess_index_handler in modules/skinr.skinr.inc
Skinr preprocess index handler.
skinr_rules in ./skinr_ui.rules.inc
Menu callback; displays the skinr rules listing.
skinr_rule_delete in ./skinr.module
Delete a skinr page rule object.
skinr_rule_delete_confirm in ./skinr_ui.rules.inc
Menu callback; displays the delete confirmation for a skinr page rule.
skinr_rule_edit in ./skinr_ui.rules.inc
Menu callback; displays the edit form for a skinr rule.

... See full list

File

./skinr.module, line 315

Code

function skinr_rule_load($rid = NULL) {
  if (is_null($rid)) {
    $rules = array();
    $result = db_query("SELECT * FROM {skinr_rules}");
    while ($rule = db_fetch_object($result)) {
      $rule->roles = unserialize($rule->roles);
      $rules[] = $rule;
    }
    return $rules;
  }
  else {
    $result = db_query("SELECT * FROM {skinr_rules} WHERE rid = %d", $rid);
    if ($rule = db_fetch_object($result)) {
      $rule->roles = unserialize($rule->roles);
      return $rule;
    }
    return FALSE;
  }
}