HEX
Server: nginx/1.27.1
System: Linux in-4 5.15.0-131-generic #141-Ubuntu SMP Fri Jan 10 21:18:28 UTC 2025 x86_64
User: ilikadirect (1186)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system,proc_open,popen,parse_ini_file,show_source
Upload Files
File: /storage/v6964/testingff/public_html/fdfctr/wp-content/plugins/listdom/app/includes/ads.php
<?php
// no direct access
defined('ABSPATH') or die();

if(!class_exists('LSD_Ads')):

/**
 * Listdom Ads Class.
 *
 * @class LSD_Ads
 * @version	1.0.0
 */
class LSD_Ads extends LSD_Base
{
    /**
	 * Constructor method
	 */
	public function __construct()
    {
        parent::__construct();
	}

    public static function display($position)
    {
        $html = LSD_Ads::get($position);
        if($html) echo ($html);
    }

    public static function get($position)
    {
        $ads = get_transient('lsd_ads');
        if(!$ads)
        {
            $JSON = LSD_File::download('https://totalery.com/api/ads.php');
            if(!$JSON or !trim($JSON)) return false;

            $response = json_decode($JSON, true);
            $ads = ((isset($response['ads']) and is_array($response['ads'])) ? $response['ads'] : false);

            set_transient('lsd_ads', $ads, DAY_IN_SECONDS);
        }

        $html = '';
        if(is_array($ads) and isset($ads[$position]) and trim($ads[$position])) $html = $ads[$position];

        return $html;
    }
}

endif;