コード例 #1
0
ファイル: SpotPage_rss.php プロジェクト: remielowik/spotweb
	function render() {
		# Controleer de users' rechten
		$this->_spotSec->fatalPermCheck(SpotSecurity::spotsec_view_spotdetail, '');
		$this->_spotSec->fatalPermCheck(SpotSecurity::spotsec_view_spots_index, '');
		$this->_spotSec->fatalPermCheck(SpotSecurity::spotsec_view_rssfeed, '');

		$spotsOverview = new SpotsOverview($this->_db, $this->_settings);
		$nzbhandling = $this->_currentSession['user']['prefs']['nzbhandling'];

		# we willen niet dat de RSS feed gecached wordt
		$this->sendExpireHeaders(true);
		
		# Zet the query parameters om naar een lijst met filters, velden,
		# en sorteringen etc
		$parsedSearch = $spotsOverview->filterToQuery($this->_params['search'],
							array('field' => $this->_params['sortby'],
								  'direction' => $this->_params['sortdir']),
						    $this->_currentSession);
		$this->_params['search'] = $parsedSearch['search'];

		# laad de spots
		$pageNr = $this->_params['page'];
		$spotsTmp = $spotsOverview->loadSpots($this->_currentSession['user']['userid'],
							$pageNr,
							$this->_currentSession['user']['prefs']['perpage'],
							$parsedSearch);

		# Opbouwen XML
		$doc = new DOMDocument('1.0', 'utf-8');
		$doc->formatOutput = true;

		$rss = $doc->createElement('rss');
		$rss->setAttribute('version', '2.0');
		$rss->setAttribute('xmlns:atom', 'http://www.w3.org/2005/Atom');
		$doc->appendChild($rss);

		$atomSelfLink = $doc->createElementNS('http://www.w3.org/2005/Atom', 'atom10:link');
		$atomSelfLink->setAttribute('href', html_entity_decode($this->_tplHelper->makeSelfUrl("full")));
		$atomSelfLink->setAttribute('rel', 'self');
		$atomSelfLink->setAttribute('type', 'application/rss+xml');

		$channel = $doc->createElement('channel');
		$channel->appendChild($doc->createElement('generator', 'Spotweb v' . SPOTWEB_VERSION));
		$channel->appendChild($doc->createElement('language', 'nl'));
		$channel->appendChild($doc->createElement('title', 'Spotweb'));
		$channel->appendChild($doc->createElement('description', 'Spotweb RSS Feed'));
		$channel->appendChild($doc->createElement('link', $this->_tplHelper->makeBaseUrl("full")));
		$channel->appendChild($atomSelfLink);
		$channel->appendChild($doc->createElement('webMaster', $this->_currentSession['user']['mail'] . ' (' . $this->_currentSession['user']['firstname'] . ' ' . $this->_currentSession['user']['lastname'] . ')'));
		$channel->appendChild($doc->createElement('pubDate', date('r')));
		$rss->appendChild($channel);

		# Fullspots ophalen en aan XML toevoegen
		foreach($spotsTmp['list'] as $spotHeaders) {
			try {
				$spot = $this->_tplHelper->getFullSpot($spotHeaders['messageid'], false);
				# Normaal is fouten oplossen een beter idee, maar in dit geval is het een bug in de library (?)
				# Dit voorkomt Notice: Uninitialized string offset: 0 in lib/ubb/TagHandler.inc.php on line 142
				# wat een onbruikbare RSS oplevert
				$spot = @$this->_tplHelper->formatSpot($spot);

				$title = preg_replace(array('/</', '/>/'), array('&#x3C;', '&#x3E;'), $spot['title']);
				$poster = (empty($spot['userid'])) ? $spot['poster'] : $spot['poster'] . " (" . $spot['userid'] . ")";

				$guid = $doc->createElement('guid', $spot['messageid']);
				$guid->setAttribute('isPermaLink', 'false');

				$description = $doc->createElement('description');
				$descriptionCdata = $doc->createCDATASection($spot['description'] . '<br /><font color="#ca0000">Door: ' . $poster . '</font>');
				$description->appendChild($descriptionCdata);

				$item = $doc->createElement('item');
				$item->appendChild($doc->createElement('title', $title));
				$item->appendChild($guid);
				$item->appendChild($doc->createElement('link', $this->_tplHelper->makeBaseUrl("full") . '?page=getspot&amp;messageid=' . urlencode($spot['messageid']) . $this->_tplHelper->makeApiRequestString()));
				$item->appendChild($description);
				$item->appendChild($doc->createElement('author', $spot['messageid'] . ' (' . $poster . ')'));
				$item->appendChild($doc->createElement('pubDate', date('r', $spot['stamp'])));
				$item->appendChild($doc->createElement('category', SpotCategories::HeadCat2Desc($spot['category']) . ': ' . SpotCategories::Cat2ShortDesc($spot['category'], $spot['subcata'])));

				$enclosure = $doc->createElement('enclosure');
				$enclosure->setAttribute('url', html_entity_decode($this->_tplHelper->makeNzbUrl($spot)));
				$enclosure->setAttribute('length', $spot['filesize']);
				switch ($nzbhandling['prepare_action']) {
					case 'zip'	: $enclosure->setAttribute('type', 'application/zip'); break;
					default		: $enclosure->setAttribute('type', 'application/x-nzb');
				} # switch
				$item->appendChild($enclosure);

				$channel->appendChild($item);
			} # try
			catch(Exception $x) {
				// Article not found. ignore.
			} # catch
		} # foreach

		# XML output
		header('Content-Type: application/rss+xml; charset=UTF-8');
		echo $doc->saveXML();
	} # render()
