Exemplo n.º 1
0
 static function setNotification($bookingId, $oneWeek, $threeDays, $oneDay)
 {
     $mysql = new MySQL();
     if (self::getNotification($bookingId) === null) {
         $results = $mysql->query('INSERT INTO notification(booking_id, one_week, three_days, one_day) VALUES (:booking_id, :one_week, :three_days, :one_day)', [':booking_id' => $bookingId, ':one_week' => $oneWeek, ':three_days' => $threeDays, ':one_day' => $oneDay]);
     } else {
         $results = $mysql->query('UPDATE notification SET one_week = :one_week, three_days = :three_days, one_day = :one_day WHERE booking_id = :booking_id', [':booking_id' => $bookingId, ':one_week' => $oneWeek, ':three_days' => $threeDays, ':one_day' => $oneDay]);
     }
     return $results['success'];
 }
Exemplo n.º 2
0
 /**
  * Добавить ключ если он не сущетсует или изменить его значение
  * 
  * @param mixed $key
  * @param string $value
  */
 public static function setKey($key, $value)
 {
     $value = serialize($value);
     self::dbConnector();
     try {
         self::$_sql->query("INSERT INTO `REGISTRY` VALUES ('{$key}','{$value}')");
     } catch (Exception $ex) {
         self::$_sql->query("UPDATE `REGISTRY` SET `value_serealized`='{$value}' WHERE `key`='{$key}'");
     }
 }
 /**
  *  Query database.  Retrun all values from a table
  *
  *  @param $table     String   Table name
  *
  *  @returns   Object   Database records.  MySQL object
  */
 public function checkNeededDataGoogleSearchAnalytics($website)
 {
     $core = new Core();
     //Load core
     $mysql = new MySQL();
     //Load MySQL
     $now = $core->now();
     /* Identify date range */
     $dateStartOffset = self::GOOGLE_SEARCH_ANALYTICS_MAX_DATE_OFFSET + self::GOOGLE_SEARCH_ANALYTICS_MAX_DAYS;
     $dateStart = date('Y-m-d', strtotime('-' . $dateStartOffset . ' days', $now));
     $dateEnd = date('Y-m-d', strtotime('-' . self::GOOGLE_SEARCH_ANALYTICS_MAX_DATE_OFFSET . ' days', $now));
     /* Query database for dates with data */
     $query = "SELECT COUNT( DISTINCT date ) AS record, date FROM " . MySQL::DB_TABLE_SEARCH_ANALYTICS . " WHERE domain LIKE '" . $website . "' AND date >= '" . $dateStart . "' AND date <= '" . $dateEnd . "' GROUP BY date";
     $result = $mysql->query($query);
     /* Create array from database response */
     $datesWithData = array();
     foreach ($result as $row) {
         array_push($datesWithData, $row['date']);
     }
     /* Get date rante */
     $dates = $core->getDateRangeArray($dateStart, $dateEnd);
     /* Loop through dates, removing those with data */
     foreach ($dates as $index => $date) {
         if (in_array($date, $datesWithData)) {
             unset($dates[$index]);
         }
     }
     /* Reindex dates array */
     $dates = array_values($dates);
     $returnArray = array('dateStart' => $dateStart, 'dateEnd' => $dateEnd, 'datesWithNoData' => $dates);
     return $returnArray;
 }
Exemplo n.º 4
0
 private static function testTemplateType()
 {
     if (self::$clanData['premiumBis'] < time()) {
         if (!empty(self::$clanData['useStandartDesign'])) {
             echo "Eigenes Standart Design ";
         } else {
             Template::init("templates/standart_stylecheet.css");
             Template::replace("{header_height}", self::$clanData['designset_headerheight']);
             Template::set("Content-Type: text/css");
             echo Template::out();
         }
     } else {
         MySQL::query("SELECT * FROM `inhalte` WHERE `template`='1' AND `templateType`='5'");
         if (MySQL::count()) {
             MySQL::query("SELECT * FROM `inhalte` WHERE `template`='1' AND `templateType`='6'");
             if (MySQL::count()) {
                 $row = MySQL::fetchArray();
                 Template::init(NULL, true, $row['inhalt']);
                 Template::replace("{header_height}", self::$clanData['designset_headerheight']);
                 Template::set("Content-Type: text/css");
                 echo Template::out();
             }
         } else {
             echo "Premium Standart";
         }
     }
 }
