Latest Purchases
Fatal Error - Skyfall

Uncaught TypeError

count(): Argument #1 ($value) must be of type Countable|array, null given

(File: /home/u564339922/domains/coldfiredzn.com/public_html/skyfall/cache/templates_c/033f43ea8fb243fce79a8315b13c964336239688_0.file.latest_purchases.tpl.php)

https://skyfall.coldfiredzn.com/store/

File: /home/u564339922/domains/coldfiredzn.com/public_html/skyfall/cache/templates_c/033f43ea8fb243fce79a8315b13c964336239688_0.file.latest_purchases.tpl.php

                                                          'unifunc' => 'content_60e7a87ea42df3_56027475',
  'has_nocache_code' => false,
  'file_dependency' => 
  array (
    '033f43ea8fb243fce79a8315b13c964336239688' => 
    array (
      0 => '/home/u564339922/domains/coldfiredzn.com/public_html/skyfall/custom/templates/Skyfall/tebex/widgets/latest_purchases.tpl',
      1 => 1607896185,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
  ),
),false)) {
function content_60e7a87ea42df3_56027475 (Smarty_Internal_Template $_smarty_tpl) {
?><div class="card">
    <div class="card-header header-theme"><?php echo $_smarty_tpl->tpl_vars['LATEST_PURCHASES']->value;?>
</div>
    <div class="card-body">
        <?php if (count($_smarty_tpl->tpl_vars['PURCHASES']->value)) {?>
        <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['PURCHASES']->value, 'purchase', false, NULL, 'purchases_array', array (
  'last' => true,
  'iteration' => true,
  'total' => true,
));
$_smarty_tpl->tpl_vars['purchase']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['purchase']->value) {
$_smarty_tpl->tpl_vars['purchase']->do_else = false;
$_smarty_tpl->tpl_vars['__smarty_foreach_purchases_array']->value['iteration']++;
$_smarty_tpl->tpl_vars['__smarty_foreach_purchases_array']->value['last'] = $_smarty_tpl->tpl_vars['__smarty_foreach_purchases_array']->value['iteration'] === $_smarty_tpl->tpl_vars['__smarty_foreach_purchases_array']->value['total'];
?>
        <a href="<?php echo $_smarty_tpl->tpl_vars['purchase']->value['profile'];?>
" style="<?php echo $_smarty_tpl->tpl_vars['purchase']->value['style'];?>
" data-poload="<?php echo $_smarty_tpl->tpl_vars['USER_INFO_URL']->value;
if ($_smarty_tpl->tpl_vars['purchase']->value['user_id'] > 0) {
echo $_smarty_tpl->tpl_vars['purchase']->value['user_id'];
} else {
echo $_smarty_tpl->tpl_vars['purchase']->value['username'];?>
&uuid=<?php echo $_smarty_tpl->tpl_vars['purchase']->value['uuid'];

                                                    
File: /home/u564339922/domains/coldfiredzn.com/public_html/skyfall/core/includes/smarty/sysplugins/smarty_template_resource_base.php

                                                             *
     * @throws \Exception
     */
    public function getRenderedTemplateCode(Smarty_Internal_Template $_template, $unifunc = null)
    {
        $smarty = &$_template->smarty;
        $_template->isRenderingCache = $this->isCache;
        $level = ob_get_level();
        try {
            if (!isset($unifunc)) {
                $unifunc = $this->unifunc;
            }
            if (empty($unifunc) || !function_exists($unifunc)) {
                throw new SmartyException("Invalid compiled template for '{$_template->template_resource}'");
            }
            if ($_template->startRenderCallbacks) {
                foreach ($_template->startRenderCallbacks as $callback) {
                    call_user_func($callback, $_template);
                }
            }
            $unifunc($_template);
            foreach ($_template->endRenderCallbacks as $callback) {
                call_user_func($callback, $_template);
            }
            $_template->isRenderingCache = false;
        } catch (Exception $e) {
            $_template->isRenderingCache = false;
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
            if (isset($smarty->security_policy)) {
                $smarty->security_policy->endTemplate();
            }
            throw $e;
        }
    }

    /**
     * Get compiled time stamp
     *
     * @return int

                                                    
File: /home/u564339922/domains/coldfiredzn.com/public_html/skyfall/core/includes/smarty/sysplugins/smarty_template_compiled.php

                                                                if (!$_template->source->exists) {
            $type = $_template->source->isConfig ? 'config' : 'template';
            throw new SmartyException("Unable to load {$type} '{$_template->source->type}:{$_template->source->name}'");
        }
        if ($_template->smarty->debugging) {
            if (!isset($_template->smarty->_debug)) {
                $_template->smarty->_debug = new Smarty_Internal_Debug();
            }
            $_template->smarty->_debug->start_render($_template);
        }
        if (!$this->processed) {
            $this->process($_template);
        }
        if (isset($_template->cached)) {
            $_template->cached->file_dependency =
                array_merge($_template->cached->file_dependency, $this->file_dependency);
        }
        if ($_template->source->handler->uncompiled) {
            $_template->source->handler->renderUncompiled($_template->source, $_template);
        } else {
            $this->getRenderedTemplateCode($_template);
        }
        if ($_template->caching && $this->has_nocache_code) {
            $_template->cached->hashes[ $this->nocache_hash ] = true;
        }
        if ($_template->smarty->debugging) {
            $_template->smarty->_debug->end_render($_template);
        }
    }

    /**
     * load compiled template or compile from source
     *
     * @param Smarty_Internal_Template $_smarty_tpl do not change variable name, is used by compiled template
     *
     * @throws Exception
     */
    public function process(Smarty_Internal_Template $_smarty_tpl)
    {
        $source = &$_smarty_tpl->source;
        $smarty = &$_smarty_tpl->smarty;

                                                    
File: /home/u564339922/domains/coldfiredzn.com/public_html/skyfall/core/includes/smarty/sysplugins/smarty_internal_template.php

                                                                        "Unable to load template '{$this->source->type}:{$this->source->name}'" .
                ($this->_isSubTpl() ? " in '{$this->parent->template_resource}'" : '')
            );
        }
        // disable caching for evaluated code
        if ($this->source->handler->recompiled) {
            $this->caching = Smarty::CACHING_OFF;
        }
        // read from cache or render
        if ($this->caching === Smarty::CACHING_LIFETIME_CURRENT || $this->caching === Smarty::CACHING_LIFETIME_SAVED) {
            if (!isset($this->cached) || $this->cached->cache_id !== $this->cache_id
                || $this->cached->compile_id !== $this->compile_id
            ) {
                $this->loadCached(true);
            }
            $this->cached->render($this, $no_output_filter);
        } else {
            if (!isset($this->compiled) || $this->compiled->compile_id !== $this->compile_id) {
                $this->loadCompiled(true);
            }
            $this->compiled->render($this);
        }
        // display or fetch
        if ($display) {
            if ($this->caching && $this->smarty->cache_modified_check) {
                $this->smarty->ext->_cacheModify->cacheModifiedCheck(
                    $this->cached,
                    $this,
                    isset($content) ? $content : ob_get_clean()
                );
            } else {
                if ((!$this->caching || $this->cached->has_nocache_code || $this->source->handler->recompiled)
                    && !$no_output_filter && (isset($this->smarty->autoload_filters[ 'output' ])
                                              || isset($this->smarty->registered_filters[ 'output' ]))
                ) {
                    echo $this->smarty->ext->_filterHandler->runFilter('output', ob_get_clean(), $this);
                } else {
                    echo ob_get_clean();
                }
            }
            if ($this->smarty->debugging) {

                                                    
File: /home/u564339922/domains/coldfiredzn.com/public_html/skyfall/core/includes/smarty/sysplugins/smarty_internal_templatebase.php

                                                                        if ($template->caching) {
                    // return cache status of template
                    if (!isset($template->cached)) {
                        $template->loadCached();
                    }
                    $result = $template->cached->isCached($template);
                    Smarty_Internal_Template::$isCacheTplObj[ $template->_getTemplateId() ] = $template;
                } else {
                    return false;
                }
            } else {
                if ($saveVars) {
                    $savedTplVars = $template->tpl_vars;
                    $savedConfigVars = $template->config_vars;
                }
                ob_start();
                $template->_mergeVars();
                if (!empty(Smarty::$global_tpl_vars)) {
                    $template->tpl_vars = array_merge(Smarty::$global_tpl_vars, $template->tpl_vars);
                }
                $result = $template->render(false, $function);
                $template->_cleanUp();
                if ($saveVars) {
                    $template->tpl_vars = $savedTplVars;
                    $template->config_vars = $savedConfigVars;
                } else {
                    if (!$function && !isset(Smarty_Internal_Template::$tplObjCache[ $template->templateId ])) {
                        $template->parent = null;
                        $template->tpl_vars = $template->config_vars = array();
                        Smarty_Internal_Template::$tplObjCache[ $template->templateId ] = $template;
                    }
                }
            }
            if (isset($_smarty_old_error_level)) {
                error_reporting($_smarty_old_error_level);
            }
            return $result;
        } catch (Exception $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }

                                                    
File: /home/u564339922/domains/coldfiredzn.com/public_html/skyfall/core/includes/smarty/sysplugins/smarty_internal_templatebase.php

                                                             * universal cache
     *
     * @var array()
     */
    public $_cache = array();

    /**
     * fetches a rendered Smarty template
     *
     * @param string $template   the resource handle of the template file or template object
     * @param mixed  $cache_id   cache id to be used with this template
     * @param mixed  $compile_id compile id to be used with this template
     * @param object $parent     next higher level of Smarty variables
     *
     * @throws Exception
     * @throws SmartyException
     * @return string rendered template output
     */
    public function fetch($template = null, $cache_id = null, $compile_id = null, $parent = null)
    {
        $result = $this->_execute($template, $cache_id, $compile_id, $parent, 0);
        return $result === null ? ob_get_clean() : $result;
    }

    /**
     * displays a Smarty template
     *
     * @param string $template   the resource handle of the template file or template object
     * @param mixed  $cache_id   cache id to be used with this template
     * @param mixed  $compile_id compile id to be used with this template
     * @param object $parent     next higher level of Smarty variables
     *
     * @throws \Exception
     * @throws \SmartyException
     */
    public function display($template = null, $cache_id = null, $compile_id = null, $parent = null)
    {
        // display template
        $this->_execute($template, $cache_id, $compile_id, $parent, 1);
    }


                                                    
File: /home/u564339922/domains/coldfiredzn.com/public_html/skyfall/modules/Tebex/widgets/LatestPurchasesWidget.php

                                                        				}
			}

			$this->_cache->store('latest_purchases', $latest_purchases, 120);

			$latest_purchases_query = null;
		}

		if(count($latest_purchases)){
			$this->_smarty->assign(array(
				'LATEST_PURCHASES' => $this->_buycraft_language->get('language', 'latest_purchases'),
				'PURCHASES' => $latest_purchases
			));

		} else
			$this->_smarty->assign(array(
				'LATEST_PURCHASES' => $this->_buycraft_language->get('language', 'latest_purchases'),
				'NO_PURCHASES' => $this->_buycraft_language->get('language', 'no_purchases')
			));

		$this->_content = $this->_smarty->fetch('tebex/widgets/latest_purchases.tpl');
	}
}
                                                    
