当前位置: 首页>>代码示例>>PHP>>正文


PHP vB::get_config方法代码示例

本文整理汇总了PHP中vB::get_config方法的典型用法代码示例。如果您正苦于以下问题:PHP vB::get_config方法的具体用法?PHP vB::get_config怎么用?PHP vB::get_config使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在vB的用法示例。


在下文中一共展示了vB::get_config方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: searchHelp

    public function searchHelp($params, $db, $check_only = false)
    {
        if ($check_only) {
            if (empty($params['search']) or empty($params['languages']) or empty($params['fields'])) {
                return false;
            } else {
                return true;
            }
        }
        $className = 'vB_Db_' . $this->db_type . '_QueryBuilder';
        $queryBuilder = new $className($db, false);
        $conditions['languageid'] = $params['languages'];
        $conditions['fieldname'] = $params['fields'];
        $where = "WHERE " . $queryBuilder->conditionsToFilter($conditions);
        foreach ($params['search'] as $word) {
            if (strlen($word) == 1) {
                // searches happen anywhere within a word, so 1 letter searches are useless
                continue;
            }
            $keyword_filters[] = $queryBuilder->conditionsToFilter(array(array('field' => 'text', 'value' => $word, 'operator' => vB_dB_Query::OPERATOR_INCLUDES)));
        }
        if (!empty($keyword_filters)) {
            $where .= ' AND ((' . implode(') OR (', $keyword_filters) . '))';
        }
        $sql = '
		SELECT fieldname, varname FROM ' . TABLE_PREFIX . 'phrase AS phrase
		' . $where . '
		/** searchHelp' . (defined('THIS_SCRIPT') ? '- ' . THIS_SCRIPT : '') . '**/';
        $resultclass = 'vB_dB_' . $this->db_type . '_result';
        $config = vB::get_config();
        if (isset($config['Misc']['debug_sql']) and $config['Misc']['debug_sql']) {
            echo "sql: {$sql}<br />\n";
        }
        $result = new $resultclass($db, $sql);
        return $result;
    }
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:36,代码来源:querydefs.php

示例2: fetchAdminusersFromUsergroup

 public function fetchAdminusersFromUsergroup($params, $db, $check_only = false)
 {
     $params = vB::getCleaner()->cleanArray($params, array('ausergroupids' => vB_Cleaner::TYPE_ARRAY_INT, 'usergroupid' => vB_Cleaner::TYPE_INT));
     if ($check_only) {
         return !empty($params['ausergroupids']) and !empty($params['usergroupid']);
     }
     $notinsetsql = '';
     foreach ($params['ausergroupids'] as $ausergroupid) {
         $notinsetsql .= " AND NOT FIND_IN_SET('{$ausergroupid}', membergroupids)";
     }
     $ausergroupidsstr = implode(',', $params['ausergroupids']);
     $sql = "SELECT userid FROM " . TABLE_PREFIX . "user\n\t\t\tWHERE usergroupid NOT IN ('{$ausergroupidsstr}')\n\t\t\t\t{$notinsetsql}\n\t\t\t\tAND (usergroupid = {$params['usergroupid']}\n\t\t\t\tOR FIND_IN_SET('{$params['usergroupid']}', membergroupids))";
     $resultclass = 'vB_dB_' . $this->db_type . '_result';
     $config = vB::get_config();
     if (isset($config['Misc']['debug_sql']) and $config['Misc']['debug_sql']) {
         echo "sql: {$sql}<br />\n";
     }
     $result = new $resultclass($db, $sql);
     return $result;
 }
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:20,代码来源:querydefs.php

示例3: updateUGPMaxSGs

 /**
  * Used to map maximumsocialgroups limit permission to the new maxchannels channel limit permission.
  * We basically pass everything globally defined to sg channel node permissions.
  */
 public function updateUGPMaxSGs($params, $db, $check_only = false)
 {
     if ($check_only) {
         // only array to update
         if (!isset($params['groups']) or !is_array($params['groups']) or empty($params['groups'])) {
             return false;
         }
         // ugp info should be ugpid => val
         foreach ($params['groups'] as $ugpid => $param) {
             if (!is_numeric($ugpid)) {
                 return false;
             }
             if (!is_numeric($param)) {
                 return false;
             }
         }
         return true;
     } else {
         $sql = "UPDATE " . TABLE_PREFIX . "permission SET maxchannels = CASE groupid\n";
         foreach ($params['groups'] as $id => $val) {
             $sql .= "WHEN {$id} THEN {$val}\n";
         }
         $sql .= "END\n\t\t\t\tWHERE groupid IN (" . implode(", ", array_keys($params['groups'])) . ") AND nodeid = " . vB_Api::instanceInternal('content_channel')->fetchChannelIdByGUID(vB_Channel::DEFAULT_SOCIALGROUP_PARENT) . "\n\t\t\t/** getSubscriptionUsersLog" . (defined('THIS_SCRIPT') ? '- ' . THIS_SCRIPT : '') . "**/";
         $resultclass = 'vB_dB_' . $this->db_type . '_result';
         $config = vB::get_config();
         if (isset($config['Misc']['debug_sql']) and $config['Misc']['debug_sql']) {
             echo "sql: {$sql}<br />\n";
         }
         $result = new $resultclass($db, $sql);
         return $result;
     }
 }
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:36,代码来源:querydefs.php


注:本文中的vB::get_config方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。