コード例 #2
0
 function spotDetails($outputtype)
 {
     if (empty($this->_params['messageid'])) {
         $this->showApiError(200);
         return;
     }
     # if
     # Make sure the specific permissions are implemented
     $this->_spotSec->fatalPermCheck(SpotSecurity::spotsec_view_spotdetail, '');
     # spot ophalen
     try {
         $fullSpot = $this->_tplHelper->getFullSpot($this->_params['messageid'], true);
     } catch (Exception $x) {
         $this->showApiError(300);
         return;
     }
     # catch
     $nzbhandling = $this->_currentSession['user']['prefs']['nzbhandling'];
     /*
      * Ugly @ operator, but we cannot reliably fix the library for the moment
      */
     $spot = @$this->_tplHelper->formatSpot($fullSpot);
     if ($outputtype == "json") {
         $doc = array();
         $doc['ID'] = $spot['id'];
         $doc['name'] = $spot['title'];
         $doc['size'] = $spot['filesize'];
         $doc['adddate'] = date('Y-m-d H:i:s', $spot['stamp']);
         $doc['guid'] = $spot['messageid'];
         $doc['fromname'] = $spot['poster'];
         $doc['completion'] = 100;
         $nabCat = explode("|", $this->Cat2NewznabCat($spot['category'], $spot['subcata']));
         if ($nabCat[0] != "" && is_numeric($nabCat[0])) {
             $doc['categoryID'] = $nabCat[0];
             $cat = implode(",", $nabCat);
         }
         # if
         $nabCat = explode("|", $this->Cat2NewznabCat($spot['category'], $spot['subcatb']));
         if ($nabCat[0] != "" && is_numeric($nabCat[0])) {
             $cat .= "," . $nabCat[0];
         }
         # if
         $doc['comments'] = $spot['commentcount'];
         $doc['category_name'] = SpotCategories::HeadCat2Desc($spot['category']) . ': ' . SpotCategories::Cat2ShortDesc($spot['category'], $spot['subcata']);
         $doc['category_ids'] = $cat;
         echo json_encode($doc);
     } else {
         $nzbUrl = $this->_tplHelper->makeBaseUrl("full") . 'api?t=g&amp;id=' . $spot['messageid'] . $this->_tplHelper->makeApiRequestString();
         # Opbouwen XML
         $doc = new DOMDocument('1.0', 'utf-8');
         $doc->formatOutput = true;
         $rss = $doc->createElement('rss');
         $rss->setAttribute('version', '2.0');
         $rss->setAttribute('xmlns:atom', 'http://www.w3.org/2005/Atom');
         $rss->setAttribute('xmlns:newznab', 'http://www.newznab.com/DTD/2010/feeds/attributes/');
         $rss->setAttribute('encoding', 'utf-8');
         $doc->appendChild($rss);
         $channel = $doc->createElement('channel');
         $channel->appendChild($doc->createElement('title', 'Spotweb'));
         $channel->appendChild($doc->createElement('language', 'nl'));
         $channel->appendChild($doc->createElement('description', 'Spotweb Index Api Detail'));
         $channel->appendChild($doc->createElement('link', $this->_settings->get('spotweburl')));
         $channel->appendChild($doc->createElement('webMaster', $this->_currentSession['user']['mail'] . ' (' . $this->_currentSession['user']['firstname'] . ' ' . $this->_currentSession['user']['lastname'] . ')'));
         $channel->appendChild($doc->createElement('category', ''));
         $rss->appendChild($channel);
         $image = $doc->createElement('image');
         $image->appendChild($doc->createElement('url', $this->_tplHelper->makeImageUrl($spot, 300, 300)));
         $image->appendChild($doc->createElement('title', 'Spotweb Index'));
         $image->appendChild($doc->createElement('link', $this->_settings->get('spotweburl')));
         $image->appendChild($doc->createElement('description', 'Visit Spotweb Index'));
         $channel->appendChild($image);
         $poster = empty($spot['spotterid']) ? $spot['poster'] : $spot['poster'] . " (" . $spot['spotterid'] . ")";
         $guid = $doc->createElement('guid', $spot['messageid']);
         $guid->setAttribute('isPermaLink', 'false');
         $description = $doc->createElement('description');
         $descriptionCdata = $doc->createCDATASection($spot['description'] . '<br /><font color="#ca0000">Door: ' . $poster . '</font>');
         $description->appendChild($descriptionCdata);
         $item = $doc->createElement('item');
         $item->appendChild($doc->createElement('title', htmlspecialchars($spot['title'], ENT_QUOTES, "UTF-8")));
         $item->appendChild($guid);
         $item->appendChild($doc->createElement('link', $nzbUrl));
         $item->appendChild($doc->createElement('pubDate', date('r', $spot['stamp'])));
         $item->appendChild($doc->createElement('category', SpotCategories::HeadCat2Desc($spot['category']) . " > " . SpotCategories::Cat2ShortDesc($spot['category'], $spot['subcata'])));
         $item->appendChild($description);
         $channel->appendChild($item);
         $enclosure = $doc->createElement('enclosure');
         $enclosure->setAttribute('url', html_entity_decode($nzbUrl));
         $enclosure->setAttribute('length', $spot['filesize']);
         switch ($nzbhandling['prepare_action']) {
             case 'zip':
                 $enclosure->setAttribute('type', 'application/zip');
                 break;
             default:
                 $enclosure->setAttribute('type', 'application/x-nzb');
         }
         # switch
         $item->appendChild($enclosure);
         $nabCat = explode("|", $this->Cat2NewznabCat($spot['category'], $spot['subcata']));
         if ($nabCat[0] != "" && is_numeric($nabCat[0])) {
             $attr = $doc->createElement('newznab:attr');
             $attr->setAttribute('name', 'category');
             $attr->setAttribute('value', $nabCat[0]);
             $item->appendChild($attr);
             $attr = $doc->createElement('newznab:attr');
             $attr->setAttribute('name', 'category');
             $attr->setAttribute('value', $nabCat[1]);
             $item->appendChild($attr);
         }
         # if
         $nabCat = explode("|", $this->Cat2NewznabCat($spot['category'], $spot['subcatb']));
         if ($nabCat[0] != "" && is_numeric($nabCat[0])) {
             $attr = $doc->createElement('newznab:attr');
             $attr->setAttribute('name', 'category');
             $attr->setAttribute('value', $nabCat[0]);
             $item->appendChild($attr);
         }
         # if
         $attr = $doc->createElement('newznab:attr');
         $attr->setAttribute('name', 'size');
         $attr->setAttribute('value', $spot['filesize']);
         $item->appendChild($attr);
         $attr = $doc->createElement('newznab:attr');
         $attr->setAttribute('name', 'poster');
         $attr->setAttribute('value', $spot['poster'] . '@spot.net (' . $spot['poster'] . ')');
         $item->appendChild($attr);
         $attr = $doc->createElement('newznab:attr');
         $attr->setAttribute('name', 'comments');
         $attr->setAttribute('value', $spot['commentcount']);
         $item->appendChild($attr);
         $this->sendContentTypeHeader('xml');
         echo $doc->saveXML();
     }
     # if
 }
