"1" && $_GET["step"]<="5"){ $step = $_GET["step"]; }else{ die("Oups. Looks like you did not follow the instructions! Please follow the instructions otherwise you will not be able to install this script."); } switch ($step) { case '2': if(file_exists("includes/config.php")) $error='Configuration file already exists. Please delete or rename "config.php" and recopy "config_sample.php" from the original zip file. You cannot continue until you do this.'; if(isset($_POST["step2"])){ if (empty($_POST["host"])) $error.="

- You forgot to enter your host.

"; if (empty($_POST["name"])) $error.="

- You forgot to enter your database name.

"; if (empty($_POST["user"])) $error.="

- You forgot to enter your username.

"; if(empty($error)){ try{ $db = new PDO("mysql:host=".$_POST["host"].";dbname=".$_POST["name"]."", $_POST["user"], $_POST["pass"]); generate_config($_POST); $query=get_query(); foreach ($query as $q) { $db->query($q); } $_SESSION["msg"]="Database has been successfully imported and configuration file has been created."; header("Location: install.php?step=3"); }catch (PDOException $e){ $error = $e->getMessage(); } } } break; case '3': if(!file_exists("includes/config.php")) die("
The file includes/config.php cannot be found. If the file includes/config_sample.php exists rename that to includes/config.php and refresh this page.
"); @include("includes/config.php"); $_SESSION["msg"]=""; if(isset($_POST["step3"])){ if (empty($_POST["email"])) $error.="
You forgot to enter your email.
"; if (empty($_POST["pass"])) $error.="
You forgot to enter your password.
"; if (empty($_POST["url"])) $error.="
You forgot to enter the url.
"; if(!$error){ $data=array( ":admin"=>"1", ":email"=>$_POST["email"], ":username"=>$_POST["username"], ":password"=>Main::encode($_POST["pass"]), ":date"=>"NOW()", ":pro"=>"1", ":auth_key"=>Main::encode(Main::strrand()), ":last_payment" => date("Y-m-d H:i:s",time()), ":expiration" => date("Y-m-d H:i:s",time()+315360000), ":api" => Main::strrand(12) ); $db->insert("user",$data); $db->update("settings",array("var"=>"?"),array("config"=>"?"),array($_POST["url"],"url")); $db->update("settings",array("var"=>"?"),array("config"=>"?"),array($_POST["email"],"email")); $_SESSION["msg"]="Your admin account has been successfully created."; $_SESSION["site"]=$_POST["url"]; $_SESSION["username"]=$_POST["username"]; $_SESSION["email"]=$_POST["email"]; $_SESSION["password"]=$_POST["pass"]; header("Location: install.php?step=4"); } } break; case '4': $_SESSION["msg"]=""; @include("includes/config.php"); if(!file_exists(ROOT."/.htaccess")){ $content = "### Generated on ".date("d-m-Y H:i:s", strtotime("now"))."\nRewriteEngine On\n#Rewritebase /\n## Admin \nRewriteCond %{REQUEST_FILENAME} !-d\nRewriteCond %{REQUEST_FILENAME} !-f\nRewriteRule ^admin/(.*)?$ admin/index.php?a=$1 [QSA,NC,L]\nRewriteRule ^sitemap.xml$ sitemap.php\n## App \nRewriteCond %{REQUEST_FILENAME} !-d\nRewriteCond %{REQUEST_FILENAME} !-f\nRewriteRule ^(.*)?$ index.php?a=$1 [QSA,NC,L]\nErrorDocument 404 /index.php?a=404"; $file = fopen(ROOT."/.htaccess", "w"); fwrite($file, $content); fclose($file); } break; case '5': header("Location: index.php"); unset($_SESSION); unlink(__FILE__); if(file_exists("main.zip")){ unlink('main.zip'); } if(file_exists("updater.php")){ unlink('updater.php'); } break; } ?> Premium URL Shortener Installation

Installation Process

    >Requirement Check "1")?"Completed":"" ?> >Database Configuration"2")?"Completed":"" ?> >Basic Configuration"3")?"Completed":"" ?> >Installation Complete

Home | Support | Profile
2012- © KBRmedia - All Rights Reserved

Installation of Premium URL Shortener

$message
"; ?> $error
"; ?>

1.0 Requirement Check

These are some of the important requirements for this software. "Red" means it is vital to this script, "Orange" means it is required but not vital and "Green" means it is good. If one of the checks is "Red", you will not be able to install this script because without that requirement, the script will not work.

PHP Version (need at least version 5.5)

It is very important to have at least PHP Version 5.5. It is highly recommended that you use 7.0 or later for better performance.

PDO Driver must be enabled

PDO driver is very important so it must enabled. Without this, the script will not connect to the database hence it will not work at all. If this check fails, you will need to contact your web host and ask them to either enable it or configure it properly.

config_sample.php must be accessible.

This installation will open that file to put values in so it must be accessible. Make sure that file is there in the includes folder and is writable.

content/ folder must writable.

Many things will be uploaded to that folder so please make sure it has the proper permission.

allow_url_fopen Enabled

The function file_get_contents is used to interact with external servers or APIs.

cURL Enabled

cURL is used to interact with external servers or APIs.
Requirements are met. You can now Proceed.'?>

2.0 Database Configuration

Now you have to set up your database by filling the following fields. Make sure you fill them correctly.

Now you have to create an admin account by filling the fields below. Make sure to add a valid email and a strong password. For the site URL, make sure to remove the last slash.

The script has been successfully installed and your admin account has been created. Please click "Delete Install" button below to attempt to delete this file. Please make sure that it has been successfully deleted.

Once clicked, you may see a blank page otherwise you will be redirected to your main page. If you see a blank, don't worry it is normal. All you have to do is to go to your main site, login using the info below and configure your site by clicking the "Admin" menu and then "Settings". Thanks for your purchase and enjoy :)

Login URL: /user/login
Email:
Username:
Password:

Delete install.php = "5.5"){ return "You have ".PHP_VERSION.""; }else{ global $error; $error.=1; return "You have ".PHP_VERSION.""; } break; case 'config': if(@file_get_contents('includes/config_sample.php') && is_writable('includes/config_sample.php')){ return "Accessible"; }else{ global $error; $error.=1; return "Not Accessible"; } break; case 'content': if(is_writable('content')){ return "Accessible"; }else{ global $error; $error.=1; return "Not Accessible"; } break; case 'pdo': if(defined('PDO::ATTR_DRIVER_NAME') && class_exists("PDO")){ return "Enabled"; }else{ global $error; $error.=1; return "Disabled"; } break; case 'file': if(ini_get('allow_url_fopen')){ return "Enabled"; }else{ return "Disabled"; } break; case 'curl': if(in_array('curl', get_loaded_extensions())){ return "Enabled"; }else{ return "Disabled"; } break; } } function get_query(){ $query[] = "CREATE TABLE IF NOT EXISTS `".trim($_POST["prefix"])."bundle` ( `id` int(11) AUTO_INCREMENT, `name` varchar(255) NULL, `userid` mediumint(9) NULL, `date` datetime NULL, `access` varchar(10) NOT NULL DEFAULT 'private', `view` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;"; $query[] = "CREATE TABLE IF NOT EXISTS `".trim($_POST["prefix"])."page` ( `id` int(11) AUTO_INCREMENT, `name` varchar(255) NULL, `seo` varchar(255) NULL, `content` text NULL, `menu` int(11) NOT NULL DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;"; $query[] = "CREATE TABLE IF NOT EXISTS `".trim($_POST["prefix"])."payment` ( `id` int(11) AUTO_INCREMENT, `tid` varchar(255) NULL, `userid` bigint(20) NULL, `status` varchar(255) NULL, `amount` decimal(10,2) NULL, `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `expiry` datetime NULL, `data` text NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;"; $query[] = "CREATE TABLE IF NOT EXISTS `".trim($_POST["prefix"])."settings` ( `config` varchar(255), `var` text NULL, PRIMARY KEY (`config`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8;"; $query[] = "INSERT INTO `".trim($_POST["prefix"])."settings` (`config`, `var`) VALUES ('url', ''), ('title', ''), ('description', ''), ('api', '1'), ('user', '1'), ('sharing', '1'), ('geotarget', '1'), ('adult', '1'), ('maintenance', '0'), ('keywords', ''), ('theme', 'cleanex'), ('apikey', ''), ('ads', '1'), ('captcha', '0'), ('ad728', ''), ('ad468', ''), ('ad300', ''), ('frame', '0'), ('facebook', ''), ('twitter', ''), ('email', ''), ('fb_connect', '0'), ('analytic', ''), ('private', '0'), ('facebook_app_id', ''), ('facebook_secret', ''), ('twitter_key', ''), ('twitter_secret', ''), ('safe_browsing', ''), ('captcha_public', ''), ('captcha_private', ''), ('tw_connect', '0'), ('multiple_domains', '0'), ('domain_names', ''), ('tracking', '1'), ('update_notification', '0'), ('default_lang', ''), ('user_activate', '0'), ('domain_blacklist', ''), ('keyword_blacklist', ''), ('user_history', '0'), ('pro_yearly', ''), ('show_media', '0'), ('pro_monthly', ''), ('paypal_email', ''), ('logo', ''), ('timer', ''), ('smtp', ''), ('style', ''), ('font', ''), ('currency', 'USD'), ('news', 'Installation successful Please go to the admin panel to configure important settings including this message!'), ('gl_connect', '0'), ('require_registration', '0'), ('phish_api', ''), ('aliases', ''), ('pro', '1'), ('google_cid', ''), ('google_cs', ''), ('public_dir', '0'), ('devicetarget', '1'), ('homepage_stats', '1'), ('home_redir', ''), ('detectadblock', '0'), ('timezone', ''), ('freeurls', '10');"; $query[] = "CREATE TABLE IF NOT EXISTS `".trim($_POST["prefix"])."splash` ( `id` int(11) AUTO_INCREMENT, `userid` bigint(12) NULL, `name` varchar(255) NULL, `data` text NULL, `date` datetime NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;"; $query[] = "CREATE TABLE IF NOT EXISTS `".trim($_POST["prefix"])."stats` ( `id` int(11) AUTO_INCREMENT, `short` varchar(255) NULL, `urlid` bigint(20) NULL, `urluserid` bigint(20) NOT NULL DEFAULT '0', `date` datetime NULL, `ip` varchar(255) NULL, `country` varchar(255) NULL, `domain` varchar(50) NULL, `referer` text NULL, `browser` text NULL, `os` text NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;"; $query[] = "CREATE TABLE IF NOT EXISTS `".trim($_POST["prefix"])."url` ( `id` int(20) AUTO_INCREMENT, `userid` int(16) NOT NULL DEFAULT '0', `alias` varchar(10) NULL, `custom` varchar(160) NULL, `url` text NULL, `location` text NULL, `devices` text NULL, `domain` text NULL, `description` text NULL, `date` datetime NULL, `pass` varchar(255) NULL, `click` bigint(20) NOT NULL DEFAULT '0', `meta_title` varchar(255) NULL, `meta_description` varchar(255) NULL, `ads` int(1) NOT NULL DEFAULT '1', `bundle` mediumint(9) NULL, `public` int(1) NOT NULL DEFAULT '0', `archived` int(1) NOT NULL DEFAULT '0', `type` varchar(64) NULL, `pixels` varchar(255) NULL, `expiry` date NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;"; $query[] = "CREATE TABLE IF NOT EXISTS `".trim($_POST["prefix"])."user` ( `id` int(11) AUTO_INCREMENT, `auth` text NULL, `auth_id` varchar(255) NULL, `admin` int(1) NOT NULL DEFAULT '0', `email` varchar(255) NULL, `name` varchar(255) NULL, `username` varchar(255) NULL, `password` varchar(255) NULL, `address` text NULL, `date` datetime NULL, `api` varchar(255) NULL, `ads` int(1) NOT NULL DEFAULT '1', `active` int(1) NOT NULL DEFAULT '1', `banned` int(1) NOT NULL DEFAULT '0', `public` int(1) NOT NULL DEFAULT '0', `domain` varchar(255) NULL, `media` int(1) NOT NULL DEFAULT '0', `splash_opt` int(1) NOT NULL DEFAULT '0', `splash` text NULL, `auth_key` varchar(255) NULL, `last_payment` datetime NULL, `expiration` datetime NULL, `pro` int(1) NOT NULL DEFAULT '0', `overlay` text NULL, `fbpixel` varchar(255) NULL, `linkedinpixel` varchar(255) NULL, `adwordspixel` varchar(255) NULL, `defaulttype` varchar(255) NULL, PRIMARY KEY (`id`), UNIQUE KEY `api` (`api`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;"; $query[]=<<