CLICK HERE"; exit; } // check to see if they can parse php if (false) { ?> Can not write to the text based database directory . Make sure $txtpath is chmod 777 "; } } // check for errors. if ($password == ""){ $errors .= "
  • You did not enter in a password."; } if ($password != $password2){ $errors .= "
  • The two passwords you entered do not equal eachother .. you might of mistyped it password the second time . please retype the passwords you entered in again."; } $password = ereg_replace("[^A-Za-z0-9]", "", $password); if ($password != $password2){ $errors .= "
  • The password you entered contained invalid characters. Please only use letters and numbers "; } if ($email == ""){ $errors .= "
  • You did not enter in a e-mail address. This is important for if you ever loose your password. "; } if ($dbtype == "mysql_options.php"){ if ($database == ""){ $errors .= "
  • You did not enter in a Mysql database name "; } if ($datausername == ""){ $errors .= "
  • You did not enter in a Mysql Username name "; } if($errors == ""){ $conn = mysql_connect($server,$datausername,$mypassword); if(!$conn) { $errors .= "
  • Connection to the database failed. You may have the wrong database username/password "; } if(!mysql_select_db($database,$conn)) { $errors .= "
  • Database select failed. You may have the wrong database "; } } } if( ($homepage == "") || ($homepage == "http://www.urltoyourwebsite.com") ){ $errors .= "
  • You did not enter in a valid homepage address. "; } if ($errors == ""){ // setup the config file.. $fcontents = implode ('', file ('config.php')); $fcontents = ereg_replace("installed=false","installed=true",$fcontents); $fcontents = ereg_replace("INPUT-DBTYPE","$dbtype",$fcontents); $fcontents = ereg_replace("INPUT-SERVER","$server",$fcontents); $fcontents = ereg_replace("INPUT-DATABASE","$database",$fcontents); $fcontents = ereg_replace("INPUT-DATAUSERNAME","$datausername",$fcontents); $fcontents = ereg_replace("INPUT-PASSWORD","$mypassword",$fcontents); $lastchar = substr($txtpath,-1); if($lastchar != "/"){ $txtpath .= "/"; } $lastchar = substr($rootpath,-1); if($lastchar != "/"){ $rootpath .= "/"; } $lastchar = substr($dbpath,-1); if($lastchar != "/"){ $dbpath .= "/"; } $lastchar = substr($homepage,-1); if($lastchar != "/"){ $homepage .= "/"; } if (get_magic_quotes_gpc()) { $fcontents = ereg_replace("INPUT-TXTPATH",stripslashes($txtpath),$fcontents); $fcontents = ereg_replace("INPUT-ROOTPATH",stripslashes($rootpath),$fcontents); $fcontents = ereg_replace("INPUT-DBPATH",stripslashes($dbpath),$fcontents); $fcontents = ereg_replace("INPUT-HTTP",stripslashes($homepage),$fcontents); } else { $fcontents = ereg_replace("INPUT-TXTPATH",stripslashes($txtpath),$fcontents); $fcontents = ereg_replace("INPUT-ROOTPATH",stripslashes($rootpath),$fcontents); $fcontents = ereg_replace("INPUT-DBPATH",stripslashes($dbpath),$fcontents); $fcontents = ereg_replace("INPUT-HTTP",stripslashes($homepage),$fcontents); } $insert_query = "INSERT INTO livehelp_config (version, site_title, use_flush, membernum, offset, show_typing,webpath,speaklanguage) VALUES ('2.7', 'Live Help!', 'YES', 0, 0, '','$homepage','$speaklanguage')"; $insert_query2 = "INSERT INTO livehelp_users (username,password,isonline,isoperator,isadmin,isnamed,email,show_arrival,user_alert,auto_invite) VALUES ('$username','$password','N','Y','Y','Y','$email','Y','N','N')"; $onlineimage = $homepage . "online.gif"; $offlineimage = $homepage . "leavemessage.gif"; $insert_query3 = "INSERT INTO livehelp_departments (nameof, onlineimage, offlineimage, qaimage, requirename, messageemail, leaveamessage, opening, offline, qa_topic, qa_enabled) VALUES ('default', '$onlineimage', '$offlineimage', 'qaimage.gif', 'Y', '$email', 'YES', '
    $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 "
    ";
      print htmlspecialchars($fcontents);
      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 "

    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; } ?>
      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

      CLICK HERE to get started..
      "; exit; } ?>

      Crafty Syntax livehelp Installation

      problems on this page?!? CLICK HERE TO GO TO SUPPORT PAGE
      ERRORS: $errors"; } // Check to see if we can write to the config file. if($manualinstall != "YES"){ $fp = fopen ("config.php", "r+"); } else { $fp = True; } if(!$fp){ ?>
      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


      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
      LANGUAGE:
      All of the text for CSLH that is shown on the users side can be in :
      Language:
      INSTALLATION OPTION:
      You can upgrade to the newest version of the live help and not loose any of your data...
      Installation:
      Title of your livehelp:
      This is the Title of your livehelp and will be shown as the title tag.
      Title of your livehelp:
      Web path to Livehelp:
      This is the url to the Live help on your server. It will be used to access the online help for your site..
      Live help URL:
      Administration user/Password:
      Although you can create multiple Operators for the Live help. There is one operator that is the main administrator that can create users, edit, add, delete everything. Create that account here. The password must only contain number and letters. no spaces or !@#$ characters.
      username:
      password:
      password (again):
      Administration e-mail:
      This is the e-mail address for the administrator of this. e-mails on access, lost password, etc..
      email:
      Full Path to livehelp:
      This is the Full Path to livehelp not to be confused with the httpd path. This should be a file path like /www/username/public_html/livehelp
      Full Path to livehelp:">
      Opening message:
      When the user first opens up the Live Help they are directed to a page to enter in their name so that Operators can Identify them easy. This is the text shown on that opening page.
      Opening Message:
      Type of Database:
      This is the type of database that you are using. At the moment this is only Mysql. Future versions will have more types of databases.. if you are having trouble with your database settings you can request help at Programming and Support Page.
      Database:
        If MySQL is selected above:
        SQL server:
        SQL database:
        SQL user:
        SQL password:

        If txt-db-api (simple Flat text files) is selected above you need to provide a full path to the directory where the txt files will be stored. This directory must be writable by the web and if you care about security should not be in a web accessable directory.
        txt path:" >