Hi
Just bought this script and trying to install it. The install guide specify to use the .exe file for the install, and requires php 5. I cannot get the install panel to display or run after following this process you have outlined in the guide. If I however use the .exe running php 4 then i can get the install panel to display.
When I change to php 5 to complete the online part which is outlined in the pdf download with this script, the final stage, after entering the password for the admin, returns garbled script.
db_use_persistent = $db_use_persistent; if ($cfg) $this->cfg = $cfg; $this->Connect($host, $username, $pwd, $db, $driver); } function Connect($host, $username, $pwd, $db, $driver = "mysql") { $this->host = $host; $this->username = $username; $this->pwd = $pwd; if ($db) $this->db = $db; $this->driver = $driver; $this->conn = ADONewConnection($driver); if ($this->db_use_persistent) { $this->conn->PConnect($host, $username, $pwd, $db); } else { $this->conn->Connect($host, $username, $pwd, $db); } } function SetConnection(&$conn) { $this->conn = $conn; } function Execute($query) { $query = trim($query); $this->conn->debug = $this->debug; $result = $this->conn->Execute($query); if (!$result) { return false; } else { return new DB_Resultset($result, $query); } } function DatabaseBuilder() { return new DB_Builder($this->conn); } function PageExecute($query, $pg_which, $pg_size) { return $this->conn->PageExecute($query, $pg_size, $pg_which); } function InsertID() { return $this->conn->Insert_ID(); } function Close() { return true; } function FetchArray($query) { $result = $this->Execute($query); $arr = array(); $i = 0; if ($result) { while ($row = $result->FetchRow()) { $arr[$i] = $row; $arr[$i]['alternate_color'] = ($i % 2) ? 'alt1' : 'alt2'; $i++; } $result->Close(); } return $arr; } function FetchYML($nodeName, $query) { $result = $this->Execute($query); $retVal = " " . $nodeName; $i = 0; if ($result) { while ($row = $result->FetchRow()) { $retVal .= " " . $i; foreach ($row as $key => $value) { $retVal .= " " . $key; $retVal .= " " . $value; } $i++; } $result->Close(); } return $retVal; } function FetchPair($query, $id, $value) { $arr = array(); $result = $this->Execute($query); if ($result) { while ($row = $result->FetchRow()) { $arr[$row[$id]] = $row[$value]; } $result->Close(); } return $arr; } function FetchArrayValue($query, $col, $quote = "'") { $arr = array(); $result = $this->Execute($query); if ($result) { while ($row = $result->FetchRow()) { $arr[] = $quote . $row[$col] . $quote; } $result->Close(); } return $arr; } function FetchStringValue($query, $col, $delimiter = ',', $quote = "'") { $arr = array(); $result = $this->Execute($query); $arr[] = $quote . '' . $quote; if ($result) { while ($row = $result->FetchRow()) { $arr[] = $quote . $row[$col] . $quote; } $result->Close(); } return @implode($delimiter, $arr); } function FetchOne() { $args = func_get_args(); switch (func_num_args()) { case 1: $sql = $args[0]; break; case 3: $sql = "select $args[0] from {$this->cfg[table][$args[1]]} where $args[2]"; break; case 4: $sql = "select $args[0] from {$this->cfg[table][$args[1]]} where $args[2] = '$args[3]'"; break; } $result = $this->Execute($sql . ' limit 1'); if ($result) { $row = $result->FetchRow(); $result->Close(); } return $row; } function Lookup() { $value = null; $args = func_get_args(); switch (func_num_args()) { case 1: $sql = $args[0]; $field = 'col'; break; case 3: $sql = "select $args[0] from {$this->cfg[table][$args[1]]} where $args[2]"; $field = $args[0]; break; case 4: $sql = "select $args[0] from {$this->cfg[table][$args[1]]} where $args[2] = '$args[3]'"; $field = $args[0]; break; } $sql .= " limit 1"; $result = $this->Execute($sql); if ($result) { $value = $result->Fields($field); $result->Close(); } return $value; } function LogSQL($val = true) { $this->conn->LogSQL($val); } } class DB_Resultset { public $resultset = null; public $num_rows = null; public $num_field = null; public $current_row = null; public $EOF = true; public $query = null; function DB_Resultset(&$resultset, $query = '') { $this->resultset = $resultset; $this->query = $query; if (preg_match('/^select|^show/i', $query)) { $this->MoveNext(); } } function RecordCount() { $this->num_rows = $this->resultset->RecordCount(); return $this->num_rows; } function FieldCount() { $this->num_field = $this->resultset->FieldCount(); return $this->num_field; } function FetchField($offset) { return $this->resultset->FetchField($offset); } function MetaType($field_type) { return $this->resultset->MetaType($field_type); } function Move($offset) { return $this->resultset->Move($offset); } function MoveFirst() { return $this->resultset->MoveFirst(); } function MoveLast() { return $this->resultset->MoveLast(); } function MoveNext() { $this->EOF = $this->resultset->EOF; if (!$this->EOF) { $this->current_row = $this->resultset->GetRowAssoc(false); $this->resultset->MoveNext(); return true; } else { return false; } } function Fields($name) { return $this->current_row[$name]; } function FetchRow() { if (!$this->EOF) { $row = $this->current_row; $this->MoveNext(); return $row; } else { return false; } } function Close() { if ($this->resultset) { $this->resultset->Close(); } } } class DB_Builder { private $conn, $data_dict = null; function DB_Builder($ADODBConnection) { $this->conn = $ADODBConnection; $this->data_dict = NewDataDictionary($this->conn); } function CreateDatabase($database_name, $options_array = false) { $this->data_dict->CreateDatabase($database_name, $options_array); } function CreateTableSQL($table_name, $fields, $table_option_array = false) { $this->data_dict->CreateTableSQL($table_name, $fields, $table_option_array); } function DropTableSQL($table_name) { $this->data_dict->DropTableSQL($table_name); } function ChangeTableSQL($table_name, $fields) { $this->data_dict->CreateTableSQL($table_name, $fields); } function RenameTableSQL($table_name, $new_table_name) { $this->data_dict->RenameTableSQL($table_name, $new_table_name); } function RenameColumnSQL($table_name, $column_name, $new_column_name, $fields = '') { $this->data_dict->RenameColumnSQL($table_name, $new_column_name, $fields); } function CreateIndexSQL($index_name, $table_name, $fields, $idxoptarray = false) { $this->data_dict->CreateIndexSQL($index_name, $table_name, $fields, $idxoptarray); } function DropIndexSQL($index_name, $table_name = null) { $this->data_dict->DropIndexSQL($index_name, $table_name); } function AddColumnSQL($table_name, $fields) { $this->data_dict->AddColumnSQL($table_name, $fields); } function AlterColumnSQL($table_name, $fields) { $this->data_dict->AlterColumnSQL($table_name, $fields); } function DropColumnSQL($table_name, $fields) { $this->data_dict->DropColumnSQL($table_name, $fields); } function SetSchema($schema) { $this->data_dict->SetSchema($schema); } function NameQuote($name = null) { return $this->data_dict->NameQuote($name); } function TableName($name) { return $this->data_dict->TableName($name); } function ActualType($meta) { return $this->data_dict->ActualType($meta); } function ExecuteSQLArray($sql_array, $contOnError = true) { return $this->data_dict->ExecuteSQLArray($sql_array, $contOnError); } } class DB_Session { //var $db_use_persistent, $cfg; function DB_Session($db_use_persistent = false, $cfg = null) { global $ADODB_SESS_CONN; $this->db_use_persistent = $db_use_persistent; if ($cfg) $this->cfg = $cfg; } function Open($save_path, $session_name) { global $ADODB_SESS_CONN; if (preg_match('/opera|msie|netscape|firefox|safari|konqueror|mozil la/msi', $_SERVER['HTTP_USER_AGENT'])) { if (is_null($ADODB_SESS_CONN)) { $ADODB_SESS_CONN = new DB_Connection($this->cfg['db']['host'], $this->cfg['db']['username'], $this->cfg['db']['password'], $this->cfg['db']['name']); } } return true; } function Close() { global $ADODB_SESS_CONN; if (!is_null($ADODB_SESS_CONN)) { $ADODB_SESS_CONN->Close(); } return true; } function Read($key) { global $ADODB_SESS_CONN, $ADODB_SESS_MD5; $data = ''; if ($ADODB_SESS_CONN) { //FAHRUL MATIKAN :$query = "delete from {$this->cfg[table][sessions]} where expiry < " . time(); //FAHRUL MATIKAN :$ADODB_SESS_CONN->Execute($query); $Authenticated = $_COOKIE["NICETALK_COOKIE_USER_AUTHENTICATED"]; if ($Authenticated) { $query = "select data from {$this->cfg[table][sessions]} where sesskey = '$key' AND expiry >= " . time(); $result = $ADODB_SESS_CONN->Execute($query); if ($result->RecordCount()) { $data = rawurldecode($result->Fields('data')); } $ADODB_SESS_MD5 = md5($data); //FAHRUL MATIKAN : $this->Write($key, $data); $result->Close(); } else { $query = "delete from {$this->cfg[table][sessions]} where sesskey = '$key'"; $ADODB_SESS_CONN->Execute($query); } } return $data; } function Write($key, $data) { global $ADODB_SESS_CONN, $ADODB_SESS_MD5; if ($ADODB_SESS_CONN) { $lifetime = ini_get('session.gc_maxlifetime'); $cookie_lifetime = $_COOKIE["NICETALK_COOKIE_EXPIRED"]; if ($cookie_lifetime == 0) { if ($lifetime <= 1) { $lifetime = $this->cfg['default_session_lifetime']; } $expiry = time() + $lifetime; } else $expiry = $cookie_lifetime; if ($ADODB_SESS_MD5 !== false && $ADODB_SESS_MD5 == md5($data)) { $status_id=1; $query = "update {$this->cfg[table][sessions]} set expiry = '$expiry', status_id='$status_id' where sesskey = '$key'"; } else { $email=$_SESSION['nicetalksessions']['email']; $status_id=1; $data = rawurlencode($data); $query = "replace into {$this->cfg[table][sessions]} (sesskey, expiry, data, email, status_id) values ('$key', '$expiry', '$data', '$email', '$status_id')"; } $ADODB_SESS_CONN->Execute($query); } return true; } function Destroy($key) { global $ADODB_SESS_CONN; if ($ADODB_SESS_CONN) { $query = "delete from {$this->cfg[table][sessions]} where sesskey = '$key'"; $ADODB_SESS_CONN->Execute($query); } return true; } function GC($maxlifetime) { global $ADODB_SESS_CONN; if ($ADODB_SESS_CONN) { //FAHRUL MATIKAN : $query = "delete from {$this->cfg[table][sessions]} where expiry < " . time(); //FAHRUL MATIKAN : $ADODB_SESS_CONN->Execute($query); //$query = "optimize table {$this->cfg[table][sessions]}"; //$ADODB_SESS_CONN->Execute($query); } return true; } function Init() { session_module_name('user'); session_set_save_handler(array($this, 'Open'), array($this, 'Close'), array($this, 'Read'), array($this, 'Write'), array($this, 'Destroy'), array($this, 'GC')); } } $ADODB_SESS_CONN = null; $ADODB_SESS_MD5 = false; $DB_Session = new DB_Session(false, $cfg); $DB_Session->Init(); ?>
If I switch back to php 4 it displays the following error.
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/sites/mydomain/public_html/nicetalk/lib/core/db.php on line 8
Anyone with any ideas please?


LinkBack URL
About LinkBacks
