Results 1 to 9 of 9

Thread: NiceTalk Install Problem (PHP4/PHP5)

  1. #1
    DeLaRey is offline Registered User
    Join Date
    Feb 2009
    Location
    UK
    Posts
    20

    Question NiceTalk Install Problem (PHP4/PHP5)

    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?

  2. #2
    Bruceper is offline Active Member
    Join Date
    Jun 2002
    Location
    Winnipeg Canada
    Posts
    4,913

    Default

    Enable short_open_tags in php.ini

    If you do not have access to php.ini then ask your host to enable short_open_tags

  3. #3
    DeLaRey is offline Registered User
    Join Date
    Feb 2009
    Location
    UK
    Posts
    20

    Default

    Thanks Bruceper. I have contacted my host, and they do NOT support the open tags. Is the only way to alter the shorter tags to normal tags. In all the php files, or just the php.ini? Are all the scripts you are selling done in short tags?? I was thinking of buying more of your products, but this is the first script I have spent money on that isn't working out of the box, so to speak. Maybe you huys should consider publishing this (the fact that you need short tags enabled) as a pre requirement before the download. I know I would have first found out about the tags, and if my host didnt (as it doesnt) support this, I would have gone elsewhere.

    Thanks for getting back to me so quickly Bruceper. I appreciate your help and quick response.

  4. #4
    FSGDAG's Avatar
    FSGDAG is offline Moderator
    Join Date
    May 2007
    Location
    NJ, United States
    Posts
    1,651

    Default

    DeLaRey...

    If you continue having problems running any of NiceCoder scripts on your current host, have a look at my company ( link in my signature ). I can guarantee that all NiceCoder scripts will run 'out of box'
    FSGDAG | IndexU Hosting | Owner
    Website | NiceCoder Script Hosting and More! | Web4URL is For Sale!
    Follow Us On Twitter | FaceBook Profile | YouTube Videos

  5. #5
    DeLaRey is offline Registered User
    Join Date
    Feb 2009
    Location
    UK
    Posts
    20

    Default

    Geeeeeee - maybe your response should be posted under hosting. The thread is clearly an issue around short tag issues. If I need to change hosting companies whenever I purchase a commercial script, that just wouldn't work. As a owner, I suggest you add a linkt to the sales information saying that this script will NOT work unless your host allows short tags, and if your host doesnt
    a) DONT BUY THE SCRIPT
    b) CHANGE HOSTING TO THIS COMPANY

    Thanks for your post. That was not helpfull.

  6. #6
    DeLaRey is offline Registered User
    Join Date
    Feb 2009
    Location
    UK
    Posts
    20

    Default Please clarify which PHP short tags to change

    Thanks Bruceper

    Do I only need to change the php.ini file, or all the php files to remove ALL short tags?

    FSDAG - thanks, I wated to buy a commercial script that works, not change my hosting supplier

  7. #7
    Bruceper is offline Active Member
    Join Date
    Jun 2002
    Location
    Winnipeg Canada
    Posts
    4,913

    Default

    Considering thousands of scripts out there use short_open_tags and removing short_open_tags (by default) is something new in PHP, the answer is that most of our scripts use short_open_tags.

    We're in the process of removing them in all our scripts.

    Other than changing php.ini how else can you do it? Do a search and replace for <? to <?php Or you can wait a few days and see if we can re-release our products to remove short_open_tags.

  8. #8
    DeLaRey is offline Registered User
    Join Date
    Feb 2009
    Location
    UK
    Posts
    20

    Default Thanx

    Thanks Bruceper. I have used a search and replace utility and done the replace. Bit of a hassle with changing things about, but managed to get it working.

  9. #9
    Bruceper is offline Active Member
    Join Date
    Jun 2002
    Location
    Winnipeg Canada
    Posts
    4,913

    Default

    Good stuff. I think we're releasing a bugfix version of indexu this week and then we'll move on to removing the short tags.

Similar Threads

  1. Install.php problem - Admin problem
    By highfly in forum Indexu Lite
    Replies: 0
    Last Post: 01-12-2006, 06:31 PM
  2. Problem With Install.php
    By hysteriaweb in forum v5.x
    Replies: 32
    Last Post: 09-21-2005, 03:28 AM
  3. Install problem
    By yorweb in forum v5.x
    Replies: 1
    Last Post: 10-19-2004, 09:10 PM
  4. indexu304 with php4.03
    By ntjang298 in forum v5.x
    Replies: 1
    Last Post: 08-01-2002, 12:33 AM
  5. Install problem...
    By Jibé in forum v5.x
    Replies: 3
    Last Post: 02-27-2002, 12:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •