Beispiel #1
0
 /**
  * Handles the custom data that needs to be preloaded.
  *
  * @param array $data Data that was loaded. Unsuccessfully loaded items will have a value of null
  */
 protected function _handleCustomPreloadedData(array &$data)
 {
     if (!is_array($data['routesAdmin'])) {
         $data['routesAdmin'] = XenForo_Model::create('XenForo_Model_RoutePrefix')->rebuildRoutePrefixTypeCache('admin');
     }
     XenForo_Link::setHandlerInfoForGroup('admin', $data['routesAdmin']);
     if (!is_array($data['adminStyleProperties'])) {
         $data['adminStyleProperties'] = XenForo_Model::create('XenForo_Model_StyleProperty')->rebuildPropertyCacheInStyleAndChildren(-1);
     }
     XenForo_Application::set('adminStyleProperties', $data['adminStyleProperties']);
     if (!is_int($data['adminStyleModifiedDate'])) {
         $data['adminStyleModifiedDate'] = 0;
     }
     XenForo_Application::set('adminStyleModifiedDate', $data['adminStyleModifiedDate']);
     if (!is_array($data['adminSearchTypes'])) {
         try {
             $data['adminSearchTypes'] = XenForo_Model::create('XenForo_Model_AdminSearch')->rebuildSearchTypesCache();
         } catch (Exception $e) {
             $data['adminSearchTypes'] = array();
         }
     }
     XenForo_Application::set('adminSearchTypes', $data['adminSearchTypes']);
     XenForo_Application::$allowManualDeferred = true;
     XenForo_Application::$javaScriptUrl = 'js';
 }
 /**
  * Loads the default data for the application (config, DB, options, etc).
  */
 public function loadDefaultData()
 {
     $config = $this->loadConfig();
     self::set('config', $config);
     self::setDebugMode($config->debug);
     self::$jsVersion = substr(md5(self::$versionId . $config->jsVersion), 0, 8);
     self::$externalDataPath = (string) $config->externalDataPath;
     self::$externalDataUrl = (string) $config->externalDataUrl;
     self::$javaScriptUrl = (string) $config->javaScriptUrl;
     $this->addLazyLoader('db', array($this, 'loadDb'), $config->db);
     $this->addLazyLoader('cache', array($this, 'loadCache'), $config->cache);
     $this->addLazyLoader('options', array($this, 'loadOptions'));
     $this->addLazyLoader('simpleCache', array($this, 'loadSimpleCache'));
 }
Beispiel #3
0
 /**
  * Pre-loads globally required data for the system.
  */
 public function preLoadData()
 {
     XenForo_Application::$javaScriptUrl = 'js';
     XenForo_Error::setIgnorePendingUpgrade(true);
 }
 */
header('content-type: application/json; charset: utf-8');
/**
 * Bridge to XenForo
 */
$startTime = microtime(true);
$fileDir = '../../';
require $fileDir . '/library/XenForo/Autoloader.php';
XenForo_Autoloader::getInstance()->setupAutoloader($fileDir . '/library');
XenForo_Application::initialize($fileDir . '/library', $fileDir);
XenForo_Application::set('page_start_time', $startTime);
XenForo_Application::disablePhpErrorHandler();
XenForo_Application::setDebugMode(false);
XenForo_Application::$externalDataPath = $fileDir . '/data';
XenForo_Application::$externalDataUrl = $fileDir . '/data';
XenForo_Application::$javaScriptUrl = $fileDir . '/js';
restore_error_handler();
restore_exception_handler();
$options = XenForo_Application::get('options');
$STEAM_GAMEBANNER = $options->steamDisplayBanner;
if (!empty($_GET['steamids'])) {
    /*
     * Fetch profile data
     */
    $sHelper = new Steam_Helper_Steam();
    $steamProfileAPI = $sHelper->getSteamProfileAPI($_GET['steamids']);
    $fullProfile = $_GET['fullprofile'];
    $contentJson = $sHelper->getJsonData($steamProfileAPI);
    $contentDecoded = json_decode($contentJson);
    if (isset($contentDecoded->response->players)) {
        foreach ($contentDecoded->response->players as $rows) {