File: /home/u564339922/domains/coldfiredzn.com/public_html/skyfall/core/classes/Widgets.php

                                                            }

    /**
     * Get code for all enabled widgets on the current page.
     *
     * @param string $location Either `left` or `right`.
     * @return array List of HTML to be displayed.
     */
    public function getWidgets($location = 'right') {
        $ret = array();

        $widgets = $this->getAll();

        foreach($widgets as $item) {
            if (array_key_exists($item->getName(), $this->_enabled)
                && $item->getLocation() == $location
                && is_array($item->getPages())
                && ((defined('CUSTOM_PAGE') && in_array(CUSTOM_PAGE, $item->getPages()))
                    || in_array((defined('PAGE') ? PAGE : 'index'), $item->getPages()))
            ) {
                $item->initialise();
                $ret[] = $item->display();
            }
        }

        return $ret;
    }

    /**
     * List all widgets, sorted by their order.
     *
     * @return WidgetBase[] List of widgets.
     */
    public function getAll() {
        $widgets = $this->_widgets;
        
        uasort($widgets, function($a, $b) {
            return $a->getOrder() - $b->getOrder();
        });

        return $widgets;

                                                    
File: /home/u564339922/domains/coldfiredzn.com/public_html/skyfall/modules/Tebex/pages/store/index.php

                                                        	'CONTENT' => $content
));