コード例 #3
0
	function showResults($spots, $offset, $outputtype) {
		$nzbhandling = $this->_currentSession['user']['prefs']['nzbhandling'];

		if ($outputtype == "json") {
			echo json_encode($spots); //TODO:make that a more specific array of data to return rather than resultset
		} else {
			# Opbouwen XML
			$doc = new DOMDocument('1.0', 'utf-8');
			$doc->formatOutput = true;

			$rss = $doc->createElement('rss');
			$rss->setAttribute('version', '2.0');
			$rss->setAttribute('xmlns:atom', 'http://www.w3.org/2005/Atom');
			$rss->setAttribute('xmlns:newznab', 'http://www.newznab.com/DTD/2010/feeds/attributes/');
			$doc->appendChild($rss);

			$atomSelfLink = $doc->createElement('atom:link');
			$atomSelfLink->setAttribute('href', $this->_settings->get('spotweburl') . 'api');
			$atomSelfLink->setAttribute('rel', 'self');
			$atomSelfLink->setAttribute('type', 'application/rss+xml');

			$channel = $doc->createElement('channel');
			$channel->appendChild($atomSelfLink);
			$channel->appendChild($doc->createElement('title', 'Spotweb Index'));
			$channel->appendChild($doc->createElement('description', 'Spotweb Index API Results'));
			$channel->appendChild($doc->createElement('link', $this->_settings->get('spotweburl')));
			$channel->appendChild($doc->createElement('language', 'en-gb'));
			$channel->appendChild($doc->createElement('webMaster', $this->_currentSession['user']['mail'] . ' (' . $this->_currentSession['user']['firstname'] . ' ' . $this->_currentSession['user']['lastname'] . ')'));
			$channel->appendChild($doc->createElement('category', ''));
			$rss->appendChild($channel);

			$image = $doc->createElement('image');
			$image->appendChild($doc->createElement('url', $this->_settings->get('spotweburl') . 'images/spotnet.gif'));
			$image->appendChild($doc->createElement('title', 'Spotweb Index'));
			$image->appendChild($doc->createElement('link', $this->_settings->get('spotweburl')));
			$image->appendChild($doc->createElement('description', 'SpotWeb Index API Results'));
			$channel->appendChild($image);

			$newznabResponse = $doc->createElement('newznab:response');
			$newznabResponse->setAttribute('offset', $offset);
			$newznabResponse->setAttribute('total', count($spots['list']));
			$channel->appendChild($newznabResponse);

			foreach($spots['list'] as $spot) {
				$spot = $this->_tplHelper->formatSpotHeader($spot);
				$title = preg_replace(array('/</', '/>/'), array('&#x3C;', '&#x3E;'), $spot['title']);

				$guid = $doc->createElement('guid', $spot['messageid']);
				$guid->setAttribute('isPermaLink', 'false');

				$item = $doc->createElement('item');
				$item->appendChild($doc->createElement('title', $title));
				$item->appendChild($guid);
				$item->appendChild($doc->createElement('link', $this->_tplHelper->makeNzbUrl($spot)));
				$item->appendChild($doc->createElement('pubDate', date('r', $spot['stamp'])));
				$item->appendChild($doc->createElement('category', SpotCategories::HeadCat2Desc($spot['category']) . " > " . SpotCategories::Cat2ShortDesc($spot['category'], $spot['subcata'])));
				$channel->appendChild($item);

				$enclosure = $doc->createElement('enclosure');
				$enclosure->setAttribute('url', html_entity_decode($this->_tplHelper->makeNzbUrl($spot)));
				$enclosure->setAttribute('length', $spot['filesize']);
				switch ($nzbhandling['prepare_action']) {
					case 'zip'	: $enclosure->setAttribute('type', 'application/zip'); break;
					default		: $enclosure->setAttribute('type', 'application/x-nzb');
				} # switch
				$item->appendChild($enclosure);

				$nabCat = explode("|", $this->Cat2NewznabCat($spot['category'], $spot['subcata']));
				if ($nabCat[0] != "" && is_numeric($nabCat[0])) {
					$attr = $doc->createElement('newznab:attr');
					$attr->setAttribute('name', 'category');
					$attr->setAttribute('value', $nabCat[0]);
					$item->appendChild($attr);

					$attr = $doc->createElement('newznab:attr');
					$attr->setAttribute('name', 'category');
					$attr->setAttribute('value', $nabCat[1]);
					$item->appendChild($attr);
				} # if

				$nabCat = explode("|", $this->Cat2NewznabCat($spot['category'], $spot['subcatb']));
				if ($nabCat[0] != "" && is_numeric($nabCat[0])) {
					$attr = $doc->createElement('newznab:attr');
					$attr->setAttribute('name', 'category');
					$attr->setAttribute('value', $nabCat[0]);
					$item->appendChild($attr);
				}

				$attr = $doc->createElement('newznab:attr');
				$attr->setAttribute('name', 'size');
				$attr->setAttribute('value', $spot['filesize']);
				$item->appendChild($attr);

				if ($this->_params['extended'] != "0") {
					$attr = $doc->createElement('newznab:attr');
					$attr->setAttribute('name', 'poster');
					$attr->setAttribute('value', $spot['poster'] . '@spot.net');
					$item->appendChild($attr);

					$attr = $doc->createElement('newznab:attr');
					$attr->setAttribute('name', 'comments');
					$attr->setAttribute('value', $spot['commentcount']);
					$item->appendChild($attr);
				} # if
			} # foreach

			header('Content-Type: text/xml; charset=UTF-8');
			echo $doc->saveXML();
		}
	} # showResults
