예제 #1
2
function db_test()
{
    include_once EZSQL_LIB . "/shared/ez_sql_core.php";
    include_once EZSQL_LIB . "/mysql/ez_sql_mysql.php";
    $db = new ezSQL_mysql(DB_USER, DB_PASSWD, DB_NAME, DB_HOST);
    return @$db->quick_connect(DB_USER, DB_PASSWD, DB_NAME, DB_HOST);
}
예제 #2
1
파일: connect.php 프로젝트: Add-One/Design
function db_Init()
{
    // $db=new ezSQL_mysql('root','CQsPxs2VPXnmW4','Design','120.26.79.226');//阿里云 mysql
    $db = new ezSQL_mysql('bdm121435617', 'ftdesign2015', 'bdm121435617_db', 'bdm121435617.my3w.com');
    // 万网虚拟主机 数据库
    $db->query('set names UTF8');
    return $db;
}
예제 #3
0
function getUserData($secreatCode, $token, $device)
{
    if (isset($secreatCode)) {
        global $dbhost;
        global $dbuser;
        global $dbpassword;
        global $db;
        $deviceId = isset($_POST['deviceId']) ? $_POST['deviceId'] : '';
        $code = explode('_', $secreatCode);
        $userdb = new ezSQL_mysql($dbuser, $dbpassword, $code[0], $dbhost);
        $query = "SELECT * FROM `user_info` WHERE `uniqueCode`= '" . $secreatCode . "'";
        $result = $userdb->get_results($query, ARRAY_A);
        if (!empty($result)) {
            if ($result[0]['deviceId'] == '' && $deviceId !== '') {
                $updateDeviceIdQuery = "UPDATE `user_info` SET `deviceId`= '" . $deviceId . "',`token`= '" . $token . "',`devicetype`= '" . $device . "' WHERE `uniqueCode`= '" . $secreatCode . "'";
                $userdb->query($updateDeviceIdQuery);
                $query1 = "SELECT `contactno` FROM `admin_database_info` WHERE `admindatabase`= '{$code['0']}" . "'";
                $result1 = $db->get_results($query1, ARRAY_A);
                unset($result[0]['password']);
                unset($result[0]['deviceId']);
                $data = $result[0];
                $data['admin_contactNo'] = $result1[0]['contactno'];
                $data['admin_jid'] = $code[0];
                $final['data'] = $data;
                $final['status'] = TRUE;
                echo json_encode($final);
                exit;
            } elseif ($result[0]['deviceId'] !== '' && $result[0]['deviceId'] == $deviceId) {
                $query1 = "SELECT `contactno` FROM `admin_database_info` WHERE `admindatabase`= '{$code['0']}" . "'";
                $result1 = $db->get_results($query1, ARRAY_A);
                unset($result[0]['password']);
                unset($result[0]['deviceId']);
                $data = $result[0];
                $data['admin_contactNo'] = $result1[0]['contactno'];
                $data['admin_jid'] = $code[0];
                $final['data'] = $data;
                $final['status'] = TRUE;
                echo json_encode($final);
                exit;
            } elseif ($result[0]['deviceId'] !== '' && $result[0]['deviceId'] !== $deviceId) {
                $data['status'] = FALSE;
                $data['message'] = 'This account is already registered with another device';
                echo json_encode($data);
                exit;
            } else {
                $data['status'] = FALSE;
                $data['message'] = 'device id not found';
                echo json_encode($data);
                exit;
            }
        } else {
            $data['status'] = FALSE;
            $data['message'] = 'Secret code is invalid!';
            echo json_encode($data);
            exit;
        }
    }
}
예제 #4
0
 /**
  * Perform mySQL query
  *
  * Added to the original function: logging of all queries
  *
  * @since 1.7
  */
 function query($query)
 {
     // Keep history of all queries
     $this->debug_log[] = $query;
     // Original function
     return parent::query($query);
 }
