Please change the file permissions to 777 for the following files and folders:
includes/connect.php
sitemap.xml
userfiles/
ERROR: please complete the fields with a *
"; } // ------------------------------------------------ do the following if Step 2 if ($_GET['step'] == 'Step2') { // check to see if step 1 required details have been completed if (empty($_POST['Host']) || empty($_POST['Username']) || empty($_POST['Password']) || empty($_POST['Name']) || empty($_POST['adminUser']) || empty($_POST['adminPass']) || empty($_POST['adminEmail']) || empty($_POST['adminWebTitle']) || empty($_POST['adminWebURL'])) { header("Location: install.php?error=1"); } if (!isset($_GET['error'])) { // get login details from Step 1 $hostname = $_POST['Host']; $database = $_POST['Name']; $username = $_POST['Username']; $password = $_POST['Password']; $databaseConnect = mysql_pconnect($hostname, $username, $password) or trigger_error(mysql_error(),E_USER_ERROR); // connect to database mysql_select_db($database, $databaseConnect); // drop config table if it already exists $sql = "DROP TABLE IF EXISTS affiliSt_config"; mysql_query($sql, $databaseConnect) or die(mysql_error()); // create config table $sql = "CREATE TABLE affiliSt_config ( name VARCHAR(150) NOT NULL, value TEXT, comment VARCHAR(150), title VARCHAR(150), PRIMARY KEY (name) )"; mysql_query($sql, $databaseConnect) or die(mysql_error()); // drop categories table if it already exists $sql = "DROP TABLE IF EXISTS affiliSt_categories"; mysql_query($sql, $databaseConnect) or die(mysql_error()); // create categories table $sql = "CREATE TABLE affiliSt_categories ( id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, name VARCHAR(255), parent INT(10) default 0, subCategories INT(10) default 0, keywords TEXT, negkeywords TEXT, priceFrom DECIMAL(10,2) default 0.00, priceLimit DECIMAL(10,2) default 0.00, searchType SMALLINT(1) default 0, bindParent SMALLINT(1) default 0, searchCols VARCHAR(50) default '1:1:1:1:1:1:1:1:1:1:1:1', negSearchCols VARCHAR(50) default '1:1:1:1:1:1:1:1:1:1:1:1', linkGroup VARCHAR(150), subLinks SMALLINT(1), PRIMARY KEY (id) )"; mysql_query($sql, $databaseConnect) or die(mysql_error()); // drop link categories table if it already exists $sql = "DROP TABLE IF EXISTS affiliSt_linkcategories"; mysql_query($sql, $databaseConnect) or die(mysql_error()); // create link categories table $sql = "CREATE TABLE affiliSt_linkcategories ( id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, name VARCHAR(255), parent INT(10) default 0, counter INT(10) default 0, subCategories INT(10) default 0, PRIMARY KEY (id) )"; mysql_query($sql, $databaseConnect) or die(mysql_error()); // drop links table if it already exists $sql = "DROP TABLE IF EXISTS affiliSt_links"; mysql_query($sql, $databaseConnect) or die(mysql_error()); // create links table $sql = "CREATE TABLE affiliSt_links ( id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, name VARCHAR(255), email VARCHAR(255), url VARCHAR(255), title TEXT, description TEXT, category INT(10) default 0, reciprocal VARCHAR(255), confirmed SMALLINT(1) default 0, approved SMALLINT(1) default 0, nocheck SMALLINT(1) default 0, added INT(10) default 0, nextcheck INT(10) default 0, PRIMARY KEY (id) )"; mysql_query($sql, $databaseConnect) or die(mysql_error()); // drop news table if it already exists $sql = "DROP TABLE IF EXISTS affiliSt_news"; mysql_query($sql, $databaseConnect) or die(mysql_error()); // create news table $sql = "CREATE TABLE affiliSt_news ( id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, name VARCHAR(255), timestamp INT(10) default 0, content TEXT, PRIMARY KEY (id) )"; mysql_query($sql, $databaseConnect) or die(mysql_error()); // drop pages table if it already exists $sql = "DROP TABLE IF EXISTS affiliSt_pages"; mysql_query($sql, $databaseConnect) or die(mysql_error()); // create pages table $sql = "CREATE TABLE affiliSt_pages ( id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, name VARCHAR(255), parent INT(10) default 0, subCategories INT(10) default 0, content TEXT, location VARCHAR(10), PRIMARY KEY (id) )"; mysql_query($sql, $databaseConnect) or die(mysql_error()); // drop comments table if it already exists $sql = "DROP TABLE IF EXISTS affiliSt_comments"; mysql_query($sql, $databaseConnect) or die(mysql_error()); // create comments table $sql = "CREATE TABLE affiliSt_comments ( commentID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, name VARCHAR(250), email TEXT, link TEXT, comments TEXT, date INT(10) default 0, attachedID TEXT, section VARCHAR(150), approve SMALLINT(1) default 0, rating SMALLINT(1) default 0, PRIMARY KEY (commentID) )"; mysql_query($sql, $databaseConnect) or die(mysql_error()); // drop tag cloud table if it already exists $sql = "DROP TABLE IF EXISTS affiliSt_cloud"; mysql_query($sql, $databaseConnect) or die(mysql_error()); // create tag cloud table $sql = "CREATE TABLE affiliSt_cloud ( searchPhraseID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, searchPhrase TEXT, searchPhraseCount INT(10) default 0, approve SMALLINT(1) default 0, PRIMARY KEY (searchPhraseID) )"; mysql_query($sql, $databaseConnect) or die(mysql_error()); // drop products table if it already exists $sql = "DROP TABLE IF EXISTS affiliSt_products1"; mysql_query($sql, $databaseConnect) or die(mysql_error()); // create products table $sql = "CREATE TABLE affiliSt_products1 ( prodID INT(10) UNSIGNED ZEROFILL NOT NULL AUTO_INCREMENT, merchant VARCHAR(150), merchantProdID VARCHAR(255), prodCategory VARCHAR(255), prodName VARCHAR(255), prodBrand VARCHAR(255), prodDescription TEXT, prodPromoText TEXT, prodLink TEXT, prodImageURL TEXT, prodImageSmall TEXT, prodPrice DECIMAL(10,2), prodCurrency VARCHAR(20), prodPopularity INT(10) NOT NULL default 0, prodDB INT(10) NOT NULL default 0, extraFieldA TEXT, extraFieldB TEXT, extraFieldC TEXT, extraFieldD TEXT, extraFieldE TEXT, PRIMARY KEY (prodID) )"; mysql_query($sql, $databaseConnect) or die(mysql_error()); if (dirname($_SERVER['PHP_SELF']) == '/') { $theHostDir = "http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']); } else { $theHostDir = "http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/"; } // sample pages $insert = array ( array ( 'id' => 1, 'name' => '', 'parent' => 0, 'subCategories' => 0, 'content' => 'You can add some text and images here using the wysiwyg editor in admin
', 'location' => '::'), array ( 'id' => 2, 'name' => 'About Page', 'parent' => 0, 'subCategories' => 0, 'content' => 'This is a sample about page', 'location' => '1:1:1') ); // insert values into pages table foreach ($insert as $row) { $sql = "INSERT INTO affiliSt_pages ( id, name, parent, subCategories, content, location ) values ( '{$row['id']}', '{$row['name']}', '{$row['parent']}', '{$row['subCategories']}', '{$row['content']}', '{$row['location']}' )"; mysql_query($sql, $databaseConnect) or die(mysql_error()); } // sample news item $timeNow = mktime(0, 0, 0, date("m"), date("d"), date("Y")); $insert = array ( array ( 'id' => 1, 'name' => 'Sample News Title', 'timestamp' => $timeNow, 'content' => 'Sample news description') ); // insert values into news table foreach ($insert as $row) { $sql = "INSERT INTO affiliSt_news ( id, name, timestamp, content ) values ( '{$row['id']}', '{$row['name']}', '{$row['timestamp']}', '{$row['content']}' )"; mysql_query($sql, $databaseConnect) or die(mysql_error()); } // sample built navigation item $insert = array ( array ( 'id' => 1, 'name' => 'AffiliStore', 'parent' => 0, 'subCategories' => 0, 'keywords' => 'affilistore', 'negkeywords' => '', 'priceFrom' => 0.00, 'priceLimit' => 999999999.99, 'searchType' => 0, 'bindParent' => 0, 'searchCols' => '::1:1:1:::::::', 'negSearchCols' => '1:1:1:1:1:1:1:1:1:1:1:1', 'linkGroup' => 'Affiliate Products', 'subLinks' => 1) ); // insert values into built navigation table foreach ($insert as $row) { $sql = "INSERT INTO affiliSt_categories ( id, name, parent, subCategories, keywords, negkeywords, priceFrom, priceLimit, searchType, bindParent, searchCols, negSearchCols, linkGroup, subLinks ) values ( '{$row['id']}', '{$row['name']}', '{$row['parent']}', '{$row['subCategories']}', '{$row['keywords']}', '{$row['negkeywords']}', '{$row['priceFrom']}', '{$row['priceLimit']}', '{$row['searchType']}', '{$row['bindParent']}', '{$row['searchCols']}', '{$row['negSearchCols']}', '{$row['linkGroup']}', '{$row['subLinks']}' )"; mysql_query($sql, $databaseConnect) or die(mysql_error()); } // create array for values posted from Step 1 $insert = array ( array ( 'name' => 'adUsername', 'value' => $_POST['adminUser'], 'comment' => 'Your admin username', 'title' => 'Admin Username'), array ( 'name' => 'adPassword', 'value' => $_POST['adminPass'], 'comment' => 'Your admin password', 'title' => 'Admin Password'), array ( 'name' => 'adEmail', 'value' => $_POST['adminEmail'], 'comment' => 'Your admin email address', 'title' => 'Admin Email'), array ( 'name' => 'adWebTitle', 'value' => $_POST['adminWebTitle'], 'comment' => 'Your website title', 'title' => 'Website Title'), array ( 'name' => 'adWebStrap', 'value' => 'An AffiliStore Website', 'comment' => 'Your website description', 'title' => 'Website Description'), array ( 'name' => 'adWebURL', 'value' => $_POST['adminWebURL'], 'comment' => 'Your website address', 'title' => 'Website Address'), array ( 'name' => 'adSkinURL', 'value' => 'default', 'comment' => 'Your chosen website skin', 'title' => 'Website Skin'), array ( 'name' => 'dbHost', 'value' => $_POST['Host'], 'comment' => 'Your database host', 'title' => 'Database Host'), array ( 'name' => 'dbUsername', 'value' => $_POST['Username'], 'comment' => 'Your database username', 'title' => 'Database Username'), array ( 'name' => 'dbPassword', 'value' => $_POST['Password'], 'comment' => 'Your database password', 'title' => 'Database Password'), array ( 'name' => 'dbName', 'value' => $_POST['Name'], 'comment' => 'Your database name', 'title' => 'Database Name'), array ( 'name' => 'installDir', 'value' => $theHostDir, 'comment' => 'Directory of installation', 'title' => 'Installation Directory'), array ( 'name' => 'adLinkDescription', 'value' => 'Your Website Link Description', 'comment' => 'Your website link description', 'title' => 'Website Link Description'), array ( 'name' => 'adLinkTitle', 'value' => 'Your website link title', 'comment' => 'Your website link title', 'title' => 'Website Link Title'), array ( 'name' => 'adLinkURL', 'value' => 'http://www.yourwebsite.com/', 'comment' => 'Your backlink URL', 'title' => 'Website Address'), array ( 'name' => 'emailNewLink', 'value' => 'You have received a new link submission.', 'comment' => 'New link added', 'title' => 'New Link'), array ( 'name' => 'emailSig', 'value' => 'Regards Admin', 'comment' => 'Email signature', 'title' => 'Email Signature'), array ( 'name' => 'emailThanks', 'value' => 'We have received your submission and will review your link asap.', 'comment' => 'Thank you for submitting link', 'title' => 'Thank You Email'), array ( 'name' => 'emailApprove', 'value' => 'Your link has been approved!', 'comment' => 'Approved link email', 'title' => 'Approved Link'), array ( 'name' => 'emailNoRecip', 'value' => 'We are unable to find a reciprocal link, your link has been approved here:', 'comment' => 'No reciprocal link found', 'title' => 'No Reciprocal'), array ( 'name' => 'navOptions', 'value' => '1:1::1:1:1:1::1:99999:1:1::1:', 'comment' => 'Turn on or off navigation panels', 'title' => 'Navigation Options'), array ( 'name' => 'prodPerPage', 'value' => '1:30:1:4:20:4', 'comment' => 'How many products to display on home and other pages', 'title' => 'Products Per Page'), array ( 'name' => 'prodListings', 'value' => '::1:1:1::1:1:1:1:1:1:1:1', 'comment' => 'Items to display on the product listings', 'title' => 'Product Listings Options'), array ( 'name' => 'prodSingle', 'value' => '::1:1:1:1:1:1:1:1:1:1:1:1', 'comment' => 'Items to display on the single product listing', 'title' => 'Single Product Listings Options'), array ( 'name' => 'adLogo', 'value' => $theHostDir.'userfiles/logo.gif', 'comment' => 'Your logo file', 'title' => 'Website Logo'), array ( 'name' => 'adLogoAlt', 'value' => 'Logo', 'comment' => 'The alt tag for the logo', 'title' => 'Logo Alt Tag'), array ( 'name' => 'totalDBs', 'value' => '1', 'comment' => 'The Total Product Databases', 'title' => 'Total Prod DBs'), array ( 'name' => 'csvURL1', 'value' => $theHostDir.'userfiles/samplefeed.csv', 'comment' => 'The link to your product feed', 'title' => 'URL Feed'), array ( 'name' => 'csvType1', 'value' => ',', 'comment' => 'The format of the product field eg. comma seperate...', 'title' => 'Product Feed Type'), array ( 'name' => 'feedMemory1', 'value' => 'AffiliStore-:-0-:-1-:-2-:-3-:-4-:-5-:-6-:-7-:-9-:-£-:-1-:-0-:--:-10-:-11-:-12-:-13-:-14-:-Product ID: -:-Category: -:-Name: -:-Brand: -:-Description: -:-Promotion: -:--:--:-Price: -:-A: -:-B: -:-C: -:-D: -:-E: -:-userfiles/logoBot.jpg-:-8', 'comment' => 'Remembers which feed columns have been put into AffiliStore columns', 'title' => 'Feed Memory') ); // insert values posted from Step 1 into config table foreach ($insert as $row) { $sql = "INSERT INTO affiliSt_config ( name, value, comment, title ) values ( '{$row['name']}', '{$row['value']}', '{$row['comment']}', '{$row['title']}' )"; mysql_query($sql, $databaseConnect) or die(mysql_error()); } // write values posted to connect.php include file $file = fopen("includes/connect.php", "w"); $cData =''; fwrite($file, $cData); fclose($file); $typeFeed = ","; $row = 1; $handle = fopen("userfiles/samplefeed.csv", "r") or die (""); // empty the table $empty = "TRUNCATE TABLE affiliSt_products1"; mysql_query($empty); // while loop with fgetcsv sorts the csv into the data array while (($data = fgetcsv($handle, 3000, $typeFeed)) !== FALSE) { $resulta = 'AffiliStore'; $resultb = $data[0]; $resultc = $data[1]; $resultd = $data[2]; $resulte = $data[3]; $resultf = $data[4]; $resultg = $data[5]; $resulth = $data[6]; $resulti = $data[7]; $resultj = $data[9]; $resultk = '£'; $resultl = '1'; $resultm = $data[10]; $resultn = $data[11]; $resulto = $data[12]; $resultp = $data[13]; $resultq = $data[14]; $resultr = $data[8]; // miss out headers row if ($row != 1) { // insert all the data into the database table $sql = "INSERT INTO affiliSt_products1 ( merchant, merchantProdID, prodCategory, prodName, prodBrand, prodDescription, prodPromoText, prodLink, prodImageURL, prodPrice, prodCurrency, prodDB, extraFieldA, extraFieldB, extraFieldC, extraFieldD, extraFieldE, prodImageSmall ) VALUES ( '$resulta', '$resultb', '$resultc', '$resultd', '$resulte', '$resultf', '$resultg', '$resulth', '$resulti', '$resultj', '$resultk', '$resultl', '$resultm', '$resultn', '$resulto', '$resultp', '$resultq', '$resultr' )"; mysql_query($sql); } $row++; } // email details $email = $_POST['adminEmail']; $user = $_POST['adminUser']; $pass = $_POST['adminPass']; $emailaddress = $email; $subject = "Your AffiliStore Website Has Been Created"; $emailfrom = $email; $message .= "Here are your AffiliStore admin sign-in details: \n Username: $user \n Password: $pass \n Email: $email \n Sign-in here: \n ".$theHostDir."admin/ \n\n"; $runtime = (date("d M Y H:i")); $message .= "Time of the message: $runtime (server time zone)\n\n"; mail($emailaddress, $subject, $message, "From: '$emailfrom'"); } } ?>