コード例 #4
0
ファイル: SpotPage_rss.php プロジェクト: Ernie69/spotweb
 function render()
 {
     # Make sure the proper permissions are met
     $this->_spotSec->fatalPermCheck(SpotSecurity::spotsec_view_spotdetail, '');
     $this->_spotSec->fatalPermCheck(SpotSecurity::spotsec_view_spots_index, '');
     $this->_spotSec->fatalPermCheck(SpotSecurity::spotsec_view_rssfeed, '');
     $nzbhandling = $this->_currentSession['user']['prefs']['nzbhandling'];
     # Don't allow the RSS feed to be cached
     $this->sendExpireHeaders(true);
     /*
      * Transform the query parameters to a list of filters, fields, 
      * sortings, etc.
      */
     $svcUserFilter = new Services_User_Filters($this->_daoFactory, $this->_settings);
     $svcSearchQp = new Services_Search_QueryParser($this->_daoFactory->getConnection());
     $parsedSearch = $svcSearchQp->filterToQuery($this->_params['search'], array('field' => $this->_params['sortby'], 'direction' => $this->_params['sortdir']), $this->_currentSession, $svcUserFilter->getIndexFilter($this->_currentSession['user']['userid']));
     /* 
      * Actually fetch the spots
      */
     $pageNr = $this->_params['page'];
     $svcProvSpotList = new Services_Providers_SpotList($this->_daoFactory->getSpotDao());
     $spotsTmp = $svcProvSpotList->fetchSpotList($this->_currentSession['user']['userid'], $pageNr, $this->_currentSession['user']['prefs']['perpage'], $parsedSearch);
     # Create an XML document for RSS
     $doc = new DOMDocument('1.0', 'utf-8');
     $doc->formatOutput = true;
     $rss = $doc->createElement('rss');
     $rss->setAttribute('version', '2.0');
     $rss->setAttribute('xmlns:atom', 'http://www.w3.org/2005/Atom');
     $doc->appendChild($rss);
     $atomSelfLink = $doc->createElementNS('http://www.w3.org/2005/Atom', 'atom10:link');
     $atomSelfLink->setAttribute('href', html_entity_decode($this->_tplHelper->makeSelfUrl("full")));
     $atomSelfLink->setAttribute('rel', 'self');
     $atomSelfLink->setAttribute('type', 'application/rss+xml');
     $channel = $doc->createElement('channel');
     $channel->appendChild($doc->createElement('generator', 'Spotweb v' . SPOTWEB_VERSION));
     $channel->appendChild($doc->createElement('language', 'nl'));
     $channel->appendChild($doc->createElement('title', 'Spotweb'));
     $channel->appendChild($doc->createElement('description', 'Spotweb RSS Feed'));
     $channel->appendChild($doc->createElement('link', $this->_tplHelper->makeBaseUrl("full")));
     $channel->appendChild($atomSelfLink);
     $channel->appendChild($doc->createElement('webMaster', $this->_currentSession['user']['mail'] . ' (' . $this->_currentSession['user']['firstname'] . ' ' . $this->_currentSession['user']['lastname'] . ')'));
     $channel->appendChild($doc->createElement('pubDate', date('r')));
     $rss->appendChild($channel);
     # Retrieve full spots so we can show images for spots etc.
     foreach ($spotsTmp['list'] as $spotHeaders) {
         try {
             $spot = $this->_tplHelper->getFullSpot($spotHeaders['messageid'], false);
             /*
              * We supress the error by using this ugly operator simply because the library
              * sometimes gives an notice and we cannot be bothered to fix it, but it does
              * give an incorrect and unusable RSS feed
              */
             $spot = @$this->_tplHelper->formatSpot($spot);
             $title = str_replace(array('<', '>', '&'), array('&#x3C;', '&#x3E;', '&amp;'), $spot['title']);
             $poster = empty($spot['spotterid']) ? $spot['poster'] : $spot['poster'] . " (" . $spot['spotterid'] . ")";
             $guid = $doc->createElement('guid', $spot['messageid']);
             $guid->setAttribute('isPermaLink', 'false');
             $description = $doc->createElement('description');
             $descriptionCdata = $doc->createCDATASection($spot['description'] . '<br /><font color="#ca0000">Door: ' . $poster . '</font>');
             $description->appendChild($descriptionCdata);
             $item = $doc->createElement('item');
             $item->appendChild($doc->createElement('title', $title));
             $item->appendChild($guid);
             $item->appendChild($doc->createElement('link', $this->_tplHelper->makeBaseUrl("full") . '?page=getspot&amp;messageid=' . urlencode($spot['messageid']) . $this->_tplHelper->makeApiRequestString()));
             $item->appendChild($description);
             $item->appendChild($doc->createElement('author', $spot['messageid'] . ' (' . $poster . ')'));
             $item->appendChild($doc->createElement('pubDate', date('r', $spot['stamp'])));
             $item->appendChild($doc->createElement('category', SpotCategories::HeadCat2Desc($spot['category']) . ': ' . SpotCategories::Cat2ShortDesc($spot['category'], $spot['subcata'])));
             $enclosure = $doc->createElement('enclosure');
             $enclosure->setAttribute('url', html_entity_decode($this->_tplHelper->makeNzbUrl($spot)));
             $enclosure->setAttribute('length', $spot['filesize']);
             switch ($nzbhandling['prepare_action']) {
                 case 'zip':
                     $enclosure->setAttribute('type', 'application/zip');
                     break;
                 default:
                     $enclosure->setAttribute('type', 'application/x-nzb');
             }
             # switch
             $item->appendChild($enclosure);
             $channel->appendChild($item);
         } catch (Exception $x) {
             // Article not found. ignore.
         }
         # catch
     }
     # foreach
     # Output XML
     $this->sendContentTypeHeader('rss');
     echo $doc->saveXML();
 }
コード例 #5
0
 function formatSpot($spot, $comments)
 {
     # fix the sabnzbdurl en searchurl
     $spot['sabnzbdurl'] = $this->makeSabnzbdUrl($spot);
     $spot['searchurl'] = $this->makeSearchUrl($spot);
     // Category is altijd een integer bij ons
     $spot['category'] = (int) $spot['category'];
     // Geen website? Dan standaard naar de zoekmachine
     if (empty($spot['website'])) {
         $spot['website'] = $this->makeSearchUrl($spot);
     }
     # if
     // geef de category een fatsoenlijke naam
     $spot['catname'] = SpotCategories::HeadCat2Desc($spot['category']);
     $spot['formatname'] = SpotCategories::Cat2ShortDesc($spot['category'], $spot['subcata']);
     // properly escape sevreal urls
     if (!is_array($spot['image'])) {
         $spot['image'] = htmlentities($spot['image']);
     } else {
         $spot['image'] = '';
     }
     # else
     $spot['website'] = htmlentities($spot['website']);
     $spot['poster'] = htmlentities(strip_tags($spot['poster']), ENT_QUOTES);
     $spot['tag'] = htmlentities(strip_tags($spot['tag']));
     // title escapen
     $spot['title'] = htmlentities(strip_tags($spot['title']), ENT_QUOTES);
     // description
     $spot['description'] = htmlentities(strip_tags($this->formatDescription($spot['description'])), ENT_QUOTES);
     // escape de HTML voor de comments
     $commentCount = count($comments);
     for ($i = 0; $i < $commentCount; $i++) {
         $comments[$i]['body'] = array_map('strip_tags', $comments[$i]['body']);
     }
     # for
     return array($spot, $comments);
 }
