xml=simplexml_load_file($file); if($this->xml === false) { echo "Failed loading XML\n"; foreach(libxml_get_errors() as $error) { echo "\t", $error->message; // Fairly fatal } } else { $this->isSuccess=true; } } else {$this->errorMessage='XML file does not exist: '.$file;echo $this->errorMessage;exit();} // Fatal } } class film { var $filmpath; var $xmlTag,$title,$logline,$keyimage,$synopsis,$featuring,$gs,$gsimage; var $subimages,$projectimes; var $nextShowing,$nextShowingIcon,$showings; function __construct($xmlTag='undefined') { $this->filmpath=$GLOBALS['xml']->xml->filmpath.'/'.$xmlTag.'/'; $this->xmlTag=$xmlTag; $this->title=$GLOBALS['xml']->xml->$xmlTag->title; $this->cleanURL=$GLOBALS['xml']->xml->$xmlTag->cleanurl; $this->headtitle=$GLOBALS['xml']->xml->$xmlTag->headtitle; $this->logline=$GLOBALS['xml']->xml->$xmlTag->logline; $this->keyimage=$this->filmpath.$GLOBALS['xml']->xml->$xmlTag->keyimage; $this->synopsis=$GLOBALS['xml']->xml->$xmlTag->synopsis; $this->featuring=$GLOBALS['xml']->xml->$xmlTag->featuring; $this->gs=$GLOBALS['xml']->xml->$xmlTag->gs; $this->gsimage=$GLOBALS['xml']->xml->$xmlTag->gsimage; foreach($GLOBALS['xml']->xml->$xmlTag->images as $image) { // $this->subimages[]=$this->filmpath.$image; $this->subimages[(string)$image]['image']=$this->filmpath.$image; $this->subimages[(string)$image]['caption']=$image->attributes()->caption; } foreach($GLOBALS['xml']->xml->$xmlTag->projectitems as $item) { $this->projectitems[]=array((string)$item->item,(string)$item->entry); } $this->nextShowing=$GLOBALS['xml']->xml->$xmlTag->nextshowing; //$this->nextShowingIcon=$GLOBALS['xml']->xml->$xmlTag->nextshowing->attributes()->icon; foreach($GLOBALS['xml']->xml->$xmlTag->showings as $showing) { $this->showings[]=(string)$showing; } } function returnMyImages() { $myImages=''; foreach($this->subimages as $image) { // $myImages.='
'; $myImages.='

'.$image['caption'].'

'; } return $myImages; } function returnMyProjectItems() { $myItems=''; foreach($this->projectitems as $item) { $myItems.=$item[0].': '.$item[1].' '; } return '

'.$myItems.'

'; } function returnCleanURL() { return $this->cleanURL; } function returnHeadTitle() { return $this->headtitle; } function returnHeaderTitle() { return $this->title; } function returnLogline() { return $this->logline; } function returnGS() { if($this->gs != ''){return '';} } function returnGSImage() { if($this->gs != ''){return '';} } function returnNextShowing() { if($this->nextShowing != ''){return '

Next Screening

'.$this->nextShowing.'

';} } function returnNextShowingIcon() { if($this->nextShowingIcon != ''){return '
';} } function returnShowings() { if($this->showings == NULL){return;} $myShowings='

Screenings

'.$this->nextShowing.'

'; foreach($this->showings as $showing) { $myShowings.='

'.$showing.'

'; } return $myShowings; } function returnMyself() { $nja='
'.$this->returnGSImage().'

'.$this->title.'

"'.$this->logline.'"

'.$this->returnNextShowing().$this->returnNextShowingIcon().'

'.$this->synopsis.'

'; if($this->featuring!=''){$nja.='

'.$this->featuring.'

';} $nja.='
'.$this->returnMyImages().'
'; $nja.=$this->returnMyProjectItems(); $nja.='
'.$this->returnShowings().'
'; return $nja; } } /// BEGIN /// INCLUDE MY URI CLASS include('lib/nja_classURI.php'); /// GET SITE URI $GLOBALS['SiteURI']=new njaURI('generic',parse_url($_SERVER['REQUEST_URI'])); /// GET SITE XML $GLOBALS['xml']=new xmlData('dat/filmdata.xml'); /// CHECK IF THERE IS AN ACTUAL COMMAND THERE if($GLOBALS['SiteURI']->hasCommand()) { $myCommand=$GLOBALS['SiteURI']->returnCommand(); } else { // FrontPage header("Location: http://www.albiontales.com/"); die(); } /// CHECK IF THE ACCESSED PAGE COMMAND EXISTS IN THE XML. IF SO, GRAB THE PAGE. IF NOT, BACK TO INDEX if(isset($GLOBALS['xml']->xml->pages->$myCommand)) { $nja_myFilm = new film($GLOBALS['xml']->xml->pages->$myCommand->attributes()->page); } else { header("Location: http://www.albiontales.com/"); die(); } ?> <? echo $nja_myFilm->returnHeadTitle(); ?> returnGSImage(); ?> returnGS(); ?> returnMyself(); ?>