registerNamespace("r", "urn:e6:sites:pubasp:ContentServer.asmx"); $this->data["id"] = $query->query("/r:Response/r:Data/@contentid")->item(0)->nodeValue; $this->data["title"] = $query->query("/r:Response/r:Data/r:Title")->item(0)->textContent; $this->data["text"] = $query->query("/r:Response/r:Data/r:Content")->item(0)->textContent; $this->data["type"] = $query->query("/r:Response/r:Data/@type")->item(0)->nodeValue; } function __set($name, $value) { $this->data[$name] = $value; } function __get($name) { return $this->data[$name]; } function FormattedContent() { switch ($this->data["type"]) { case "Text": return nl2br($this->data["text"]); case "HTML": return $this->data["text"]; case "Include": return @file_get_contents("/content/" . $this->data["text"]); default: return ""; } } } function GetContentByPage($name) { return new Content(LoadContentByPage($name)); } function GetContentByID($id) { return new Content(LoadContentByID($id)); } function LoadContentByPage($name) { $page = urlencode($name); $url = "http://pubasp.blueribboninteractive.com/ContentServer.asmx/GetPageByName?page=" . $page; $xml = new DOMDocument(); $xml->load($url); return $xml; } function LoadContentByID($id) { if (!is_numeric($id)) { return new DOMDocument(); } $url = "http://pubasp.blueribboninteractive.com/ContentServer.asmx/GetPageByID?id=" . $id; $xml = new DOMDocument(); $xml->load($url); return $xml; } ?>