NewStar

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • URL: xnova.nat.cu/index.php | Version: 2.4.git
    Stack trace:
    #0 /includes/pages/login/ShowIndexPage.class.php(50): AbstractLoginPage->assign(Array)
    #1 /index.php(39): ShowIndexPage->show()
    #2 {main}

    The post was edited 2 times, last by Desconocido: Por favor vengo presentado este problema alguien sabe como solucionarlos o que debo hacer ().

  • hello, looked at the value sent or received on this line because just putting the error without any explanation or code we cannot help you.
  • New

    PHP Source Code

    1. <?php
    2. abstract class AbstractLoginPage
    3. {
    4. /**
    5. * reference of the template object
    6. * @var template
    7. */
    8. protected $tplObj = null;
    9. protected $window;
    10. public $defaultWindow = 'normal';
    11. protected function __construct() {
    12. if(!AJAX_REQUEST)
    13. {
    14. $this->setWindow($this->defaultWindow);
    15. $this->initTemplate();
    16. } else {
    17. $this->setWindow('ajax');
    18. }
    19. }
    20. protected function getUniverseSelector()
    21. {
    22. $universeSelect = array();
    23. foreach(Universe::availableUniverses() as $uniId)
    24. {
    25. $universeSelect[$uniId] = Config::get($uniId)->uni_name;
    26. }
    27. return $universeSelect;
    28. }
    29. protected function initTemplate()
    30. {
    31. if(isset($this->tplObj))
    32. return true;
    33. $this->tplObj = new template;
    34. list($tplDir) = $this->tplObj->getTemplateDir();
    35. $this->tplObj->setTemplateDir($tplDir.'login/');
    36. return true;
    37. }
    38. protected function setWindow($window) {
    39. $this->window = $window;
    40. }
    41. protected function getWindow() {
    42. return $this->window;
    43. }
    44. protected function getQueryString() {
    45. $queryString = array();
    46. $page = HTTP::_GP('page', '');
    47. if(!empty($page)) {
    48. $queryString['page'] = $page;
    49. }
    50. $mode = HTTP::_GP('mode', '');
    51. if(!empty($mode)) {
    52. $queryString['mode'] = $mode;
    53. }
    54. return http_build_query($queryString);
    55. }
    56. protected function getPageData()
    57. {
    58. global $LNG;
    59. $config = Config::get();
    60. $this->tplObj->assign_vars(array(
    61. 'recaptchaEnable' => $config->capaktiv,
    62. 'recaptchaPublicKey' => $config->cappublic,
    63. 'gameName' => $config->game_name,
    64. 'facebookEnable' => $config->fb_on,
    65. 'fb_key' => $config->fb_apikey,
    66. 'mailEnable' => $config->mail_active,
    67. 'reg_close' => $config->reg_closed,
    68. 'referralEnable' => $config->ref_active,
    69. 'lang' => $LNG->getLanguage(),
    70. 'UNI' => Universe::current(),
    71. 'VERSION' => $config->VERSION,
    72. 'REV' => substr($config->VERSION, -4),
    73. 'languages' => Language::getAllowedLangs(false),
    74. ));
    75. }
    76. protected function printMessage($message, $redirectButtons = null, $redirect = null, $fullSide = true)
    77. {
    78. $this->assign(array(
    79. 'message' => $message,
    80. 'redirectButtons' => $redirectButtons,
    81. ));
    82. if(isset($redirect)) {
    83. $this->tplObj->gotoside($redirect[0], $redirect[1]);
    84. }
    85. if(!$fullSide) {
    86. $this->setWindow('popup');
    87. }
    88. $this->display('error.default.tpl');
    89. }
    90. protected function save() {
    91. }
    92. protected function assign($array, $nocache = true) {
    93. $this->tplObj->assign_vars($array, $nocache);
    94. }
    95. protected function display($file) {
    96. global $THEME, $LNG;
    97. $this->save();
    98. if($this->getWindow() !== 'ajax') {
    99. $this->getPageData();
    100. }
    101. if (UNIS_WILDCAST) {
    102. $hostParts = explode('.', HTTP_HOST);
    103. if (preg_match('/uni[0-9]+/', $hostParts[0])) {
    104. array_shift($hostParts);
    105. }
    106. $host = implode('.', $hostParts);
    107. $basePath = PROTOCOL.$host.HTTP_BASE;
    108. } else {
    109. $basePath = PROTOCOL.HTTP_HOST.HTTP_BASE;
    110. }
    111. $this->assign(array(
    112. 'lang' => $LNG->getLanguage(),
    113. 'bodyclass' => $this->getWindow(),
    114. 'dpath' => $THEME->getTheme(),
    115. 'basepath' => $basePath,
    116. 'isMultiUniverse' => count(Universe::availableUniverses()) > 1,
    117. 'unisWildcast' => UNIS_WILDCAST,
    118. ));
    119. $this->assign(array(
    120. 'LNG' => $LNG,
    121. ), false);
    122. $this->tplObj->display('extends:layout.'.$this->getWindow().'.tpl|'.$file);
    123. exit;
    124. }
    125. protected function sendJSON($data) {
    126. $this->save();
    127. echo json_encode($data);
    128. exit;
    129. }
    130. protected function redirectTo($url) {
    131. $this->save();
    132. HTTP::redirectTo($url);
    133. exit;
    134. }
    135. protected function redirectPost($url, $postFields) {
    136. $this->save();
    137. $this->assign(array(
    138. 'url' => $url,
    139. 'postFields' => $postFields,
    140. ));
    141. $this->display('info.redirectPost.tpl');
    142. }
    143. }
    144. ?>
    Display All
  • New

    PHP Source Code

    1. <?php
    2. class ShowIndexPage extends AbstractLoginPage
    3. {
    4. function __construct()
    5. {
    6. parent::__construct();
    7. }
    8. function show()
    9. {
    10. global $LNG;
    11. $referralID = HTTP::_GP('ref', 0);
    12. if(!empty($referralID))
    13. {
    14. $this->redirectTo('index.php?page=register&referralID='.$referralID);
    15. }
    16. $universeSelect = array();
    17. foreach(Universe::availableUniverses() as $uniId)
    18. {
    19. $config = Config::get($uniId);
    20. $universeSelect[$uniId] = $config->uni_name.($config->game_disable == 0 ? $LNG['uni_closed'] : '');
    21. }
    22. $Code = HTTP::_GP('code', 0);
    23. $loginCode = false;
    24. if(isset($LNG['login_error_'.$Code]))
    25. {
    26. $loginCode = $LNG['login_error_'.$Code];
    27. }
    28. $sql = "SELECT date, title, text, user FROM %%NEWS%% ORDER BY id DESC LIMIT 2;";
    29. $newsResult = Database::get()->select($sql);
    30. $newsList = array();
    31. foreach ($newsResult as $newsRow)
    32. {
    33. $newsList[] = array(
    34. 'title' => $newsRow['title'],
    35. 'from' => sprintf($LNG['news_from'], _date($LNG['php_tdformat'], $newsRow['date']), $newsRow['user']),
    36. 'text' => makebr($newsRow['text']),
    37. );
    38. }
    39. $this->assign(array(
    40. 'newsList' => $newsList,
    41. ));
    42. $config = Config::get();
    43. $this->assign(array(
    44. 'is_news' => $config->OverviewNewsFrame,
    45. 'news' => $config->OverviewNewsText,
    46. 'universeSelect' => $universeSelect,
    47. 'code' => $loginCode,
    48. 'descHeader' => sprintf($LNG['loginWelcome'], $config->game_name),
    49. 'descText' => sprintf($LNG['loginServerDesc'], $config->game_name),
    50. 'loginInfo' => sprintf($LNG['loginInfo'], '<a href="index.php?page=rules">'.$LNG['nav_rules'].'</a>')
    51. ));
    52. $this->display('page.index.default.tpl');
    53. }
    54. }
    55. ?>
    Display All