nb Core Community
September 08, 2010, 05:46:37 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: 1.2.2 +nb is now final and released

@new registrations. I will not allow any new registrations here as there are more (real person) spambots here than ever.... captcha proved to be ineffective.

After your registration, mail me at ( admin AT shinobilegends.com ) from the mail address you want to register. Provide some text about you and possibly your game.
 
   Home   Help Search Calendar Downloads Login Register  
Pages: [1]
  Print  
Author Topic: Installation Error  (Read 1091 times)
marjanovich
Newbie
*

Karma: +0/-0
Posts: 7


View Profile
« on: October 14, 2008, 07:57:29 AM »

Didn't want to triple post...
Code:
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /mnt/w1007/d12/s14/b02d4616/www/digitaldamon.net/UAO-121/lib/output.php on line 13

Downloaded all 3 version hosted here 1.1.1,1.2.0,1.2.1 installed to 3 seperate directories on my domain. All three give me the exact same error when i try to goto the installer.php or home.php

Lines 10-22 of output.php...

Code:
class output_collector {

private $output; //!< the output to the template body
private $block_new_output; //!< is current output blocked? boolean
private static $colors; //!< the color codes=>CSS tags
private static $color_map,$colormap_esc; //!< the letters of color codes only, escaped and not escaped
private $nestedtags; //!<open spans, or whatever...we need to make sure that we close them on output

/**
* Constructor. Fill our class with the colors and set all up.
*/

Anyone else having these issues?
Logged
Nightborn
Administrator
Sr. Member
*****

Karma: +20/-0
Posts: 302



View Profile WWW
« Reply #1 on: October 14, 2008, 10:35:25 AM »

You need PHP 5 ... you have only PHP4 installed.

It is imperative to have it, else you won't get it to work.

However, I think the "which php version do you have" check should be before the output class...

thanks for the hint.

EDIT: I updated the installer.php in 1.2.1 (and might in the other versions too), it should now display the correct error message about the PHP version
« Last Edit: October 14, 2008, 10:45:06 AM by Nightborn » Logged

It should be fixed, but it won't be easy and it won't be fast. If you want
to help - wonderful. But keep in mind that it will take months of wading
through the ugliest code we have in the tree. If you've got a weak stomach -
stay out. I've been there and it's not a nice place.

   - Al Viro
marjanovich
Newbie
*

Karma: +0/-0
Posts: 7


View Profile
« Reply #2 on: October 14, 2008, 04:42:17 PM »

PHP Version is 5.2.2

1.1.1 - Install completes without a hitch
1.2.0 - Install completes without a hitch
1.2.1 - Error
Code:
Fatal error: Call to a member function saveSetting() on a non-object in /mnt/w1007/d12/s14/b02d4616/www/digitaldamon.net/UAO-121/lib/settings.php on line 10

As settings.php is a complete rebuild comparitive from 1.1.1 or 1.2.0 it would be hard telling for me what the new array is missing...

1.1.1 Settings.php lines 6-24
Code:
function savesetting($settingname,$value){
global $settings;
loadsettings();
if (!isset($settings[$settingname]) && $value){
$sql = "INSERT INTO " . db_prefix("settings") . " (setting,value) VALUES (\"".addslashes($settingname)."\",\"".addslashes($value)."\")";
}else if (isset($settings[$settingname])) {
$sql = "UPDATE " . db_prefix("settings") . " SET value=\"".addslashes($value)."\" WHERE setting=\"".addslashes($settingname)."\"";
} else {
return false;
}
db_query($sql);
$settings[$settingname]=$value;
invalidatedatacache("gamesettings");
if (db_affected_rows()>0) {
return true;
}else{
return false;
}
}

1.2.1 settings.php lines 6-12
Code:
require_once("lib/settings.class.php");

function savesetting($settingname,$value){
global $settings;
$settings->saveSetting($settingname,$value);
}
1.2.1 Is fresh download from this morning 8:33am PST

On a secondary note the code is a crapload better looking in 1.2.1 so much extra line and wasted procs are gone so you get my thanks there...
Logged
Nightborn
Administrator
Sr. Member
*****

Karma: +20/-0
Posts: 302



View Profile WWW
« Reply #3 on: October 14, 2008, 05:17:17 PM »

Ok, just to be sure: You upgraded your php version, so NOW it installs correctly?

@1.2.1

was that the first message when you hit the installer? it would be good to know the URL you were.

I have not installed 1.2.1 from scratch yet, but as you saw the settings is now a class (was done in DP edition 1.2.0 too, but did not check how).

I'll check where the error is.

EDIT:

