當前位置: 首頁>>代碼示例>>PHP>>正文


PHP driver_interface::sql_bit_and方法代碼示例

本文整理匯總了PHP中phpbb\db\driver\driver_interface::sql_bit_and方法的典型用法代碼示例。如果您正苦於以下問題:PHP driver_interface::sql_bit_and方法的具體用法?PHP driver_interface::sql_bit_and怎麽用?PHP driver_interface::sql_bit_and使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在phpbb\db\driver\driver_interface的用法示例。


在下文中一共展示了driver_interface::sql_bit_and方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: switch

    /**
     * Return correct object for specified mode
     *
     * @param string	$mode		The feeds mode.
     * @param int	$forum_id	Forum id specified by the script if forum feed provided.
     * @param int	$topic_id	Topic id specified by the script if topic feed provided.
     *
     * @return object	Returns correct feeds object for specified mode.
     */
    function get_feed($mode, $forum_id, $topic_id)
    {
        switch ($mode) {
            case 'forums':
                if (!$this->config['feed_overall_forums']) {
                    return false;
                }
                return $this->container->get('feed.forums');
                break;
            case 'topics':
            case 'topics_new':
                if (!$this->config['feed_topics_new']) {
                    return false;
                }
                return $this->container->get('feed.topics');
                break;
            case 'topics_active':
                if (!$this->config['feed_topics_active']) {
                    return false;
                }
                return $this->container->get('feed.topics_active');
                break;
            case 'news':
                // Get at least one news forum
                $sql = 'SELECT forum_id
					FROM ' . FORUMS_TABLE . '
					WHERE ' . $this->db->sql_bit_and('forum_options', FORUM_OPTION_FEED_NEWS, '<> 0');
                $result = $this->db->sql_query_limit($sql, 1, 0, 600);
                $s_feed_news = (int) $this->db->sql_fetchfield('forum_id');
                $this->db->sql_freeresult($result);
                if (!$s_feed_news) {
                    return false;
                }
                return $this->container->get('feed.news');
                break;
            default:
                if ($topic_id && $this->config['feed_topic']) {
                    return $this->container->get('feed.topic')->set_topic_id($topic_id);
                } else {
                    if ($forum_id && $this->config['feed_forum']) {
                        return $this->container->get('feed.forum')->set_forum_id($forum_id);
                    } else {
                        if ($this->config['feed_overall']) {
                            return $this->container->get('feed.overall');
                        }
                    }
                }
                return false;
                break;
        }
    }
開發者ID:Tarendai,項目名稱:spring-website,代碼行數:60,代碼來源:factory.php

示例2: news

    /**
     * Controller for /feed/news route
     *
     * @return Response
     *
     * @throws http_exception when the feed is disabled
     */
    public function news()
    {
        // Get at least one news forum
        $sql = 'SELECT forum_id
					FROM ' . FORUMS_TABLE . '
					WHERE ' . $this->db->sql_bit_and('forum_options', FORUM_OPTION_FEED_NEWS, '<> 0');
        $result = $this->db->sql_query_limit($sql, 1, 0, 600);
        $s_feed_news = (int) $this->db->sql_fetchfield('forum_id');
        $this->db->sql_freeresult($result);
        if (!$s_feed_news) {
            $this->send_unavailable();
        }
        return $this->send_feed($this->container->get('feed.news'));
    }
開發者ID:MrAdder,項目名稱:phpbb,代碼行數:21,代碼來源:feed.php

示例3: array

    function get_excluded_forums()
    {
        static $forum_ids;
        // Matches acp/acp_board.php
        $cache_name = 'feed_excluded_forum_ids';
        if (!isset($forum_ids) && ($forum_ids = $this->cache->get('_' . $cache_name)) === false) {
            $sql = 'SELECT forum_id
				FROM ' . FORUMS_TABLE . '
				WHERE ' . $this->db->sql_bit_and('forum_options', FORUM_OPTION_FEED_EXCLUDE, '<> 0');
            $result = $this->db->sql_query($sql);
            $forum_ids = array();
            while ($forum_id = (int) $this->db->sql_fetchfield('forum_id')) {
                $forum_ids[$forum_id] = $forum_id;
            }
            $this->db->sql_freeresult($result);
            $this->cache->put('_' . $cache_name, $forum_ids);
        }
        return $forum_ids;
    }
開發者ID:mike-a-b,項目名稱:crossfit,代碼行數:19,代碼來源:base.php


注:本文中的phpbb\db\driver\driver_interface::sql_bit_and方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。