_lang = $lang; $this->_loadImages(); $this->_getTestimonies(); } public function loadContent () { $contents = new ContentLoader("gallery"); $this->_content = sprintf( "

%s

", (string) $contents->getContent("gallery|title", []), implode('', $this->_indicatorsList), implode('', $this->_itemList) ); $this->_content .= sprintf( "
%s
", $this->_getTestimonies() ); $this->_content .= ""; return $this->_content; } public function getPhotos () { return $this->_imageList; } public function getList () { return $this->_list; } public function getIndicators () { return $this->_indicatorsList; } private function _loadImages () { foreach ($this->_imageList AS $k => $image) { $active = ''; if ($k == 0) { $active = "active"; } $this->_indicatorsList[] = sprintf( '
  • ', $active ); $this->_itemList[] = sprintf( '', $active, $image, $image ); } } private function _getTestimonies () { global $_SERVER; $db = new SQLDB(); if (! $db->connect()) { die('Database connect error'); } $sql = sprintf(" SELECT id, firstname, lastname, deposit, occupation, country, promo, picture, active FROM testimonies t WHERE active = 1 ORDER BY ordre DESC " ); if (! $query = $db->query($sql)) { die('Database io error'); } $list = []; while ($member = $db->fetchAssocQueryResult($query)) { $html = []; $html["picture"] = $member['picture']; $html['deposit'] = $member['deposit']; $html['firstname'] = $member['firstname']; $html['lastname'] = $member['lastname'] ; $html['occupation'] = $member['occupation']; $html['country'] = $member['country']; $list[] = $html; } $db->close(); return $this->_list = $list; } }