/** * Method render * @access public * @param boolean $ajax_render [default value: false] * @return string html code of object Video * @since 1.0.35 */ public function render($ajax_render = false) { $video_object = new SwfObject($this->id, BASE_URL . "wsp/flash/mediaplayer.swf", $this->width, $this->height); $video_object->addParam("allowfullscreen", "true"); if (strtoupper(substr($this->video, 0, 7)) != "HTTP://" && strtoupper(substr($this->video, 0, 8)) != "HTTPS://") { $this->video = BASE_URL . $this->video; } $video_object->addVariable("file", $this->video); $video_object->addVariable("autostart", $this->autostart ? "true" : "false"); if ($this->controlbar != "") { $video_object->addVariable("controlbar", $this->controlbar); } if ($this->screencolor != "") { $video_object->addVariable("screencolor", $this->screencolor); } if ($this->snapshot != "") { if (strtoupper(substr($this->snapshot, 0, 7)) != "HTTP://" && strtoupper(substr($this->snapshot, 0, 8)) != "HTTPS://") { $this->snapshot = BASE_URL . $this->snapshot; } $video_object->addVariable("image", $this->snapshot); } if ($this->repeat != "") { $video_object->addVariable("repeat", $this->repeat); } $this->object_change = false; return $video_object->render(); }
/** * Method render * @access public * @param boolean $ajax_render [default value: false] * @return string html code of object ImageRotator * @since 1.0.35 */ public function render($ajax_render = false) { // remove old cache files $dirname = "wsp/cache/xml/image-rotator/"; $dir = opendir($dirname); while ($file = readdir($dir)) { if ($file != '.' && $file != '..' && !is_dir($dirname . $file)) { $filemtime = @filemtime($dirname . $file); if ($filemtime != false && time() - $filemtime >= 1800) { // > 30 minutes $filedir = $dirname . $file; unlink($filedir); } } } closedir($dir); $file = $dirname . $this->id . "-" . session_id() . ".xml"; $f = new File($file, false, true); $f->debug_mode(true); $data = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"; $data .= "<playlist version=\"1\" xmlns=\"http://xspf.org/ns/0/\">\n"; $data .= "\t<trackList>\n"; for ($i = 0; $i < sizeof($this->array_img_src); $i++) { $link = new Link($this->array_img_link[$i]); if ($link->getUserHaveRights()) { $data .= "\t\t<track>\n"; $data .= "\t\t\t<title>" . utf8encode($this->array_img_title[$i]) . "</title>\n"; $data .= "\t\t\t<creator>" . utf8encode(SITE_NAME) . "</creator>\n"; $data .= "\t\t\t<location>" . $this->array_img_src[$i] . "</location>\n"; $data .= "\t\t\t<info>" . $this->array_img_link[$i] . "</info>\n"; $data .= "\t\t</track>\n"; } } $data .= "\t</trackList>\n"; $data .= "</playlist>\n"; $f->write($data); $f->close(); $video_object = new SwfObject($this->id, BASE_URL . "wsp/flash/imagerotator.swf", $this->width, $this->height); $video_object->addParam("allowfullscreen", "true"); $video_object->addVariable("file", $file); if ($this->navigation_bar == false) { $video_object->addVariable("shownavigation", "false"); } if ($this->rotate_time != '') { $video_object->addVariable("rotatetime", $this->rotate_time); } if ($this->transition != '') { $video_object->addVariable("transition", $this->transition); } if ($this->is_link) { $video_object->addVariable("linkfromdisplay", 'true'); } $this->object_change = false; return $video_object->render(); }