  8 function savesetting($settingname,$value){
  9         global $settings;
 10         if (!defined("DB_NODB") || (defined("DB_NODB") && !DB_NODB)) $settings->saveSetting($settingname,$value);

change line 10 to the above, then it will work.

I forgot to make sure we have a DB before saving - interestingly this did work in the previous versions - so there was a small bug that had no apparent effect.

I also had a typo in installer.php - download 1.2.1 anew please.
« Last Edit: October 14, 2008, 05:33:36 PM by Nightborn » Logged

It should be fixed, but it won't be easy and it won't be fast. If you want
to help - wonderful. But keep in mind that it will take months of wading
through the ugliest code we have in the tree. If you've got a weak stomach -
stay out. I've been there and it's not a nice place.

   - Al Viro
marjanovich
Newbie
*

Karma: +0/-0
Posts: 7


View Profile
« Reply #4 on: October 14, 2008, 05:40:36 PM »

Just had to change hosting options last night from php4 engine to php5 engine, took bout an hour to take effect which was why i had the intermitent issues last eve, my patience sucked... as for secondary items

settings.php v1.2.0
Code:
<?php
// translator ready
// addnews ready
// mail ready

function savesetting($settingname,$value){
global $settings;
loadsettings();
if (!isset($settings[$settingname]) && $value){
$sql "INSERT INTO " db_prefix("settings") . " (setting,value) VALUES (\"".addslashes($settingname)."\",\"".addslashes($value)."\")";
}else if (isset($settings[$settingname])) {
$sql "UPDATE " db_prefix("settings") . " SET value=\"".addslashes($value)."\" WHERE setting=\"".addslashes($settingname)."\"";
} else {
return false;
}
db_query($sql);
$settings[$settingname]=$value;
invalidatedatacache("gamesettings");
if (db_affected_rows()>0) {
return true;
}else{
return false;
}
}

function 
loadsettings(){
global $settings;
// as this seems to be a common complaint, examine the execution path
// of this function, it will only load the settings once per page hit,
// in subsequent calls to this function, $settings will be an array,
// thus this function will do nothing.
// slight change in 1.1.1 ... let's store a serialized array instead of a cached query
// we need it too often and the for/while construct necessary is just too much for it.
if (!is_array($settings)){
$settings=datacache("gamesettings");
if (!is_array($settings)){
$settings=array();
$sql "SELECT * FROM " db_prefix("settings");
$result db_query($sql);
while ($row db_fetch_assoc($result)) {
$settings[$row['setting']] = $row['value'];
}
db_free_result($result);
updatedatacache("gamesettings",$settings);
}
}
}

function 
clearsettings(){
//scraps the loadsettings() data to force it to reload.
global $settings;
invalidatedatacache("gamesettings");
unset($settings);
}

function 
getsetting($settingname,$default){
global $settings;
global $DB_USEDATACACHE,$DB_DATACACHEPATH;
if ($settingname=="usedatacache") return $DB_USEDATACACHE;
elseif ($settingname=="datacachepath") return $DB_DATACACHEPATH;
if (!isset($settings[$settingname])) {
loadsettings();
}else {
return $settings[$settingname];
}
if (!isset($settings[$settingname])){
savesetting($settingname,$default);
return $default;
}else{
return $settings[$settingname];
}
}
?>

settings.php v1.2.1
Code:
<?php
// translator ready
// addnews ready
// mail ready

require_once("lib/settings.class.php");

function 
savesetting($settingname,$value){
global $settings;
$settings->saveSetting($settingname,$value);
}

function 
loadsettings(){
global $settings;
// as this seems to be a common complaint, examine the execution path
// of this function, it will only load the settings once per page hit,
// in subsequent calls to this function, $settings will be an array,
// thus this function will do nothing.
// slight change in 1.1.1 ... let's store a serialized array instead of a cached query
// we need it too often and the for/while construct necessary is just too much for it.
var_export($settings);
// $settings->loadSettings();
}

function 
clearsettings(){
//scraps the loadsettings() data to force it to reload.
global $settings;
$settings->clearSettings();
unset($settings);
$settings=new settings("settings");
}

function 
getsetting($settingname,$default){
global $settings;
if (!$settings) return "";
return $settings->getSetting($settingname,$default);
}
?>


for seeing them in their locations
http://www.digitaldamon.net/UAO-111/
http://www.digitaldamon.net/UAO-120/
http://www.digitaldamon.net/UAO-121/

1.2.1 can loadup installer with intermitent issue, but clicking on "Game Installer" gives
Code:
Parse error: syntax error, unexpected ')', expecting ',' or ';' in /mnt/w1007/d12/s14/b02d4616/www/digitaldamon.net/UAO-121/installer.php on line 28

Which is the get MySQL version line (Mine is 5.0.24a so I meet the 5.0.0+ specification)

Appologize for being a pain in the arse but attempting for module building and trying to make sure my testbed enviroments are fully functional before i start throwing code at the wind

EDITED 9:43AM PST - Modified settings.php as per your directions above settings glitch gone, just installer line 28 glitch remaining, I will download a new package right now and reupload her, be back in a few moments.
« Last Edit: October 14, 2008, 05:46:43 PM by marjanovich » Logged
Nightborn
Administrator
Sr. Member
*****

Karma: +20/-0
Posts: 302



View Profile WWW
« Reply #5 on: October 14, 2008, 05:43:15 PM »

Nope, your adressed issues were correct.

Quote
I also had a typo in installer.php - download 1.2.1 anew please.

That was my typo, remove a ")" in line 28 - and it works.
Logged

It should be fixed, but it won't be easy and it won't be fast. If you want
to help - wonderful. But keep in mind that it will take months of wading
through the ugliest code we have in the tree. If you've got a weak stomach -
stay out. I've been there and it's not a nice place.

   - Al Viro
marjanovich
Newbie
*

Karma: +0/-0
Posts: 7


View Profile
« Reply #6 on: October 14, 2008, 05:59:33 PM »

9:51AM PST - No worries mate new core downloaded a few minutes ago, and installer is functional.
9:56AM PST - Installtion complete and core 1.2.1 +NB up and running.

Thank you, and now onto the next task of checking functional Modules...
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!