Esempio n. 1
0
<?php

/**
 *      [PHPB2B] Copyright (C) 2007-2099, Ualink Inc. All Rights Reserved.
 *      The contents of this file are subject to the License; you may not use this file except in compliance with the License. 
 *
 *      @version $Revision: 2075 $
 */
require "../libraries/common.inc.php";
require "session_cp.inc.php";
require LIB_PATH . "cache.class.php";
require LIB_PATH . "file.class.php";
uses("setting");
$setting_controller = new Setting();
$setting = new Settings();
$cache = new Caches();
$file = new Files();
$conditions = null;
$tpl_file = "language";
if (isset($_POST['action'])) {
    $vals = $datas = array();
    foreach ($_POST['data']['item'] as $key => $val) {
        $_POST['data']['language'][$val]['img'] = str_replace(array("../", "../../"), "", $_POST['data']['language'][$val]['img']);
        $vals[$val] = $_POST['data']['language'][$val];
    }
    $datas['languages'] = serialize($vals);
    $setting->replace($datas);
    if (isset($_POST['update_dot'])) {
        foreach ($vals as $lang => $lang_var) {
            pb_configmake($lang, false);
            $cache->lang_dirname = $lang;
Esempio n. 2
0
<?php

/**
 *      [PHPB2B] Copyright (C) 2007-2099, Ualink Inc. All Rights Reserved.
 *      The contents of this file are subject to the License; you may not use this file except in compliance with the License. 
 *
 *      @version $Revision: 2075 $
 */
require "../libraries/common.inc.php";
uses("expotype");
require "session_cp.inc.php";
require LIB_PATH . "cache.class.php";
$cache = new Caches();
$expotype = new Expotypes();
$conditions = null;
$tpl_file = "fairtype";
if (isset($_POST['del']) && !empty($_POST['id'])) {
    $deleted = false;
    $result = $expotype->del($_POST['id']);
    if (!$result) {
        flash();
    }
    $cache->writeCache("expotype", "expotype");
}
if (isset($_GET['do'])) {
    $do = trim($_GET['do']);
    if (!empty($_GET['id'])) {
        $id = intval($_GET['id']);
    }
    if ($do == "del" && $id) {
        $deleted = false;
Esempio n. 3
0
<?php

/**
 *      [PHPB2B] Copyright (C) 2007-2099, Ualink Inc. All Rights Reserved.
 *      The contents of this file are subject to the License; you may not use this file except in compliance with the License. 
 *
 *      @version $Revision: 2075 $
 */
require "../libraries/common.inc.php";
require "session_cp.inc.php";
uses("nav", "typeoption");
require LIB_PATH . "cache.class.php";
$cache = new Caches();
$nav = new Navs();
$typeoption = new Typeoption();
$conditions = null;
$tpl_file = "nav";
setvar("AskAction", $typeoption->get_cache_type("common_option"));
if (isset($_POST['del']) && is_array($_POST['id'])) {
    $deleted = $nav->del($_POST['id']);
    if (!$deleted) {
        flash();
    }
    $cache->writeCache("nav", "nav");
}
if (isset($_POST['update_prior'])) {
    if (!empty($_POST['nid'])) {
        for ($i = 0; $i < count($_POST['nid']); $i++) {
            $pdb->Execute("UPDATE {$tb_prefix}navs SET display_order='" . $_POST['display_order'][$i] . "',status='" . $_POST['status'][$i] . "' WHERE id='" . $_POST['nid'][$i] . "'");
        }
        $cache->writeCache("nav", "nav");
Esempio n. 4
0
 public static function pull($key)
 {
     return Caches::pull($key);
 }
Esempio n. 5
0
<?php

/**
 *      [PHPB2B] Copyright (C) 2007-2099, Ualink Inc. All Rights Reserved.
 *      The contents of this file are subject to the License; you may not use this file except in compliance with the License. 
 *
 *      @version $Revision: 2075 $
 */
require "../libraries/common.inc.php";
require PHPB2B_ROOT . './libraries/page.class.php';
require "session_cp.inc.php";
require LIB_PATH . "cache.class.php";
uses("service", "typeoption", "setting");
$page = new Pages();
$cache = new Caches();
$setting = new Settings();
$typeoption = new Typeoption();
$service = new Services();
$conditions = null;
$tpl_file = "service";
setvar("Status", $typeoption->get_cache_type("common_status"));
setvar("ServiceTypes", $typeoption->get_cache_type("service_type"));
if (isset($_POST['save_client'])) {
    if (!empty($_POST['data']['setting'])) {
        $updated = $setting->replace($_POST['data']['setting'], 1);
        if ($updated) {
            $cache->writeCache("setting", "setting");
            flash("success");
        }
    }
    flash();
Esempio n. 6
0
<?php

/**
 *      [PHPB2B] Copyright (C) 2007-2099, Ualink Inc. All Rights Reserved.
 *      The contents of this file are subject to the License; you may not use this file except in compliance with the License. 
 *
 *      @version $Revision: 2075 $
 */
require "../libraries/common.inc.php";
uses("newstype");
require LIB_PATH . 'page.class.php';
require LIB_PATH . 'cache.class.php';
require "session_cp.inc.php";
$newstype = new Newstypes();
$cache = new Caches();
$page = new Pages();
$conditions = array();
$tpl_file = "newstype";
if (isset($_POST['save']) && !empty($_POST['data']['newstype']['name'])) {
    $vals = array();
    $vals = $_POST['data']['newstype'];
    $vals['level_id'] = intval($pdb->GetOne("SELECT level_id AS new_levelid FROM {$tb_prefix}newstypes WHERE id='" . $vals['parent_id'] . "'") + 1);
    if (!empty($_POST['id'])) {
        $result = $newstype->save($vals, "update", $_POST['id']);
    } elseif (!empty($vals['name'])) {
        $vals['created'] = $time_stamp;
        $names = explode("\r\n", $vals['name']);
        $tmp_name = array();
        if (!empty($names)) {
            foreach ($names as $val) {
                $name = $val;
Esempio n. 7
0
/**
 * PHPB2B :  Opensource B2B Script (http://www.phpb2b.com/)
 * Copyright (C) 2007-2010, Ualink. All Rights Reserved.
 * 
 * Licensed under The Languages Packages Licenses.
 * Support : phpb2b@hotmail.com
 * 
 * @version $Revision$
 */
require "../libraries/common.inc.php";
uses("productcategory", "typeoption");
require LIB_PATH . 'page.class.php';
require LIB_PATH . 'cache.class.php';
require "session_cp.inc.php";
$productcategories = new Productcategories();
$cache = new Caches();
$page = new Pages();
$typeoption = new Typeoption();
$type_models = new Typeoptions();
$conditions = array();
$tpl_file = "productcategory";
setvar("AskAction", $typeoption->get_cache_type("common_option"));
if (isset($_POST['save']) && !empty($_POST['data'])) {
    if ($_POST['data']['method'] == 2) {
        $result = $type_models->copy("productcategories", $_POST['data']['truncate'], $_POST['data']['coverage']);
    } else {
        $vals = array();
        $vals = $_POST['data']['productcategory'];
        $vals['level'] = intval($pdb->GetOne("SELECT level AS new_level FROM {$tb_prefix}productcategories WHERE id='" . $vals['parent_id'] . "'") + 1);
        if (!empty($_POST['id'])) {
            $result = $productcategories->save($vals, "update", $_POST['id']);
Esempio n. 8
0
/**
 *      [PHPB2B] Copyright (C) 2007-2099, Ualink Inc. All Rights Reserved.
 *      The contents of this file are subject to the License; you may not use this file except in compliance with the License. 
 *
 *      @version $Revision: 2075 $
 */
require "../libraries/common.inc.php";
uses("brand", "attachment", "brandtype", "typeoption");
require LIB_PATH . 'page.class.php';
require LIB_PATH . 'cache.class.php';
require "session_cp.inc.php";
$attachment = new Attachment('pic');
$brandtypes = new Brandtypes();
$typeoption = new Typeoption();
$brand = new Brands();
$cache = new Caches();
$page = new Pages();
$conditions = array();
$tpl_file = "brand";
setvar("AskAction", $typeoption->get_cache_type("common_option"));
if (isset($_GET['do'])) {
    $do = trim($_GET['do']);
    $action = trim($_GET['action']);
    if (!empty($_GET['id'])) {
        $id = intval($_GET['id']);
    }
    if ($do == "search") {
        if (isset($_GET['q'])) {
            $conditions[] = "Brand.name like '%" . trim($_GET['q']) . "%'";
        }
    }
Esempio n. 9
0
<?php

/**
 *      [PHPB2B] Copyright (C) 2007-2099, Ualink Inc. All Rights Reserved.
 *      The contents of this file are subject to the License; you may not use this file except in compliance with the License. 
 *
 *      @version $Revision: 2075 $
 */
require "../libraries/common.inc.php";
require "session_cp.inc.php";
uses("setting");
require LIB_PATH . "cache.class.php";
$cache = new Caches();
$setting = new Settings();
$conditions = null;
$tpl_file = "trust";
$item = $setting->getValues(1);
if (isset($_POST['save_trust_rule'])) {
    $cache->writeCache("setting", "setting");
    $setting->replace($_POST['data']['setting'], 1);
    flash("success");
}
if (isset($_GET['do'])) {
    $do = trim($_GET['do']);
    if (!empty($_GET['id'])) {
        $id = intval($_GET['id']);
    }
    if ($do == "rule") {
        $tpl_file = "trust.rule";
        setvar("item", $item);
        template($tpl_file, 1);
Esempio n. 10
0
<?php

/**
 *      [PHPB2B] Copyright (C) 2007-2099, Ualink Inc. All Rights Reserved.
 *      The contents of this file are subject to the License; you may not use this file except in compliance with the License. 
 *
 *      @version $Revision: 2075 $
 */
require "../libraries/common.inc.php";
require PHPB2B_ROOT . 'libraries/page.class.php';
require "session_cp.inc.php";
require LIB_PATH . "cache.class.php";
$cache = new Caches();
$page = new Pages();
$tpl_file = "type";
$conditions = array();
$condition = null;
if (isset($_POST['do'])) {
    if (isset($_POST['id'])) {
        $id = intval($_POST['id']);
    }
    $vals = $_POST['data']['typeoption'];
    if (!empty($_POST['data']['typemodel']['title']) && !empty($_POST['data']['typemodel']['type_name'])) {
        $vals['typemodel_id'] = $pdb->GetOne("select min(id+1) as ids from " . $tb_prefix . "typemodels a where not exists (select 1 from " . $tb_prefix . "typemodels where id=a.id+1)");
        $result = $pdb->Execute("INSERT INTO {$tb_prefix}typemodels (id,title,type_name) VALUE ( " . $vals['typemodel_id'] . ",'" . $_POST['data']['typemodel']['title'] . "','" . $_POST['data']['typemodel']['type_name'] . "')");
    }
    if (!empty($id)) {
        $result = $pdb->Execute("UPDATE {$tb_prefix}typeoptions SET option_label='" . $vals['option_label'] . "',option_value='" . $vals['option_value'] . "',typemodel_id='" . $vals['typemodel_id'] . "' WHERE id={$id}");
    } else {
        $result = $pdb->Execute("INSERT INTO {$tb_prefix}typeoptions (option_label,option_value,typemodel_id) VALUE ( '" . $vals['option_label'] . "','" . $vals['option_value'] . "','" . $vals['typemodel_id'] . "')");
    }
Esempio n. 11
0
<?php

/**
 *      [PHPB2B] Copyright (C) 2007-2099, Ualink Inc. All Rights Reserved.
 *      The contents of this file are subject to the License; you may not use this file except in compliance with the License. 
 *
 *      @version $Revision: 2075 $
 */
require "../libraries/common.inc.php";
require "session_cp.inc.php";
require LIB_PATH . 'cache.class.php';
include CACHE_PATH . "cache_membergroup.php";
include CACHE_PATH . 'cache_type.php';
uses("membergroup", "typeoption");
$cache = new Caches();
$conditions = array();
$membergroup = new Membergroups();
$typeoption = new Typeoption();
$tpl_file = "membergroup";
setvar("AskAction", $typeoption->get_cache_type("common_option"));
setvar("Membertypes", $_PB_CACHE['membertype']);
if (isset($_POST['updateDefault']) && !empty($_POST['gid'])) {
    $id = intval($_POST['gid'][0]);
    $pdb->Execute("UPDATE {$tb_prefix}membergroups SET is_default='0' WHERE 1");
    $pdb->Execute("UPDATE {$tb_prefix}membergroups SET is_default='1' WHERE id=" . $id);
}
if (isset($_POST['saveauth'])) {
    $vals = $_POST['membergroup'];
    if (isset($_POST['id'])) {
        $id = intval($_POST['id']);
    }
Esempio n. 12
0
<?php

/**
 *      [PHPB2B] Copyright (C) 2007-2099, Ualink Inc. All Rights Reserved.
 *      The contents of this file are subject to the License; you may not use this file except in compliance with the License. 
 *
 *      @version $Revision: 2075 $
 */
define('CURSCRIPT', 'templet');
require "../libraries/common.inc.php";
uses("templet", "typeoption", "setting");
require "session_cp.inc.php";
require LIB_PATH . "cache.class.php";
include CACHE_PATH . "cache_membergroup.php";
include CACHE_PATH . "cache_type.php";
$cache = new Caches();
$setting = new Settings();
$templet = new Templets();
$typeoption = new Typeoption();
$templet_controller = new Templet();
$conditions = null;
$tpl_file = "templet";
setvar("AskAction", $typeoption->get_cache_type("common_option"));
if (isset($_POST['save']) && !empty($_POST['data']['templet']['title'])) {
    $vals = array();
    $vals = $_POST['data']['templet'];
    if (!in_array(0, $_POST['data']['require_membertype']) && !empty($_POST['data']['require_membertype'])) {
        $res = "[" . implode("][", $_POST['data']['require_membertype']) . "]";
        $vals['require_membertype'] = $res;
    } elseif (!empty($_POST['data']['require_membertype'])) {
        $vals['require_membertype'] = 0;
Esempio n. 13
0
require PHPB2B_ROOT . 'phpb2b_version.php';
uses("adminfield", "setting", "member");
$adminer = new Adminfields();
$member = new Members();
$setting = new Settings();
$sections = array('admin', 'message');
if (isset($_GET['action'])) {
    if ($_GET['action'] == "dereg") {
        usetcookie("admin", "");
        unset($_SESSION['last_adminer_time']);
    }
}
//for temp upgrade.
if (!file_exists(CACHE_LANG_PATH . "locale.js")) {
    require LIB_PATH . "cache.class.php";
    $cache = new Caches();
    //	$cache->updateLanguages();
    $cache->writeCache("javascript", "javascript");
}
capt_check("capt_login_admin");
if (isset($_POST['do'])) {
    $do = trim($_POST['do']);
    //	if(is_file(CACHE_ROOT.$_POST['data']['language'].DS."lang_admin.php")) {
    usetcookie("lang", $_POST['data']['language']);
    //	}
    if ($do == "login") {
        pb_submit_check('data');
        if (!empty($_POST['data']['username']) && !empty($_POST['data']['userpass'])) {
            $checked = false;
            $uname = $_POST['data']['username'];
            $upass = $_POST['data']['userpass'];
Esempio n. 14
0
<?php

/**
 *      [PHPB2B] Copyright (C) 2007-2099, Ualink Inc. All Rights Reserved.
 *      The contents of this file are subject to the License; you may not use this file except in compliance with the License. 
 *
 *      @version $Revision: 2075 $
 */
require "../libraries/common.inc.php";
require LIB_PATH . 'page.class.php';
require "session_cp.inc.php";
require LIB_PATH . "cache.class.php";
require CACHE_COMMON_PATH . "cache_type.php";
$_PB_CACHE['industry'] = cache_read("industry");
uses("industry", "typeoption");
$cache = new Caches();
$typeoption = new Typeoption();
$industry = new Industries();
$condition = null;
$conditions = array();
$tpl_file = "industry";
$page = new Pages();
setvar("Types", $_PB_CACHE['industrytype']);
$cache_items = $_PB_CACHE['industry'];
setvar("AskAction", $typeoption->get_cache_type("common_option"));
if (isset($_POST['del'])) {
    if (!empty($_POST['id'])) {
        $industry->del($_POST['id']);
    }
}
if (isset($_POST['hide_batch'])) {
Esempio n. 15
0
	public static function clear() {
		$caches_model = new Caches();
		$cache_tags_model = new CacheTags();
		$caches_tags_model = new CachesTags();
		$caches_model->delete();
		$cache_tags_model->delete();
		$caches_tags_model->delete();
	}
Esempio n. 16
0
$connected = $pdb->PConnect($dbhost, $dbuser, $dbpasswd, $dbname);
if (!$connected or empty($connected)) {
    $msg = L("db_conn_error", 'msg', $pdb->ErrorMsg());
    $msg .= "<br />" . L("db_conn_error_no", 'msg', $pdb->ErrorNo());
    if (!file_exists(DATA_PATH . "install.lock")) {
        $msg .= "<br /><a href='install/install.php'>" . L("please_reinstall_program", "msg") . "</a>";
    }
    header_sent($msg);
    exit;
}
if ($dbcharset && mysql_get_server_info() > '4.1') {
    $pdb->Execute("SET NAMES '{$dbcharset}'");
}
if (!file_exists(CACHE_PATH . "cache_setting.php")) {
    require_once LIB_PATH . "cache.class.php";
    $cache = new Caches();
    if ($cache->cacheAll()) {
        $msg .= "<a href='index.php'>" . L("cached_and_refresh") . "</a>";
        header_sent($msg);
        exit;
    }
}
$cachelost = (include CACHE_PATH . 'cache_setting.php') ? '' : 'settings';
$phpb2b_auth_key = md5($_PB_CACHE['setting']['auth_key'] . pb_getenv('HTTP_USER_AGENT'));
$php_self = pb_getenv('PHP_SELF');
$base_script = basename($php_self);
list($basefilename) = explode('.', $base_script);
if ($headercharset) {
    @header('Content-Type: text/html; charset=' . $charset);
}
//timezone
Esempio n. 17
0
 //:~
 $db->query("REPLACE INTO {$tb_prefix}settings (variable, valued) VALUES ('install_dateline', '" . $time_stamp . "')");
 $db->query("REPLACE INTO {$tb_prefix}settings (variable, valued) VALUES ('site_name', '{$sitename}')");
 $db->query("REPLACE INTO {$tb_prefix}settings (variable, valued) VALUES ('site_title', '" . htmlspecialchars($sitetitle) . " - Powered By " . $software_name . "')");
 $db->query("REPLACE INTO {$tb_prefix}settings (variable, valued) VALUES ('backup_dir', '" . $backupdir . "')");
 $db->query("REPLACE INTO {$tb_prefix}settings (variable, valued) VALUES ('site_url', '" . $siteurl . "')");
 $db->query("REPLACE INTO {$tb_prefix}settings (variable, valued) VALUES ('watertext', '" . $siteurl . "')");
 $db->query("REPLACE INTO {$tb_prefix}settings (variable, valued) VALUES ('auth_key', '{$passwordkey}')");
 $aminer_id = 1;
 $db->query("REPLACE INTO {$tb_prefix}members (id,username, userpass,email,membertype_id,membergroup_id,created,modified,status) VALUES ({$aminer_id},'{$username}','" . md5($password) . "','{$email}',2,9," . $time_stamp . "," . $time_stamp . ",'1')");
 $db->query("REPLACE INTO {$tb_prefix}adminfields (member_id,last_name,created,modified) VALUES ('{$aminer_id}','" . L("administrator", "tpl") . "'," . $time_stamp . "," . $time_stamp . ")");
 $db->free();
 require PHPB2B_ROOT . "libraries" . DS . 'adodb' . DS . 'adodb.inc.php';
 require PHPB2B_ROOT . "libraries" . DS . "cache.class.php";
 $pdb =& NewADOConnection($database);
 $cache = new Caches();
 $conn = $pdb->PConnect($dbhost, $dbuser, $dbpasswd, $dbname);
 if ($dbcharset && mysql_get_server_info() > '4.1') {
     $pdb->Execute("SET NAMES '{$dbcharset}'");
 }
 $cache->writeCache("setting", "setting");
 $cache->writeCache("industry", "industry");
 $cache->writeCache("area", "area");
 $cache->writeCache("membergroup", "membergroup");
 $cache->writeCache("userpage", "userpage");
 $cache->writeCache("trusttype", "trusttype");
 $cache->writeCache("form", "form");
 $cache->writeCache("nav", "nav");
 $cache->writeCache("country", "country");
 $cache->updateTypevars();
 //			$cache->updateLanguages();
Esempio n. 18
0
/**
 *      [PHPB2B] Copyright (C) 2007-2099, Ualink Inc. All Rights Reserved.
 *      The contents of this file are subject to the License; you may not use this file except in compliance with the License. 
 *
 *      @version $Revision: 2075 $
 */
require "../libraries/common.inc.php";
require LIB_PATH . 'page.class.php';
require "session_cp.inc.php";
require LIB_PATH . "json_config.php";
require LIB_PATH . "cache.class.php";
include CACHE_PATH . "cache_type.php";
include CACHE_PATH . "cache_area.php";
uses("area", "typeoption", "country");
$cache = new Caches();
$area = new Areas();
$country = new Countries();
$typeoption = new Typeoption();
$condition = null;
$conditions = array();
$tpl_file = "area";
$page = new Pages();
$cache_items = $_PB_CACHE['area'];
setvar("Types", $_PB_CACHE['areatype']);
setvar("AskAction", $typeoption->get_cache_type("common_option"));
if (isset($_POST['del'])) {
    if (!empty($_POST['id'])) {
        $area->del($_POST['id']);
    }
}
Esempio n. 19
0
/**
 *      [PHPB2B] Copyright (C) 2007-2099, Ualink Inc. All Rights Reserved.
 *      The contents of this file are subject to the License; you may not use this file except in compliance with the License. 
 *
 *      @version $Revision: 2075 $
 */
require "../libraries/common.inc.php";
require "session_cp.inc.php";
require LIB_PATH . "cache.class.php";
require LIB_PATH . "file.class.php";
if (file_exists($cache_userpage = CACHE_PATH . "cache_userpage.php")) {
    require $cache_userpage;
}
uses("userpage");
$cache = new Caches();
$userpage = new Userpages();
$conditions = null;
$tpl_file = "userpage";
$file = new Files();
if (isset($_POST['del']) && is_array($_POST['id'])) {
    $deleted = $userpage->del($_POST['id']);
    if (!$deleted) {
        flash();
    }
    $cache->writeCache("userpage", "userpage");
}
if (isset($_POST['save'])) {
    $vals = array();
    $vals = $_POST['data']['userpage'];
    if (!empty($vals['title']) && !empty($vals['name'])) {
Esempio n. 20
0
<?php

/**
 *      [PHPB2B] Copyright (C) 2007-2099, Ualink Inc. All Rights Reserved.
 *      The contents of this file are subject to the License; you may not use this file except in compliance with the License. 
 *
 *      @version $Revision: 2234 $
 */
require "../configs/config.inc.php";
require "../libraries/common.inc.php";
require "session_cp.inc.php";
require LIB_PATH . "cache.class.php";
require CLASS_PATH . "string.class.php";
//require(CACHE_LANG_PATH.'lang_emails.php');
uses("setting", "typeoption", "attachment");
$cache = new Caches();
$attachment_controller = new Attachment();
$typeoption = new Typeoption();
$string = new Strings();
$setting = new Settings();
setvar("AskAction", $typeoption->get_cache_type("common_option"));
$tpl_file = "setting.basic";
$item = $setting->getValues();
if (preg_match("/iis/", strtolower(pb_getenv("SERVER_SOFTWARE")))) {
    $is_iis = true;
}
if (isset($_POST['do'])) {
    $do = trim($_POST['do']);
    switch ($do) {
        case "testemail":
            require LIB_PATH . 'sendmail.inc.php';
Esempio n. 21
0
 function post()
 {
     global $G, $viewhelper;
     require CLASS_PATH . "validation.class.php";
     $validate = new Validation();
     if (session_id() == '') {
         require_once LIB_PATH . "session_php.class.php";
         $session = new PbSessions();
     }
     uses("trade", "member", "tradefield", "tag");
     $tag = new Tags();
     $offer = new Tradefields();
     $member = new Members();
     $trade = new Trades();
     $expires = cache_read("typeoption", "offer_expire");
     setvar("Genders", cache_read("typeoption", "gender", 1, array("0", "-1")));
     setvar("PhoneTypes", cache_read("typeoption", "phone_type"));
     setvar("ImTypes", cache_read("typeoption", "im_type"));
     $if_visit_post = $G['setting']['vis_post'];
     if (!$if_visit_post) {
         $this->view->flash('visitor_forbid', URL, 0);
     }
     //for temp upgrade.
     if (!file_exists(CACHE_LANG_PATH . "locale.js")) {
         require LIB_PATH . "cache.class.php";
         $cache = new Caches();
         $cache->updateLanguages();
         $cache->writeCache("javascript", "javascript");
     }
     $trade_types = $trade->GetArray("SELECT * FROM " . $trade->table_prefix . "tradetypes");
     foreach ($trade_types as $key => $val) {
         if ($val['parent_id'] == 0) {
             $set_types[$val['id']] = pb_lang_split_recursive($val);
             foreach ($trade_types as $key1 => $val1) {
                 if ($val1['parent_id'] == $val['id']) {
                     $set_types[$val['id']]['child'][$val1['id']] = pb_lang_split_recursive($val1);
                 }
             }
         }
     }
     if (isset($_GET['typeid'])) {
         setvar("type_id", intval($_GET['typeid']));
     }
     if (isset($_GET['industryid'])) {
         setvar("industry_id", intval($_GET['industryid']));
     }
     if (isset($_GET['areaid'])) {
         setvar("area_id", intval($_GET['areaid']));
     }
     setvar("select_tradetypes", $set_types);
     $viewhelper->setPosition(L("free_release_offer", "tpl"));
     setvar("OfferExpires", $expires);
     setvar("sid", md5(uniqid($offer->timestamp)));
     capt_check("capt_post_free");
     render("offer/post");
 }
Esempio n. 22
0
<?php

/**
 *      [PHPB2B] Copyright (C) 2007-2099, Ualink Inc. All Rights Reserved.
 *      The contents of this file are subject to the License; you may not use this file except in compliance with the License. 
 *
 *      @version $Revision: 2075 $
 */
require "../libraries/common.inc.php";
require "session_cp.inc.php";
require LIB_PATH . "cache.class.php";
include CACHE_PATH . "cache_type.php";
$cache = new Caches();
$tpl_file = "industrytype";
if (isset($_POST['do'])) {
    $do = trim($_POST['do']);
    if ($do == "save") {
        $ins_arr = array();
        $tmp_arr = explode("\r\n", $_POST['data']['sort']);
        array_filter($tmp_arr);
        $i = 1;
        foreach ($tmp_arr as $key => $val) {
            $ins_arr[$i] = "(" . $i . ",'" . $val . "')";
            $i++;
        }
        if (!empty($ins_arr)) {
            $ins_str = "REPLACE INTO {$tb_prefix}industrytypes (id,name) VALUES " . implode(",", $ins_arr) . ";";
            $pdb->Execute($ins_str);
        }
        if ($cache->updateTypes()) {
            flash("success");
Esempio n. 23
0
     dir_copy($source, $dest, 1);
 }
 $db->query("REPLACE INTO {$tb_prefix}settings (variable, valued) VALUES ('install_dateline', '" . $time_stamp . "')");
 $db->query("REPLACE INTO {$tb_prefix}settings (variable, valued) VALUES ('site_name', '{$sitename}')");
 $db->query("REPLACE INTO {$tb_prefix}settings (variable, valued) VALUES ('site_title', '" . htmlspecialchars($sitetitle) . " - Powered By " . $arrTemplate['_software_name'] . "')");
 $db->query("REPLACE INTO {$tb_prefix}settings (variable, valued) VALUES ('backup_dir', '" . $backupdir . "')");
 $db->query("REPLACE INTO {$tb_prefix}settings (variable, valued) VALUES ('site_url', '" . $siteurl . "')");
 $db->query("REPLACE INTO {$tb_prefix}settings (variable, valued) VALUES ('watertext', '" . $siteurl . "')");
 $db->query("REPLACE INTO {$tb_prefix}settings (variable, valued) VALUES ('auth_key', '{$passwordkey}')");
 $aminer_id = 1;
 $db->query("REPLACE INTO {$tb_prefix}members (id,username, userpass,email,membertype_id,membergroup_id,created,modified,status) VALUES ({$aminer_id},'{$username}','" . md5($password) . "','{$email}',2,9," . $time_stamp . "," . $time_stamp . ",'1')");
 $db->query("REPLACE INTO {$tb_prefix}adminfields (member_id,last_name,created,modified) VALUES ('{$aminer_id}','" . L("administrator", "tpl") . "'," . $time_stamp . "," . $time_stamp . ")");
 $db->free();
 require PHPB2B_ROOT . "libraries" . DS . 'adodb' . DS . 'adodb.inc.php';
 require PHPB2B_ROOT . "libraries" . DS . "cache.class.php";
 $cache = new Caches();
 $pdb =& NewADOConnection($database);
 $conn = $pdb->PConnect($dbhost, $dbuser, $dbpasswd, $dbname);
 if ($dbcharset && mysql_get_server_info() > '4.1') {
     $pdb->Execute("SET NAMES '{$dbcharset}'");
 }
 $cache->writeCache("industry", "industry");
 $cache->writeCache("area", "area");
 $cache->writeCache("membergroup", "membergroup");
 $cache->writeCache("userpage", "userpage");
 $cache->writeCache("trusttype", "trusttype");
 $cache->writeCache("form", "form");
 $cache->writeCache("nav", "nav");
 $cache->writeCache("country", "country");
 $cache->updateTypevars();
 $cache->updateLanguages();