Exemplo n.º 5
0
 private static function testTemplateType()
 {
     if (self::$clanData['data']['premiumBis'] < time()) {
         if (!empty(self::$clanData['data']['useStandartDesign'])) {
             echo "Eigenes Standart Design ";
         } else {
             Template::init("templates/standart.html");
             Template::replace("</head>", "\n" . Template::leerzeichen("<title>") . '<link rel="stylesheet" type="text/css" href="http://myclankonto.net/' . self::$routerData['clanid'] . '/stylecheet.css" />' . "\n" . Template::leerzeichen("<head>") . '</head>');
             Template::replaceContent("{seiteninhalt}", "pages/site/" . self::$routerData['site'] . ".php");
             Template::replace("{title}", self::$clanData['data']['pageTitle']);
             echo Template::out();
         }
     } else {
         MySQL::query("SELECT * FROM `inhalte` WHERE `clanid`='" . self::$routerData['clanid'] . "' AND `template`='1' AND `templateType`='5'");
         if (MySQL::count() == 1) {
             $row = MySQL::fetchArray();
             Template::init(NULL, true, $row['inhalt']);
             MySQL::query("SELECT * FROM `inhalte` WHERE `template`='1' AND `templateType`='6'");
             if (MySQL::count()) {
                 Template::replace("</head>", "\n" . Template::leerzeichen("<title>") . '<link rel="stylesheet" type="text/css" href="http://myclankonto.net/' . self::$routerData['clanid'] . '/stylecheet.css" />' . "\n" . Template::leerzeichen("<head>") . '</head>');
             }
             Template::replaceContent("{seiteninhalt}", "pages/site/" . self::$routerData['site'] . ".php");
             Template::replace("{title}", self::$clanData['data']['pageTitle']);
             echo Template::out();
         } else {
             echo "Premium Standart";
         }
     }
 }
Exemplo n.º 6
0
 public static function createEntity($identifier, $friendlyname, $lat, $lon)
 {
     $db = new MySQL();
     $sql = 'INSERT INTO entities ';
     $sql .= '(`ID`, `IDENTIFIER`, `FRIENDLYNAME`, `LATITUDE`, `LONGITUDE`, `DATETIME`, `DETACHED`) ';
     $sql .= 'VALUES (\'\', %s, %s, %s, %s, NOW(), 0);';
     return $db->query($sql, $identifier, $friendlyname, $lat, $lon);
 }
Exemplo n.º 7
0
 /**
  * Get a specific rating
  *
  * @param $offerId
  * @param $userId
  * @return null
  */
 static function getRating($offerId, $userId)
 {
     $mysql = new MySQL();
     $results = $mysql->query('SELECT * FROM rating WHERE offer = :offer AND createdby = :createdby', [':offer' => $offerId, ':createdby' => $userId]);
     if ($results['success'] == true && !empty($results['results']) && $results['results'] != null) {
         return $results['results'];
     }
     return null;
 }
Exemplo n.º 8
0
 /**
  * Creates a non attendance record for a booking id
  *
  * @param $bookingId
  * @param $workshopId
  * @return bool
  */
 public static function createNonAttendance($bookingId, $workshopId)
 {
     if (self::getAttendance($bookingId) != null) {
         return false;
     }
     $mysql = new MySQL();
     $results = $mysql->query('INSERT INTO attendance(booking_id, workshop_id, student_id, attendance, learnt, taught, datecompleted) VALUES (:booking_id, :workshop_id, :student_id, :attendance, :learnt, :taught, :datecompleted)', [':booking_id' => $bookingId, ':workshop_id' => $workshopId, ':student_id' => User::getId(), ':attendance' => 0, ':learnt' => 'DID NOT ATTEND', ':taught' => 'DID NOT ATTEND', ':datecompleted' => time()]);
     if ($results['success']) {
         return true;
     }
     return false;
 }
Exemplo n.º 9
0
 public static function getSiteData($siteId = NULL)
 {
     if ($siteId == NULL) {
         throw new Exeption("siteData::getSiteData() haven't become an Siteid.");
     } else {
         MySQL::query("SELECT * FROM `webseiten` WHERE `clanid`='" . $siteId . "'");
         if (MySQL::count() != 1) {
             return array("success" => false, "error" => "Die Webseite mit der ID " . $siteId . " existiert nicht.");
         } else {
             return array("success" => true, "data" => MySQL::fetchArray());
         }
     }
 }
