public static function getInstance($name, $host, $user, $pass) { if (!isset(self::$instance)) { $nameClass = __CLASS__; self::$instance = new $nameClass(); include "ClassConnect.php"; $con = new db_mysql(); self::$status = $con->conectar($name, $host, $user, $pass); } return self::$instance; }
function query($sql, $type = '') { if ($this->slaveid && !$this->slaveexcept && strtoupper(substr($sql, 0, 6)) == 'SELECT') { $this->slave_connect(); } $this->slaveexcept = false; return parent::query($sql, $type); }
public function metamatter_change($change_type, $metamatter, $comment = false, $already_changed = false) { global $debug, $mm_change_legit, $config; if (!$this->is_exists || !($metamatter = round(floatval($metamatter)))) { $debug->error('Ошибка при попытке манипуляции с ММ'); return false; } $account_id_safe = $this->db->db_escape($this->account_id); $mm_change_legit = true; // $sn_data_metamatter_db_name = pname_resource_name(RES_METAMATTER); if ($already_changed) { $metamatter_total_delta = 0; $result = -1; } else { $metamatter_total_delta = $metamatter > 0 ? $metamatter : 0; $result = $this->db->doquery("UPDATE {{account}}\n SET\n `account_metamatter` = `account_metamatter` + '{$metamatter}'" . ($metamatter_total_delta ? ", `account_immortal` = IF(`account_metamatter_total` + '{$metamatter_total_delta}' >= {$config->player_metamatter_immortal}, NOW(), `account_immortal`), `account_metamatter_total` = `account_metamatter_total` + '{$metamatter_total_delta}'" : '') . " WHERE `account_id` = {$account_id_safe}"); if (!$result) { $debug->error("Error adjusting Metamatter for player ID {$this->account_id} (Player Not Found?) with {$metamatter}. Reason: {$comment}", 'Metamatter Change', 402); } $result = classSupernova::$db->db_affected_rows(); } if (empty(core_auth::$user['id'])) { $user_list = PlayerToAccountTranslate::db_translate_get_users_from_account_list(core_auth::$main_provider->provider_id, $this->account_id); reset($user_list); $user_id_unsafe = key($user_list); } else { $user_id_unsafe = core_auth::$user['id']; } $user_id_safe = $this->db->db_escape($user_id_unsafe); if (!$result) { $debug->error("Error adjusting Metamatter for player ID {$this->account_id} (Player Not Found?) with {$metamatter}. Reason: {$comment}", 'Metamatter Change', 402); } if (!$already_changed) { $this->account_metamatter += $metamatter; $this->account_metamatter_total += $metamatter_total_delta; } if (is_array($comment)) { $comment = call_user_func_array('sprintf', $comment); } $result = $this->db_mm_log_insert($comment, $change_type, $metamatter, $user_id_unsafe); if ($metamatter > 0 && !empty($user_id_safe)) { $old_referral = doquery("SELECT * FROM {{referrals}} WHERE `id` = {$user_id_safe} LIMIT 1 FOR UPDATE;", '', true); if ($old_referral['id']) { $dark_matter_from_metamatter = $metamatter * AFFILIATE_MM_TO_REFERRAL_DM; doquery("UPDATE {{referrals}} SET dark_matter = dark_matter + '{$dark_matter_from_metamatter}' WHERE `id` = {$user_id_safe} LIMIT 1;"); $new_referral = doquery("SELECT * FROM {{referrals}} WHERE `id` = {$user_id_safe} LIMIT 1;", '', true); $partner_bonus = floor($new_referral['dark_matter'] / $config->rpg_bonus_divisor) - ($old_referral['dark_matter'] >= $config->rpg_bonus_minimum ? floor($old_referral['dark_matter'] / $config->rpg_bonus_divisor) : 0); if ($partner_bonus > 0 && $new_referral['dark_matter'] >= $config->rpg_bonus_minimum) { rpg_points_change($new_referral['id_partner'], RPG_REFERRAL_BOUGHT_MM, $partner_bonus, "Incoming MM From Referral ID {$user_id_safe}"); } } } $mm_change_legit = false; return $result; }
public static function db_del_record_list($location_type, $condition) { if (!($condition = trim($condition))) { return false; } $location_info =& static::$location_info[$location_type]; $table_name = $location_info[P_TABLE_NAME]; //static::db_get_record_list($location_type, $condition, false, true); if ($result = static::db_query("DELETE FROM `{{{$table_name}}}` WHERE {$condition}")) { if (static::$db->db_affected_rows()) { // Обнуление кэша, потому что непонятно, что поменялось // TODO - когда будет структурированный $condition можно будет делать только cache_unset по нужным записям static::cache_clear($location_type); } } return $result; }
<?php define('DIR_SITE_ROOT', '../'); require_once DIR_SITE_ROOT . '/config/config.php'; require_once "lib_db_mysql.php"; /* @var $db db_mysql*/ $db = new db_mysql(); //incluindo bibliotecas: include_once 'lib_datetime.php'; include_once 'funcoes.php'; /* @var $user logon*/ $db->abreConexao(NUM_CONEXAO); if (!$user->LOGED) { die("usuario nao logado"); } $datasetID = $user->getDatasetID(); $sql = sprintf('SELECT manual_evaluation_strategy FROM dataset WHERE id = %s', $datasetID); $db->query($sql); $manualEvaluationStrategy = $db->result(0, 0); switch (true) { case isset($_GET["tituloframe"]) && $_GET["tituloframe"]: if ($manualEvaluationStrategy == 'Q') { if (isset($_GET["idurl"]) && $_GET["idurl"]) { $sql = sprintf("SELECT url FROM document WHERE id = %s", addslashes($_GET["idurl"])); $db->query($sql); $url = $db->fetch_assoc(); if (!$url) { die("Error"); } $smarty->assign("url", $url); //$smarty->assign("idpergunta",$_GET["idpergunta"]);
<?php define('DIR_SITE_ROOT', '../'); require_once DIR_SITE_ROOT . '/config/config.php'; require_once "lib_db_mysql.php"; /* @var $db db_mysql*/ $db = new db_mysql(); //incluindo bibliotecas: include_once 'lib_datetime.php'; include_once 'funcoes.php'; /* @var $user logon*/ $db->abreConexao(NUM_CONEXAO); $sql = sprintf("SELECT d.Nome AS DataSet, d.Descricao AS Desc_DataSet, \r\n\t\t\t\t\tp.Nome AS Pergunta, p.Descricao AS Desc_Pergunta\r\n\t\t\t\tFROM DataSet d, Pergunta p\r\n\t\t\t\tWHERE d.IdDataSet = %s\r\n\t\t\t\t AND d.IdDataSet = p.IdDataSet\r\n\t\t\t\t AND p.Status = 'A'", $user->getDatasetID()); $db->query($sql); $tmp = $db->fetch_assoc(); echo "<b>" . $tmp["DataSet"] . "</b><br>" . $tmp["Desc_DataSet"] . "<br><br>"; do { echo $tmp["Pergunta"] . "<br>" . $tmp["Desc_Pergunta"] . "<br><br>"; } while ($tmp = $db->fetch_assoc());
<?php ini_set('error_log', dirname(__FILE__) . '/error_log.txt'); include_once "./services/mysql.class.php"; // echo PHP_VERSION; 5.3.5 $db_servername = "10.0.80.212"; $db_username = "******"; $db_password = "******"; $db_name = "zic"; $db = new db_mysql($db_servername, $db_username, $db_password, $db_name); $strsql = "select * from tb_news"; $rs = $db->fetch_array_pager($strsql, 1, 5); foreach ($rs as $v) { //echo $v["num"]."</br>"; }
/** *@package db_mysql *@method close() *@desc Close MySQL connection *@since v0.1 beta * */ public function close() { if (self::$is_connected) { mysql_close(); self::$is_connected = false; } }
<base target="_self"> <script> function set_cimg(url,obj){ $('#imglist>li>img').css({'border':'0px'}); window.returnValue=url; $(obj).css({'border':'2px solid red','padding':'1px'}); } </script> <div style="clear:both;height:30px;margin-top:10px;"> <a href="javascript:void(0);" class="but_enter" onclick="window.returnValue='';window.close();">取消</a> <a href="javascript:void(0);" class="but_enter" onclick="window.close();">确定</a> </div> <?php $p = isset($_GET['p']) && is_numeric($_GET['p']) ? intval($_GET['p']) : 1; $dbm = new db_mysql(); $where = ""; $suffix = ""; $suffix .= " order by id desc "; $suffix .= $dbm->get_limit_sql(15, $p); $params = array('table_name' => TB_PREFIX . 'resource_list', 'where' => $where, 'pagesize' => 15, 'count' => 1, 'suffix' => $suffix); $rs = $dbm->single_query($params); function get_alt_txt($url) { $file = pathinfo($url); switch ($file['extension']) { case 'jpg': case 'jpeg': case 'gif': case 'png': case 'ico':
<?php define('DIR_SITE_ROOT', '../'); require_once DIR_SITE_ROOT . '/config/config.php'; require_once "lib_db_mysql.php"; /* @var $db db_mysql*/ $db = new db_mysql(); //incluindo bibliotecas: include_once 'lib_datetime.php'; include_once 'funcoes.php'; /* @var $user logon*/ $db->abreConexao(NUM_CONEXAO); if (!$user->LOGED) { die("usuario nao logado"); } $sql = "UPDATE idioma SET Descricao = 'Português (Brasil)' WHERE IdIdioma = 1"; $db->query($sql); $sql = "UPDATE idioma SET Descricao = 'Inglês (EUA)' WHERE IdIdioma = 2"; $db->query($sql);
function mysql_connect_test($config, $type) { global $setting; static $error_code = array('connect_error' => -1, 'table_error' => -2); static $db; $ret = true; if ($db === null) { require_once DISCUZ_ROOT . './include/db.class.php'; $db = new db_mysql(); } $db->set_config($config); $check = $db->connect(false); if (!$check) { $ret = $error_code['connect_error']; } else { if (isset($setting['tablecheck'][$type])) { $find = $db->fetch_first("SHOW TABLES LIKE '{$config[tablepre]}{$setting['tablecheck'][$type]}'"); if (!$find) { $ret = $error_code['table_error']; } } } $db->close(); return $ret; }
<?php require_once DIR_SITE_ROOT . '/config/config.php'; require_once "lib_db_mysql.php"; /* @var $db db_mysql*/ $db = new db_mysql(); //incluindo bibliotecas: include_once 'lib_datetime.php'; include_once 'funcoes.php'; //tempo de inicio $starttime = microtime_float(); /* @var $user logon*/ $db->abreConexao(NUM_CONEXAO); //efetua o login caso solicitado if (isset($_POST["efetualogin"]) && $_POST["efetualogin"]) { $user->forceLogon($_POST["nome"], $_POST["senha"]); if ($user->ERROR) { $smarty->assign("mensagem", $user->ERROR); } } $smarty->assign("logado", $user->LOGED); $smarty->assign("username", $user->USERNAME); // Verificando se o usuário está logado: if ($user->LOGED) { $smarty->assign("usuario_nome", $user->NOME); $hasRoleC = $user->hasRole('C'); $hasRoleU = $user->hasRole('U'); $menus = array(); if ($user->ADMIN) { $menu["nome"] = "Collaborators"; $menu["pagina"] = "/cadastros/usuarios.php";
public function db_confirmation_get_by_type_and_code($confirmation_type_safe, $confirmation_code_unsafe) { $confirmation_code_safe = $this->db->db_escape($confirmation_code_unsafe); return $this->db->doquery("SELECT * FROM {{confirmations}} WHERE\n `type` = {$confirmation_type_safe} AND `code` = '{$confirmation_code_safe}' ORDER BY create_time DESC LIMIT 1 FOR UPDATE", true); }
public static function db_translate_unregister_user($user_id_unsafe) { static::init(); $user_id_safe = static::$db->db_escape($user_id_unsafe); return static::$db->doquery("DELETE FROM `{{account_translate}}` WHERE `user_id` = {$user_id_safe});"); }
function model($db = NULL) { global $config; $db = $db ? $db : $config["db_server"]; parent::db_mysql($db['host'], $db['db'], $db['user'], $db['pass'], 'utf8', 0, $debug = 0); }
<?php header("Content-type:text/html;charset=utf-8"); define('IN_PHP', true); define('IN_IA', true); require_once "qiniu/http.php"; require_once "qiniu/auth_digest.php"; require_once "qiniu/utils.php"; require_once "qiniu/mysql.class.php"; require_once "../data/config.php"; //require_once("qiniu/rs.php"); $db = new db_mysql($config['db']['host'] . ":" . $config['db']['port'], $config['db']['username'], $config['db']['password'], $config['db']['database'], $config['db']['charset']); //$db = new db_mysql ( 'localhost:3306', 'root' , 'mima' , 'w9' , 'utf8' ); $ty_conf = $db->getone("select * from ims_xhw_voice_setting where weid=" . $_POST['weid']); $accessKey = $_POST['accesskey']; $secretKey = $_POST['secretkey']; $access_tonken = $_POST['access_token']; $media_id = $_POST['mediaid']; $targetUrl = "http://file.api.weixin.qq.com/cgi-bin/media/get?access_token=" . $access_tonken . "&media_id=" . $media_id; $times = time(); $destBucket = $_POST['name']; $destKey = $_POST['title'] . $times . ".amr"; $encodedUrl = Qiniu_Encode($targetUrl); $destEntry = "{$destBucket}:{$destKey}"; $encodedEntry = Qiniu_Encode($destEntry); $apiHost = "http://iovip.qbox.me"; $apiPath = "/fetch/{$encodedUrl}/to/{$encodedEntry}"; $requestBody = ""; $mac = new Qiniu_Mac($accessKey, $secretKey); $client = new Qiniu_MacHttpClient($mac); list($ret, $err) = Qiniu_Client_CallWithForm($client, $apiHost . $apiPath, $requestBody);
<?php // Init error_reporting(E_ALL & ~E_STRICT); header('Content-type: text/plain'); $start = microtime(1); if ( isset($_GET['mysql']) ) { require '../db_mysql.php'; $db = db_mysql::open(array('user' => $_GET['user'], 'pass' => $_GET['pass'], 'db' => $_GET['db'])); } else { require '../db_sqlite.php'; $db = db_sqlite::open(array('database' => './stuff.sqlite3')); }
$trade_no = $_GET['trade_no']; //交易状态 $trade_status = $_GET['trade_status']; $dbconfig = (require_once dirname(__FILE__) . "/../../../mysqlconf.php"); require_once dirname(__FILE__) . "/../../../infoconfig.php"; $cfg['tb_pre'] = $dbconfig['DB_PREFIX']; $cfg['db_charset'] = 'utf8'; $cfg['sqlerr'] = '1'; $cfg['errlog'] = '1'; $cfg['timediff'] = '0'; $fr_time = time(); define('FR_ROOT', str_replace("\\", '/', dirname(__FILE__))); define('CACHE_ROOT', $cfg['cache_dir'] ? $cfg['cache_dir'] : FR_ROOT . '/cache'); define('DATA_ROOT', FR_ROOT . '/data'); include '../mysql.class.php'; $db = new db_mysql(); $db->halt = $cfg['sqlerr']; $db->connect($dbconfig['DB_HOST'], $dbconfig['DB_USER'], $dbconfig['DB_PWD'], $dbconfig['DB_NAME'], 0); if ($_GET['trade_status'] == 'TRADE_FINISHED' || $_GET['trade_status'] == 'TRADE_SUCCESS') { //判断该笔订单是否在商户网站中已经做过处理 //如果没有做过处理,根据订单号(out_trade_no)在商户网站的订单系统中查到该笔订单的详细,并执行商户的业务程序 //如果有做过处理,不执行商户的业务程序 $inquery = "UPDATE `{$cfg['tb_pre']}member_operation` SET sta=1 WHERE buyid='" . $out_trade_no . "'"; $db->query($inquery); $operation = $db->get_one("SELECT mid,`money`,pname FROM `{$cfg['tb_pre']}member_operation` where buyid='" . $out_trade_no . "' "); $mid = $operation['mid']; $pname = $operation['pname']; $score = $operation['money'] * $infoconfig['cfg_recharge']; $inquery = "UPDATE `{$cfg['tb_pre']}member` SET scores=scores+" . $score . " WHERE mid='" . $mid . "'"; $db->query($inquery); //insert log
<?php //header('Content-Type: text/html; charset=utf-8'); $dbhost = "192.168.0.95"; //数据库地址 $dbuser = "******"; //MySql数据库用户名 $dbpass = "******"; //MySql数据库密码 $dbname = "crm20140704"; //MySql数据库名称 $dbcharset = "utf8"; //数据库读写所采用的编码,utf8或gb2312 if (empty($dbname)) { echo '<script>top.location="install.php";</script>'; } require_once 'db_function.php'; //数据库操作类 require_once 'function.php'; //引用函数 /*------------------------------------------------ * 数据库连接 *-----------------------------------------------*/ $db = new db_mysql(); $db->connect($dbhost, $dbuser, $dbpass, $dbname, $dbcharset); //mysql_query("set names utf8"); /*防止 PHP 5.1.x 使用时间函数报错*/ if (function_exists('date_default_timezone_set')) { date_default_timezone_set('PRC'); }
/** * 得到帖子信息 * @param $tid - 帖子ID * @param $returnpid - 返回首帖pid * @param $msgleng - 內容截斷的長度 */ function list_threads($tid = 0, $msgleng = 255) { global $_G, $_SC; $tid = intval($tid); $msgleng = intval($msgleng); $ret_thread = array(); if ($tid > 0) { $bbs_dbpre = $_SC['bbs_dbpre']; $db = new db_mysql(array(1 => array('tablepre' => $_SC['bbs_dbpre'], 'dbcharset' => $_SC['bbs_dbcharset'], 'dbhost' => $_SC['bbs_dbhost'], 'dbuser' => $_SC['bbs_dbuser'], 'dbpw' => $_SC['bbs_dbpw'], 'dbname' => $_SC['bbs_dbname']))); $db->connect(); //$db->charset = $_SC['bbs_dbcharset']; //$db->connect($_SC['bbs_dbhost'], $_SC['bbs_dbuser'], $_SC['bbs_dbpw'], $_SC['bbs_dbname'], 0, 1); $query = $db->query("SELECT pid, authorid, author, subject, message FROM {$bbs_dbpre}posts WHERE tid='{$tid}' AND first='1' LIMIT 1"); $ret_thread = $db->fetch_array($query); if (!empty($ret_thread['message'])) { $ret_thread['message'] = messagecutstr($ret_thread['message'], $msgleng); } $db->close(); unset($db); } return $ret_thread; }
foreach ($key as $value) { if ($value == 'uc_key') { //echo $localuc;exit; if (strexists(UC_API, $_G['siteurl']) && $localuc == 1) { //local ucenter $newuc_mykey = UC_MYKEY; //更新到UCenter配置文件 $newuc_uckey = UC_KEY; //更新到UCenter配置文件 $newapp_authkey = generate_key(); //更新到 Discuz! UC配置文件 $newapp_appkey = authcode($newapp_authkey, 'ENCODE', $newuc_mykey); //更新到UCenter数据库 $newapp_appkey = daddslashes($newapp_appkey); //echo $newcu_mykey;exit; $ucdb = new db_mysql(); $ucdblink = $ucdb->_dbconnect(UC_DBHOST, UC_DBUSER, UC_DBPW, UC_DBCHARSET, UC_DBNAME); $apptablename = UC_DBTABLEPRE . 'applications'; // $a = $ucdb->query("SELECT appid,authkey FROM $apptablename"); // $apparray = array(); // while($data = $ucdb->fetch_array($a)){ // $apparray[] = $data; // } //echo UC_DBTABLEPRE;exit; $uc_dbtablepre = UC_DBTABLEPRE; $ucconfig = array($newapp_authkey, UC_APPID, UC_DBHOST, UC_DBNAME, UC_DBUSER, UC_DBPW, UC_DBCHARSET, $uc_dbtablepre, UC_CHARSET, UC_API, UC_IP); $ucconfig = @implode('|', $ucconfig); save_uc_config($ucconfig, DISCUZ_ROOT . './config/config_ucenter.php'); $ucdb->query("UPDATE {$apptablename} SET authkey = '{$newapp_appkey}' WHERE appid = " . UC_APPID); //note } else {
} } } @(include DT_ROOT . '/file/data/' . $name . '.inc.php'); include tpl('data_view'); exit; } break; case 'import': $data = array(); @(include DT_ROOT . '/file/data/' . $name . '.php'); $data = dstripslashes($data); extract($data); if ($database == 'mysql') { if ($db_host && $db_user && $db_name) { $sc = new db_mysql(); $sc->connect($db_host, $db_user, $db_pass, $db_name, $CFG['db_expires'], $CFG['db_charset'], $CFG['pconnect']); } else { $sc =& $db; } } else { if ($database == 'mssql') { require DT_ROOT . '/include/db_mssql.class.php'; $sc = new db_mssql(); $sc->connect($db_host, $db_user, $db_pass, $db_name); } else { if ($database == 'access') { require DT_ROOT . '/include/db_access.class.php'; $sc = new db_access(); $sc->connect(DT_ROOT . '/' . $db_host, $db_user, $db_pass, $db_table); } else {
$newconfig = getgpc('newconfig'); if (is_array($newconfig)) { $checkarray = $setting['config']['ucenter'] ? array('source', 'target', 'ucenter') : array('source', 'target'); foreach ($checkarray as $key) { if (!empty($newconfig[$key]['dbhost'])) { $check = mysql_connect_test($newconfig[$key], $key); if ($check < 0) { $error[$key] = lang('mysql_connect_error_' . abs($check)); } } else { $error[$key] = lang('mysql_config_error'); } } save_config_file($configfile, $newconfig, $config_default); if (empty($error)) { $db_target = new db_mysql($newconfig['target']); $db_target->connect(); delete_process('all'); showmessage('config_success', 'index.php?a=select&source=' . $source); } } } showtips('如果无法显示设置项目,请删除文件 data/config.inc.php'); $config = loadconfig('config.inc.php'); if (empty($config)) { $config = $config_default; } show_form_header(); show_config_input('source', $config['source'], $error['source']); show_config_input('target', $config['target'], $error['target']); if ($setting['config']['ucenter']) {
<?php $config = loadconfig(); $db_source = new db_mysql($config['source']); $db_source->connect(); $db_target = new db_mysql($config['target']); $db_target->connect(); $db_uc = new db_mysql($config['ucenter']); if ($setting['config']['ucenter']) { $db_uc->connect(); } $process = load_process('main'); if (empty($process)) { showmessage("请首先选择转换程序", "index.php?action=select&source={$source}"); } $prg = getgpc('prg'); $prg_dir['tables'] = DISCUZ_ROOT . './source/' . $source . '/table/'; $prg_dir['start'] = DISCUZ_ROOT . './source/' . $source . '/'; $prg_dir['steps'] = DISCUZ_ROOT . './source/' . $source . '/'; $prg_done = 0; $prg_next = ''; $prg_total = $prg_total = count($process['tables']) + count($process['start']) + count($process['steps']); foreach (array('start', 'tables', 'steps') as $program) { if (!empty($process[$program]) && !$process[$program . '_is_end']) { foreach ($process[$program] as $k => $v) { if ($v) { $prg_done++; } elseif ($prg_next == '') { $prg_next = $k; } }
if ($page <= 0 or $page >= 100) { $page = 1; } unset($_SESSION['contents']); unset($_SESSION['type']); $_SESSION['page'] = $page; $page_a = $page * 10 - 10; if ($page == 1) { $page_b = $page; } else { $page_b = $page - 1; } $list_query = DB::fetch_all("SELECT * FROM `" . DCRM_CON_PREFIX . "UDID` ORDER BY `ID` DESC, `CreateStamp` DESC, `TimeStamp` DESC LIMIT " . (string) $page_a . ",10"); $page_c = show_table($list_query); $q_info = DB::query("SELECT count(*) FROM `" . DCRM_CON_PREFIX . "UDID`"); $info = db_mysql::fetch_row($q_info); $totalnum = (int) $info[0]; $params = array('total_rows' => $totalnum, 'method' => 'html', 'parameter' => 'udid.php?page=%page', 'now_page' => $page, 'list_rows' => 10); $page = new Core_Lib_Page($params); echo '<div class="page">' . $page->show(2) . '</div>'; } } elseif (!empty($_GET['action']) and $_GET['action'] == "search" and !empty($_GET['contents']) and !empty($_GET['type'])) { // 搜索内容显示 unset($_SESSION['page']); $_SESSION['contents'] = $_GET['contents']; $_SESSION['type'] = $_GET['type']; if (isset($_GET['page'])) { $page = $_GET['page']; } else { $page = 1; }
<?php define('DIR_SITE_ROOT', '../'); require_once DIR_SITE_ROOT . '/config/config.php'; require_once "lib_db_mysql.php"; /* @var $db db_mysql*/ $db = new db_mysql(); //incluindo bibliotecas:^M include_once 'lib_datetime.php'; include_once 'funcoes.php'; /* @var $user logon*/ $db->abreConexao(NUM_CONEXAO); if (isset($_GET["url"])) { $url = $_GET["url"]; } require_once "../include/urlgrabber.php"; if (isset($_GET["idurl"])) { $idurl = $_GET["idurl"]; } if (isset($_GET["furl"])) { $furl = $_GET["furl"]; } if (isset($idurl) && $idurl && (!isset($furl) || !$furl)) { $sql = sprintf("SELECT url FROM document WHERE id = %s", addslashes($idurl)); $db->query($sql); $url = $db->result(0, 0); if (!$url) { die("Erro"); } header('Location: ' . $url); die;
function db_mysqli($db_host, $db_user, $db_pass, $db_name, $db_port = 3306, $db_socket = '', $db_prefix) { parent::database($db_host, $db_user, $db_pass, $db_name, $db_port, $db_socket, $db_prefix); $this->socket = $db_socket; $this->connection = @mysqli_connect($db_host, $db_user, $db_pass, $db_name, $db_port, $db_socket); }
exit('Invalid Request'); } include_once DISCUZ_ROOT . './uc_client/lib/xml.class.php'; $post = xml_unserialize(file_get_contents('php://input')); if (in_array($get['action'], array('test', 'deleteuser', 'renameuser', 'gettag', 'synlogin', 'synlogout', 'updatepw', 'updatebadwords', 'updatehosts', 'updateapps', 'updateclient', 'updatecredit', 'getcredit', 'getcreditsettings', 'updatecreditsettings', 'addfeed'))) { $uc_note = new uc_note(); echo $uc_note->{$get}['action']($get, $post); exit; } else { exit(API_RETURN_FAILED); } } else { define('DISCUZ_ROOT', $app['extra']['apppath']); require_once DISCUZ_ROOT . './config/config_global.php'; require_once DISCUZ_ROOT . './source/class/class_core.php'; $discuz = new db_mysql(); $discuz->set_config($_config['db']); $discuz->connect(); } class uc_note { var $dbconfig = ''; var $db = ''; var $tablepre = ''; var $appdir = ''; function _serialize($arr, $htmlon = 0) { if (!function_exists('xml_serialize')) { include_once DISCUZ_ROOT . './uc_client/lib/xml.class.php'; } return xml_serialize($arr, $htmlon);
<?php /*********************/ /* */ /* Version : 5.1.0 */ /* Author : RM */ /* Comment : 071223 */ /* */ /*********************/ require "db_config.php"; require "db_mysql.class.php"; require "../cache/site_config.php"; date_default_timezone_set("PRC"); $db = new db_mysql(); $db->connect($dbhost, $dbuser, $dbpw, $dbname, $dbpconnect, $dbcharset);
function __construct($debug = 0) { parent::__construct($debug); }