コード例 #6
0
ファイル: atom.inc.php プロジェクト: red-arrow/spotweb
$selfUrl = htmlspecialchars($tplHelper->selfUrl());
$indexUrl = htmlspecialchars($tplHelper->changePage('index'));
?>
        <title>SpotWeb Spot overzicht</title>
        <link href="<?php echo $selfUrl ?>" rel="self" />
        <link href="<?php echo $indexUrl ?>" rel="alternate" />
        <id><?php echo $selfUrl?></id>
        <updated><?php echo date('c')?></updated>
        <generator>Spotweb</generator>
        <icon><?echo $baseUrl?>images/touch-icon-iphone4.png</icon>

<?php foreach($spots as $spot):
$spotLink = $tplHelper->spotUrl($spot);
$id = 'tag:' . $tplHelper->host() . ',2011:spot/'. urlencode($spot['messageid']);
$spot['description'] = @$tplHelper->formatDescription($spot['description']); ?>
        <entry>
                <title><?php echo htmlspecialchars($spot['title']) ?></title>
                <author><name><?php echo htmlspecialchars($spot['poster'])?></name></author>
                <link rel="alternate" type="text/html" href="<?php echo $spotLink ?>"/>
                <link rel="alternate" type="application/x-nzb" href="<?php echo $tplHelper->nzbUrl($spot)?>" title="NZB"/>
                <link rel="related" type="text/html" href="<?php echo htmlspecialchars($spot['website'])?>" />
                <id><?php echo $id ?></id>
                <published><? echo date('c', $spot['stamp'])?></published>
                <updated><? echo date('c', $spot['stamp'])?></updated>
                <category label="<?echo SpotCategories::HeadCat2Desc($spot['category'])?>" term="cat<?echo $spot['category']?>"/>
                <category label="<?echo SpotCategories::Cat2ShortDesc($spot['category'],$spot['subcat'])?>" term="<?echo SpotCategories::SubcatToFilter($spot['category'],$spot['subcat'])?>"/>
                <content type="html"><![CDATA[<?php echo $spot['description']?><br/><img src="<?php echo $spot['image'] ?>"/>]]></content>
        </entry>
<?php endforeach; ?>

</feed>
コード例 #7
0
 function spotDetails($outputtype)
 {
     if (empty($this->_params['messageid'])) {
         $this->showApiError(200);
     }
     # if
     # Controleer de users' rechten
     $this->_spotSec->fatalPermCheck(SpotSecurity::spotsec_view_spotdetail, '');
     # spot ophalen
     try {
         $fullSpot = $this->_tplHelper->getFullSpot($this->_params['messageid'], true);
     } catch (Exception $x) {
         $this->showApiError(300);
     }
     # catch
     $nzbhandling = $this->_currentSession['user']['prefs']['nzbhandling'];
     # Normaal is fouten oplossen een beter idee, maar in dit geval is het een bug in de library (?)
     # Dit voorkomt Notice: Uninitialized string offset: 0 in lib/ubb/TagHandler.inc.php on line 142
     # wat een onbruikbaar resultaat oplevert
     $spot = @$this->_tplHelper->formatSpot($fullSpot);
     if ($outputtype == "json") {
         $doc = array();
         $doc['ID'] = $spot['id'];
         $doc['name'] = $spot['title'];
         $doc['size'] = $spot['filesize'];
         $doc['adddate'] = date('Y-m-d H:i:s', $spot['stamp']);
         $doc['guid'] = $spot['messageid'];
         $doc['fromname'] = $spot['poster'];
         $doc['completion'] = 100;
         $nabCat = explode("|", $this->Cat2NewznabCat($spot['category'], $spot['subcata']));
         if ($nabCat[0] != "" && is_numeric($nabCat[0])) {
             $doc['categoryID'] = $nabCat[0];
             $cat = implode(",", $nabCat);
         }
         # if
         $nabCat = explode("|", $this->Cat2NewznabCat($spot['category'], $spot['subcatb']));
         if ($nabCat[0] != "" && is_numeric($nabCat[0])) {
             $cat .= "," . $nabCat[0];
         }
         # if
         $doc['comments'] = $spot['commentcount'];
         $doc['category_name'] = SpotCategories::HeadCat2Desc($spot['category']) . ': ' . SpotCategories::Cat2ShortDesc($spot['category'], $spot['subcata']);
         $doc['category_ids'] = $cat;
         echo json_encode($doc);
     } else {
         $nzbUrl = $this->_tplHelper->makeBaseUrl("full") . 'api?t=g&amp;id=' . $spot['messageid'] . $this->_tplHelper->makeApiRequestString();
         # Opbouwen XML
         $doc = new DOMDocument('1.0', 'utf-8');
         $doc->formatOutput = true;
         $rss = $doc->createElement('rss');
         $rss->setAttribute('version', '2.0');
         $rss->setAttribute('xmlns:atom', 'http://www.w3.org/2005/Atom');
         $rss->setAttribute('xmlns:newznab', 'http://www.newznab.com/DTD/2010/feeds/attributes/');
         $rss->setAttribute('encoding', 'utf-8');
         $doc->appendChild($rss);
         $channel = $doc->createElement('channel');
         $channel->appendChild($doc->createElement('title', 'Spotweb'));
         $channel->appendChild($doc->createElement('language', 'nl'));
         $channel->appendChild($doc->createElement('description', 'Spotweb Index Api Detail'));
         $channel->appendChild($doc->createElement('link', $this->_settings->get('spotweburl')));
         $channel->appendChild($doc->createElement('webMaster', $this->_currentSession['user']['mail'] . ' (' . $this->_currentSession['user']['firstname'] . ' ' . $this->_currentSession['user']['lastname'] . ')'));
         $channel->appendChild($doc->createElement('category', ''));
         $rss->appendChild($channel);
         $image = $doc->createElement('image');
         $image->appendChild($doc->createElement('url', $this->_tplHelper->makeImageUrl($spot, 300, 300)));
         $image->appendChild($doc->createElement('title', 'Spotweb Index'));
         $image->appendChild($doc->createElement('link', $this->_settings->get('spotweburl')));
         $image->appendChild($doc->createElement('description', 'Visit Spotweb Index'));
         $channel->appendChild($image);
         $title = preg_replace(array('/</', '/>/'), array('&#x3C;', '&#x3E;'), $spot['title']);
         $poster = empty($spot['userid']) ? $spot['poster'] : $spot['poster'] . " (" . $spot['userid'] . ")";
         $guid = $doc->createElement('guid', $spot['messageid']);
         $guid->setAttribute('isPermaLink', 'false');
         $description = $doc->createElement('description');
         $descriptionCdata = $doc->createCDATASection($spot['description'] . '<br /><font color="#ca0000">Door: ' . $poster . '</font>');
         $description->appendChild($descriptionCdata);
         $item = $doc->createElement('item');
         $item->appendChild($doc->createElement('title', $title));
         $item->appendChild($guid);
         $item->appendChild($doc->createElement('link', $nzbUrl));
         $item->appendChild($doc->createElement('pubDate', date('r', $spot['stamp'])));
         $item->appendChild($doc->createElement('category', SpotCategories::HeadCat2Desc($spot['category']) . " > " . SpotCategories::Cat2ShortDesc($spot['category'], $spot['subcata'])));
         $item->appendChild($description);
         $channel->appendChild($item);
         $enclosure = $doc->createElement('enclosure');
         $enclosure->setAttribute('url', html_entity_decode($nzbUrl));
         $enclosure->setAttribute('length', $spot['filesize']);
         switch ($nzbhandling['prepare_action']) {
             case 'zip':
                 $enclosure->setAttribute('type', 'application/zip');
                 break;
             default:
                 $enclosure->setAttribute('type', 'application/x-nzb');
         }
         # switch
         $item->appendChild($enclosure);
         $nabCat = explode("|", $this->Cat2NewznabCat($spot['category'], $spot['subcata']));
         if ($nabCat[0] != "" && is_numeric($nabCat[0])) {
             $attr = $doc->createElement('newznab:attr');
             $attr->setAttribute('name', 'category');
             $attr->setAttribute('value', $nabCat[0]);
             $item->appendChild($attr);
             $attr = $doc->createElement('newznab:attr');
             $attr->setAttribute('name', 'category');
             $attr->setAttribute('value', $nabCat[1]);
             $item->appendChild($attr);
         }
         # if
         $nabCat = explode("|", $this->Cat2NewznabCat($spot['category'], $spot['subcatb']));
         if ($nabCat[0] != "" && is_numeric($nabCat[0])) {
             $attr = $doc->createElement('newznab:attr');
             $attr->setAttribute('name', 'category');
             $attr->setAttribute('value', $nabCat[0]);
             $item->appendChild($attr);
         }
         # if
         $attr = $doc->createElement('newznab:attr');
         $attr->setAttribute('name', 'size');
         $attr->setAttribute('value', $spot['filesize']);
         $item->appendChild($attr);
         $attr = $doc->createElement('newznab:attr');
         $attr->setAttribute('name', 'poster');
         $attr->setAttribute('value', $spot['poster'] . '@spot.net (' . $spot['poster'] . ')');
         $item->appendChild($attr);
         $attr = $doc->createElement('newznab:attr');
         $attr->setAttribute('name', 'comments');
         $attr->setAttribute('value', $spot['commentcount']);
         $item->appendChild($attr);
         header('Content-Type: text/xml; charset=UTF-8');
         echo $doc->saveXML();
     }
     # if
 }
