Skip to content

Instantly share code, notes, and snippets.

@oojacoboo
Created May 4, 2013 00:35
Show Gist options
  • Select an option

  • Save oojacoboo/5515411 to your computer and use it in GitHub Desktop.

Select an option

Save oojacoboo/5515411 to your computer and use it in GitHub Desktop.
##################
# Function: is_faq
# Inputs:
# page - optional english file name
# Returns: boolean
# Note:
# This function returns true if the current page or the page argument is a faq page
# false otherwise
private function is_faq($page = FALSE){
# return early if we know we are on a faq page
# and no argument provide
if(!$page && $this->is_faq) return TRUE;
# set page based on func arg or file name
$page = ($page) ? $page: $this->english_file_name;
$q = "SELECT 1 FROM $this->content_faq WHERE url = '$page' LIMIT 1";
$result = $this->db->execute($q);
return ($result && mysql_num_rows($result));
}// is_faq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment