03.02.2008, 11:15 | #1 |
Новичок
Регистрация: 28.10.2007
Сообщений: 16
Вес репутации: 0
|
Помогите установить код
Помогите установить код!!! Движок какой не знаю. Заранее всем спасибо
<?php ini_set('display_errors', 1); error_reporting(E_ALL); ini_set('include_path', ini_get('include_path') . ':' . $_SERVER['DOCUMENT_ROOT'].'/lib'); if (is_writable("conf.php")) { die("File conf.php is writable! It is hole in sequrity! Please remove write permissions from it to run shop."); } if (file_exists("install.php")) { die("File install.php exists! It is hole in sequrity! Please remove it to run shop."); } session_start(); include_once("./conf.php"); include_once("./conf_add.php"); include_once("click.php"); click(); check_prices(); include_once(LIB_C_PATH."/DB.php"); if (DB::connect() == -1) { echo 'help - can\'t connect to database'; if (file_exists("install.php")) { include_once("install.php"); } exit(); } include_once("nf.php"); // core include_once(LIB_C_PATH."/Utils.php"); include_once(LIB_C_PATH."/SmartyEx.php"); include_once(LIB_C_PATH."/State.php"); define("DEFAULT_VIEW","product.home"); // =========================================== // Action loader & processor // =========================================== $inputs = Utils::getRequest(); if (!isset($inputs["view"]) || $inputs["view"] == "") { $inputs["view"] = DEFAULT_VIEW; } $v = split("\.",$inputs["view"]); // try to load private action $a_file = ACT_PATH."/".strtolower($v[0]).".inc"; if (!is_file($a_file)) { NotFound(); //die("Action file doesnt exist : ".$a_file); } include_once($a_file); $c = "_".$v[0]; $oA = new $c($inputs["view"]); if (!is_object($oA)) { NotFound(); //die("Action object is invalid : ".$v[0]); } header ("HTTP/1.0: 200 OK\n"); $oA->__pre(); $oA->$v[1](); $oA->__post(); $content = $oA->content; if(!isset($oA->result["skip_main"])) { $oTpl = new SmartyEx(); $oTpl->assign("SITE_TITLE", SITE_TITLE); $oTpl->assign("CONTENT",$content); $oTpl->assign("AFF_ID", AFF_ID); $oTpl->assign("SITE_ID", SITE_ID); $oTpl->assign("testimonials", get_cms_page("testimonials")); //$oTpl->assign("product_table", get_product_table()); $oTpl->register_function("product_table", "get_product_table"); $oTpl->assign($oA->result); if(isset($_SESSION["cart"]) && count($_SESSION["cart"])) $oTpl->assign(get_cart_info()); $oTpl->display("main.tpl"); } else { print $content; } DB::disconnect(); function get_product_table($params) { if (!empty($params["name"])){ $sql="select id from product where link='".$params["name"]."' or name='".$params["name"]."'"; $rs=DB::getResultRow($sql); if(isset($rs["id"])){ include_once (LIB_M_PATH."/Product.php"); $oTpl = new SmartyEx(); $o = new Product ($rs["id"]); $props =$o->getProperties (); $prices=$o->getPriceListEx (true); $oTpl->assign($props); $oTpl->assign("prices", $prices); return $oTpl->display("product_table.tpl"); } } return ""; } /** * Makes safe redirection * * @param string $view Action name * @param string $s_view Action event name * @param array $params GET Params * @return void */ function get_cart_info() { foreach($_SESSION["cart"] as $item=>$count) Cart::setItem($item, $count); $data=Cart::get(); $data["show_cart"]=true; return $data; } // function get_cms_page($page) { include_once(LIB_M_PATH."/CMS.php"); $o=CMS::initFromName($page); if($o) { $props=$o->getProperties(); return $props["content"]; } return ""; } function forward($view = "",$s_view = "",$params = array()) { DB::disconnect(); $p = ""; if (is_array($params) && count($params)) { foreach ($params as $k=>$v) $p .= "&".$k."=".urlencode($v); } if ($view != "" && $s_view != "") $view .= ".".$s_view; header("Location: ./?view=".$view.$p); exit; } function stop() { DB::disconnect(); exit; } function debug($mess) { $f=fopen("log.txt", "a"); $dt=date("Y M d H:i:s "); fwrite($f, "[$dt]$mess"); fclose($f); } ?> |
03.02.2008, 12:29 | #2 |
Эксперт
Регистрация: 03.07.2007
Адрес: Chinatown
Сообщений: 7,265
Вес репутации: 609
|
если на фтп будет доступ, то поставлю код. за литр водки...
__________________
тексты по 10 руб/кзнак автоматизируй все, не мучайся! |
|
|
Похожие темы | ||||
Тема | Автор | Раздел | Ответов | Последнее сообщение |
Помогите установить код...:-) | Flower | Установка кода на различные движки | 4 | 03.07.2008 12:48 |
Помогите установить код! | allsu | Установка кода на различные движки | 14 | 26.03.2008 23:28 |
Помогите установить | igorinich | Установка кода на различные движки | 7 | 31.01.2008 10:24 |
Помогите установить код! | idaho75 | Установка кода на различные движки | 8 | 15.12.2007 20:53 |
Часовой пояс GMT +3, время: 15:05.