//****************************************************************************************/ // Crafty Syntax Live Help (CSLH) by Eric Gerdes (http://craftysyntax.com ) //====================================================================================== // NOTICE: Do NOT remove the copyright and/or license information from this file. // doing so will automatically terminate your rights to use this program. // ------------------------------------------------------------------------------------ // ORIGINAL CODE: // --------------------------------------------------------- // Crafty Syntax Live Help (CSLH) http://www.craftysyntax.com/livehelp/ // Copyright (C) 2003 Eric Gerdes // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program in a file named LICENSE.txt . // if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // --------------------------------------------------------- // MODIFICATIONS: // --------------------------------------------------------- // [ Programmers who change this code should cause the ] // [ modified changes here and the date of any change. ] //====================================================================================== //****************************************************************************************/ require("globals.php"); $version = "2.7"; // first check to see if the setup already ran if so do not do this page. if ($installed == true){ print "Installation program has already been run.. CLICK HERE"; exit; } // check to see if they can parse php if (false) { ?> } if ($action == "INSTALL"){ if ($dbtype == "txt-db-api.php"){ $fp2 = fopen ("$txtpath/test.txt", "w+"); if(!($fp2)){ $errors .= "
$opening', '
\r\nSorry no operators are currently online to provide Live support at this time.', 0, 'N')"; $insert_query4 = "INSERT INTO livehelp_operator_departments (recno, user_id, department, extra) VALUES (1, 1, 1, '')"; // update the config file. if($manualinstall != "YES"){ $fp = fopen ("config.php", "w+"); fwrite($fp,$fcontents); fclose($fp); } else { print "config.php: Select all of the code below and then copy and paste it over your existing config.php file on the server"; print ""; } // build the database. if($installationtype == "upgrade"){ // not supported... } if($installationtype == "upgrade22"){ $sql = "ALTER TABLE `livehelp_config` ADD `speaklanguage` VARCHAR(10) DEFAULT 'eng' NOT NULL "; mysql_query($sql,$conn); $sql = "UPDATE livehelp_users set onchannel=user_id where isadmin='Y'"; mysql_query($sql,$conn); $installationtype = "upgrade24"; } if($installationtype == "upgrade24"){ $sql = "UPDATE livehelp_config set speaklanguage='eng',version='2.7'"; mysql_query($sql,$conn); $sql = "UPDATE livehelp_users set onchannel=user_id where isadmin='Y'"; mysql_query($sql,$conn); $installationtype = "upgrade25"; } if($installationtype == "upgrade25"){ if ($dbtype == "txt-db-api.php"){ if (get_magic_quotes_gpc()) { $txtpath = stripslashes($txtpath); } else { $txtpath = $txtpath; } $sql = "ALTER TABLE livehelp_users ADD auto_invite CHAR(1) NOT NULL "; mysql_query($sql,$conn); $sql = "ALTER TABLE livehelp_users ADD istyping CHAR(1) NOT NULL "; mysql_query($sql,$conn); $sql = "ALTER TABLE livehelp_users ADD visits INT(8) NOT NULL "; mysql_query($sql,$conn); $filepath = "$txtpath" . "/" ."livehelp" . "/" ."livehelp_autoinvite.txt"; $fp = fopen ("$filepath", "w+"); $headerfields = "idnum#isactive#department#message#page#visits#referer#\n"; $headerfields .= "inc#str#int#str#str#int#str#\n"; $headerfields .= "0######"; fwrite($fp,$headerfields); fclose($fp); chmod("$filepath", 0777); $filepath = "$txtpath" . "/" ."livehelp" . "/" ."livehelp_modules.txt"; $fp = fopen ("$filepath", "w+"); $headerfields = "id#name#path#adminpath#query_string#\n"; $headerfields .= "inc#str#str#str#str#\n"; $headerfields .= "0#####\n"; $headerfields .= "1#Live Help!#livehelp.php###\n"; $headerfields .= "2#Contact#leavemessage.php###\n"; $headerfields .= "3#Q & A#user_qa.php#qa.php##\n"; fwrite($fp,$headerfields); fclose($fp); chmod("$filepath", 0777); $filepath = "$txtpath" . "/" ."livehelp" . "/" ."livehelp_modules_dep.txt"; $fp = fopen ("$filepath", "w+"); $headerfields = "rec#departmentid#modid#ordernum#defaultset#\n"; $headerfields .= "inc#int#int#int#str#\n"; $headerfields .= "0#####\n"; $headerfields .= "1#1#1#1##\n"; $headerfields .= "2#1#2#2##\n"; fwrite($fp,$headerfields); fclose($fp); chmod("$filepath", 0777); } else { $sql = "ALTER TABLE livehelp_users ADD auto_invite CHAR(1) NOT NULL "; mysql_query($sql,$conn); $sql = "ALTER TABLE livehelp_users ADD istyping CHAR(1) NOT NULL "; mysql_query($sql,$conn); $sql = "ALTER TABLE livehelp_users ADD visits INT(8) NOT NULL "; mysql_query($sql,$conn); $sql = "DROP TABLE IF EXISTS livehelp_modules_dep"; mysql_query($sql,$conn); $sql = "CREATE TABLE livehelp_modules_dep ( rec int(10) NOT NULL auto_increment, departmentid int(10) NOT NULL default '0', modid int(10) NOT NULL default '0', ordernum int(8) NOT NULL default '0', defaultset char(1) NOT NULL default '', PRIMARY KEY (rec) ) "; $results = mysql_query($sql,$conn); if(!$results) { echo "
"; print htmlspecialchars($fcontents); print "Query went bad!
\n"; echo mysql_errno().": ".mysql_error().""; $wentwrong = true; } $sql = "DROP TABLE IF EXISTS livehelp_autoinvite"; mysql_query($sql,$conn); $sql = "CREATE TABLE `livehelp_autoinvite` ( `idnum` int(10) NOT NULL auto_increment, isactive char(1) NOT NULL default '', `department` int(10) NOT NULL default '0', `message` text NOT NULL, `page` varchar(255) NOT NULL default '', `visits` int(8) NOT NULL default '0', `referer` varchar(255) NOT NULL default '', PRIMARY KEY (idnum) ) "; $results = mysql_query($sql,$conn); if(!$results) { echo "
Query went bad!
\n"; echo mysql_errno().": ".mysql_error().""; $wentwrong = true; } $sql = "DROP TABLE IF EXISTS livehelp_modules"; mysql_query($sql,$conn); $sql = "CREATE TABLE livehelp_modules ( id int(10) NOT NULL auto_increment, name varchar(30) NOT NULL default '', path varchar(255) NOT NULL default '', adminpath varchar(255) NOT NULL default '', query_string varchar(255) NOT NULL default '', PRIMARY KEY (id) ) "; $results = mysql_query($sql,$conn); if(!$results) { echo "
Query went bad!
\n"; echo mysql_errno().": ".mysql_error().""; $wentwrong = true; } $results = mysql_query("INSERT INTO `livehelp_modules` (id,name,path) VALUES (1, 'Live Help!', 'livehelp.php')",$conn); $results = mysql_query("INSERT INTO `livehelp_modules` (id,name,path) VALUES (2, 'Contact', 'leavemessage.php')",$conn); $results = mysql_query("INSERT INTO `livehelp_modules` (id,name,path,adminpath) VALUES (3, 'Q & A', 'user_qa.php','qa.php')",$conn); $results = mysql_query("INSERT INTO `livehelp_modules_dep` VALUES (1, 1, 1, 1, '')",$conn); $results = mysql_query("INSERT INTO `livehelp_modules_dep` VALUES (2, 1, 2, 2, '')",$conn); } $installationtype = "upgrade26"; } if($installationtype == "upgrade26"){ $sql = "UPDATE livehelp_config set speaklanguage='eng',version='2.7'"; mysql_query($sql,$conn); } if($installationtype == "newinstall"){ if ($dbtype == "txt-db-api.php"){ if (get_magic_quotes_gpc()) { $txtpath = stripslashes($txtpath); } else { $txtpath = $txtpath; } $filepath = "$txtpath" . "/" . "livehelp"; mkdir ("$filepath", 0777); $filepath = "$txtpath" . "/" ."livehelp" . "/" ."livehelp_channels.txt"; $fp = fopen ("$filepath", "w+"); $headerfields = "id#user_id#statusof#startdate#\n"; $headerfields .= "inc#int#str#int#\n"; $headerfields .= "0#0##0#"; fwrite($fp,$headerfields); fclose($fp); chmod("$filepath", 0777); $filepath = "$txtpath" . "/" ."livehelp" . "/" ."livehelp_autoinvite.txt"; $fp = fopen ("$filepath", "w+"); $headerfields = "idnum#isactive#department#message#page#visits#referer#\n"; $headerfields .= "inc#str#int#str#str#int#str#\n"; $headerfields .= "0######"; fwrite($fp,$headerfields); fclose($fp); chmod("$filepath", 0777); $openingmessage = ereg_replace("\n"," ",$openingmessage); $filepath2 = "$txtpath" . "/" ."livehelp" . "/" ."livehelp_config.txt"; $fp2 = fopen ("$filepath2", "w+"); $headerfields = "version#site_title#use_flush#membernum#offset#show_typing#webpath#speaklanguage#\n"; $headerfields .= "str#str#str#int#int#str#str#str#\n"; $headerfields .= "2.7########"; fwrite($fp2,$headerfields); fclose($fp2); chmod("$filepath", 0777); $filepath2 = "$txtpath" . "/" ."livehelp" . "/" ."livehelp_visits.txt"; $fp2 = fopen ("$filepath2", "w+"); $headerfields = "recno#pageurl#dayof#uniquevisits#\n"; $headerfields .= "inc#str#int#int#\n"; $headerfields .= "0#######"; fwrite($fp2,$headerfields); fclose($fp2); chmod("$filepath", 0777); $filepath2 = "$txtpath" . "/" ."livehelp" . "/" ."livehelp_visits_total.txt"; $fp2 = fopen ("$filepath2", "w+"); $headerfields = "recno#pageurl#ctotal#\n"; $headerfields .= "inc#str#int#\n"; $headerfields .= "0######"; fwrite($fp2,$headerfields); fclose($fp2); chmod("$filepath", 0777); $filepath2 = "$txtpath" . "/" ."livehelp" . "/" ."livehelp_visits.txt"; $fp2 = fopen ("$filepath2", "w+"); $headerfields = "recno#pageurl#dayof#uniquevisits#\n"; $headerfields .= "inc#str#int#int#\n"; $headerfields .= "0#######"; fwrite($fp2,$headerfields); fclose($fp2); chmod("$filepath", 0777); $filepath2 = "$txtpath" . "/" ."livehelp" . "/" ."livehelp_referers.txt"; $fp2 = fopen ("$filepath2", "w+"); $headerfields = "recno#camefrom#dayof#uniquevisits#\n"; $headerfields .= "inc#str#int#int#\n"; $headerfields .= "0#######"; fwrite($fp2,$headerfields); fclose($fp2); chmod("$filepath", 0777); $filepath2 = "$txtpath" . "/" ."livehelp" . "/" ."livehelp_referers_total.txt"; $fp2 = fopen ("$filepath2", "w+"); $headerfields = "recno#camefrom#ctotal#\n"; $headerfields .= "inc#str#int#\n"; $headerfields .= "0######"; fwrite($fp2,$headerfields); fclose($fp2); chmod("$filepath", 0777); $filepath = "$txtpath" . "/" ."livehelp" . "/" ."livehelp_departments.txt"; $fp = fopen("$filepath", "w+"); $headerfields = "recno#nameof#onlineimage#offlineimage#qaimage#requirename#messageemail#leaveamessage#opening#offline#qa_topic#qa_enabled#creditline#\n"; $headerfields .= "inc#str#str#str#str#str#str#str#str#str#int#str#str#\n"; $headerfields .= "0#############\n"; fwrite($fp,$headerfields); fclose($fp); chmod("$filepath", 0777); $filepath = "$txtpath" . "/" ."livehelp" . "/" ."livehelp_messages.txt"; $fp = fopen("$filepath", "w+"); $headerfields = "id_num#message#channel#timeof#saidfrom#saidto#\n"; $headerfields .= "inc#str#int#int#int#int#\n"; $headerfields .= "0##0#0#0#0#"; fwrite($fp,$headerfields); fclose($fp); chmod("$filepath", 0777); $filepath = "$txtpath" . "/" ."livehelp" . "/" ."livehelp_operator_channels.txt"; $fp = fopen("$filepath", "w+"); $headerfields = "id#user_id#channel#userid#statusof#startdate#bgcolor#\n"; $headerfields .= "inc#int#int#int#str#int#str#\n"; $headerfields .= "0#0#0#0##0##"; fwrite($fp,$headerfields); fclose($fp); chmod("$filepath", 0777); $filepath = "$txtpath" . "/" ."livehelp" . "/" ."livehelp_operator_departments.txt"; $fp = fopen("$filepath", "w+"); $headerfields = "recno#user_id#department#extra#\n"; $headerfields .= "inc#int#int#str#\n"; $headerfields .= "0####\n"; fwrite($fp,$headerfields); fclose($fp); chmod("$filepath", 0777); $filepath = "$txtpath" . "/" ."livehelp" . "/" ."livehelp_qa.txt"; $fp = fopen("$filepath", "w+"); $headerfields = "recno#parent#question#typeof#status#username#ordernum#\n"; $headerfields .= "inc#int#str#str#str#str#int#\n"; $headerfields .= "0#######\n"; fwrite($fp,$headerfields); fclose($fp); chmod("$filepath", 0777); $filepath = "$txtpath" . "/" ."livehelp" . "/" ."livehelp_quick.txt"; $fp = fopen ("$filepath", "w+"); $headerfields = "id#name#typeof#message#visiblity#department#user#\n"; $headerfields .= "inc#str#str#str#str#int#int#\n"; $headerfields .= "0#######\n"; fwrite($fp,$headerfields); fclose($fp); chmod("$filepath", 0777); $filepath = "$txtpath" . "/" ."livehelp" . "/" ."livehelp_modules.txt"; $fp = fopen ("$filepath", "w+"); $headerfields = "id#name#path#adminpath#query_string#\n"; $headerfields .= "inc#str#str#str#str#\n"; $headerfields .= "0###\n"; $headerfields .= "1#Live Help!#livehelp.php###\n"; $headerfields .= "2#Contact#leavemessage.php###\n"; $headerfields .= "3#Q & A#user_qa.php#qa.php##\n"; fwrite($fp,$headerfields); fclose($fp); chmod("$filepath", 0777); $filepath = "$txtpath" . "/" ."livehelp" . "/" ."livehelp_modules_dep.txt"; $fp = fopen ("$filepath", "w+"); $headerfields = "rec#departmentid#modid#ordernum#defaultset#\n"; $headerfields .= "inc#int#int#int#str#\n"; $headerfields .= "0#####\n"; $headerfields .= "1#1#1#1##\n"; $headerfields .= "2#1#2#2##\n"; fwrite($fp,$headerfields); fclose($fp); chmod("$filepath", 0777); $filepath = "$txtpath" . "/" ."livehelp" . "/" ."livehelp_transcripts.txt"; $fp = fopen ("$filepath", "w+"); $headerfields = "recno#who#daytime#transcript#\n"; $headerfields .= "inc#str#int#str#\n"; $headerfields .= "0####\n"; fwrite($fp,$headerfields); fclose($fp); chmod("$filepath", 0777); $filepath = "$txtpath" . "/" ."livehelp" . "/" ."livehelp_users.txt"; $fp = fopen ($filepath, "w+"); $headerfields = "user_id#lastaction#username#password#isonline#isoperator#onchannel#isadmin#department#identity#status#isnamed#showedup#email#camefrom#show_arrival#user_alert#auto_invite#istyping#visits#\n"; $headerfields .= "inc#int#str#str#str#str#int#str#str#str#str#str#str#str#str#str#str#str#str#int#\n"; $headerfields .= "0#20030503141153####N##############0#"; fwrite($fp,$headerfields); fclose($fp); chmod("$filepath", 0777); $filepath = "$txtpath" . "/" ."livehelp" . "/" ."livehelp_visit_track.txt"; $fp = fopen ($filepath, "w+"); $headerfields = "recno#id#location#page#title#whendone#referrer#\n"; $headerfields .= "inc#int#str#str#str#int#str#\n"; $headerfields .= "0#####0##"; fwrite($fp,$headerfields); fclose($fp); chmod("$filepath", 0777); if (get_magic_quotes_gpc()) { $DB_DIR = stripslashes($txtpath); $API_HOME_DIR = stripslashes($rootpath) . "txt-db-api/"; } else { $DB_DIR = $txtpath; $API_HOME_DIR = $rootpath . "txt-db-api/"; } require "txt-db-api/txt-db-api.php"; $mydatabase = new Database("livehelp"); $mydatabase->insert($insert_query); $mydatabase->insert($insert_query2); $mydatabase->insert($insert_query3); $mydatabase->insert($insert_query4); } if ($dbtype == "MSaccess.php"){ require "MSaccess.php"; $mydatabase = new MS_options(); $mydatabase->insert($insert_query); $mydatabase->insert($insert_query2); $mydatabase->insert($insert_query3); $mydatabase->insert($insert_query4); } if ($dbtype == "MSSQLaccess.php"){ $conn = new COM("ADODB.Connection") or die("Cannot start ADO"); $strCon = "Provider=SQLOLEDB;Server=$server;User ID=$user;Password=$pass;Database=$dbase"; $conn->Open($strCon); } if ($dbtype == "mysql_options.php"){ $sql = "DROP TABLE IF EXISTS livehelp_autoinvite"; mysql_query($sql,$conn); $sql = "CREATE TABLE `livehelp_autoinvite` ( `idnum` int(10) NOT NULL auto_increment, isactive char(1) NOT NULL default '', `department` int(10) NOT NULL default '0', `message` text NOT NULL, `page` varchar(255) NOT NULL default '', `visits` int(8) NOT NULL default '0', `referer` varchar(255) NOT NULL default '', PRIMARY KEY (idnum) ) "; $results = mysql_query($sql,$conn); if(!$results) { echo "
Query went bad!
\n"; echo mysql_errno().": ".mysql_error().""; $wentwrong = true; } $sql = "DROP TABLE IF EXISTS livehelp_modules_dep"; mysql_query($sql,$conn); $sql = "CREATE TABLE livehelp_modules_dep ( rec int(10) NOT NULL auto_increment, departmentid int(10) NOT NULL default '0', modid int(10) NOT NULL default '0', ordernum int(8) NOT NULL default '0', defaultset char(1) NOT NULL default '', PRIMARY KEY (rec) ) "; $results = mysql_query($sql,$conn); if(!$results) { echo "
Query went bad!
\n"; echo mysql_errno().": ".mysql_error().""; $wentwrong = true; } $sql = "DROP TABLE IF EXISTS livehelp_modules"; mysql_query($sql,$conn); $sql = "CREATE TABLE livehelp_modules ( id int(10) NOT NULL auto_increment, name varchar(30) NOT NULL default '', path varchar(255) NOT NULL default '', adminpath varchar(255) NOT NULL default '', query_string varchar(255) NOT NULL default '', PRIMARY KEY (id) ) "; $results = mysql_query($sql,$conn); if(!$results) { echo "
Query went bad!
\n"; echo mysql_errno().": ".mysql_error().""; $wentwrong = true; } $results = mysql_query("INSERT INTO `livehelp_modules` (id,name,path) VALUES (1, 'Live Help!', 'livehelp.php')",$conn); $results = mysql_query("INSERT INTO `livehelp_modules` (id,name,path) VALUES (2, 'Contact', 'leavemessage.php')",$conn); $results = mysql_query("INSERT INTO `livehelp_modules` (id,name,path,adminpath) VALUES (3, 'Q & A', 'user_qa.php','qa.php')",$conn); $results = mysql_query("INSERT INTO `livehelp_modules_dep` VALUES (1, 1, 1, 1, '')",$conn); $results = mysql_query("INSERT INTO `livehelp_modules_dep` VALUES (2, 1, 2, 2, '')",$conn); $sql = "DROP TABLE IF EXISTS livehelp_channels"; mysql_query($sql,$conn); $sql = "CREATE TABLE livehelp_channels ( id int(10) NOT NULL auto_increment, user_id int(10) NOT NULL default '0', statusof char(1) NOT NULL default '', startdate bigint(8) NOT NULL default '0', PRIMARY KEY (id) ) "; $results = mysql_query($sql,$conn); if(!$results) { echo "
Query went bad!
\n"; echo mysql_errno().": ".mysql_error().""; $wentwrong = true; } $sql = "DROP TABLE IF EXISTS livehelp_config"; mysql_query($sql,$conn); $sql = "CREATE TABLE livehelp_config ( version float(3,1) NOT NULL default '1.7', site_title varchar(100) NOT NULL default '', use_flush varchar(10) NOT NULL default 'YES', membernum int(8) NOT NULL default '0', offset int(5) NOT NULL default '0', show_typing char(1) NOT NULL default '', webpath varchar(255) NOT NULL default '', speaklanguage varchar(10) not NULL default 'eng' ) "; $results = mysql_query($sql,$conn); if(!$results) { echo "
Query went bad!
\n"; echo mysql_errno().": ".mysql_error().""; $wentwrong = true; } $results = mysql_query($insert_query,$conn); if(!$results) { echo "
Query went bad!
\n"; echo mysql_errno().": ".mysql_error().""; $wentwrong = true; } $sql = "DROP TABLE IF EXISTS livehelp_departments"; mysql_query($sql,$conn); $sql = " CREATE TABLE livehelp_departments ( recno int(5) NOT NULL auto_increment, nameof varchar(30) NOT NULL default '', onlineimage varchar(255) NOT NULL default '', offlineimage varchar(255) NOT NULL default '', qaimage varchar(255) NOT NULL default '', requirename char(1) NOT NULL default '', messageemail varchar(60) NOT NULL default '', leaveamessage varchar(10) NOT NULL default '', opening text NOT NULL, offline text NOT NULL, qa_topic int(10) NOT NULL default '0', qa_enabled char(1) NOT NULL default '', creditline char(1) NOT NULL default '', PRIMARY KEY (recno) )"; $results = mysql_query($sql,$conn); if(!$results) { echo "
Query went bad!
\n"; echo mysql_errno().": ".mysql_error().""; $wentwrong = true; } $sql = "DROP TABLE IF EXISTS livehelp_messages"; mysql_query($sql,$conn); $sql = " CREATE TABLE livehelp_messages ( id_num int(10) NOT NULL auto_increment, message text NOT NULL, channel int(10) NOT NULL default '0', timeof bigint(14) NOT NULL default '0', saidfrom int(10) NOT NULL default '0', saidto int(10) NOT NULL default '0', PRIMARY KEY (id_num), KEY channel (channel), KEY timeof (timeof) )"; $results = mysql_query($sql,$conn); if(!$results) { echo "
Query went bad!
\n"; echo mysql_errno().": ".mysql_error().""; $wentwrong = true; } $sql = "DROP TABLE IF EXISTS livehelp_operator_channels"; mysql_query($sql,$conn); $sql = " CREATE TABLE livehelp_operator_channels ( id int(10) NOT NULL auto_increment, user_id int(10) NOT NULL default '0', channel int(10) NOT NULL default '0', userid int(10) NOT NULL default '0', statusof char(1) NOT NULL default '', startdate bigint(8) NOT NULL default '0', bgcolor varchar(10) NOT NULL default '000000', PRIMARY KEY (id), KEY channel (channel), KEY user_id (user_id) )"; $results = mysql_query($sql,$conn); if(!$results) { echo "
Query went bad!
\n"; echo mysql_errno().": ".mysql_error().""; $wentwrong = true; } $sql = "DROP TABLE IF EXISTS livehelp_operator_departments"; mysql_query($sql,$conn); $sql = " CREATE TABLE livehelp_operator_departments ( recno int(10) NOT NULL auto_increment, user_id int(10) NOT NULL default '0', department int(10) NOT NULL default '0', extra varchar(100) NOT NULL default '', PRIMARY KEY (recno), KEY user_id (user_id), KEY department (department) )"; $results = mysql_query($sql,$conn); if(!$results) { echo "
Query went bad!
\n"; echo mysql_errno().": ".mysql_error().""; $wentwrong = true; } $sql = "DROP TABLE IF EXISTS livehelp_qa"; mysql_query($sql,$conn); $sql = " CREATE TABLE livehelp_qa ( recno int(10) NOT NULL auto_increment, parent int(10) NOT NULL default '0', question text NOT NULL, typeof varchar(10) NOT NULL default '', status VARCHAR(20) NOT NULL, username varchar(60) NOT NULL, ordernum int(10) NOT NULL default '0', PRIMARY KEY (recno) )"; $results = mysql_query($sql,$conn); if(!$results) { echo "
Query went bad!
\n"; echo mysql_errno().": ".mysql_error().""; $wentwrong = true; } $sql = "DROP TABLE IF EXISTS livehelp_quick"; mysql_query($sql,$conn); $sql = " CREATE TABLE livehelp_quick ( id int(10) NOT NULL auto_increment, name varchar(50) NOT NULL default '', typeof varchar(30) NOT NULL default '', message text NOT NULL, visiblity varchar(20) NOT NULL default '', department int(10) NOT NULL default '0', user int(10) NOT NULL default '0', PRIMARY KEY (id) )"; $results = mysql_query($sql,$conn); if(!$results) { echo "
Query went bad!
\n"; echo mysql_errno().": ".mysql_error().""; $wentwrong = true; } $sql = "DROP TABLE IF EXISTS livehelp_referers"; mysql_query($sql,$conn); $sql = "CREATE TABLE livehelp_referers ( recno int(11) NOT NULL auto_increment, camefrom varchar(255) NOT NULL default '0', dayof int(8) NOT NULL default '0', uniquevisits int(10) NOT NULL default '0', PRIMARY KEY (recno), KEY camefrom (camefrom), KEY dayof (dayof), KEY uniquevisits (uniquevisits) )"; $results = mysql_query($sql,$conn); if(!$results) { echo "
Query went bad!
\n"; echo mysql_errno().": ".mysql_error().""; $wentwrong = true; } $sql = "DROP TABLE IF EXISTS livehelp_referers_total"; mysql_query($sql,$conn); $sql = "CREATE TABLE livehelp_referers_total ( recno int(11) NOT NULL auto_increment, camefrom varchar(255) NOT NULL default '0', ctotal int(10) NOT NULL default '0', PRIMARY KEY (recno), KEY camefrom (camefrom), KEY ctotal (ctotal) )"; $results = mysql_query($sql,$conn); if(!$results) { echo "
Query went bad!
\n"; echo mysql_errno().": ".mysql_error().""; $wentwrong = true; } $sql = "DROP TABLE IF EXISTS livehelp_transcripts"; mysql_query($sql,$conn); $sql = " CREATE TABLE livehelp_transcripts ( recno int(10) NOT NULL auto_increment, who varchar(100) NOT NULL default '', daytime timestamp(14) NOT NULL, transcript text NOT NULL, PRIMARY KEY (recno) )"; $results = mysql_query($sql,$conn); if(!$results) { echo "
Query went bad!
\n"; echo mysql_errno().": ".mysql_error().""; $wentwrong = true; } $sql = "DROP TABLE IF EXISTS livehelp_users"; mysql_query($sql,$conn); $sql = " CREATE TABLE livehelp_users ( user_id int(10) NOT NULL auto_increment, lastaction timestamp(14) NOT NULL, username varchar(30) NOT NULL default '', password varchar(60) NOT NULL default '', isonline char(1) NOT NULL default '', isoperator char(1) NOT NULL default 'N', onchannel int(10) NOT NULL default '0', isadmin char(1) NOT NULL default 'N', department int(5) NOT NULL default '0', identity varchar(255) NOT NULL default '', status varchar(30) NOT NULL default '', isnamed char(1) NOT NULL default 'N', showedup bigint(14) default NULL, email varchar(60) NOT NULL default '', camefrom varchar(200) NOT NULL default '', show_arrival char(1) NOT NULL default 'N', user_alert char(1) NOT NULL default '', auto_invite CHAR( 1 ) NOT NULL, istyping CHAR( 1 ) NOT NULL, visits int(8) NOT NULL, PRIMARY KEY (user_id) )"; $results = mysql_query($sql,$conn); if(!$results) { echo "
Query went bad!
\n"; echo mysql_errno().": ".mysql_error().""; $wentwrong = true; } $sql = "DROP TABLE IF EXISTS livehelp_visit_track"; mysql_query($sql,$conn); $sql = " CREATE TABLE livehelp_visit_track ( recno int(10) NOT NULL auto_increment, id varchar(30) NOT NULL default '0', location varchar(100) NOT NULL default '', page bigint(14) NOT NULL default '0', title varchar(100) NOT NULL default '', whendone timestamp(14) NOT NULL, referrer varchar(100) NOT NULL default '', PRIMARY KEY (recno), KEY id (id) )"; $results = mysql_query($sql,$conn); if(!$results) { echo "
Query went bad!
\n"; echo mysql_errno().": ".mysql_error().""; $wentwrong = true; } $sql = "DROP TABLE IF EXISTS livehelp_visits"; mysql_query($sql,$conn); $sql = "CREATE TABLE livehelp_visits ( recno int(11) NOT NULL auto_increment, pageurl varchar(255) NOT NULL default '0', dayof int(8) NOT NULL default '0', uniquevisits int(10) NOT NULL default '0', PRIMARY KEY (recno), KEY pageurl (pageurl), KEY dayof (dayof), KEY uniquevisits (uniquevisits) )"; $results = mysql_query($sql,$conn); if(!$results) { echo "
Query went bad!
\n"; echo mysql_errno().": ".mysql_error().""; $wentwrong = true; } $sql = "DROP TABLE IF EXISTS livehelp_visits_total"; mysql_query($sql,$conn); $sql = "CREATE TABLE livehelp_visits_total ( recno int(11) NOT NULL auto_increment, pageurl varchar(255) NOT NULL default '0', ctotal int(10) NOT NULL default '0', PRIMARY KEY (recno), KEY pageurl (pageurl), KEY ctotal (ctotal) )"; $results = mysql_query($sql,$conn); if(!$results) { echo "
Query went bad!
\n"; echo mysql_errno().": ".mysql_error().""; $wentwrong = true; } // default stuff... $results = mysql_query($insert_query2,$conn); $results = mysql_query($insert_query3,$conn); $results = mysql_query($insert_query4,$conn); if(!$results) { echo "
Query went bad!
\n"; echo mysql_errno().": ".mysql_error().""; $wentwrong = true; } }} } if($errors != ""){ print "THERE WAS A FEW PROBLEMS:
"; print "$errors"; print "CLICK HERE TO TRY AGAIN"; exit; } ?>
"; exit; } ?>
INSTALLATION IS DONE!! You will now need to log into the admin of this livehelp and start adding pages. To do this click the link below. Right it down username:
password:
CLICK HERE TO BEGIN REGISTRATION
Skip REGISTRATION
print "CLICK HERE to get started..Crafty Syntax livehelp Installation $test_dir = getcwd(); ?>
problems on this page?!? CLICK HERE TO GO TO SUPPORT PAGE
if ($errors != ""){ print ""; } // Check to see if we can write to the config file. if($manualinstall != "YES"){ $fp = fopen ("config.php", "r+"); } else { $fp = True; } if(!$fp){ ?>
ERRORS: $errors
Can not open config.php file for writing:
HOW TO FIX THIS:
In order to configure the Live Help using this web wizard, the web server needs to be able to read and write to the file named config.php. if you can not change the permissions of this file then there is a manual change option listed at the bottom of this page... if you are planning on using a text based database you will also need to change the permissions of the directory txt-database. Directions on doing this follows:
Installing and configuring C.S. livehelp is done via a set of web pages. To enable these web pages you need to log onto your web server using telnet or (preferably) ssh, go to the livehelp directory and at the prompt (which usually ends in '%' or '$') type:
chmod 777 txt-database (if using a text based database)
chmod 777 config.php
After installation you can change the permissions of config.php to chmod 755.
if you can not ssh or telent into your website you can to the same task by FTP:
Using WS_FTP this would be right hand clicking on the file config.php , selecting chmod, and then giving all permissions to that file/directory.
![]()
Manual config change option:
if you do not have access to, or can not change the permissions of config.php you also have the Option to update config.php yourself. CLICK HERE TO RUN INSTALLAION BY MANUALLY CHANGING config.php
AFTER YOU HAVE CHANGED THE PERMISSIONS OF THE FILES HOLD DOWN THE shift KEY and PRESS REFRESH or RELOAD
exit; } ?>
if you can not change the permissions of the files here are Manual Installation Directions:
if you do not have access to, or can not change the permissions of config.php you also have the Option to update config.php yourself after the database has been created. CLICK HERE TO RUN INSTALLAION BY MANUALLY CHANGING config.php