예제 #5
0
function phpbb_connect()
{
    global $settings, $db, $phpbb_db;
    if ($settings['user']) {
        $dbname = strpos($settings['db'], '.') > 0 ? substr($settings['db'], 0, strpos($settings['db'], '.')) : $settings['db'];
        $db1 = new ezSQL_mysql($settings['user'], $settings['pass'], $dbname, $settings['host']);
        $db1->show_errors = true;
        $db1->quick_connect($settings['user'], $settings['pass'], $dbname, $settings['host']);
        if (count($db1->captured_errors) > 0) {
            return null;
        }
        return $db1;
    } else {
        return $db;
    }
}
예제 #6
0
 /**
  * Renders the addon author ranking
  *
  * @return string
  */
 public function getTopDevelopersWidgetMarker()
 {
     $top5 = $this->db->get_results("SELECT *, COUNT( provider_name ) AS counttotal FROM addon WHERE 1=1 " . $this->configuration['addonExcludeClause'] . " GROUP BY provider_name ORDER BY counttotal DESC LIMIT 9");
     $counter = 0;
     $iconMap = array(1 => 'gold.png', 2 => 'silver.png', 3 => 'bronze.png');
     if (is_array($top5) && count($top5)) {
         $developers = '';
         foreach ($top5 as $top5s) {
             $author = cleanupAuthorName($top5s->provider_name);
             $counter++;
             $icon = 'images/' . (isset($iconMap[$counter]) ? $iconMap[$counter] : $counter . '.png');
             $developers .= "<li><img src='{$icon}' height='20' width='20' alt='Rank {$counter}' /><a href='" . createLinkUrl('author', $author) . "' title='Show all addons from this author'> " . substr($author, 0, 15) . " ({$top5s->counttotal} uploads)</a></li>";
         }
         return $this->makeWidget('Top developers', '<ul class="topDevelopers">' . $developers . '</ul>');
     }
     return '';
 }
예제 #7
0
파일: Db.php 프로젝트: RenzcPHP/3dproduct
 public function setup()
 {
     $settings = $this->routeInstance->getSetup();
     //TODO 调用对应的驱动配置
     require_once Kohana::find_file('vendor', 'ez_sql/shared/ez_sql_core', TRUE);
     require_once Kohana::find_file('vendor', 'ez_sql/mysql/ez_sql_mysql', TRUE);
     $curInst = new ezSQL_mysql($settings['dbUser'], $settings['dbPasswd'], $settings['dbSchema'], $settings['dbHost']);
     $curInst->cache_timeout = $settings['dbCacheTimeout'];
     $curInst->cache_dir = $settings['dbDiskCachePath'];
     $curInst->use_disk_cache = $settings['dbCache'] == 1;
     $curInst->cache_queries = $settings['dbCache'] == 1;
     if ($settings['dbShowError'] == 1) {
         $curInst->show_errors();
     } else {
         $curInst->hide_errors();
     }
     $curInst->set_charset('utf8');
     //$curInst->quick_connect($settings['dbUser'], $settings['dbPasswd'], $settings['dbSchema'], $settings['dbHost']);
     $this->instance = $curInst;
     //$this->isAvailable = $this->instance->dbh?TRUE:FALSE;
     $this->isAvailable = TRUE;
 }
예제 #8
0
파일: ajax.php 프로젝트: hytczhuliwei/PHP
include_once "ez_sql_mysql.php";
$db = new ezSQL_mysql();
session_start();
$curuserid = isset($_SESSION["curuserid"]) ? $_SESSION["curuserid"] : "";
$curusername = isset($_SESSION["curusername"]) ? $_SESSION["curusername"] : "";
$flag = isset($_POST["flag"]) ? $_POST["flag"] : "";
$chatMsg = isset($_POST["chatMsg"]) ? $_POST["chatMsg"] : "";
$chatMsg = str_replace("'", "\\'", $chatMsg);
$receiverId = isset($_POST["receiverId"]) ? $_POST["receiverId"] : "";
$setReadSenderid = isset($_POST["setReadSenderid"]) ? $_POST["setReadSenderid"] : "";
$userid = isset($_POST["userid"]) ? $_POST["userid"] : "";
$userpwd = isset($_POST["userpwd"]) ? $_POST["userpwd"] : "";
//验证登录
if ($flag == "checkUser") {
    if ($userid != "" && $userpwd != "") {
        $db = new ezSQL_mysql();
        $sql = "select * from userinfo where id='" . $userid . "' and userpwd='" . $userpwd . "'";
        $res = $db->get_row($sql);
        if (!$res) {
            echo "fail";
        } else {
            //echo "success";
            $_SESSION["curuserid"] = $userid;
            $_SESSION["curusername"] = $res->userNickname;
            $changeloginsql = "UPDATE userinfo SET userState = '在线' WHERE id = '" . $userid . "'";
            $db->query($changeloginsql);
            header("location:../index.php?username=" . $res->userNickname);
        }
    }
    die;
}
예제 #9
0
<?php

