本文整理汇总了PHP中BxDolDb类的典型用法代码示例。如果您正苦于以下问题:PHP BxDolDb类的具体用法?PHP BxDolDb怎么用?PHP BxDolDb使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了BxDolDb类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: getGridObject
public static function getGridObject($sObject)
{
$oDb = BxDolDb::getInstance();
$sQuery = $oDb->prepare("SELECT * FROM `sys_objects_grid` WHERE `object` = ?", $sObject);
$aObject = $oDb->getRow($sQuery);
if (!$aObject || !is_array($aObject)) {
return false;
}
// paginate
if (!empty($aObject['paginate_url']) && 0 != strncasecmp($aObject['paginate_url'], 'http://', 7) && 0 != strncasecmp($aObject['paginate_url'], 'https://', 8)) {
$aObject['paginate_url'] = BX_DOL_URL_ROOT . $aObject['paginate_url'];
}
// filter
if ($aObject['filter_fields']) {
$aObject['filter_fields'] = array_map('trim', explode(',', $aObject['filter_fields']));
}
if ($aObject['filter_fields_translatable']) {
$aObject['filter_fields_translatable'] = array_map('trim', explode(',', $aObject['filter_fields_translatable']));
}
// sorting
if ($aObject['sorting_fields']) {
$aObject['sorting_fields'] = array_map('trim', explode(',', $aObject['sorting_fields']));
}
if ($aObject['sorting_fields_translatable']) {
$aObject['sorting_fields_translatable'] = array_map('trim', explode(',', $aObject['sorting_fields_translatable']));
$aObject['sorting_fields'] = array_merge($aObject['sorting_fields'], $aObject['sorting_fields_translatable']);
}
// get fields
$sQuery = $oDb->prepare("SELECT * FROM `sys_grid_fields` WHERE `object` = ? ORDER BY `order`", $sObject);
$aFields = $oDb->getAllWithKey($sQuery, 'name');
if (!$aFields || !is_array($aFields)) {
// it is impossible to have grid without any fields
return false;
}
foreach ($aFields as $sKey => $aRow) {
$aObject['fields'][$sKey] = array('title' => _t($aRow['title']), 'width' => $aRow['width'], 'translatable' => $aRow['translatable'], 'chars_limit' => $aRow['chars_limit']);
if (empty($aRow['params'])) {
continue;
}
$aAdd = unserialize($aRow['params']);
if (!empty($aAdd) && is_array($aAdd)) {
$aObject['fields'][$sKey] = array_merge($aObject['fields'][$sKey], $aAdd);
}
}
// get actions
$a = array('bulk', 'single', 'independent');
foreach ($a as $sActionType) {
$sActionField = 'actions_' . $sActionType;
$aObject[$sActionField] = array();
$sQuery = $oDb->prepare("SELECT * FROM `sys_grid_actions` WHERE `object` = ? AND `type` = ? ORDER BY `order`", $sObject, $sActionType);
$aActions = $oDb->getAllWithKey($sQuery, 'name');
if (!$aActions || !is_array($aActions)) {
continue;
}
foreach ($aActions as $sKey => $aRow) {
$aObject[$sActionField][$sKey] = $aRow['title'] || $aRow['icon'] ? array('title' => _t($aRow['title']), 'icon' => $aRow['icon'], 'confirm' => $aRow['confirm'], 'icon_only' => $aRow['icon_only']) : array();
}
}
return $aObject;
}
开发者ID:blas-dmx,项目名称:trident,代码行数:60,代码来源:BxDolGridQuery.php
示例2: serviceLoginForm
public function serviceLoginForm($sParams = '', $sForceRelocate = '')
{
if (isLogged()) {
return false;
}
// get all auth types
$aAuthTypes = BxDolDb::getInstance()->fromCache('sys_objects_auths', 'getAll', 'SELECT * FROM `sys_objects_auths`');
$oForm = BxDolForm::getObjectInstance('sys_login', 'sys_login');
$sCustomHtmlBefore = '';
$sCustomHtmlAfter = '';
bx_alert('profile', 'show_login_form', 0, 0, array('oForm' => $oForm, 'sParams' => &$sParams, 'sCustomHtmlBefore' => &$sCustomHtmlBefore, 'sCustomHtmlAfter' => &$sCustomHtmlAfter, 'aAuthTypes' => &$aAuthTypes));
if ($sForceRelocate && 0 === mb_stripos($sForceRelocate, BX_DOL_URL_ROOT)) {
$oForm->aInputs['relocate']['value'] = $sForceRelocate;
} elseif ('homepage' == $sForceRelocate) {
$oForm->aInputs['relocate']['value'] = BX_DOL_URL_ROOT;
}
$sFormCode = $oForm->getCode();
$sJoinText = '';
if (strpos($sParams, 'no_join_text') === false) {
$sJoinText = '<hr class="bx-def-hr bx-def-margin-sec-topbottom" /><div class="bx-def-font-align-center">' . _t('_sys_txt_login_description', BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=create-account')) . '</div>';
}
BxDolTemplate::getInstance()->addJs(array('jquery.form.min.js'));
$sAuth = $this->serviceMemberAuthCode($aAuthTypes);
return $sCustomHtmlBefore . $sAuth . $sFormCode . $sCustomHtmlAfter . $sJoinText;
}
开发者ID:blas-dmx,项目名称:trident,代码行数:25,代码来源:BxBaseServiceLogin.php
示例3: __construct
/**
* Constructor
*/
public function __construct()
{
parent::__construct();
$this->aZonesUrls = array(2 => BX_DIRECTORY_PATH_MODULES . "boonex/antispam/data/two-level-tlds", 3 => BX_DIRECTORY_PATH_MODULES . "boonex/antispam/data/three-level-tlds");
$this->oDb = BxDolDb::getInstance();
$this->initZones();
}
开发者ID:Baloo7super,项目名称:dolphin,代码行数:10,代码来源:BxAntispamDNSURIBlacklists.php
示例4: serviceLoginForm
public function serviceLoginForm($sParams = '', $sForceRelocate = '')
{
if (isLogged()) {
return false;
}
// get all auth types
$aAuthTypes = BxDolDb::getInstance()->fromCache('sys_objects_auths', 'getAll', 'SELECT * FROM `sys_objects_auths`');
// define additional auth types
if ($aAuthTypes) {
$aAddInputEl[''] = _t('_Basic');
// procces all additional menu's items
foreach ($aAuthTypes as $iKey => $aItems) {
$aAddInputEl[$aItems['Link']] = _t($aItems['Title']);
}
$aAuthTypes = array('type' => 'select', 'caption' => _t('_Auth type'), 'values' => $aAddInputEl, 'value' => '', 'attrs' => array('onchange' => 'if (this.value) { location.href = "' . BX_DOL_URL_ROOT . '" + this.value }'));
} else {
$aAuthTypes = array('type' => 'hidden');
}
$oForm = BxDolForm::getObjectInstance('sys_login', 'sys_login');
$sCustomHtmlBefore = '';
$sCustomHtmlAfter = '';
bx_alert('profile', 'show_login_form', 0, 0, array('oForm' => $oForm, 'sParams' => &$sParams, 'sCustomHtmlBefore' => &$sCustomHtmlBefore, 'sCustomHtmlAfter' => &$sCustomHtmlAfter, 'aAuthTypes' => &$aAuthTypes));
if ($sForceRelocate && 0 === mb_stripos($sForceRelocate, BX_DOL_URL_ROOT)) {
$oForm->aInputs['relocate']['value'] = $sForceRelocate;
} elseif ('homepage' == $sForceRelocate) {
$oForm->aInputs['relocate']['value'] = BX_DOL_URL_ROOT;
}
$sFormCode = $oForm->getCode();
$sJoinText = '';
if (strpos($sParams, 'no_join_text') === false) {
$sJoinText = '<hr class="bx-def-hr bx-def-margin-sec-topbottom" /><div>' . _t('_sys_txt_login_description', BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=create-account')) . '</div>';
}
BxDolTemplate::getInstance()->addJs(array('jquery.form.min.js'));
return $sCustomHtmlBefore . $sFormCode . $sCustomHtmlAfter . $sJoinText;
}
开发者ID:blas-dmx,项目名称:trident,代码行数:35,代码来源:BxBaseServiceLogin.php
示例5: BxDolCmtsQuery
function BxDolCmtsQuery(&$aSystem)
{
$this->_aSystem =& $aSystem;
$this->_sTable = $this->_aSystem['table_cmts'];
$this->_sTableTrack = $this->_aSystem['table_track'];
parent::BxDolDb();
}
开发者ID:dalinhuang,项目名称:shopexts,代码行数:7,代码来源:BxDolCmtsQuery.php
示例6: BxDolModuleDb
function BxDolModuleDb($oConfig = null)
{
parent::BxDolDb();
if (is_a($oConfig, 'BxDolConfig')) {
$this->_sPrefix = $oConfig->getDbPrefix();
}
}
开发者ID:Gotgot59,项目名称:dolphin.pro,代码行数:7,代码来源:BxDolModuleDb.php
示例7: _action
protected function _action($sCache, $sMode = 'clear')
{
$sFuncCacheObject = $sMode == 'clear' ? '_clearObject' : '_getSizeObject';
$sFuncCacheFile = $sMode == 'clear' ? '_clearFile' : '_getSizeFile';
$mixedResult = false;
switch ($sCache) {
case 'db':
if (getParam('sys_db_cache_enable') != 'on') {
break;
}
$oCacheDb = BxDolDb::getInstance()->getDbCacheObject();
$mixedResult = $this->{$sFuncCacheObject}($oCacheDb, 'db_');
break;
case 'template':
if (getParam('sys_template_cache_enable') != 'on') {
break;
}
$oCacheTemplates = BxDolTemplate::getInstance()->getTemplatesCacheObject();
$mixedResult = $this->{$sFuncCacheObject}($oCacheTemplates, BxDolStudioTemplate::getInstance()->getCacheFilePrefix($sCache));
break;
case 'css':
if (getParam('sys_template_cache_css_enable') != 'on') {
break;
}
$mixedResult = $this->{$sFuncCacheFile}(BxDolStudioTemplate::getInstance()->getCacheFilePrefix($sCache), BX_DIRECTORY_PATH_CACHE_PUBLIC);
break;
case 'js':
if (getParam('sys_template_cache_js_enable') != 'on') {
break;
}
$mixedResult = $this->{$sFuncCacheFile}(BxDolStudioTemplate::getInstance()->getCacheFilePrefix($sCache), BX_DIRECTORY_PATH_CACHE_PUBLIC);
break;
}
return $mixedResult;
}
开发者ID:Baloo7super,项目名称:dolphin,代码行数:35,代码来源:BxDolCacheUtilities.php
示例8: __construct
function __construct()
{
parent::__construct();
if (class_exists('BxDolDb') && BxDolDb::getInstance()) {
$this->_aConfig['aLessConfig']['bx-page-width'] = getParam('main_div_width');
}
}
开发者ID:blas-dmx,项目名称:trident,代码行数:7,代码来源:BxBaseConfig.php
示例9: initVideoFile
function initVideoFile($sId, $sTitle, $sCategory, $sTags, $sDesc)
{
global $sModule;
$oDb = BxDolDb::getInstance();
$sDBModule = DB_PREFIX . ucfirst($sModule);
getResult("UPDATE `" . $sDBModule . "Files` SET `Categories`='" . $sCategory . "', `Title`='" . $sTitle . "', `Tags`='" . $sTags . "', `Description`='" . $sDesc . "' WHERE `ID`='" . $sId . "'");
return $oDb->getAffectedRows() > 0 ? true : false;
}
开发者ID:toxalot,项目名称:dolphin.pro,代码行数:8,代码来源:functions.inc.php
示例10: initFile
function initFile($sId, $sTitle, $sCategory, $sTags, $sDesc)
{
global $sModule;
$oDb = BxDolDb::getInstance();
$sUri = mp3_genUri($sTitle);
$sUriPart = empty($sUri) ? "" : "`Uri`='" . $sUri . "', ";
$sDBModule = DB_PREFIX . ucfirst($sModule);
getResult("UPDATE `" . $sDBModule . "Files` SET `Categories`= ?, `Title`= ?, " . $sUriPart . "`Tags`= ?, `Description`= ? WHERE `ID`= ?", [$sCategory, $sTitle, $sTags, $sDesc, $sId]);
return $oDb->getAffectedRows() > 0 ? true : false;
}
开发者ID:toxalot,项目名称:dolphin.pro,代码行数:10,代码来源:functions.inc.php
示例11: getInstance
/**
* Get singleton instance of the class
*/
public static function getInstance($aDbConf = false, &$sError = null)
{
if (!isset($GLOBALS['bxDolClasses'][__CLASS__])) {
if (false === $aDbConf && !defined('BX_DATABASE_HOST')) {
return null;
}
$o = new BxDolDb($aDbConf);
$sErrorMessage = $o->connect();
if ($sErrorMessage) {
if ($sError !== null) {
$sError = $sErrorMessage;
}
return null;
} else {
$GLOBALS['bxDolClasses'][__CLASS__] = $o;
}
}
return $GLOBALS['bxDolClasses'][__CLASS__];
}
开发者ID:blas-dmx,项目名称:trident,代码行数:22,代码来源:BxDolDb.php
示例12: getPrivacyObject
public static function getPrivacyObject($sObject)
{
$oDb = BxDolDb::getInstance();
$sQuery = $oDb->prepare("SELECT * FROM `sys_objects_privacy` WHERE `object` = ?", $sObject);
$aObject = $oDb->getRow($sQuery);
if (!$aObject || !is_array($aObject)) {
return false;
}
return $aObject;
}
开发者ID:blas-dmx,项目名称:trident,代码行数:10,代码来源:BxDolPrivacyQuery.php
示例13: BxDolPermalinks
function BxDolPermalinks()
{
parent::BxDolDb();
$oCache = $GLOBALS['MySQL']->getDbCacheObject();
$this->aLinks = $oCache->getData($GLOBALS['MySQL']->genDbCacheKey('sys_permalinks'));
if (null === $this->aLinks) {
if (!$this->cache()) {
$this->aLinks = array();
}
}
}
开发者ID:dalinhuang,项目名称:shopexts,代码行数:11,代码来源:BxDolPermalinks.php
示例14: __construct
function __construct()
{
$this->oDb = BxDolDb::getInstance();
$oCache = $this->oDb->getDbCacheObject();
$this->aLinks = $oCache->getData($this->oDb->genDbCacheKey('sys_permalinks'));
if (null === $this->aLinks) {
if (!$this->cache()) {
$this->aLinks = array();
}
}
}
开发者ID:Prashank25,项目名称:dolphin.pro,代码行数:11,代码来源:BxDolPermalinks.php
示例15: setPageWidth
protected function setPageWidth($sParamName)
{
if (!class_exists('BxDolDb') || !BxDolDb::getInstance() || empty($sParamName)) {
return;
}
$mixedWidth = getParam($sParamName);
if (is_numeric($mixedWidth)) {
$mixedWidth .= 'px';
}
$this->_aConfig['aLessConfig']['bx-page-width'] = $mixedWidth;
}
开发者ID:blas-dmx,项目名称:trident,代码行数:11,代码来源:BxBaseConfig.php
示例16: __construct
function __construct()
{
$this->oDb = BxDolDb::getInstance();
$this->iViewer = getLoggedId();
$this->sCacheFile = 'sys_objects_tag';
$this->sNonParseParams = 'tags_non_parsable';
$this->sCacheTable = 'sys_objects_tag';
$this->sTagTable = 'sys_tags';
$this->aTagFields = array('id' => 'ObjID', 'type' => 'Type', 'tag' => 'Tag', 'date' => 'Date');
$this->aObjFields = array('id' => 'ID', 'name' => 'ObjectName', 'query' => 'Query', 'perm_param' => 'PermalinkParam', 'perm_enable' => 'EnabledPermalink', 'perm_disable' => 'DisabledPermalink', 'lang_key' => 'LangKey');
}
开发者ID:toxalot,项目名称:dolphin.pro,代码行数:11,代码来源:BxDolTags.php
示例17: __construct
function __construct(&$aModule)
{
parent::__construct($aModule);
$aConfig = array('client_table' => 'bx_oauth_clients', 'access_token_table' => 'bx_oauth_access_tokens', 'refresh_token_table' => 'bx_oauth_refresh_tokens', 'code_table' => 'bx_oauth_authorization_codes', 'user_table' => 'Profiles', 'jwt_table' => '', 'jti_table' => '', 'scope_table' => 'bx_oauth_scopes', 'public_key_table' => '');
$this->_oStorage = new OAuth2\Storage\Pdo(BxDolDb::getInstance()->getLink(), $aConfig);
$this->_oServer = new OAuth2\Server($this->_oStorage, array('require_exact_redirect_uri' => false));
// Add the "Client Credentials" grant type (it is the simplest of the grant types)
$this->_oServer->addGrantType(new OAuth2\GrantType\ClientCredentials($this->_oStorage));
// Add the "Authorization Code" grant type (this is where the oauth magic happens)
$this->_oServer->addGrantType(new OAuth2\GrantType\AuthorizationCode($this->_oStorage));
}
开发者ID:toxalot,项目名称:dolphin.pro,代码行数:11,代码来源:BxOAuthModule.php
示例18: BxDolPrivacyQuery
/**
* constructor
*/
function BxDolPrivacyQuery($sTable = '', $sFieldId = '', $sFieldOwnerId = '')
{
parent::BxDolDb();
$this->_sTable = $sTable;
$this->_sFieldId = $sFieldId;
$this->_sFieldOwnerId = $sFieldOwnerId;
$this->_sGroupCache = 'sys_ps_group_';
$this->_sGroupsByOwnersCache = 'sys_ps_groups_owners_';
$this->_sGroupMembersCache = 'sys_ps_group_members_';
$this->_sObjectCache = 'sys_ps_object_';
$this->_sActionCache = 'sys_ps_action_';
$this->_sActionDefaultCache = 'sys_ps_action_default_';
}
开发者ID:dalinhuang,项目名称:shopexts,代码行数:16,代码来源:BxDolPrivacyQuery.php
示例19: getMemberInfoKeysByType
public static function getMemberInfoKeysByType($sType)
{
$oDb = BxDolDb::getInstance();
$sQuery = "SELECT * FROM `sys_objects_member_info` WHERE `type` = ? ORDER BY `title` ASC";
$aObjects = $oDb->getPairs($sQuery, 'object', 'title', [$sType]);
if (!$aObjects || !is_array($aObjects)) {
return false;
}
foreach ($aObjects as $k => $v) {
$aObjects[$k] = _t($v);
}
return $aObjects;
}
开发者ID:Prashank25,项目名称:dolphin.pro,代码行数:13,代码来源:BxDolMemberInfoQuery.php
示例20: getSystems
public function getSystems()
{
if (!isset($GLOBALS['bx_dol_live_updates_systems'])) {
$GLOBALS['bx_dol_live_updates_systems'] = BxDolDb::getInstance()->fromCache('sys_objects_live_updates', 'getAllWithKey', '
SELECT
`id` as `id`,
`name` AS `name`,
`frequency` AS `frequency`,
`service_call` AS `service_call`,
`active` AS `active`
FROM `sys_objects_live_updates`', 'name');
}
return $GLOBALS['bx_dol_live_updates_systems'];
}
开发者ID:blas-dmx,项目名称:trident,代码行数:14,代码来源:BxDolLiveUpdatesQuery.php
注:本文中的BxDolDb类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论