<?php if (!defined('VB_ENTRY')) die('Access denied.'); class vB_External_Export_Js extends vB_External_Export { private $threadObj = "
	function thread(threadid, title, poster, threaddate, threadtime)
	{
		this.threadid = threadid;
		this.title = title;
		this.poster = poster;
		this.threaddate = threaddate;
		this.threadtime = threadtime;
	}
	"; protected $type = 'JS'; protected $outputContentType = 'application/javascript'; protected function buildOutputFromItems($items, $options) { $output = $this->threadObj; $output .= "var threads = new Array(" . sizeof($items) . ");\r\n"; $itemnum = 0; $items = $this->formatItems($items, $options); foreach ($items AS $item) { $item = $item['content']; $item['title'] = vB_Library_Functions::addSlashesJs(vB_String::htmlSpecialCharsUni($item['external_prefix_plain']) . $item['external_title']); $item['authorname'] = vB_Library_Functions::addSlashesJs($item['authorname']); $output .= "\tthreads[$itemnum] = new thread($item[external_nodeid], '$item[title]', '$item[authorname]', '" . vB_Library_Functions::addSlashesJs($this->callvBDate(vB::getDatastore()->getOption('dateformat'), $item['publishdate'])) . "', '" . vB_Library_Functions::addSlashesJs($this->callvBDate(vB::getDatastore()->getOption('timeformat'), $item['publishdate'])) . "');\r\n"; $itemnum++; } return $output; } } 