session_start();
require_once 'libs/ez_sql_core.php';
require_once 'libs/ez_sql_mysql.php';
$conn = new ezSQL_mysql('root', '', 'jvs_tutoriales');
$usuario = $conn->get_row("SELECT id_usuario, nombre, apellido FROM usuarios WHERE login = '******'login'] . "' AND password = '******'pwd']) . "'");
if ($usuario) {
    $_SESSION['usuario_logeado'] = $usuario;
    echo json_encode($usuario);
} else {
    echo json_encode(array('error' => true));
}
예제 #10
0
파일: setup.php 프로젝트: mp459/rxalarm
    require_once './config.php';
} else {
    die('404: Config Not Found.');
}
/**

	Load up Libraries

	**/
include_once "../libs/ez_sql_core.php";
include_once "../libs/ez_sql_mysql.php";
include_once "../libs/myfunctions.php";
// MySQL Connection
$mysql_server = $db_host . ":" . $db_port;
// server details
$db = new ezSQL_mysql($db_user, $db_pass, $db_name, $mysql_server);
// Username , password , DB
$debug = false;
// no debug by default.
// Table Checking...
$my_tables = $db->get_results("SHOW TABLES LIKE '%user%'", ARRAY_N);
// query db for user table
if (!$my_tables) {
    // We have no tables, better create some....
    /**
    			TABLE DEF:
    				id = unique user id
    				
    				tw_at = Twitter Access Token
    				tw_sec = Twitter Secret Token
    				tw_account = Array of account info we want/store from Twitter
 * and open the template in the editor.
 */
//print_r($_POST['values']);exit;
error_reporting(0);
include_once './db.php';
$xml = simplexml_load_string($_POST['values'], "SimpleXMLElement", LIBXML_NOCDATA);
$json = json_encode($xml);
$array = json_decode($json, TRUE);
if (isset($array['body']) && $array['body'] != '') {
    global $dbhost;
    global $dbuser;
    global $dbpassword;
    $to = $array['@attributes']['to'];
    $toArray = explode('@', $to);
    $database = strtoupper($toArray[0]);
    $adminDb = new ezSQL_mysql($dbuser, $dbpassword, $database, $dbhost);
    $data = json_decode($array['body'], TRUE);
    if (!is_null($data) && $data['email'] !== '' && $data['latitude'] !== '' && $data['longitude'] !== '' && $data['locationtime'] !== '') {
        try {
            $qry = "INSERT into `user_tracking_info` (`email`,`latitude`, `longitude`, `locationtime`, `timestamp`) \n\t\tVALUES ('" . $data['email'] . "','" . $data['latitude'] . "','" . $data['longitude'] . "','" . $data['locationtime'] . "','" . date('Y-m-d H:i:s') . "')";
            $adminDb->query($qry);
            $result['status'] = TRUE;
            $result['message'] = 'Location sucessfully inserted';
            echo json_encode($result);
            exit;
        } catch (Exception $ex) {
            $result['status'] = FALSE;
            $result['message'] = $ex->getMessage();
            echo json_encode($result);
            exit;
        }
예제 #12
0
<?php

require_once 'lib/ez_sql_core.php';
require_once 'lib/ez_sql_mysql.php';
$data = serialize($_POST['item']);
$db = new ezSQL_mysql('root', '', 'jvs_tutoriales');
$db->query("UPDATE opciones SET menu = '{$data}' WHERE id_opcion = '1'");
/**
 * Initialize Database
 *
 * @return object
 */
function init_database()
{
    $ezSQL = new ezSQL_mysql(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
    $ezSQL->query("SET NAMES 'utf8'");
    return $ezSQL;
}
예제 #14
0
" alt="War3 Stats" /></a>

                                        </td>

                                </tr>

                                <tr id="page_body">

                                        <td>

<?php 
include_once "includes/ez_sql_core.php";
include_once "includes/ez_sql_mysql.php";
include_once "includes/functions.inc.php";
// Initate the SQL connection
$db = new ezSQL_mysql($config->my_user, $config->my_pass, $config->my_database, $config->my_hostname, 'utf8');
// Get list of tables from current database..
// What page are we on?
// 0 == home (general stats)
// 1 == search
// 2 == player info
// 3 == race info
$page = 0;
if (isset($_GET['page'])) {
    $page = $_GET['page'];
    $page = stripslashes(trim($page));
    $page = nl2br($page);
    $page = (int) htmlentities($page);
}
// Three generic parameters of string datatype
$param_x = '0';
예제 #15
0
파일: goldcode.php 프로젝트: xhute/LYB
$game = $_GET['game'];
$room = $_GET['room'];
$generator = $_GET['generator'];
$code = $_GET['code'];
$user = $_GET['user'];
$result = "";
function genCode()
{
    mt_srand((double) microtime() * 10000);
    //optional for php 4.2.0 and up.
    $charid = substr(strtoupper(md5(uniqid(rand(), true))), rand(0, 18), rand(9, 12));
    return $charid;
}
// Initialise database object and establish a connection
// at the same time - db_user / db_password / db_name / db_host
$db = new ezSQL_mysql('root', 'root', 'lyb', '127.0.0.1');
if ($act = "gencode") {
    if ($pwd != "shuntong@") {
        $result["ret"] = "-1";
        $result["msg"] = "密码错误";
        echo json_encode($result);
        exit;
    }
    if ('' == $game) {
        $game = "兵锋王座";
    }
    if ('' == $room) {
        $room = "兵者之心";
    }
    $result["ret"] = "0";
    $result["game"] = $game;
 function setTrackingUpdate($usr)
 {
     global $dbhost;
     global $dbpassword;
     global $dbuser;
     $currentDate = date('Y-m-d H:i:s');
     foreach ($usr as $value) {
         if (strtotime($value['trackEnd']) < strtotime($currentDate)) {
             $dbDetalis = explode('_', $value['uniqueCode']);
             $dbUser = new ezSQL_mysql($dbuser, $dbpassword, $dbDetalis[0], $dbhost);
             $trackingStatus = 'UPDATE `user_info` SET `cronTrackStatus` = 0 WHERE `uniqueCode` = "' . $value['uniqueCode'] . '"';
             $dbUser->query($trackingStatus);
             unset($dbUser);
         }
     }
     return TRUE;
 }
예제 #17
0
<?php

include_once 'ez_sql_core.php';
include_once 'ez_sql_mysql.php';
$host = $_SERVER['SERVER_NAME'];
$document_root = $_SERVER['DOCUMENT_ROOT'];
$db = new ezSQL_mysql('root', '', 'mymasterstu', 'localhost');
$user_id = 3;
$currentDate = "2015-10-16";
$online_users = array();
$results2 = $db->get_results('select at_id from admin where ad_id=' . $user_id . '');
if ($results2) {
    foreach ($results2 as $user2) {
        $at_id = $user2->at_id;
        //$online_users[]=$at_id;
        //echo "id=".$at_id;
    }
} else {
}
$results = $db->get_results('select c.ucn_id,c.ucn_from,c.ucn_to from user_connections c where c.ucn_status=1 and ucn_from=' . $user_id . ' and "2015-10-15" in (select ucd_date from user_connection_dates where ucn_id=c.ucn_id and ucd_status=2)');
if ($results) {
    foreach ($results as $user) {
        $online_users[] = $user->ucn_id;
        //$online_users[]=$user->ucn_from;
        $online_users[] = $user->ucn_to;
    }
} else {
}
$results1 = $db->get_results('select ad_id from admin where ad_id in( select distinct(ucn_to) from user_connections where ucn_from=' . $user_id . ' and ucn_status=1 ) and at_id=' . $at_id . '');
if ($results1) {
    foreach ($results1 as $user1) {
예제 #18
0
function db()
{
    $db = new ezSQL_mysql('root', '163888', 'phoenix', '127.0.0.1');
    $db->query("SET CHARACTER SET `utf8`");
    return $db;
}
예제 #19
0
파일: index.php 프로젝트: hytchouwei/php
<?php

include_once "include/ez_sql_core.php";
include_once "include/ez_sql_mysql.php";
$db = new ezSQL_mysql();
session_start();
$userID = isset($_POST["userID"]) ? $_POST["userID"] : "";
$userPwd = isset($_POST["userPwd"]) ? $_POST["userPwd"] : "";
$userIDN = isset($_SESSION["userID"]) ? $_SESSION["userID"] : "";
$userPwdN = isset($_SESSION["userPwd"]) ? $_SESSION["userPwd"] : "";
if ($userID != "" && $userPwd != "") {
    $sql = "SELECT * FROM userinfo WHERE id=" . $userID . " and userpwd='" . $userPwd . "'";
    $res = $db->get_row($sql);
    if (!$res) {
        header("location:login.php?error=inputError");
        die;
    } else {
        $_SESSION["userID"] = $userID;
        $_SESSION["userPwd"] = $userPwd;
        //echo "welcome" . $res->userNickname;
        //print_r($res);
    }
} else {
    if ($userIDN == "") {
        header("location:login.php?error=needlogin");
        die;
    }
    // echo "$userIDN";
}
?>
 <!DOCTYPE html>
예제 #20
0
<?php

session_start();
require "ez_sql_core.php";
require "ez_sql_mysql.php";
$db_user = "******";
$db_pass = "";
$db_name = "bitcs";
$db_host = "localhost";
$db = new ezSQL_mysql($db_user, $db_pass, $db_name, $db_host);
$db->query("SET NAMES 'utf8'");
$db->query("SET CHARACTER SET 'utf8'");
$db->query("SET COLLATION_CONNECTION='utf8_turkish_ci'");
예제 #21
0
파일: HaloDb.php 프로젝트: hzh123/my_yaf
 function query($query)
 {
     if ($this->slavedb == null || preg_match("/^(set|insert|deleteJob|update|replace)\\s+/i", $query)) {
         return parent::query($query);
     } else {
         return $this->slavedb->query($query);
     }
 }
예제 #22
0
function database_setup($h, $settings_file_exists)
{
    global $lang;
    //already included so Hotaru can't re-include it
    if ($h->cage->post->KeyExists('updated')) {
        $settings = new \stdClass();
        $error = 0;
        // Test CSRF
        //	    if (!$h->csrf('check', 'index')) {
        //		    $h->messages[$lang['install_step3_csrf_error']] = 'red';
        //		    $error = 1;
        //	    }
        // Test baseurl
        $settings->baseurl_name = $h->cage->post->testUri('baseurl');
        if (!$settings->baseurl_name) {
            $h->messages[$lang['install_step1_baseurl_error']] = 'red';
            $error = 1;
        }
        // Test dbname
        $settings->dbuser_name = $h->cage->post->testAlnumLines('dbuser');
        if (!$settings->dbuser_name) {
            $h->messages[$lang['install_step1_dbuser_error']] = 'red';
            $error = 1;
        }
        // Test dbpassword
        $settings->dbpassword_name = $h->cage->post->KeyExists('dbpassword');
        if (!$settings->dbpassword_name) {
            $h->messages[$lang['install_step1_dbpassword_error']] = 'red';
            $error = 1;
        }
        // Test dbname
        $settings->dbname_name = $h->cage->post->testAlnumLines('dbname');
        if (!$settings->dbname_name) {
            $h->messages[$lang['install_step1_dbname_error']] = 'red';
            $error = 1;
        }
        // Test dbprefix
        $settings->dbprefix_name = $h->cage->post->testAlnumLines('dbprefix');
        if (!$settings->dbprefix_name) {
            $h->messages[$lang['install_step1_dbprefix_error']] = 'red';
            $error = 1;
        }
        // Test dbhost
        $settings->dbhost_name = $h->cage->post->testAlpha('dbhost');
        if (!$settings->dbhost_name) {
            $h->messages[$lang['install_step1_dbhost_error']] = 'red';
            $error = 1;
        }
    } else {
        $settings = settingsFile($settings_file_exists);
    }
    // Show messages
    if ($h->cage->post->getAlpha('updated') == 'true') {
        if (!$error) {
            // Try to write file to disk based on form inputs
            $fputs = create_new_settings_file($settings->dbuser_name, $settings->dbpassword_name, $settings->dbname_name, $settings->dbprefix_name, $settings->dbhost_name, $settings->baseurl_name);
            // if file written successfully then
            if ($fputs) {
                $h->messages[$lang['install_step1_update_file_writing_success']] = 'green';
                // if yes set warning message var
            } else {
                $h->messages[$lang['install_step1_update_file_writing_failure']] = 'red';
            }
        }
        @chmod(SETTINGS, 0644);
    }
    // Check whether database and tables exist on this server
    $db = new ezSQL_mysql($settings->dbuser_name, $settings->dbpassword_name, $settings->dbname_name, $settings->dbhost_name);
    $db->show_errors = false;
    $database_exists = $db->quick_connect($settings->dbuser_name, $settings->dbpassword_name, $settings->dbname_name, $settings->dbhost_name);
    $table_exists = $database_exists ? table_exists($db, 'miscdata', $settings->dbprefix_name) : false;
    $show_next = $database_exists ? true : false;
    if ($settings->dbpassword_name && !$database_exists) {
        $h->messages[$lang['install_step1_no_db_exists_failure']] = 'red';
    }
    // Try to write the /config/settings.php file to disk
    //
    @chmod(SETTINGS, 0777);
    $settings_file_writeable = is_writeable(SETTINGS);
    if ($settings_file_writeable) {
        // show template
        template($h, 'install/database_setup.php', array('settings_file_exists' => $settings_file_exists, 'cage' => $h->cage, 'table_exists' => $table_exists, 'show_next' => $show_next, 'baseurl_name' => $settings->baseurl_name, 'dbuser_name' => $settings->dbuser_name, 'dbpassword_name' => $settings->dbpassword_name, 'dbname_name' => $settings->dbname_name, 'dbprefix_name' => $settings->dbprefix_name, 'dbhost_name' => $settings->dbhost_name));
    } else {
        @chmod(SETTINGS, 0644);
        database_setup_manual($h);
    }
}
예제 #23
0
?>
">
				<?php 
$db = new ezSQL_mysql();
$res = $db->get_row("select * from userinfo where id={$curid}");
$MyHeadImage = $res->userHeadImage;
$myshuoshuo = $res->myShuoshuo;
echo "\n  \t\t\t\t<div class='MyHeadImage'><img src='{$MyHeadImage}' curHeadImageUrl='" . $MyHeadImage . "' class='headImg' /></div>\n  \t\t\t  <div class='mYXinxi'>\n  \t\t\t\t\t <p class='nicheng'>" . $curnicheng . "</p>\n             <div class='xinxiA'>  \n                <span class='qianming'>" . $myshuoshuo . "</span>\n                <i class='xiugai'>修改</i>\n            </div>\n  \t\t\t\t</div>\n  \t\t\t";
?>
 					  		
  			</ul>
  			<ul id="friendslist">
  			<ul id="onlinefriendslist">
  				<?php 
// echo $curid;
$db = new ezSQL_mysql();
$res = $db->get_results("select userinfo.id,userinfo.userNickname,userinfo.userHeadImage,friendsinfo.friendNoteName,friendsinfo.friendid, friendsinfo.friendShuoshuo,userinfo.userState from userinfo,friendsinfo where userinfo.id=friendsinfo.friendid and friendsinfo.userid={$curid} ");
$onlineHtml = "";
$offlineHtml = "";
if ($res) {
    // echo "<script>alert('d')</script>";
    foreach ($res as $friend) {
        $curid = $friend->friendid;
        $curHeadImageUrl = $friend->userHeadImage;
        $curuserState = $friend->userState;
        $curfriNickname = $friend->friendNoteName;
        $curfrishuoshuo = $friend->friendShuoshuo;
        if ($curuserState == "online") {
            $onlineHtml .= "<li id='friendlitalk{$curid}' talkid='{$curid}' talkname='{$curfriNickname}' class='friendli' isshow='no' isappear='no' friendImg='" . $curHeadImageUrl . "'>\n  \t\t\t\t\t\t\t\t\t\t\t\t\t<img src='{$curHeadImageUrl}' class='friHeadImge' />\n  \t\t\t\t\t\t\t\t\t\t\t\t\t<div class='Friendxinxi'>\n                                <div class='FriendXX'>\n                                  <span class='nicheng'>" . $curfriNickname . "</span>\n                                  <span class='friendstate'>[  " . $curuserState . "   ]</span>\n                                </div>\n  \t\t\t\t\t\t\t\t\t\t  \t\t\t\t<p class='qianming'>" . $curfrishuoshuo . "</p>\n  \t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n  \t\t\t\t\t\t\t\t       \t\t   </li>";
        } else {
            $offlineHtml .= "<li id='friendlitalk{$curid}' talkid='{$curid}' talkname='{$curfriNickname}' class='friendli' isshow='no' isappear='no' friendImg='" . $curHeadImageUrl . "'>\n  \t\t\t\t\t\t\t\t\t\t\t\t\t<img src='{$curHeadImageUrl}' class='friHeadImge offlinePic' />\n  \t\t\t\t\t\t\t\t\t\t\t\t\t<div class='Friendxinxi'>\n  \t\t\t\t\t\t\t\t\t\t  \t\t\t\t<div class='FriendXX'>\n                                  <span class='nicheng'>" . $curfriNickname . "</span>\n                                  <span class='friendstate'>[  " . $curuserState . "   ]</span>\n                                </div>\n  \t\t\t\t\t\t\t\t\t\t  \t\t\t\t  <p class='qianming'>" . $curfrishuoshuo . "</p>\n  \t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n  \t\t\t\t\t\t\t\t\t\t\t\t</li>";
예제 #24
0
파일: export.php 프로젝트: nddery/cashmoney
error_reporting(E_ALL);
ini_set('display_errors', True);
if (!isset($argv[1])) {
    die('You should pass the season start as the first argument.');
}
if (!isset($argv[2])) {
    die('You should pass the season end as the second argument.');
}
if (!isset($argv[3])) {
    die('You should pass the database name as the third argument.');
}
include_once 'lib/ez_sql_core.php';
include_once 'lib/ez_sql_mysql.php';
// db_user / db_password / db_name / db_host
$db = new ezSQL_mysql('root', 'root', $argv[3], 'localhost');
// [
//   {
//     name,
//     children: [
//       { player },
//       { ... }
//     ]
//   },
//   { ... }
// ]
$output = array();
// Get all teams
$teams = $db->get_results("\n  SELECT    team\n  FROM      salaries\n  GROUP BY  team\n");
foreach ($teams as $team) {
    if (!is_null($team->team)) {
<?php

require_once '../../app/Mage.php';
Mage::app('default');
include_once "../shared/ez_sql_core.php";
include_once "ez_sql_mysql.php";
$db = new ezSQL_mysql('nightingaleuser', 'elagnithgin', 'nightingale', 'localhost');
$authors = $db->get_results("SELECT * FROM Authors");
foreach ($authors as $author) {
    $category = Mage::getModel('catalog/category');
    $category->setStoreId(0);
    //default/all
    $subcategory['entity_id'] = 10000 + (int) $author->Author_ID;
    $subcategory['name'] = $author->Name;
    $subcategory['path'] = "1/4";
    $subcategory['description'] = $author->Bio;
    $subcategory['meta_title'] = "";
    $subcategory['meta_keywords'] = $author->Meta_Keywords;
    $subcategory['meta_description'] = $author->Meta_Description;
    $subcategory['image'] = $author->Image_Thumbnail;
    $subcategory['landing_page'] = "";
    $subcategory['display_mode'] = "PRODUCTS";
    $subcategory['is_active'] = 1;
    $subcategory['is_anchor'] = 1;
    $subcategory['url_key'] = "";
    $category->addData($subcategory);
    try {
        $category->save();
        echo "<p><strong>" . $category->getName() . " (" . $category->getId() . ")</strong> - Category Added</p>";
    } catch (Exception $e) {
        echo $e->getMessage() . 'Cat: ';
예제 #26
0
<?php

// Standard ezSQL Libs
include_once "../shared/ez_sql_core.php";
include_once "ez_sql_mysql.php";
// Initialise singleton
$db = new ezSQL_mysql('db_user', 'db_pass', 'db_name');
// Cache expiry
$db->cache_timeout = 24;
// Note: this is hours
// Specify a cache dir. Path is taken from calling script
$db->cache_dir = 'ezsql_cache';
// (1. You must create this dir. first!)
// (2. Might need to do chmod 775)
// Global override setting to turn disc caching off
// (but not on)
$db->use_disk_cache = true;
// By wrapping up queries you can ensure that the default
// is NOT to cache unless specified
$db->cache_queries = true;
// At last.. a query!
$db->get_results("SHOW TABLES");
$db->debug();
// Select * from use
$db->get_results("SELECT * FROM User");
$db->debug();
// This ensures only the above querys are cached
$db->cache_queries = false;
// This query is NOT cached
$db->get_results("SELECT * FROM User LIMIT 0,1");
$db->debug();
예제 #27
0
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Bittytorrent.  If not, see <http://www.gnu.org/licenses/>. 
*/
require $path . '/libs/Smarty.class.php';
require $path . '/libs/db.php';
require $path . '/libs/database/ez_sql_core.php';
require $path . '/libs/database/ez_sql_mysql.php';
require $path . "/libs/categories.class.php";
require $path . '/libs/default.class.php';
require $path . '/libs/SmartyPaginate.class.php';
require $path . '/libs/Hooks.class.php';
$db = new ezSQL_mysql($dbuser, $dbpass, $dbname, $dbhost);
$smarty = new Smarty();
$hook = new phphooks();
$startUp = new Bittytorrent();
$conf = $startUp->getConfigs();
$startUp->I18n();
require $path . '/libs/lang/lang_' . $_SESSION['strLangue'] . '.php';
// Smarty config
$smarty->addPluginsDir($path . '/libs/plugins/');
// $smarty->template_dir = $path.'/themes/v2/';
$smarty->template_dir = $path . '/themes/' . $conf['theme'] . '/';
$smarty->compile_dir = $path . '/libs/cache/compile_tpl/';
$smarty->cache_dir = $path . '/libs/cache/';
$smarty->debugging = false;
//$smarty->caching = $conf['timecache'];
$smarty->caching = false;
예제 #28
0
<?php

// ezSQL
require_once 'libs/ez_sql_core.php';
require_once 'libs/ez_sql_mysql.php';
// Zebra Pagination
require_once 'libs/Zebra_Pagination.php';
$conn = new ezSQL_mysql('root', '', 'jvs_tutoriales');
$total_paises = $conn->get_var('SELECT count(*) FROM paises');
$resultados = 6;
$paginacion = new Zebra_Pagination();
$paginacion->records($total_paises);
$paginacion->records_per_page($resultados);
// Quitar ceros en numeros con 1 digito en paginacion
$paginacion->padding(false);
$paises = $conn->get_results('SELECT * FROM paises LIMIT ' . ($paginacion->get_page() - 1) * $resultados . ', ' . $resultados);
?>
<!DOCTYPE html>
<html lang="es">
	<head>
		<meta charset="utf-8">
		<title>JV Software | Tutorial 14</title>
		<link rel="stylesheet" href="http://twitter.github.com/bootstrap/1.4.0/bootstrap.min.css">
		<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
		<style>
			.mostrar-mas {
				text-align: center;
				background-color: #D9EDF7;
				border: 1px solid #BCE8F1;
			}
			.mostrar-mas a {
예제 #29
0
<?php

/**********************************************************************
 *  ezSQL initialisation for mySQL
 */
// Include ezSQL core
include_once "../shared/ez_sql_core.php";
// Include ezSQL database specific component
include_once "ez_sql_mysql.php";
// Initialise database object and establish a connection
// at the same time - db_user / db_password / db_name / db_host
$db = new ezSQL_mysql('db_user', 'db_password', 'db_name', 'db_host');
/**********************************************************************
 *  ezSQL demo for mySQL database
 */
// Demo of getting a single variable from the db
// (and using abstracted function sysdate)
$current_time = $db->get_var("SELECT " . $db->sysdate());
print "ezSQL demo for mySQL database run @ {$current_time}";
// Print out last query and results..
$db->debug();
// Get list of tables from current database..
$my_tables = $db->get_results("SHOW TABLES", ARRAY_N);
// Print out last query and results..
$db->debug();
// Loop through each row of results..
foreach ($my_tables as $table) {
    // Get results of DESC table..
    $db->get_results("DESC {$table['0']}");
    // Print out last query and results..
    $db->debug();
예제 #30
0
        Toro::serve(array("/hello" => "HelloHandler", "/tpl/admin/(.*)" => "TplAdminHandler", "/(.*)" => "DefaultHandler"));
    } else {
        if ($_SERVER["HTTP_HOST"] == "test03.tmp0230.ml" || $_SERVER["HTTP_HOST"] == "test03.vlan") {
            define('PATCHPATH', EXTRAPATH . 'patch4mall/');
            require_once COMMONPATH . 'init.php';
            require_once PATCHPATH . 'patch.php';
            //$mydb = new ezSQL_mysql(MYDB_USER,  MYDB_PASSWORD, MYDB_NAME, MYDB_HOST);
            $mydb = new ezSQL_mysql('root', 'root', 'db_test_extra3', 'localhost');
            Toro::serve(array("/hello" => "HelloHandler", "/api/picasa/(.*)" => "ApiPicasaHandler", "/tpl/admin/(.*)" => "TplAdminHandler", "/tpl/test/(.*)" => "TplTestHandler", "/api/data/(.*)" => "ApiDataHandler", "/(.*)" => "DefaultHandler"));
        } else {
            if ($_SERVER["HTTP_HOST"] == "test04.tmp0230.ml" || $_SERVER["HTTP_HOST"] == "test04.vlan") {
                define('PATCHPATH', EXTRAPATH . 'patch4mall-2/');
                require_once COMMONPATH . 'init.php';
                require_once PATCHPATH . 'patch.php';
                //$mydb = new ezSQL_mysql(MYDB_USER,  MYDB_PASSWORD, MYDB_NAME, MYDB_HOST);
                $mydb = new ezSQL_mysql('root', 'root', 'db_test_extra4', 'localhost');
                Toro::serve(array("/hello" => "HelloHandler", "/api/picasa/(.*)" => "ApiPicasaHandler", "/tpl/admin/(.*)" => "TplAdminHandler", "/tpl/test/(.*)" => "TplTestHandler", "/api/data/(.*)" => "ApiDataHandler", "/(.*)" => "DefaultHandler"));
            }
        }
    }
}
//d($_SERVER["HTTP_HOST"]);
// patch for character seting in ezSQL  ----20150814
$mydb->query("SET NAMES 'utf8'");
// patch , for fix the bug tha wordpress cannot been require in functions  ----20150715
if ($wp_flag) {
    require_once "wp-index.php";
}
//echo $wp_flag;
// patch end
?>