<?php
  class pages
  {
	  var $errors = array();
	  var $table = 'pages';
	  var $type = 'cm';
	  function getShortname($shortname = '', $returnThis = 'id')
	  {
		  global $db,$conn, $functions, $page;
		  $check = $db->query("SELECT * FROM " . $this->table . " WHERE shortname='" . addslashes(mysqli_real_escape_string($conn,$shortname)) . "'");
		  if ($db->num_rows($check) > 0)
		  {
			  $pageDetails = $db->next_record($check);
			  return $this->pageDetails = $pageDetails[$returnThis];
		  }
	  }
	  
	  function checkShortname($shortname = '', $returnThis = 'id')
	  {
      global $page;
		  return $this->getShortname($page->topCategory, $returnThis);
	  }
	  
}
?>