Exemplo n.º 10
0
 /**
  * Получает список дочерних разделов с учётом поля show_sub таблицы URL
  * 
  * @return Array
  */
 public function getSubSection()
 {
     $r = $this->_sql->query("SELECT `link`,`title` FROM `URL` WHERE `pid`={$this->_currentID} AND `module`!=0");
     $t = $this->_sql->GetRows($r);
     $bitOfString = $this->url = substr($_SERVER['REQUEST_URI'], 1);
     $resArr = NULL;
     if ($t != NULL) {
         foreach ($t as $value) {
             $resArr[] = array("link" => $value["link"] = "/" . $bitOfString . $value["link"] . "/", "title" => $value["title"]);
         }
     }
     return $resArr;
 }
Exemplo n.º 11
0
function del($src, $dst)
{
    $mysql = new MySQL();
    $mysql->opendb("dns_http_ref", "utf8");
    #$sql = "update `http_ref` set `status` = 'false' where `dst`='$dst' and `src`='$src'";
    $sql = "delete from `http_ref` where `dst`='{$dst}' and `src`='{$src}'";
    $result = $mysql->query($sql);
    if ($result) {
        $ret = 0;
    } else {
        $ret = 1;
    }
    print_r(json_encode(result_init($ret, '', '')));
}
Exemplo n.º 12
0
 public function update($record_id)
 {
     if (empty($db)) {
         $dbConnection = new dbConnection();
         $db = new MySQL($dbConnection->host, $dbConnection->userdb, $dbConnection->pass, $dbConnection->dbname);
     }
     $column_value_array = array_combine($this->my_columns_array, $this->my_values_array);
     $update_string = '';
     foreach ($column_value_array as $column => $value) {
         $value = strip_tags(mysqli_real_escape_string($db->dbConn, $value));
         $update_string .= $column . "='" . $value . "',";
     }
     $update_string = trim($update_string, ",");
     $sql = "UPDATE " . $this->my_table . " SET {$update_string} WHERE " . $this->my_table . "_id = {$record_id}";
     $results = $db->query($sql);
     return TRUE;
 }
Exemplo n.º 13
0
function t($str)
{
    global $CONF;
    //if in maintainance mode, record this string in the translation db
    if ($CONF['maintainer_mode']) {
        require_once 'pastebin/mysql.class.php';
        $db = new MySQL();
        $db->query("select * from original_phrase where original=?", $str);
        if ($db->next_record()) {
            //update timestamp
            $original_phrase_id = $db->f('original_phrase_id');
            $db->query("update original_phrase set used=now() where original_phrase_id={$original_phrase_id}");
        } else {
            //create new record
            $db->query("insert into original_phrase(original,used) values (?, now())", $str);
        }
    }
    //if using english ui, just return the string
    //if a translation is available, use that
    //otherwise, use english
    return $str;
}
Exemplo n.º 14
0
 public static function initCheck($domain = "myclankonto.net", $did = 1)
 {
     $subdomain = $_SERVER['HTTP_HOST'];
     $subdomain = preg_replace("/\\." . $domain . "/Usi", "", $subdomain);
     $subdomain = preg_replace("/www\\./Usi", "", $subdomain);
     $subdomain = strtolower($subdomain);
     if ($subdomain != $domain) {
         MySQL::query("SELECT * FROM `subdomains` WHERE `domainID`='" . $did . "' AND `host`='" . $subdomain . "'");
         if (MySQL::count() == 0) {
             echo "null mysql";
             die;
         } else {
             $row = MySQL::fetchArray();
             if ($row['status']) {
                 header("Location: http://myclankonto.net/" . $row['clanid'] . "/site/intro/");
                 die;
             } else {
                 echo "pff";
                 die;
             }
         }
     }
 }