コード例 #8
0
 function formatSpot($spot)
 {
     # formatteer de spot
     $spot = $this->formatSpotHeader($spot);
     // Category is altijd een integer bij ons
     $spot['category'] = (int) $spot['category'];
     // Geen website? Dan standaard naar de zoekmachine
     if (empty($spot['website'])) {
         $spot['website'] = $this->makeSearchUrl($spot);
     }
     # if
     // geef de category een fatsoenlijke naam
     $spot['catname'] = SpotCategories::HeadCat2Desc($spot['category']);
     $spot['formatname'] = SpotCategories::Cat2ShortDesc($spot['category'], $spot['subcata']);
     // properly escape several  urls
     if (!is_array($spot['image'])) {
         $spot['image'] = htmlspecialchars($spot['image']);
     }
     # if
     $spot['website'] = htmlspecialchars($spot['website']);
     $spot['tag'] = htmlspecialchars(strip_tags($spot['tag']), ENT_QUOTES, 'UTF-8');
     // description
     $spot['description'] = $this->formatContent($spot['description']);
     return $spot;
 }
コード例 #9
0
ファイル: SpotTemplateHelper.php プロジェクト: niel/spotweb
 function formatSpot($spot)
 {
     # formatteer de spot
     $spot = $this->formatSpotHeader($spot);
     // Category is altijd een integer bij ons
     $spot['category'] = (int) $spot['category'];
     // Geen website? Dan standaard naar de zoekmachine
     if (empty($spot['website'])) {
         $spot['website'] = $this->makeSearchUrl($spot);
     }
     # if
     // geef de category een fatsoenlijke naam
     $spot['catname'] = SpotCategories::HeadCat2Desc($spot['category']);
     $spot['formatname'] = SpotCategories::Cat2ShortDesc($spot['category'], $spot['subcata']);
     // properly escape several  urls
     if (!is_array($spot['image'])) {
         $spot['image'] = htmlspecialchars($spot['image']);
     }
     # if
     $spot['website'] = htmlspecialchars($spot['website']);
     $spot['tag'] = htmlspecialchars(strip_tags($spot['tag']), ENT_QUOTES, 'UTF-8');
     // description
     $spot['description'] = $this->formatContent($spot['description']);
     // Stripped stuff like 'Subs by:..., -releasegroup, mpg, hd, subs, nlsubs, r1.hdtv.blabla, etc. for the usage of (the imdb) api('s).
     // After that it wil remove the spaces left behind, replacing them with only one space.
     // It will probably not filter all but it will filter a lot.
     // It will only filter cat0 (beeld).
     if ($spot['category'] == 0) {
         $spot['cleantitle'] = preg_replace('/(([Ss][uU][Bb][Ss]) ([Mm][Aa][Dd][Ee]\\s)?([bB][yY])\\s?:?.{0,15}\\S)|(~.+~)|' . '( \\S{2,}( ?/ ?\\S{2,})+)|(\\*+.+\\*+)|(-=?.{0,10}=?-)|(\\d{3,4}[pP])|([Hh][Qq])|' . '(\\(\\w+(\\s\\w+)?\\))|(\\S*([Ss][Uu][Bb](([Ss])|([Bb][Ee][Dd])))\\S*)|((-\\S+)$)|' . '([Nn][Ll])|([\\s\\/][Ee][Nn][Gg]?[\\s\\/])|(AC3)|(DD(5.1)?)|([Xx][Vv][Ii][Dd])|' . '([Dd][Ii][Vv][Xx])|([Tt][Ss])|(\\d+\\s([Mm]|[Kk]|[Gg])[Bb])|([Mm][Kk][Vv])|' . '([xX]\\d{3}([Hh][Dd])?)|([Dd][Ll])|([Bb][Ll][Uu]([Ee])?\\s?-?[Rr][Aa][Yy])|' . '([Rr][Ee][Aa][Dd]\\s?[Nn][Ff][Oo])|(([Hh][Dd])([Tt][Vv])?)|(R\\d)|(S\\d+E\\d+)|' . '(2[Hh][Dd])|(5 1)|([Dd][Tt][Ss]-?[Hh][Dd])|([Aa][Vv][Cc])|' . '(([Bb][Dd])?[Rr][Ee][Mm][Uu][Xx])|([Nn][Tt][Ss][Cc])|([Pp][Aa][Ll])|' . '(\\S+(\\.\\S+)+)|([Cc][Uu][Ss][Tt][Oo][Mm])|([Mm][Pp][Ee]?[Gg]-([Hh][Dd])?)/', "", $spot['title']);
         $spot['cleantitle'] = preg_replace('/ {2,}/', " ", $spot['cleantitle']);
         $spot['cleantitle'] = preg_replace('\\s', "", $spot['cleantitle']);
         if (empty($spot['cleantitle'])) {
             // Use $spot['title'] if my regex screws up..
             $spot['cleantitle'] = $spot['title'];
         }
         # if
     } else {
         // Prevent gigantic failures from happening.
         $spot['cleantitle'] = $spot['title'];
     }
     return $spot;
 }
