本文整理汇总了PHP中CmsDev\sql\db_Skt::connect方法的典型用法代码示例。如果您正苦于以下问题:PHP db_Skt::connect方法的具体用法?PHP db_Skt::connect怎么用?PHP db_Skt::connect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CmsDev\sql\db_Skt
的用法示例。
在下文中一共展示了db_Skt::connect方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ValidateNameExistAndClean
public static function ValidateNameExistAndClean($string)
{
$UserName = new \CmsDev\util\CheckUserName();
$stringValid = $UserName->Fix($string);
$SKTDB = \CmsDev\Sql\db_Skt::connect();
$user = $SKTDB->get_row("SELECT username FROM users WHERE username = " . \GetSQLValueString($stringValid, 'text') . "");
if ($user) {
return 'exist';
} else {
return $stringValid;
}
}
示例2: Render
private function Render()
{
$SKTDB = SKT_DB\db_Skt::connect();
$Language = \THIS_LANG;
$query = $SKTDB->get_results("SELECT ID,LanguageName,Prefix,URL,SID,Hidden FROM language WHERE Hidden='0' ORDER BY LanguageName ASC");
$counter = $SKTDB->get_var("SELECT count(ID) FROM language");
self::connect($query, $counter);
self::set_Language($Language);
if ($this->counter > 1) {
$Render = $this->Nav_Sub_Items_Before;
foreach ($this->query as $Item) {
if ($this->Language == $Item->Prefix) {
$active = ' class="' . $this->Nav_Class_Item_Selected . '"';
} else {
$active = '';
}
$preitem = $this->item_model;
$item = str_replace('[LanguageName]', $Item->LanguageName, $preitem);
$item = str_replace('[URL]', SKT_URL_BASE . $Item->Prefix . '/', $item);
$item = str_replace('[Prefix]', $Item->Prefix, $item);
$item = str_replace('[activeLang]', $active, $item);
if ($Item->Hidden == 0) {
$Render .= $item;
}
}
$Render .= $this->Nav_Sub_Items_After;
}
return $Render;
}
示例3: __construct
private function __construct()
{
$SKT = SKTGLOBALS::getVar('SKT');
$SKTDB = SKTDB\db_Skt::connect();
$Request = new \CmsDev\Url\Request();
$URLName = $Request->byLevel(0);
$RequestReverse = new \CmsDev\Url\Request();
$RequestReverse->reverse(false);
$testLanguage = $RequestReverse->byLevel(0);
$LanguageArray = $SKT['LANGUAGE']['LIST'];
if (in_array($testLanguage, $LanguageArray)) {
$Language = $testLanguage;
} else {
$Language = \LANGUAGE_DEF;
}
if (\SKT_SECTION_PID != '') {
$ProductsValues = $SKTDB->query("SELECT * FROM " . \DB_PREFIX . "products WHERE ProductID = '" . \SKT_SECTION_PID . "'");
}
$SKTDB->query("SELECT * FROM " . \DB_PREFIX . "products WHERE UID != '0' LIMIT 1");
$query = $SKTDB->get_col_info();
if ($ProductsValues) {
foreach ($query as $name) {
$this->{$name} = $ProductsValues->{$name};
}
} else {
foreach ($query as $name) {
$this->{$name} = '';
}
}
}
示例4: getTableEdit
public static function getTableEdit()
{
$SKTDB = \CmsDev\Sql\db_Skt::connect();
$Language = \CmsDev\Language\CheckLanguage::get();
$query = $SKTDB->get_row("SELECT AdminParams FROM language WHERE Prefix = '" . $Language . "'");
if ($query->AdminParams != '') {
$params = json_decode($query->AdminParams, true);
if (is_array($params)) {
$HTML = '<table><tr><td>Parametro</td><td>Valor</td></tr>';
foreach ($params as $variable => $value) {
if (!is_array($value)) {
$HTML .= '<tr><td>SKT_ADMIN_' . $variable . '</td><td>' . $value . '</td></tr>';
} else {
$NewvalueToArray = \json_encode($value);
$HTML .= '<tr><td>SKT_ADMIN_' . $variable . '</td><td>' . $NewvalueToArray . '</td></tr>';
}
}
$HTML .= '</table>';
return $HTML;
} else {
$ErrorMessageBox = "Error al cargar las variables de sistema en CmsDev\\Language\\getParams(). Puede existir un json mal formado. Verifique la tabla de lenguaje o consulte al Administrador.";
$MessageBox = SKT_INFO\Asistance::get();
$MessageBox->TipError($ErrorMessageBox, true);
//
//$AdminParams=substr($query->AdminParams,strrpos($query->AdminParams,"\"")-200,200);
//echo "<pre>".$AdminParams."</pre>";
}
} else {
self::setParamsFromFile();
}
}
示例5: __construct
private function __construct()
{
if (!defined('DB_PREFIX')) {
define('DB_PREFIX', 'default_');
}
$SKT = SKTGLOBALS::getVar('SKT');
$SKTDB = SKTDB\db_Skt::connect();
$SectionValues = '';
$ParentSectionValues = '';
$Parent_2_SectionValues = '';
$Parent_3_SectionValues = '';
$Parent_4_SectionValues = '';
$Parent_5_SectionValues = '';
// new \_TemplateSite\clean\Config();
// sections // ID Title URLName SID RecycleBin SystemRequired Language Template Order
$SectionValues = $SKTDB->get_row("SELECT * FROM " . \DB_PREFIX . "sections WHERE URLName = '" . \SKTURL_Here . "'");
if (isset($SectionValues->SID) && $SectionValues->SID != '') {
$ParentSectionValues = $SKTDB->get_row("SELECT * FROM " . \DB_PREFIX . "sections WHERE ID = '{$SectionValues->SID}'");
if (isset($ParentSectionValues->SID) && $ParentSectionValues->SID != '') {
$Parent_2_SectionValues = $SKTDB->get_row("SELECT * FROM " . \DB_PREFIX . "sections WHERE ID = '{$ParentSectionValues->SID}'");
if (isset($Parent_2_SectionValues->SID) && $Parent_2_SectionValues->SID != '') {
$Parent_3_SectionValues = $SKTDB->get_row("SELECT * FROM " . \DB_PREFIX . "sections WHERE ID = '{$Parent_2_SectionValues->SID}'");
if (isset($Parent_3_SectionValues->SID) && $Parent_3_SectionValues->SID != '') {
$Parent_4_SectionValues = $SKTDB->get_row("SELECT * FROM " . \DB_PREFIX . "sections WHERE ID = '{$Parent_3_SectionValues->SID}'");
if (isset($Parent_4_SectionValues->SID) && $Parent_4_SectionValues->SID != '') {
$Parent_5_SectionValues = $SKTDB->get_row("SELECT * FROM " . \DB_PREFIX . "sections WHERE ID = '{$Parent_4_SectionValues->SID}'");
}
}
}
}
}
if (!$SectionValues) {
$SectionValues = $SKTDB->get_row("SELECT * FROM " . \DB_PREFIX . "sections WHERE Language = '" . \SKT_ThisLaguage . "' AND SID = '0' ");
if (!$SectionValues) {
$SectionValues = $SKTDB->get_row("SELECT * FROM " . \DB_PREFIX . "sections WHERE SID = '0' AND Language = '" . \SKT_ThisLaguage . "'");
}
if (\SKTURL_Here != '' && \SKTURL_Here != trim(\SKTURL_REQUEST_URI, '/') && !\in_array(\SKTURL_Here, $SKT['LANGUAGE']['LIST']) && !\in_array(\SKTURL_Here, $SKT['SITE']['RESTRICTED_URL'])) {
if (!defined("error")) {
define('error', 'error404');
}
}
}
$IDSections = $SectionValues->ID;
$_SESSION['SessionURLSection'] = $SKTDB->get_var("SELECT URLName FROM " . \DB_PREFIX . "sections WHERE ID = '{$IDSections}'");
if (!defined("SectionHidden")) {
define('SectionHidden', $SectionValues->RecycleBin);
}
$SKTDB->query("SELECT * FROM " . \DB_PREFIX . "sections WHERE SID = '0'");
$query = $SKTDB->get_col_info();
foreach ($query as $name) {
$this->{$name} = $SectionValues->{$name};
}
$this->ParentSectionValues = $ParentSectionValues;
$this->Parent_2_SectionValues = $Parent_2_SectionValues;
$this->Parent_3_SectionValues = $Parent_3_SectionValues;
$this->Parent_4_SectionValues = $Parent_4_SectionValues;
$this->Parent_5_SectionValues = $Parent_5_SectionValues;
}
示例6: getQuery
public static function getQuery($param = null)
{
/* @var $param type */
if ($param) {
$SKTDB = \CmsDev\sql\db_Skt::connect();
$QUERY = "CREATE TABLE `lists` (`ID` int(11) NOT NULL, `ListName` varchar(100) CHARACTER SET latin1 COLLATE latin1_spanish_ci NOT NULL) ENGINE=MyISAM AUTO_INCREMENT=30 DEFAULT CHARSET=latin1;\r\n TRUNCATE TABLE `lists`;\r\n INSERT INTO `lists` (`ID`, `ListName`) VALUES (29, 'Demo'),(28, 'Inmuebles');\r\n ALTER TABLE `lists` ADD PRIMARY KEY (`ID`);\r\n ALTER TABLE `lists` MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=30;";
$insertLink = $SKTDB->query($QUERY);
}
}
示例7: foreach
function __construct()
{
$SKTDB = \CmsDev\Sql\db_Skt::connect();
$categories = $SKTDB->get_results("SELECT * FROM " . \DB_PREFIX . "categories");
foreach ($categories as $Category) {
$ListNames[$Category->category_id] = $Category->category_name;
}
self::$names = $ListNames;
}
示例8: validateMD5
private function validateMD5($MD5 = 0)
{
$SKTDB = SKT_DB::connect();
$user = $SKTDB->get_row("SELECT * FROM users WHERE md5 = " . \GetSQLValueString($MD5, 'text') . "");
if ($user) {
$updateSectionImage = mysql_query(sprintf("UPDATE users Set \r\n\t\t\t\t\t\t\tisactive = %s\r\n\t\t\t\t\t\t\tWHERE md5 = %s", GetSQLValueString(1, "int"), GetSQLValueString($MD5, "text")));
return true;
} else {
$MessageBox = SKT_INFO\Asistance::get();
$MessageBox->TipError('No se pudo validar el usuario.<br>' . $MD5, true);
return false;
}
}
示例9: setParamsFromFile
private static function setParamsFromFile()
{
$SKTDB = \CmsDev\Sql\db_Skt::connect();
$query = $SKTDB->get_results("SELECT * FROM language ORDER BY LanguageName ASC");
global $SKT;
foreach ($query as $language) {
include 'site/' . $language->Prefix . '.php';
$Setparams = $SKTDB->query(\sprintf("UPDATE language Set SiteParams = %s\r\n\t\tWHERE ID = %s", GetSQLValueString(json_encode($SKT), "text"), GetSQLValueString($language->ID, "int")));
//$MessageBox = SKT_INFO\Asistance::get();
//$MessageBox->TipOk('El archivo Language/site/' . $language->Prefix . '.php, fue cargado correctamente.', true);
}
//self::getParams();
}
示例10: isset
function __construct($user, $SERVER, $POST, $GET)
{
$SKTDB = \CmsDev\Sql\db_Skt::connect();
$user = $user;
$url = !empty($SERVER['HTTPS']) ? "https://" . $SERVER['SERVER_NAME'] . $SERVER['REQUEST_URI'] : "http://" . $SERVER['SERVER_NAME'] . $SERVER['REQUEST_URI'];
$previousUrl = isset($SERVER['HTTP_REFERER']) ? $SERVER['HTTP_REFERER'] : '0';
$postData = json_encode($POST);
$now = date("Y-m-d H:i:s");
$product = isset($GET['DetailID']) ? $GET['DetailID'] : '';
$search = isset($GET['SearchQuery']) ? $GET['SearchQuery'] : '';
$query = "INSERT INTO userstep" . "(user, previous_page, url_query_string, post_param, date_time, product, search )" . "VALUES (" . GetSQLValueString($user, 'int') . "," . GetSQLValueString($previousUrl, 'text') . "," . GetSQLValueString($url, 'text') . "," . GetSQLValueString($postData, 'text') . "," . GetSQLValueString($now, 'text') . "," . GetSQLValueString($product, 'int') . "," . GetSQLValueString($search, 'text') . ")";
$insert = $SKTDB->query($query);
}
示例11: UserQuery
private static function UserQuery()
{
$SKTDB = SKT_DB::connect();
$USER_EXIST = \CmsDev\Security\loginIntent::action('validateUser');
if ($USER_EXIST === true) {
$user_row = $SKTDB->get_row("SELECT *\r\n FROM users as user, userprofile as profile \r\n WHERE user.md5 = " . \GetSQLValueString($_SESSION['login'], 'text') . " AND profile.IDX = user.id ");
if ($user_row) {
return $user_row;
} else {
return false;
}
} else {
return false;
}
}
示例12: set
public function set($PositionSelect = null, $SID = null)
{
if ($PositionSelect !== null && $SID !== null) {
$randomID = 'Position' . \md5(\rand(1000, 99999));
$SID = \GetSQLValueString($SID, 'int');
$SKTDB = \CmsDev\Sql\db_Skt::connect();
$total = $SKTDB->get_var("SELECT count(*) FROM " . \DB_PREFIX . "sections WHERE Language = '" . \THIS_LANG . "' AND SID = '{$SID}'");
if (!isset($PositionSelect) or $PositionSelect == null) {
$PositionSelect = 0;
} elseif ($PositionSelect === 'max') {
$PositionSelect = $total + 1;
}
$this->HTML .= '<input name="Position" id="' . $randomID . '" type="text" value="' . $PositionSelect . '" />';
$this->HTML .= '<script type="text/javascript">';
$this->HTML .= '$("#' . $randomID . '").spinner({step: 1,numberFormat: "n", min: 0, max: ' . ($total + 1) . '});';
//$this->HTML .= 'alert("$total =' . $total . ' y $SID =' . $SID . ' y $PositionSelect =' . $PositionSelect . '");';
$this->HTML .= '</script>';
return $this->HTML;
}
}
示例13: level
private function level($IDPage, $SID)
{
$SKTDB = \CmsDev\sql\db_Skt::connect();
$Menu = $SKTDB->get_results("SELECT ID,Title,URLName,SID,Language FROM " . \DB_PREFIX . "sections WHERE SID = '" . $SID . "' ORDER BY Position ASC");
if ($Menu) {
$this->L++;
foreach ($Menu as $Section) {
if ($Section->ID === $IDPage) {
$selected = ' selected="selected"';
} else {
$selected = '';
}
$this->HTML .= '<option value="' . $Section->ID . '" ' . $selected . ' class="L' . $this->L . '"> ' . utf8_encode($Section->URLName) . '</option>';
if ($SKTDB->get_var("SELECT count(*) FROM " . DB_PREFIX . "sections WHERE SID = '" . $Section->ID . "'") > 0) {
$this->HTML .= self::level($IDPage, $Section->ID);
}
}
$this->L = $this->L - 1;
}
}
示例14: GetDataSet
public function GetDataSet()
{
$SKTDB = SKT_DB::connect();
$USER_EXIST = \CmsDev\Security\loginIntent::action('validateUser');
if ($USER_EXIST === true) {
$user_list = $SKTDB->get_row("SELECT *\r\n FROM users as user join userprofile as profile \r\n ON user.md5 = " . \GetSQLValueString($_SESSION['login'], 'int') . "\r\n WHERE user.id = profile.IDX \r\n ");
if ($user_list) {
$this->user_list = $user_list;
$this->UserOk = true;
} else {
$this->UserOk = false;
$MessageBox = SKT_INFO\Asistance::get();
$MessageBox->TipError(\SKT_ADMIN_User_max_attempts . \SKT_ADMIN_User_max_attempts_TXT, true);
}
} else {
$this->UserOk = false;
$MessageBox = SKT_INFO\Asistance::get();
$MessageBox->TipError(\SKT_ADMIN_User_max_attempts . \SKT_ADMIN_User_max_attempts_TXT, true);
}
}
示例15: set
public static function set($PositionSelect = null, $IDPage = null, $Zone = 0)
{
if ($PositionSelect !== null && $IDPage !== null) {
$rand = rand(2, 654);
$Input = '<input name="Position" id="Position" class="Position' . $rand . ' form-control" type="text" value="[val]" />';
$IDPage = \GetSQLValueString($IDPage, 'int');
$Zone = \GetSQLValueString($Zone, 'int');
$HTML = '';
$SKTDB = \CmsDev\Sql\db_Skt::connect();
$total = $SKTDB->get_var("SELECT count(*) FROM " . \DB_PREFIX . "content WHERE IDZone = '" . $Zone . "' AND IDPage = '{$IDPage}'");
if (!isset($PositionSelect) or $PositionSelect == null) {
$PositionSelect = 0;
} elseif ($PositionSelect === -1) {
$PositionSelect = $total + 1;
}
$HTML .= str_replace('[val]', $PositionSelect, $Input);
$HTML .= '<script type="text/javascript">';
$HTML .= '$(".Position' . $rand . '").spinner({step: 1,numberFormat: "n", min: 0, max: ' . ($total + 1) . '});';
$HTML .= '</script>';
return $HTML;
}
}