Exemplo n.º 15
0
// Includo le classi principali
include_once "../core/class.Ocarina.php";
include_once "../core/class.MySQL.php";
include_once "../core/class.Functions.php";
include_once "../rendering/config.php";
// Istanzio le classi
$cms = new Ocarina();
$db = new MySQL();
$func = new Functions();
if (!isset($_GET['nickname']) and !isset($_POST['nickname'])) {
    $text = '<form action="" method="post">
Utente:<br /><select name="nickname">';
    // Mi connetto al database
    $db->connettidb();
    // Creo una select con tutte le categorie
    $query = $db->query("SELECT nickname FROM utenti");
    while ($riga = $db->estrai($query)) {
        $text .= '<option value="' . $func->rescape($riga->nickname) . '">' . $func->rescape($riga->nickname) . '</option>';
    }
    // Mi disconnetto dal database
    $db->disconnettidb();
    $text .= '</select><input type="submit" name="submit" value="Accedi">
</form>';
    $nickname = 'Profilo';
    // Per il titolo della pagina
} elseif (isset($_GET['nickname']) or isset($_POST['nickname'])) {
    // Prelevo il nickname
    if ($_GET['nickname']) {
        $nickname = $func->escape($_GET['nickname']);
    } elseif ($_POST['nickname']) {
        $nickname = $func->escape($_POST['nickname']);
Exemplo n.º 16
0
include_once "core/class.Ocarina.php";
include_once "core/class.MySQL.php";
include_once "core/class.Functions.php";
include_once "rendering/config.php";
// Istanzio le classi
$cms = new Ocarina();
$db = new MySQL();
$func = new Functions();
// Se si richiede la ricerca esegue
if (isset($_POST['keyword']) && $_POST['keyword'] !== '') {
    // Prelevo la keyword
    $keyword = $func->escape($_POST['keyword']);
    // Mi connetto al database
    $db->connettidb();
    // Effetto le query
    $query = $db->query("SELECT DISTINCT titolo,minititolo FROM pagine WHERE titolo LIKE '%" . $keyword . "%' OR contenuto LIKE '%" . $keyword . "%';");
    $query2 = $db->query("SELECT DISTINCT titolo,minititolo FROM news WHERE titolo LIKE '%" . $keyword . "%' OR news LIKE '%" . $keyword . "%';");
    $conta = $db->conta($query);
    $conta2 = $db->conta($query2);
    // Se non ci sono risultati
    if ($conta <= 0 and $conta2 <= 0) {
        $errore = 'Nessun risultato per la keyword immessa.';
        // Visualizzo la pagina di errore
        $smarty->assign("titolo", "Nessun risultato per la keyword immessa &raquo; " . $cms->nomesito());
        // Titolo della pagina
        $smarty->assign("errore", $errore);
        // Il contenuto della pagina
        $smarty->assign("description", $cms->description());
        // La descrizione
        $smarty->assign("keywords", $cms->keywords());
        // Le keywords
Exemplo n.º 17
0
 /**
  * Decline an offer
  *
  * @param $id
  * @return mixed
  */
 static function declineOffer($id)
 {
     $mysql = new MySQL();
     $results = $mysql->query('UPDATE offer SET status = 2 WHERE id = :id', [':id' => $id]);
     return $results['success'];
 }
Exemplo n.º 18
0
<?php

if (!$_GET['ID']) {
    error('导入配置编号不能为空!');
}
if (!is_numeric($_GET['ID'])) {
    error('导入配置编号只能是数字!');
}
$sql = 'SELECT * ';
$sql .= 'FROM ' . TB_DB2DB . ' ';
$sql .= 'WHERE id = ' . $_GET['ID'];
$db = new MySQL(DB_SERVER, DB_USER, DB_PASSWORD, DB_DATABASE);
$rs = $db->query($sql);
$rs->next_record();
if (!$rs) {
    error('没有找到需要的导入配置');
}
if (!$_GET['action']) {
    $tp->set_templatefile('templates/db_cfg_copy.html');
    $tp->assign('id', $rs->get('id'));
    $tp->assign('cfgname', $rs->get('name'));
    $moduleTemplate = $tp->result();
    $moduleTitle = '复制导入配置';
    $db->disconnect();
} else {
    $configName = trim($_POST['configname']);
    if (!$_POST['configname']) {
        error('请输入配置名称');
    }
    $sourceArray = $rs->getarray();
    foreach ($sourceArray as $key => $val) {
Exemplo n.º 19
0
 /**
  * Open an advertisement
  *
  * @param $id
  * @return mixed
  */
 static function open($id)
 {
     $mysql = new MySQL();
     $results = $mysql->query('UPDATE advertisement SET status = 1 WHERE id = :id', [':id' => $id]);
     return $results['success'];
 }
Exemplo n.º 20
0
<?php

session_start();
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
require_once "../config/config.inc.php";
$challenge = new Challenge();
if (isset($_POST['m'])) {
    $mail = util::getPost('m');
    $db = new MySQL(HOST, DB_USER, DB_PASSWORD, DB_NAME);
    $sql = "SELECT mfrom,mto,msubject,mbody,mdate FROM mailbox m,players u WHERE u.id=m.userid AND u.name='" . $challenge->getUser() . "' AND m.mailid={$mail}";
    // echo $sql;
    $result = $db->query($sql);
    $row = $result->fetch();
    extract($row);
    $text = <<<EOT
    <div  id="message">
            <!-- mail starts here -->
            <table id="mailheader" cellpadding="15" cellspacing="3">
                <tr><td align="right">To:</td><td>&nbsp;</td><td>{$mto}</td></tr>
                <tr><td align="right">From:</td><td>&nbsp;</td><td>{$mfrom}</td></tr>
                <tr><td align="right">Date:</td><td>&nbsp;</td><td>{$mdate}</td></tr>
                <tr><td align="right">Subject:</td><td>&nbsp;</td><td>{$msubject}</td></tr>
            </table>
            <hr/>
            <div id="mailbody">{$mbody}</div>
            <!-- mail ends here -->
        </div>
EOT;
Exemplo n.º 21
0
<?php

/**
        Author: SpringHack - springhack@live.cn
        Last modified: 2015-12-29 12:21:13
        Filename: expert.common.php
        Description: Created by SpringHack using vim automatically.
**/
require_once 'MySQL.class.php';
$db = new MySQL();
if ($db->query("SHOW TABLES LIKE 'Expert'")->num_rows() != 1) {
    $db->struct(array('school' => 'text', 'user_id' => 'text', 'user_pw' => 'text', 'name' => 'text', 'birthday' => 'text', 'nation' => 'text', 'sex' => 'text', 'what' => 'text', 'job' => 'text', 'job_name' => 'text', 'job_level' => 'text', 'job_what' => 'text', 'tele' => 'text', 'cell' => 'text', 'last_a' => 'text', 'last_b' => 'text', 'last_c' => 'text', 'for' => 'text', 'addr' => 'text', 'code' => 'text', 'email' => 'text', 'sub' => 'text', 'work' => 'text', 'rise' => 'text', 'area' => 'text', 'service' => 'text', 'time' => 'text'))->create("Expert");
}
Exemplo n.º 22
0
<?php

/**
        Author: SpringHack - springhack@live.cn
        Last modified: 2015-12-20 12:59:18
        Filename: user.common.php
        Description: Created by SpringHack using vim automatically.
**/
require_once 'MySQL.class.php';
$db = new MySQL();
if ($db->query("SHOW TABLES LIKE 'User'")->num_rows() != 1) {
    $db->struct(array('id' => 'text', 'user' => 'text', 'pass' => 'text', 'nick' => 'text', 'power' => 'text', 'birthday' => 'text', 'school' => 'text', 'use' => 'text'))->create("User");
    $db->value(array('id' => '0', 'user' => 'admin', 'pass' => 'admin', 'nick' => '管理员', 'power' => '0', 'birthday' => '0', 'school' => 'none', 'use' => 'yes'))->insert("User");
}
@session_start();
Exemplo n.º 23
0
$page = isset($_GET["page"]) && preg_match("/^[0-9]+\$/", $_GET["page"]) ? $_GET["page"] : 0;
$user_file = "/etc/mysql-user/user5000.ini";
if ($fp_user = fopen($user_file, "r")) {
    $userName = rtrim(fgets($fp_user));
    $password = rtrim(fgets($fp_user));
    $database = rtrim(fgets($fp_user));
} else {
    die("接続設定の読み込みに失敗しました");
}
$mysql = new MySQL($userName, $password, $database);
if ($mysql->connect_error) {
    die("データベースの接続に失敗しました");
}
// 掲示板情報を取得
$sql = "UPDATE `board` SET `access_cnt`=`access_cnt`+1 WHERE `name`='{$id}'";
$mysql->query($sql);
$sql = "SELECT * FROM `board` WHERE `name`='{$id}'";
$result = $mysql->query($sql);
if (!$result->num_rows) {
    die("ERROR03:存在しないIDです");
}
$board = new Board($result->fetch_array());
$title = $board->title;
// スレッド数を取得
$sql = "SELECT COUNT(1) AS `count` FROM `thread` WHERE `bid`='{$board->bid}'";
$result = $mysql->query($sql);
if ($mysql->error) {
    die("ERROR04:存在しないIDです");
}
$array = $result->fetch_array();
$rows = $array["count"];
Exemplo n.º 24
0
<?php

$db = new MySQL(DB_SERVER, DB_USER, DB_PASSWORD, DB_DATABASE);
if (!trim($_GET['action'])) {
    $sql = 'SELECT id, name ';
    $sql .= 'FROM ' . TB_RULES . ' ';
    $sql .= 'ORDER BY id DESC';
    $rs = $db->query($sql);
    $i = 0;
    while ($rs->next_record()) {
        $list['option'][$i]['rulesID'] = $rs->get('id');
        $list['option'][$i]['rulesName'] = $rs->get('name');
        $rs->get('id') == $_GET['rules'] ? $list['option'][$i]['rulesSelected'] = ' selected' : ($list['option'][$i]['rulesSelected'] = '');
        ++$i;
    }
    $tp->set_templatefile('templates/body_img_collection_form.html');
    $tp->assign($list);
    $tp->assign('display_markall', 'none');
    $tp->assign('display_mark_text', 'block');
    $tp->assign('display_mark_image', 'none');
    $tp->assign('rulesID', $_GET['rules']);
    $moduleTemplate = $tp->result();
    $moduleTitle = '文章图片采集';
} else {
    if ($_GET['action'] == 'getReady') {
        if (!$_POST['eachTimes']) {
            error('请您输入每次采集的条数');
        }
        if (!is_numeric($_POST['eachTimes'])) {
            error('每次采集条数只能是数字');
        }
Exemplo n.º 25
0
    $smarty->assign("url_cms", $cms->url_cms());
    $smarty->assign("url_smartytpl", $cms->url_smartytpl());
    $smarty->assign("cmsversion", $cms->cmsversion());
    $smarty->display("admin/index/index2.tpl");
    exit;
}
/* START */
// Prelevo il nickname
$nickname = $db->nickname($_COOKIE[$func->cookie()]);
if (isset($_POST['modificaprofilo'])) {
    $email = $func->escape($_POST['email']);
    $avatar = $func->escape($_POST['avatar']);
    // Modifico il profilo
    $db->connettidb();
    // Mi connetto al database
    $query = $db->query("UPDATE utenti SET email='{$email}', avatar='{$avatar}' WHERE nickname='{$nickname}'");
    $db->disconnettidb();
    // Mi disconnetto dal database
    // Visualizzo la pagina
    $text = 'Il tuo profilo è stato modificato.';
    $smarty->assign("titolo", "Modifica profilo");
    $smarty->assign("contents", $text);
    $smarty->assign("url_cms", $cms->url_cms());
    $smarty->assign("url_smartytpl", $cms->url_smartytpl());
    $smarty->assign("cmsversion", $cms->cmsversion());
    $smarty->display("admin/index/index2.tpl");
    exit;
}
// Stampo i dati attuali
if (!isset($_POST['modificaprofilo'])) {
    $db->connettidb();
Exemplo n.º 26
0
            fclose($confFileHandler);
            /* Include resources */
            include_once 'inc/code/core.php';
            //Core functions
            include_once 'inc/code/mysql.php';
            //Database Connection
            $core = new Core();
            //Load core
            $mysql = new MySQL();
            //Load MySQL
            require_once $GLOBALS['basedir'] . 'config/config.php';
            //Credentials & Configuration
            $GLOBALS['db'] = $core->mysql_connect_db();
            // Connect to DB
            $query = "ALTER TABLE `search_analytics` CHANGE `ctr` `ctr` FLOAT NOT NULL";
            $result = $mysql->query($query);
            $alert = array("type" => "success", "message" => "Upgrade performed succesfully.");
            break;
    }
}
?>


	<?php 
include_once 'inc/html/_alert.php';
?>
	<h1>Organic Search Analytics | Upgrade</h1>
	<div>Certain versions require special consideration when upgrading.  This page will take care of technical changes that need to be made.</div>
	<ul>
		<li>
			<h2>Version 1.x to 2.0.0</h2>
Exemplo n.º 27
0
<?php

// Подключение настроек;
include $_SERVER['DOCUMENT_ROOT'] . '/config.php';
// Подключение библиотеки MySQL;
include $_SERVER['DOCUMENT_ROOT'] . '/mysql.php';
// Создание объекта MySQL;
$db = new MySQL();
$db->connect($db_host, $db_name, $db_user, $db_password);
$db->query("SET NAMES `UTF8`");
// Подключение дополнительных функций;
include $_SERVER['DOCUMENT_ROOT'] . '/functions.php';
Exemplo n.º 28
0
<?
/*
 * Sintaxe: table nome da tabela onde procurar a imagem id id da imagem
 * typeField nome do campo tipo da imagem imgField nome do campo onde está a
 * imagem - blob
 */
error_reporting ( E_ALL );
include_once ("classes.inc.php");
$db = new MySQL ();
$db->open ();
$sql = "SELECT *
FROM " . $_REQUEST ['table'] . "
WHERE id_" . $_REQUEST ['table'] . "='" . $_REQUEST ['id'] . "'";
$db->query ( $sql );
$varTabela = $db->result ( 0, $_REQUEST ['typeField'] );
header ( "Content-type: $varTabela" );
echo $db->result ( 0, $_REQUEST ['imgField'] );
$db->close ();
?>
Exemplo n.º 29
0
        $XMLContent .= str_repeat(' ', $depth - 1) . '</' . $CNTag[$endMark] . '>
';
    }
}
$CNTag = array('nc_dbexport_config' => '易采_采集器数据库配置', 'information' => '配置信息', 'version' => '软件版本', 'config_name' => '配置名称', 'author' => '作者名字', 'contact' => '联系方式', 'readme' => '导出说明', 'date' => '导出时间', 'access' => '数据库设置', 'access_type' => '数据库类型', 'access_host' => '数据库地址', 'access_user' => '数据库用户', 'access_pass' => '数据库密码', 'access_dbname' => '数据库名称', 'otherdb' => '导出数据库设置', 'otherdb_table' => '导出数据库对应表', 'otherdb_fields' => '导出数据库对应字段', 'otherdb_rules' => '导出数据库对应关系');
if (!$_GET['ID']) {
    error('导出的配置编号不能为空!');
}
if (!is_numeric($_GET['ID'])) {
    error('导出的配置编号只能是数字!');
}
$sql = 'SELECT * ';
$sql .= 'FROM ' . TB_DB2DB . ' ';
$sql .= 'WHERE id = ' . $_GET['ID'];
$db = new MySQL(DB_SERVER, DB_USER, DB_PASSWORD, DB_DATABASE);
$rs = $db->query($sql);
$rs->next_record();
if (!$rs) {
    error('找不到编号为' . $_GET['ID'] . '的数据库导出配置');
}
if (!$_GET['action']) {
    $tp->set_templatefile('templates/db_cfg_export.html');
    $tp->assign('id', $rs->get('id'));
    $tp->assign('config_name', $rs->get('name'));
    $moduleTemplate = $tp->result();
    $moduleTitle = '数据库导出配置';
    $db->disconnect();
} else {
    $configName = trim($_POST['configname']);
    if (!$_POST['config_name']) {
        error('请输入配置名称');
Exemplo n.º 30
0
// Istanzio le classi
$cms = new Ocarina();
$db = new MySQL();
$func = new Functions();
// Prima di procedere controllo se l' utente è già loggato
if ($func->logged() == 0) {
    $text = 'Non risulti loggato, non hai bisogno di effettuare il logout.';
    // Visualizzo la pagina
    $smarty->assign("titolo", "Logout");
    $smarty->assign("cookie", $db->auth($_COOKIE[$func->cookie()]));
    $smarty->assign("grado", $db->grado($_COOKIE[$func->cookie()]));
    $smarty->assign("contents", $text);
    $smarty->assign("url_cms", $cms->url_cms());
    $smarty->assign("url_smartytpl", $cms->url_smartytpl());
    $smarty->assign("cmsversion", $cms->cmsversion());
    $smarty->display("admin/index/index2.tpl");
    exit;
}
// Prelevo il codice dal cookie
$codice = $_COOKIE[$func->cookie()];
// Mi connetto al database
$db->connettidb();
// Elimino il codice dal database
$query = $db->query("UPDATE utenti SET codice='' WHERE codice='{$codice}'");
// Mi disconnetto dal database
$db->disconnettidb();
// Effettuo il logout distruggendo il cookie
setcookie($func->cookie(), '', time() - 1, "/");
// Dirigo l' utente verso la index
header("Location: index.php");
exit;