| Server IP : 14.225.204.176 / Your IP : 216.73.216.169 Web Server : nginx/1.24.0 System : Linux nodejs-ybgk 6.8.0-40-generic #40-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 5 10:34:03 UTC 2024 x86_64 User : root ( 0) PHP Version : 8.1.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/html/php/langngon.com/wp-content/themes/langngon/class/ |
Upload File : |
<?php
/**
* Custom Home page for the theme.
*
* @copyright ZiniMedia 2016
* @version Release: 1.0
* @package penguinmag\class
* @author ZiniMedia-BM
*/
if(!class_exists('ZiniHomePage')){
class ZiniHomePage{
private $homePageHeader = null;
private $homePage = null;
private $image = null;
private $backgroundVideo = null;
function __construct() {
$this->homePage = null;
$this->image = array();
$this->backgroundVideo = array();
$this->homePageHeader = get_field('zini_home_page_header','option');
}
function __destruct() {}
public function getHomePageHeader(){
echo $this->homePageHeader;
}
public function setHomePageHeader($homePageHeader){
return $homePageHeader;
}
public function checkHomeType(){
if ($this->homePage['home_type'] == 'video') {
return 'video';
}
return 'text';
}
public function getHomeTitle(){
echo $this->homePage['home_title'];
}
public function getHomeImageURL(){
echo $this->image['url'];
}
public function getHomeImageTitle(){
echo $this->image['title'];
}
public function getBackgroundVideoURL(){
echo $this->backgroundVideo['url'];
}
public function getBackgroundVideoTitle(){
echo $this->backgroundVideo['title'];
}
public function getHomeVideoURL(){
if ($this->homePage['home_type'] == 'video') {
$iframe = $this->homePage['home_video'];
preg_match('/src="(.+?)"/', $iframe, $matches);
$url = $matches[1];
}
return $url;
}
public function getHomeDescription(){
echo $this->homePage['home_description'];
}
public function getHomeType(){
echo $this->homePage['home_type'];
}
public function getHomeHighlight(){
echo $this->homePage['home_highlight'];
}
public function getHomeTitleLeft(){
echo $this->homePage['home_title_left'];
}
public function getHomeDescriptionLeft(){
echo $this->homePage['home_description_left'];
}
public function getHomeTitleRight(){
echo $this->homePage['home_title_right'];
}
public function getHomeDescriptionRight(){
echo $this->homePage['home_description_right'];
}
/**
* Set value for home page
* @param $homePage
*/
public function setHomePage($homePage){
$this->homePage['home_type'] = $homePage['home_type'];
$this->homePage['home_title'] = $homePage['home_title'];
$this->homePage['home_highlight'] = $homePage['home_highlight'];
$this->homePage['home_image'] = $homePage['home_image'];
$this->image = $homePage['home_image'];
$this->homePage['home_description'] = $homePage['home_description'];
if ($homePage['home_type'] == 'video') : {
# Get value type video
$this->homePage['home_video'] = $homePage['home_video'];
$this->backgroundVideo = $homePage['home_background_video'];
} else : if ($homePage['home_type'] == 'text') {
# Get value type text
$this->homePage['home_title_left'] = $homePage['home_title_left'];
$this->homePage['home_description_left'] = $homePage['home_description_left'];
$this->homePage['home_title_right'] = $homePage['home_title_right'];
$this->homePage['home_description_right'] = $homePage['home_description_right'];
} endif;
}
}
}
?>