コード例 #10
0
 private function createStatsPerCategory($dateLimit)
 {
     $title = $this->makeTitle('spotspercategory', $dateLimit);
     $prepData = $this->getStatisticsData('spotspercategory', $dateLimit);
     $legend = array(_(SpotCategories::HeadCat2Desc(0)), _(SpotCategories::HeadCat2Desc(1)), _(SpotCategories::HeadCat2Desc(2)), _(SpotCategories::HeadCat2Desc(3)));
     return $this->_svcImageChart->renderChart('3Dpie', $title, $prepData, $legend);
 }
コード例 #11
0
ファイル: spots.inc.php プロジェクト: Nerd-alert/spotweb
<?php 
if (isset($settings['sabnzbd']['apikey'])) {
    ?>
						<th> sabnzbd </th> 
<?php 
}
?>
						
					</tr>
			
<?php 
$count = 0;
foreach ($spots as $spot) {
    $count++;
    echo "\t\t\t\t\t";
    echo "<tr class='" . ($count % 2 ? "even" : "odd") . "' >" . "<td>" . SpotCategories::Cat2Desc($spot['category'], $spot['subcata']) . "</td>" . "<td>" . SpotCategories::HeadCat2Desc($spot['category']) . "</td>" . "<td><a href='?page=getspot&amp;messageid=" . $spot['messageid'] . "'>" . $spot['title'] . "</a></td>" . "<td>" . SpotCategories::Cat2Desc($spot['category'], $spot['subcat' . SpotCategories::SubcatNumberFromHeadcat($spot['category'])]) . "</td>" . "<td>" . $spot['poster'] . "</td>" . "<td>" . strftime("%a, %d-%b-%Y (%H:%M)", $spot['stamp']) . "</td>";
    # only display the NZB button from 24 nov or later
    if ($spot['stamp'] > 1290578400) {
        if ($settings['show_nzbbutton']) {
            echo "<td><a href='?page=getnzb&amp;messageid=" . $spot['messageid'] . "'>NZB</a></td>";
        }
        # if
        # display the sabnzbd button
        if (!empty($spot['sabnzbdurl'])) {
            echo "<td><a target='_blank' href='" . $spot['sabnzbdurl'] . "' ><img height='16 widt='16'  class='sabnzbd-button' src='images/download-small.png'></a></td>";
        }
        # if
    } else {
        if ($settings['show_nzbbutton']) {
            echo "<td> &nbsp; </td>";
        }
コード例 #12
0
ファイル: SpotImage.php プロジェクト: niel/spotweb
 function createStatistics($graph, $limit, $lastUpdate, $language)
 {
     SpotTranslation::initialize($language);
     $spotStatistics = new SpotStatistics($this->_db);
     include_once "images/pchart/pData.class.php";
     include_once "images/pchart/pDraw.class.php";
     include_once "images/pchart/pImage.class.php";
     $width = 800;
     $height = 500;
     $titleHeight = 20;
     $dataSet = array();
     $graphs = $this->getValidStatisticsGraphs();
     $limits = $this->getValidStatisticsLimits();
     switch ($graph) {
         case 'spotsperhour':
             $prepData = $this->prepareData($spotStatistics->getSpotCountPerHour($limit, $lastUpdate));
             $legend = array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23');
             for ($x = 0; $x <= 23; $x++) {
                 $dataSet[] = @$prepData[$x];
             }
             $graphicType = "bar";
             break;
         case 'spotsperweekday':
             $prepData = $this->prepareData($spotStatistics->getSpotCountPerWeekday($limit, $lastUpdate));
             $legend = array(_("Monday"), _("Tuesday"), _("Wednesday"), _("Thursday"), _("Friday"), _("Saturday"), _("Sunday"));
             $dataSet = array(@$prepData[1], @$prepData[2], @$prepData[3], @$prepData[4], @$prepData[5], @$prepData[6], @$prepData[0]);
             $graphicType = "bar";
             break;
         case 'spotspermonth':
             $prepData = $this->prepareData($spotStatistics->getSpotCountPerMonth($limit, $lastUpdate));
             $legend = array(_("January"), _("February"), _("March"), _("April"), _("May"), _("June"), _("July"), _("August"), _("September"), _("October"), _("November"), _("December"));
             for ($x = 1; $x <= 12; $x++) {
                 $dataSet[] = @$prepData[$x];
             }
             $graphicType = "bar";
             break;
         case 'spotspercategory':
             $prepData = $this->prepareData($spotStatistics->getSpotCountPerCategory($limit, $lastUpdate));
             $legend = array(_(SpotCategories::HeadCat2Desc(0)), _(SpotCategories::HeadCat2Desc(1)), _(SpotCategories::HeadCat2Desc(2)), _(SpotCategories::HeadCat2Desc(3)));
             for ($x = 0; $x <= 3; $x++) {
                 $dataSet[] = @$prepData[$x];
             }
             $graphicType = "3Dpie";
             break;
     }
     # switch
     array_walk($dataSet, create_function('& $item, $key', 'if ($item === NULL) $item = 0;'));
     $title = $graphs[$graph];
     if (!empty($limit)) {
         $title .= " (" . $limits[$limit] . ")";
     }
     # if
     $imgData = new pData();
     if ($graphicType == "bar") {
         $imgData->addPoints($dataSet, "data");
         $imgData->addPoints($legend, "legend");
         $imgData->setAbscissa("legend");
         $imgData->setPalette("data", array("R" => 0, "G" => 108, "B" => 171, "Alpha" => 100));
         $img = new pImage($width, $height, $imgData);
         $img->drawGradientArea(0, $titleHeight, $width, $height, DIRECTION_VERTICAL, array("StartR" => 200, "StartG" => 200, "StartB" => 200, "EndR" => 18, "EndG" => 52, "EndB" => 86, "Alpha" => 100));
         $img->drawGradientArea(0, 0, $width, $titleHeight, DIRECTION_VERTICAL, array("StartR" => 18, "StartG" => 52, "StartB" => 86, "EndR" => 50, "EndG" => 50, "EndB" => 50, "Alpha" => 100));
         $img->setFontProperties(array("FontName" => "images/ttf/liberation-sans/LiberationSans-Bold.ttf", "FontSize" => 10));
         $img->drawText($width / 2, 13, $title, array("Align" => TEXT_ALIGN_MIDDLEMIDDLE, "R" => 255, "G" => 255, "B" => 255));
         $img->setFontProperties(array("R" => 255, "G" => 255, "B" => 255, "FontName" => "images/ttf/liberation-sans/LiberationSans-Regular.ttf", "FontSize" => 9));
         $img->setGraphArea(60, $titleHeight + 20, $width - 50, $height - 30);
         $img->drawScale(array("GridR" => 200, "GridG" => 200, "GridB" => 200, "Mode" => SCALE_MODE_START0));
         $img->drawBarChart(array("Gradient" => TRUE, "GradientMode" => GRADIENT_EFFECT_CAN, "DisplayPos" => LABEL_POS_INSIDE, "DisplayValues" => TRUE, "Surrounding" => 10));
     } elseif ($graphicType == "3Dpie") {
         include_once "images/pchart/pPie.class.php";
         $imgData->addPoints($dataSet, "data");
         $imgData->addPoints($legend, "legend");
         $imgData->setAbscissa("legend");
         $img = new pImage($width, $height, $imgData, TRUE);
         $PieChart = new pPie($img, $imgData);
         $img->drawGradientArea(0, $titleHeight, $width, $height, DIRECTION_VERTICAL, array("StartR" => 200, "StartG" => 200, "StartB" => 200, "EndR" => 18, "EndG" => 52, "EndB" => 86, "Alpha" => 100));
         $img->drawGradientArea(0, 0, $width, $titleHeight, DIRECTION_VERTICAL, array("StartR" => 18, "StartG" => 52, "StartB" => 86, "EndR" => 50, "EndG" => 50, "EndB" => 50, "Alpha" => 100));
         $img->setFontProperties(array("FontName" => "images/ttf/liberation-sans/LiberationSans-Bold.ttf", "FontSize" => 10));
         $img->drawText($width / 2, 13, $title, array("Align" => TEXT_ALIGN_MIDDLEMIDDLE, "R" => 255, "G" => 255, "B" => 255));
         $PieChart->setSliceColor(0, array("R" => 0, "G" => 108, "B" => 171));
         $PieChart->setSliceColor(1, array("R" => 205, "G" => 159, "B" => 0));
         $PieChart->setSliceColor(2, array("R" => 0, "G" => 171, "B" => 0));
         $PieChart->setSliceColor(3, array("R" => 171, "G" => 28, "B" => 0));
         $img->setFontProperties(array("FontName" => "images/ttf/liberation-sans/LiberationSans-Regular.ttf", "FontSize" => 9));
         $PieChart->draw3DPie($width / 2, $height / 2 + $titleHeight, array("Radius" => $width / 2 - 100, "SecondPass" => TRUE, "DrawLabels" => TRUE, "WriteValues" => TRUE, "Precision" => 2, "ValueR" => 0, "ValueG" => 0, "ValueB" => 0, "ValueAlpha" => 100, "SkewFactor" => 0.6, "LabelR" => 255, "LabelG" => 255, "LabelB" => 255, "LabelAlpha" => 100));
     }
     # if
     if (isset($img)) {
         ob_start();
         $img->render(NULL);
         $imageString = ob_get_clean();
         $data = $this->getImageInfoFromString($imageString);
         return array('metadata' => $data['metadata'], 'content' => $imageString);
     }
     # img
 }
コード例 #13
0
ファイル: spotinfo.inc.php プロジェクト: Nerd-alert/spotweb
$tmp = str_replace('[/b]', '</b>', $tmp);
$tmp = str_replace('[i]', '<i>', $tmp);
$tmp = str_replace('[/i]', '</i>', $tmp);
$tmp = str_replace('[br]', "<br>", $tmp);
$tmp = str_replace('[u]', '<u>', $tmp);
$tmp = str_replace('[/u]', '</u>', $tmp);
$tmp = str_replace('&lt;br&gt;', '<br>', $tmp);
$tmp = str_replace('&lt;br /&gt;', '<br>', $tmp);
echo "<pre>{$tmp}</pre>";
?>
	
				<br class="spotinfoclear">

				<table class="spotinfotable">
					<tr> <th> Categorie </th> <td> <?php 
echo SpotCategories::HeadCat2Desc($hcat);
?>
 </td> </tr>
		
<?php 
if (!empty($spot['subcatlist'])) {
    foreach ($spot['subcatlist'] as $sub) {
        $subcatType = substr($sub, 0, 1);
        echo "\t\t\t\t\t<tr> <th> " . SpotCategories::SubcatDescription($hcat, $subcatType) . "</th> <td> " . SpotCategories::Cat2Desc($hcat, $sub) . " </td> </tr>\r\n";
    }
    # foreach
}
# if
?>
	
					<tr> <th> Omvang </th> <td> <?php