public function get_inner() { $slideshow = ''; $buttons = ''; $album = new SSP_Album($this->aid); $i = 0; foreach ($album->images() as $img) { $slideshow .= $img->slide('slide-' . $i); $buttons .= '<button class="'; if ($this->thumbnails) { $buttons .= 'thumbnail'; } if ($this->show_indicators) { $buttons .= 'indicator'; } if ($i == 0) { $buttons .= ' active'; } if ($this->thumbnails) { $buttons .= '" style="background-image:url(\'' . $img->src . '\');'; } $buttons .= '" id="ind-' . $i . '" onclick="goToSlide(' . $i . ', false);return false;">' . $i . '</button>'; $i++; } if ($this->show_indicators || $this->thumbnails) { $slideshow .= '<nav>' . $buttons . '</nav>'; } return $slideshow; }
public function __construct($id = null) { if ($id !== null) { $sql = "SELECT * FROM wolf_ssp WHERE id=" . $id; $query = Record::getConnection()->query($sql); $bool = array('show_thumbnails', 'show_indicators', 'random', 'pause_on_hover', 'include_style'); if ($ss = $query->fetch()) { foreach ($ss as $k => $v) { if (in_array($k, $bool)) { $v = $v == 1 ? true : false; } $this->{$k} = $v; } } if ($this->show_thumbnails) { $this->show_indicators = false; } $this->elid = 'ssp_slideshow_' . $this->id; if ($this->transition === null) { $this->transition = 'none'; } } $album = new SSP_Album($this->aid); $i = 0; $this->slides = ''; foreach ($album->images() as $img) { $this->slides .= $img->slide('slide' . $i); $i++; } $thumbnails = ''; $i = 0; foreach ($album->images() as $img) { $this->thumbnails .= '<button id="btn' . $i . '" class="thumbnail'; if ($i == 0) { $this->thumbnails .= ' active'; } $this->thumbnails .= '" data-img="' . $img->src . '" onclick="goToSlide(' . $i . ', false);return false;">' . $i . '</button>'; $i++; } $indicators = ''; $i = 0; foreach ($album->images() as $img) { $this->indicators .= '<button id="btn' . $i . '" class="indicator'; if ($i == 0) { $this->indicators .= ' active'; } $this->indicators .= '" onclick="goToSlide(' . $i . ', false);return false;">' . $i . '</button>'; $i++; } }
public function get_inner() { $slideshow = ''; $indicators = ''; $album = new SSP_Album($this->aid); $i = 0; foreach ($album->images() as $img) { $slideshow .= $img->slide('slide-' . $i); $indicators .= '<button class="indicator'; if ($i == 0) { $indicators .= ' active'; } $indicators .= '" id="ind-' . $i . '" onclick="goToSlide(' . $i . ');return false;">' . $i . '</button>'; $i++; } if ($this->show_indicators) { $slideshow .= '<div class="indicators">' . $indicators . '</div>'; } return $slideshow; }
public static function get_slideshow($aid, $show_indicators = false) { $i = 0; $slideshow = ''; $indicators = ''; if ($aid > -1) { $album = new SSP_Album($aid); foreach ($album->images() as $img) { $slideshow .= $img->slide('slide-' . $i); $indicators .= '<button class="indicator'; if ($i == 0) { $indicators .= ' active'; } $indicators .= '" id="ind-' . $i . '" onclick="goToSlide(' . $i . ')">' . $i . '</button>'; $i++; } if ($show_indicators) { $slideshow .= '<div class="indicators">' . $indicators . '</div>'; } return $slideshow; } }