$template->addCSSFiles(array(
	(defined('CONFIG_PATH') ? CONFIG_PATH : '') . '/core/assets/plugins/ckeditor/plugins/spoiler/css/spoiler.css' => array(),
	(defined('CONFIG_PATH') ? CONFIG_PATH : '') . '/core/assets/plugins/emoji/css/emojione.min.css' => array()
));

$template->addJSFiles(array(
	(defined('CONFIG_PATH') ? CONFIG_PATH : '') . '/core/assets/plugins/ckeditor/plugins/spoiler/js/spoiler.js' => array()
));

// Load modules + template
Module::loadPage($user, $pages, $cache, $smarty, array($navigation, $cc_nav, $mod_nav), $widgets, $template);

$page_load = microtime(true) - $start;
define('PAGE_LOAD_TIME', str_replace('{x}', round($page_load, 3), $language->get('general', 'page_loaded_in')));

$template->onPageLoad();

$smarty->assign('WIDGETS', $widgets->getWidgets());

require(ROOT_PATH . '/core/templates/navbar.php');
require(ROOT_PATH . '/core/templates/footer.php');

// Display template
$template->displayTemplate('tebex/index.tpl', $smarty);

                                                    
File: /home/u564339922/domains/coldfiredzn.com/public_html/skyfall/index.php

                                                                // Homepage
        $pages->setActivePage($pages->getPageByURL('/'));
        require(ROOT_PATH . '/modules/Core/pages/index.php');
    }

} else {
    $route = rtrim(strtok($_GET['route'], '?'), '/');

    // Check modules
    $modules = $pages->returnPages();

    // Include the page
    if (array_key_exists($route, $modules)) {
        $pages->setActivePage($modules[$route]);
        if (!isset($modules[$route]['custom'])) {
            $path = join(DIRECTORY_SEPARATOR, array(ROOT_PATH, 'modules', $modules[$route]['module'], $modules[$route]['file']));

            if (!file_exists($path)) {
                require(ROOT_PATH . '/404.php');
            } else { 
                require($path);
            }
            
            die();
        } else {
            require(join(DIRECTORY_SEPARATOR, array(ROOT_PATH, 'modules', 'Core', 'pages', 'custom.php')));
            die();
        }
    } else {
        // Use recursion to check - might have URL parameters in path
        $path_array = explode('/', $route);

        for ($i = count($path_array) - 2; $i > 0; $i--) {

            $new_path = '/';
            for($n = 1; $n <= $i; $n++){
                $new_path .= $path_array[$n] . '/';
            }

            $new_path = rtrim($new_path, '/');