<?php
function check_template_license($licensekey, $localkey = "") {
$whmcsurl = "http://www.nextinspire.com/portal/";
$licensing_secret_key = "2009^0101^%inspi#Re0271";
$checkdate = date("Ymd");
$usersip = isset($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] : $_SERVER['LOCAL_ADDR'];
$localkeydays = 15;
$allowcheckfaildays = 7;
$localkeyvalid = false;
if ($localkey) {
$localkey = str_replace("\n", "", $localkey);
$localdata = substr($localkey, 0, strlen($localkey) - 32);
$md5hash = substr($localkey, strlen($localkey) - 32);
if ($md5hash == md5($localdata . $licensing_secret_key)) {
$localdata = strrev($localdata);
$md5hash = substr($localdata, 0, 32);
$localdata = substr($localdata, 32);
$localdata = base64_decode($localdata);
$localkeyresults = unserialize($localdata);
$originalcheckdate = $localkeyresults['checkdate'];
if ($md5hash == md5($originalcheckdate . $licensing_secret_key)) {
$localexpiry = date("Ymd", mktime(0, 0, 0, date("m"), date("d") - $localkeydays, date("Y")));
if ($localexpiry < $originalcheckdate) {
$localkeyvalid = true;
$results = $localkeyresults;
$validdomains = explode(",", $results['validdomain']);
if (!in_array($_SERVER['SERVER_NAME'], $validdomains)) {
$localkeyvalid = false;
$localkeyresults['status'] = "Invalid";
$results = array();
}
$validips = explode(",", $results['validip']);
if (!in_array($usersip, $validips)) {
$localkeyvalid = false;
$localkeyresults['status'] = "Invalid";
$results = array();
}
if ($results['validdirectory'] != dirname(__FILE__)) {
$localkeyvalid = false;
$localkeyresults['status'] = "Invalid";
$results = array();
}
}
}
}
}
if (!$localkeyvalid) {
$postfields['licensekey'] = $licensekey;
$postfields['domain'] = $_SERVER['SERVER_NAME'];
$postfields['ip'] = $usersip;
$postfields['dir'] = dirname(__FILE__);
if (function_exists("curl_exec")) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $whmcsurl . "modules/servers/licensing/verify.php");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$data = curl_exec($ch);
curl_close($ch);
} else {
$fp = fsockopen($whmcsurl, 80, $errno, $errstr, 5);
if ($fp) {
$querystring = "";
foreach($postfields as $k => $v) {
$querystring.= "{$k}=" . urlencode($v) . "&";
}
$header = "POST " . $whmcsurl . "modules/servers/licensing/verify.php HTTP/1.0\r\n";
$header.= "Host: " . $whmcsurl . "\r\n";
$header.= "Content-type: application/x-www-form-urlencoded\r\n";
$header.= "Content-length: " . @strlen(@$querystring) . "\r\n";
$header.= "Connection: close\r\n\r\n";
$header.= $querystring;
$data = "";
@stream_set_timeout(@$fp, 20);
@fputs(@$fp, @$header);
$status = @socket_get_status(@$fp);
while (!feof(@$fp) && $status) {
$data.= @fgets(@$fp, 1024);
$status = @socket_get_status(@$fp);
}
@fclose(@$fp);
}
}
if (!$data) {
$localexpiry = date("Ymd", mktime(0, 0, 0, date("m"), date("d") - ($localkeydays + $allowcheckfaildays), date("Y")));
if ($localexpiry < $originalcheckdate) {
$results = $localkeyresults;
} else {
$results['status'] = "Remote Check Failed";
return $results;
}
}
preg_match_all("/<(.*?)>([^<]+)<\\/\\1>/i", $data, $matches);
$results = array();
foreach($matches[1] as $k => $v) {
$results[$v] = $matches[2][$k];
}
if ($results['status'] == "Active") {
$results['checkdate'] = $checkdate;
$data_encoded = serialize($results);
$data_encoded = base64_encode($data_encoded);
$data_encoded = md5($checkdate . $licensing_secret_key) . $data_encoded;
$data_encoded = strrev($data_encoded);
$data_encoded = $data_encoded . md5($data_encoded . $licensing_secret_key);
$data_encoded = wordwrap($data_encoded, 80, "\n", true);
$results['localkey'] = $data_encoded;
}
$results['remotecheck'] = true;
}
unset($postfields);
unset($data);
unset($matches);
unset($whmcsurl);
unset($licensing_secret_key);
unset($checkdate);
unset($usersip);
unset($localkeydays);
unset($allowcheckfaildays);
unset($md5hash);
return $results;
}
ini_set("display_errors", 0);
include ("templates/" . $this->_tpl_vars['template'] . "/load_config.php");
if (file_exists("nextinspire/{$template_id}/db_connect.php")) {
include ("nextinspire/{$template_id}/db_connect.php");
}
$result = mysql_query("SELECT * FROM tblconfiguration WHERE setting='version'");
while ($row = mysql_fetch_array($result)) {
$whmcs_version = $row['value'];
}
assign("whmcs_version", $whmcs_version);
$result = mysql_query("SELECT * FROM nextinspire_template WHERE id={$template_id}");
while ($row = mysql_fetch_array($result)) {
$licensekey = $row['license_key'];
$localkey = $row['local_key'];
}
$results = check_template_license($licensekey, $localkey);
$template_status = $results['status'];
mysql_query("UPDATE nextinspire_template SET template_status = '{$template_status}' WHERE id = {$template_id}");
if ($results['status'] == "Active") {
if ($results['productid'] == $template_id || $results['productid'] == $site_license) {
require_once (SMARTY_CORE_DIR . "core.load_plugins.php");
smarty_core_load_plugins(array("plugins" => array(array("function", "config_load"), array("modifier", "lower", $this->_tpl_vars['template'] . "/header.tpl", 1, false), array("modifier", "file_exists", $this->_tpl_vars['template'] . "/header.tpl", 115, false), array("modifier", "date_format", $this->_tpl_vars['template'] . "/header.tpl", 152, false), array("modifier", "replace", $this->_tpl_vars['template'] . "/header.tpl", 2, false))), $this);
include ("templates/" . $this->_tpl_vars['template'] . "/specific/config.php");
if ($template_rev == "01") {
assign("theme_language", is_array($_tmp = $this->_tpl_vars['language']) ? _run_mod_handler("lower", true, $_tmp) : smarty_modifier_lower($_tmp));
}
assign("scheme_language", is_array($_tmp = $this->_tpl_vars['language']) ? _run_mod_handler("lower", true, $_tmp) : smarty_modifier_lower($_tmp));
if ($default_home != true) {
$default_home = "default";
}
if ($default_support != true) {
$default_support = "index";
}
if ($this->_tpl_vars['filename'] == "cart") {
assign("orderform_lang", $this->_tpl_vars['gid'] . "\"_\"" . $this->_tpl_vars['scheme_language']);
assign("orderform_lang", is_array($_tmp = $this->_tpl_vars['orderform_lang']) ? _run_mod_handler("replace", true, $_tmp, "\"_\"", "_") : smarty_modifier_replace($_tmp, "\"_\"", "_"));
if ((is_array($_tmp = "templates/" . $this->_tpl_vars['template'] . "/extras/products_gid_" . $this->_tpl_vars['orderform_lang'] . ".tpl") ? _run_mod_handler("file_exists", true, $_tmp) : file_exists($_tmp)) || (is_array($_tmp = "templates/" . $this->_tpl_vars['template'] . "/extras/products_gid_" . $this->_tpl_vars['gid'] . ".tpl") ? _run_mod_handler("file_exists", true, $_tmp) : file_exists($_tmp))) {
assign("custom_orderform", "1");
}
$_from = $this->_tpl_vars['products'];
if (!is_array($_from) && !is_object($_from)) {
settype($_from, "array");
}
$this->_foreach['items'] = array("total" => count($_from), "iteration" => 0);
if (0 < $this->_foreach['items']['total']) {
foreach($_from as $Var_6240 => $Var_6312) {
++$this->_foreach['items']['iteration'];
if ($this->_foreach['items']['iteration'] == $this->_foreach['items']['total']) {
assign("product_count", $this->_foreach['items']['total']);
}
}
}
unset($_from);
}
if ($template_rev == "01") {
if ($this->_tpl_vars['filename'] == $default_home) {
assign("theme_division", "home");
assign("homepage", true);
} else if ($this->_tpl_vars['pagetitle'] == $this->_tpl_vars['LANG']['globalsystemname'] || $this->_tpl_vars['filename'] == $default_support) {
assign("theme_division", "common");
assign("supporthome", true);
assign("headline_title", $this->_tpl_vars['LANG']['ii_globalsystemtitle']);
assign("headline_description", $this->_tpl_vars['LANG']['ii_globalsystemdescription']);
assign("headline_image", "headline_supporthome.jpg");
} else if ($this->_tpl_vars['filename'] == "announcements") {
assign("theme_division", "common");
assign("headline_title", $this->_tpl_vars['LANG']['ii_announcementstitle']);
assign("headline_description", $this->_tpl_vars['LANG']['ii_announcementsdescription']);
assign("headline_image", "headline_announcements.jpg");
} else if ($this->_tpl_vars['filename'] == "knowledgebase") {
assign("theme_division", "common");
assign("headline_title", $this->_tpl_vars['LANG']['ii_knowledgebasetitle']);
assign("headline_description", $this->_tpl_vars['LANG']['ii_knowledgebasedescription']);
assign("headline_image", "headline_knowledgebase.jpg");
} else if ($this->_tpl_vars['filename'] == "downloads") {
assign("theme_division", "common");
assign("headline_title", $this->_tpl_vars['LANG']['ii_downloadstitle']);
assign("headline_description", $this->_tpl_vars['LANG']['ii_downloadsdescription']);
assign("headline_image", "headline_downloads.jpg");
} else if ($this->_tpl_vars['filename'] == "tutorials") {
assign("theme_division", "common");
assign("headline_title", $this->_tpl_vars['LANG']['ii_tutorialstitle']);
assign("headline_description", $this->_tpl_vars['LANG']['ii_tutorialsdescription']);
assign("headline_image", "headline_tutorials.jpg");
} else if ($this->_tpl_vars['filename'] == "serverstatus") {
assign("theme_division", "common");
assign("headline_title", $this->_tpl_vars['LANG']['ii_serverstatustitle']);
assign("headline_description", $this->_tpl_vars['LANG']['ii_serverstatusdescription']);
assign("headline_image", "headline_serverstatus.jpg");
} else if ($this->_tpl_vars['filename'] == "networkissues") {
assign("theme_division", "common");
assign("headline_title", $this->_tpl_vars['LANG']['ii_networkissuestitle']);
assign("headline_description", $this->_tpl_vars['LANG']['ii_networkissuesdescription']);
assign("headline_image", "headline_networkissues.jpg");
} else if ($this->_tpl_vars['filename'] == "contact") {
assign("theme_division", "common");
assign("headline_title", $this->_tpl_vars['LANG']['ii_contacttitle']);
assign("headline_description", $this->_tpl_vars['LANG']['ii_contactdescription']);
assign("headline_image", "headline_contact.jpg");
} else if ($this->_tpl_vars['filename'] == "pwreset") {
assign("theme_division", "common");
assign("headline_title", $this->_tpl_vars['LANG']['ii_pwresettitle']);
assign("headline_description", $this->_tpl_vars['LANG']['ii_pwresetdescription']);
assign("headline_image", "headline_pwreset.jpg");
} else if ($this->_tpl_vars['filename'] == "register") {
assign("theme_division", "common");
assign("headline_title", $this->_tpl_vars['LANG']['ii_registertitle']);
assign("headline_description", $this->_tpl_vars['LANG']['ii_registerdescription']);
assign("headline_image", "headline_register.jpg");
} else if ($this->_tpl_vars['pagetitle'] == $this->_tpl_vars['LANG']['carttitle'] && $this->_tpl_vars['incorrect']) {
assign("theme_division", "clientarea");
} else if ($this->_tpl_vars['filename'] == "clientarea") {
assign("theme_division", "clientarea");
assign("headline_title", $this->_tpl_vars['LANG']['ii_clientareatitle']);
assign("headline_description", $this->_tpl_vars['LANG']['ii_clientareadescription']);
assign("headline_image", "headline_clientarea.jpg");
} else if ($this->_tpl_vars['filename'] == "logout") {
assign("theme_division", "clientarea");
assign("headline_title", $this->_tpl_vars['LANG']['ii_logouttitle']);
assign("headline_description", $this->_tpl_vars['LANG']['ii_logoutdescription']);
assign("headline_image", "headline_logout.jpg");
} else if ($this->_tpl_vars['filename'] == "banned") {
assign("theme_division", "clientarea");
assign("headline_title", $this->_tpl_vars['LANG']['globalsystemname']);
assign("headline_description", $this->_tpl_vars['LANG']['ii_globalsystemdescription']);
assign("headline_image", "headline_supporthome.jpg");
} else if ($this->_tpl_vars['filename'] == "configuressl") {
assign("theme_division", "clientarea");
assign("headline_title", $this->_tpl_vars['LANG']['ii_configuressltitle']);
assign("headline_description", $this->_tpl_vars['LANG']['ii_configuressldescription']);
assign("headline_image", "headline_configuressl.jpg");
} else if ($this->_tpl_vars['filename'] == "affiliates") {
assign("theme_division", "clientarea");
assign("headline_title", $this->_tpl_vars['LANG']['ii_affiliatestitle']);
assign("headline_description", $this->_tpl_vars['LANG']['ii_affiliatesdescription']);
assign("headline_image", "headline_affiliates.jpg");
} else if ($this->_tpl_vars['filename'] == "domainchecker") {
assign("theme_division", "order");
assign("headline_title", $this->_tpl_vars['LANG']['ii_domaincheckertitle']);
assign("headline_description", $this->_tpl_vars['LANG']['ii_domaincheckerdescription']);
assign("headline_image", "headline_domainchecker.jpg");
} else if ($this->_tpl_vars['filename'] == "cart" || $this->_tpl_vars['filename'] == "creditcard" || $this->_tpl_vars['filename'] == "upgrade") {
assign("theme_division", "order");
assign("headline_title", $this->_tpl_vars['LANG']['ii_ordertitle']);
assign("headline_description", $this->_tpl_vars['LANG']['ii_orderdescription']);
assign("headline_image", "headline_order.jpg");
} else if ($this->_tpl_vars['filename'] == "submitticket") {
assign("theme_division", "common");
assign("headline_title", $this->_tpl_vars['LANG']['ii_supportticketstitle']);
assign("headline_description", $this->_tpl_vars['LANG']['ii_supportticketsdescription']);
assign("headline_image", "headline_supporttickets.jpg");
} else if ($this->_tpl_vars['filename'] == "supporttickets" || $this->_tpl_vars['filename'] == "viewticket") {
if ($this->_tpl_vars['loggedin']) {
assign("theme_division", "clientarea");
} else {
assign("theme_division", "support");
}
assign("headline_title", $this->_tpl_vars['LANG']['ii_supportticketstitle']);
assign("headline_description", $this->_tpl_vars['LANG']['ii_supportticketsdescription']);
assign("headline_image", "headline_supporttickets.jpg");
}
if (!(is_array($_tmp = "templates/" . $this->_tpl_vars['template'] . "/images/" . $this->_tpl_vars['headline_image']) ? _run_mod_handler("file_exists", true, $_tmp) : file_exists($_tmp))) {
assign("headline_image", "headline_default.jpg");
}
if ($this->_tpl_vars['formaction']) {
assign("theme_division", "clientarea");
}
} else {
if ($template_rev == "02" || $template_rev == "03" || $template_rev == "04") {
if ($this->_tpl_vars['filename'] == $default_home) {
assign("page_group", "home");
assign("homepage", true);
} else if ($this->_tpl_vars['pagetitle'] == $this->_tpl_vars['LANG']['globalsystemname'] || $this->_tpl_vars['filename'] == $default_support) {
assign("page_group", "support");
assign("headline_title", $this->_tpl_vars['LANG']['ii_globalsystemtitle']);
assign("headline_description", $this->_tpl_vars['LANG']['ii_globalsystemdescription']);
assign("headline_image", "headline_supporthome.jpg");
assign("supporthome", true);
} else if ($this->_tpl_vars['filename'] == "announcements") {
assign("page_group", "support");
assign("headline_title", $this->_tpl_vars['LANG']['ii_announcementstitle']);
assign("headline_description", $this->_tpl_vars['LANG']['ii_announcementsdescription']);
assign("headline_image", "headline_announcements.jpg");
} else if ($this->_tpl_vars['filename'] == "knowledgebase") {
assign("page_group", "support");
assign("headline_title", $this->_tpl_vars['LANG']['ii_knowledgebasetitle']);
assign("headline_description", $this->_tpl_vars['LANG']['ii_knowledgebasedescription']);
assign("headline_image", "headline_knowledgebase.jpg");
} else if ($this->_tpl_vars['filename'] == "downloads") {
assign("page_group", "support");
assign("headline_title", $this->_tpl_vars['LANG']['ii_downloadstitle']);
assign("headline_description", $this->_tpl_vars['LANG']['ii_downloadsdescription']);
assign("headline_image", "headline_downloads.jpg");
} else if ($this->_tpl_vars['filename'] == "tutorials") {
assign("page_group", "support");
assign("headline_title", $this->_tpl_vars['LANG']['ii_tutorialstitle']);
assign("headline_description", $this->_tpl_vars['LANG']['ii_tutorialsdescription']);
assign("headline_image", "headline_tutorials.jpg");
} else if ($this->_tpl_vars['filename'] == "serverstatus") {
assign("page_group", "support");
assign("headline_title", $this->_tpl_vars['LANG']['ii_serverstatustitle']);
assign("headline_description", $this->_tpl_vars['LANG']['ii_serverstatusdescription']);
assign("headline_image", "headline_serverstatus.jpg");
} else if ($this->_tpl_vars['filename'] == "networkissues") {
assign("page_group", "support");
assign("headline_title", $this->_tpl_vars['LANG']['ii_networkissuestitle']);
assign("headline_description", $this->_tpl_vars['LANG']['ii_networkissuesdescription']);
assign("headline_image", "headline_networkissues.jpg");
} else if ($this->_tpl_vars['filename'] == "contact") {
assign("page_group", "support");
assign("headline_title", $this->_tpl_vars['LANG']['ii_contacttitle']);
assign("headline_description", $this->_tpl_vars['LANG']['ii_contactdescription']);
assign("headline_image", "headline_contact.jpg");
} else if ($this->_tpl_vars['filename'] == "pwreset") {
assign("page_group", "support");
assign("headline_title", $this->_tpl_vars['LANG']['ii_pwresettitle']);
assign("headline_description", $this->_tpl_vars['LANG']['ii_pwresetdescription']);
assign("headline_image", "headline_pwreset.jpg");
} else if ($this->_tpl_vars['filename'] == "register") {
assign("page_group", "support");
assign("headline_title", $this->_tpl_vars['LANG']['ii_registertitle']);
assign("headline_description", $this->_tpl_vars['LANG']['ii_registerdescription']);
assign("headline_image", "headline_register.jpg");
} else if ($this->_tpl_vars['pagetitle'] == $this->_tpl_vars['LANG']['carttitle'] && $this->_tpl_vars['incorrect']) {
assign("page_group", "clientarea");
} else if ($this->_tpl_vars['filename'] == "clientarea") {
assign("page_group", "clientarea");
assign("headline_title", $this->_tpl_vars['LANG']['ii_clientareatitle']);
assign("headline_description", $this->_tpl_vars['LANG']['ii_clientareadescription']);
assign("headline_image", "headline_clientarea.jpg");
} else if ($this->_tpl_vars['filename'] == "logout") {
assign("page_group", "clientarea");
assign("headline_title", $this->_tpl_vars['LANG']['ii_logouttitle']);
assign("headline_description", $this->_tpl_vars['LANG']['ii_logoutdescription']);
assign("headline_image", "headline_logout.jpg");
} else if ($this->_tpl_vars['filename'] == "banned") {
assign("page_group", "clientarea");
assign("headline_title", $this->_tpl_vars['LANG']['globalsystemname']);
assign("headline_description", $this->_tpl_vars['LANG']['ii_globalsystemdescription']);
assign("headline_image", "headline_supporthome.jpg");
} else if ($this->_tpl_vars['filename'] == "configuressl") {
assign("page_group", "clientarea");
assign("headline_title", $this->_tpl_vars['LANG']['ii_configuressltitle']);
assign("headline_description", $this->_tpl_vars['LANG']['ii_configuressldescription']);
assign("headline_image", "headline_configuressl.jpg");
} else if ($this->_tpl_vars['filename'] == "affiliates") {
assign("page_group", "clientarea");
assign("headline_title", $this->_tpl_vars['LANG']['ii_affiliatestitle']);
assign("headline_description", $this->_tpl_vars['LANG']['ii_affiliatesdescription']);
assign("headline_image", "headline_affiliates.jpg");
} else if ($this->_tpl_vars['filename'] == "domainchecker") {
assign("page_group", "order");
assign("headline_title", $this->_tpl_vars['LANG']['ii_domaincheckertitle']);
assign("headline_description", $this->_tpl_vars['LANG']['ii_domaincheckerdescription']);
assign("headline_image", "headline_domainchecker.jpg");
} else if ($this->_tpl_vars['filename'] == "cart" || $this->_tpl_vars['filename'] == "creditcard" || $this->_tpl_vars['filename'] == "upgrade") {
assign("page_group", "order");
assign("headline_title", $this->_tpl_vars['LANG']['ii_ordertitle']);
assign("headline_description", $this->_tpl_vars['LANG']['ii_orderdescription']);
assign("headline_image", "headline_order.jpg");
} else if ($this->_tpl_vars['filename'] == "submitticket") {
assign("page_group", "support");
assign("headline_title", $this->_tpl_vars['LANG']['ii_supportticketstitle']);
assign("headline_description", $this->_tpl_vars['LANG']['ii_supportticketsdescription']);
assign("headline_image", "headline_supporttickets.jpg");
} else if ($this->_tpl_vars['filename'] == "supporttickets" || $this->_tpl_vars['filename'] == "viewticket") {
if ($this->_tpl_vars['loggedin']) {
assign("page_group", "clientarea");
} else {
assign("page_group", "support");
}
assign("headline_title", $this->_tpl_vars['LANG']['ii_supportticketstitle']);
assign("headline_description", $this->_tpl_vars['LANG']['ii_supportticketsdescription']);
assign("headline_image", "headline_supporttickets.jpg");
}
if ($this->_tpl_vars['formaction']) {
assign("page_group", "clientarea");
}
} else {
if ($this->_tpl_vars['filename'] == $default_home) {
assign("page_group", "home");
assign("homepage", true);
} else if ($this->_tpl_vars['filename'] == $default_support) {
assign("page_group", "support");
assign("supporthome", true);
} else if ($this->_tpl_vars['filename'] == "announcements") {
assign("page_group", "support");
} else if ($this->_tpl_vars['filename'] == "knowledgebase") {
assign("page_group", "support");
} else if ($this->_tpl_vars['filename'] == "downloads") {
assign("page_group", "support");
} else if ($this->_tpl_vars['filename'] == "tutorials") {
assign("page_group", "support");
} else if ($this->_tpl_vars['filename'] == "serverstatus") {
assign("page_group", "support");
} else if ($this->_tpl_vars['filename'] == "networkissues") {
assign("page_group", "support");
} else if ($this->_tpl_vars['filename'] == "contact") {
assign("page_group", "support");
} else if ($this->_tpl_vars['filename'] == "pwreset") {
assign("page_group", "support");
} else if ($this->_tpl_vars['filename'] == "register") {
assign("page_group", "clientarea");
} else if ($this->_tpl_vars['incorrect']) {
assign("page_group", "clientarea");
} else if ($this->_tpl_vars['filename'] == "clientarea") {
assign("page_group", "clientarea");
} else if ($this->_tpl_vars['filename'] == "logout") {
assign("page_group", "clientarea");
} else if ($this->_tpl_vars['filename'] == "banned") {
assign("page_group", "clientarea");
} else if ($this->_tpl_vars['filename'] == "configuressl") {
assign("page_group", "clientarea");
} else if ($this->_tpl_vars['filename'] == "affiliates") {
assign("page_group", "clientarea");
} else if ($this->_tpl_vars['filename'] == "domainchecker") {
assign("page_group", "order");
} else if ($this->_tpl_vars['filename'] == "cart" || $this->_tpl_vars['filename'] == "creditcard" || $this->_tpl_vars['filename'] == "upgrade") {
assign("page_group", "order");
} else if ($this->_tpl_vars['filename'] == "submitticket") {
assign("page_group", "support");
} else if ($this->_tpl_vars['filename'] == "supporttickets" || $this->_tpl_vars['filename'] == "viewticket") {
if ($this->_tpl_vars['loggedin']) {
assign("page_group", "clientarea");
} else {
assign("page_group", "support");
}
}
if ($this->_tpl_vars['formaction']) {
assign("page_group", "clientarea");
}
}
}
if ($template_rev == "01") {
if ($this->_tpl_vars['theme_division'] == "common") {
assign("themecolor", $themecolor_common);
} else if ($this->_tpl_vars['theme_division'] == "clientarea") {
assign("themecolor", $themecolor_clientarea);
} else if ($this->_tpl_vars['theme_division'] == "order") {
assign("themecolor", $themecolor_order);
} else if (!$this->_tpl_vars['themecolor']) {
assign("themecolor", $themecolor_other);
}
assign("scheme_path", "schemes/" . $this->_tpl_vars['themecolor']);
} else {
if ($default_scheme) {
assign("scheme_color", $default_scheme);
} else if ($this->_tpl_vars['page_group'] == "support") {
assign("scheme_color", $scheme_color_support);
} else if ($this->_tpl_vars['page_group'] == "clientarea") {
assign("scheme_color", $scheme_color_clientarea);
} else if ($this->_tpl_vars['page_group'] == "order") {
assign("scheme_color", $scheme_color_order);
} else if (!$this->_tpl_vars['scheme_color']) {
assign("scheme_color", $scheme_color_other);
}
assign("scheme_path", "schemes/" . $this->_tpl_vars['scheme_color']);
}
assign("site_root", $site_root);
assign("companyaddress", $companyaddress);
assign("url_root", $url_root);
assign("url_whmcs", $url_whmcs);
assign("url_cart", $url_cart);
assign("use_ajax_orderform", $use_ajax_orderform);
assign("load_header", "1");
assign("load_default_headline", "1");
assign("load_default_sidemenu", "1");
assign("load_stylesheet", "templates/" . $this->_tpl_vars['template'] . "/load_stylesheet.php");
assign("load_headline", "templates/" . $this->_tpl_vars['template'] . "/load_headline.php");
assign("load_sidemenu", "templates/" . $this->_tpl_vars['template'] . "/load_sidemenu.php");
assign("load_menuclientinfo", $this->_tpl_vars['template'] . "/nlsmenu/menu_clientinfo.tpl");
assign("load_menuproductdetails", $this->_tpl_vars['template'] . "/nlsmenu/menu_productdetails.tpl");
assign("load_menudomaindetails", $this->_tpl_vars['template'] . "/nlsmenu/menu_domaindetails.tpl");
assign("load_menuaffiliates", $this->_tpl_vars['template'] . "/nlsmenu/menu_affiliates.tpl");
if ($rtl == "true" || $this->_tpl_vars['scheme_language'] == "arabic" || $this->_tpl_vars['scheme_language'] == "hebrew" || $this->_tpl_vars['scheme_language'] == "persian") {
assign("rtl", true);
}
if (0 <= (is_array($_tmp = time()) ? _run_mod_handler("date_format", true, $_tmp, "%H") : smarty_modifier_date_format($_tmp, "%H")) && (is_array($_tmp = time()) ? _run_mod_handler("date_format", true, $_tmp, "%H") : smarty_modifier_date_format($_tmp, "%H")) <= 11) {
assign("greeting", $this->_tpl_vars['LANG']['ii_goodmorning']);
}
if (12 <= (is_array($_tmp = time()) ? _run_mod_handler("date_format", true, $_tmp, "%H") : smarty_modifier_date_format($_tmp, "%H")) && (is_array($_tmp = time()) ? _run_mod_handler("date_format", true, $_tmp, "%H") : smarty_modifier_date_format($_tmp, "%H")) <= 18) {
assign("greeting", $this->_tpl_vars['LANG']['ii_goodafternoon']);
}
if (19 <= (is_array($_tmp = time()) ? _run_mod_handler("date_format", true, $_tmp, "%H") : smarty_modifier_date_format($_tmp, "%H")) && (is_array($_tmp = time()) ? _run_mod_handler("date_format", true, $_tmp, "%H") : smarty_modifier_date_format($_tmp, "%H")) <= 23) {
assign("greeting", $this->_tpl_vars['LANG']['ii_goodevening']);
}
if (file_exists("nextinspire/{$template_id}/load_{$template_name}.php")) {
include ("nextinspire/{$template_id}/load_{$template_name}.php");
}
if (file_exists("nextinspire/{$template_id}/load_extend.php")) {
include ("nextinspire/{$template_id}/load_extend.php");
}
if (file_exists("nextinspire/{$template_id}/load_customize.php")) {
include ("nextinspire/{$template_id}/load_customize.php");
}
if ($results['localkey']) {
$localkeydata = $results['localkey'];
mysql_query("UPDATE nextinspire_template SET local_key = '{$localkeydata}' WHERE id = {$template_id}");
}
if (file_exists("nextinspire/{$template_id}/install.php")) {
echo "<body style=\"margin:0;\"><div style=\"background:#C00; font:700 11px/1.8 Tahoma, Geneva, sans-serif; color:#FFF; text-align:center; padding:10px;\">Security Warning !!<br />The following file needs to be deleted for security reasons before using this template<br />---<br />" . $results['validdirectory'] . "/install.php</div></body>";
break;
}
$_smarty_tpl_vars = $this->_tpl_vars;
_smarty_include(array("smarty_include_tpl_file" => $this->_tpl_vars['template'] . "/specific/site_header.tpl", "smarty_include_vars" => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
} else {
mysql_query("UPDATE nextinspire_template SET template_status = 'Not Match' WHERE id = {$template_id}");
header("Location: nextinspire/{$template_id}/index.php");
break;
}
}
if ($results['status'] == "Invalid") {
header("Location: nextinspire/{$template_id}/index.php");
break;
}
if ($results['status'] == "Expired") {
header("Location: nextinspire/{$template_id}/index.php");
break;
}
if ($results['status'] == "Suspended") {
header("Location: nextinspire/{$template_id}/index.php");
break;
}
if ($results['status'] == "Remote Check Failed") {
echo "Connection is temporarily interrupted!";
break;
}
?>