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


PHP Blog::Find方法代码示例

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


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

示例1: blogs

 function blogs()
 {
     $where = "blog_parent_id = " . $this->id;
     require_once 'class.mt_blog.php';
     $blog = new Blog();
     $blogs = $blog->Find($where);
     return $blogs;
 }
开发者ID:benvanstaveren,项目名称:movabletype,代码行数:8,代码来源:class.mt_website.php

示例2: blogs

 function blogs()
 {
     if ($this->class == 'blog') {
         return null;
     }
     $where = "blog_parent_id = " . $this->id;
     $blog = new Blog();
     $blogs = $blog->Find($where);
     return $blogs;
 }
开发者ID:OCMO,项目名称:movabletype,代码行数:10,代码来源:class.mt_blog.php

示例3: fetch_blogs

 public function fetch_blogs($args = null)
 {
     if ($blog_ids = $this->include_exclude_blogs($args)) {
         $blog_filter = 'blog_id ' . $blog_ids;
     } else {
         $blog_filter = '1 = 1';
     }
     if (!isset($args['class'])) {
         $args['class'] = 'blog';
     }
     $where = $blog_filter;
     $where .= $args['class'] == '*' ? "" : " and blog_class = '" . $args['class'] . "'";
     $where .= ' order by blog_name';
     require_once 'class.mt_blog.php';
     $blogs = null;
     $blog = new Blog();
     $blogs = $blog->Find($where);
     return $blogs;
 }
开发者ID:OCMO,项目名称:movabletype,代码行数:19,代码来源:mtdb.base.php

示例4: multiblog_filter_blogs

function multiblog_filter_blogs(&$ctx, $is_include, $blogs)
{
    # Set flag to indicate whether @blogs are to be included or excluded
    $is_include = $is_include == 'include_blogs' ? 1 : 0;
    # Set local blog
    $this_blog = $ctx->stash('blog_id');
    $multiblog_system_config = multiblog_fetch_system_config();
    # Get the MultiBlog system config for default access and overrides
    if (isset($multiblog_system_config['default_access_allowed'])) {
        $default_access_allowed = $multiblog_system_config['default_access_allowed'];
    } else {
        $default_access_allowed = 1;
    }
    $access_overrides = $multiblog_system_config['access_overrides'];
    if (!$access_overrides) {
        $access_overrides = array();
    }
    # System setting allows access by default
    if ($default_access_allowed) {
        # include_blogs="all"
        if ($is_include && $blogs[0] == "all") {
            # Check for any deny overrides.
            # If found, switch to exclude_blogs="..."
            $deny = array();
            foreach (array_keys($access_overrides) as $o) {
                if ($o != $this_blog && (isset($access_overrides[$o]) && $access_overrides[$o] == MULTIBLOG_ACCESS_DENIED)) {
                    $deny[] = $o;
                }
            }
            return count($deny) ? array('exclude_blogs', $deny) : array('include_blogs', array('all'));
        } elseif ($blogs[0] == 'site' || $blogs[0] == 'children' || $blogs[0] == 'siblings') {
            $mt = MT::get_instance();
            $ctx = $mt->context();
            $blog = $ctx->stash('blog');
            if (!empty($blog)) {
                $website = $blog->class == 'blog' ? $blog->website() : $blog;
                $blogs = $website->blogs();
                if (empty($blogs)) {
                    $blogs = array();
                }
                $allow = array();
                foreach ($blogs as $b) {
                    if ($b->id == $this_blog || !isset($access_overrides[$b->id]) || $access_overrides[$b->id] == MULTIBLOG_ACCESS_ALLOWED) {
                        array_push($allow, $b->id);
                    }
                }
            }
            return count($allow) ? array('include_blogs', $allow) : null;
        } elseif ($is_include && count($blogs)) {
            # Remove any included blogs that are specifically deny override
            # Return undef is all specified blogs are deny override
            $allow = array();
            foreach ($blogs as $b) {
                if ($b == $this_blog || !isset($access_overrides[$b]) || $access_overrides[$b] == MULTIBLOG_ACCESS_ALLOWED) {
                    $allow[] = $b;
                }
            }
            return count($allow) ? array('include_blogs', $allow) : null;
        } else {
            # Add any deny overrides blogs to the list and de-dupe
            foreach (array_keys($access_overrides) as $o) {
                if ($o != $this_blog && (isset($access_overrides[$o]) && $access_overrides[$o] == MULTIBLOG_ACCESS_DENIED)) {
                    $blogs[] = $o;
                }
            }
            $seen = array();
            foreach ($blogs as $b) {
                $seen[$b] = 1;
            }
            $blogs = array_keys($seen);
            return array('exclude_blogs', $blogs);
        }
    } else {
        # include_blogs="all"
        if ($is_include && $blogs[0] == "all") {
            # Enumerate blogs from allow override
            # Hopefully this is significantly smaller than @all_blogs
            $allow = array();
            foreach (array_keys($access_overrides) as $o) {
                if ($o == $this_blog || isset($access_overrides[$o]) && $access_overrides[$o] == MULTIBLOG_ACCESS_ALLOWED) {
                    $allow[] = $o;
                }
            }
            if (!isset($access_overrides[$this_blog])) {
                $allow[] = $this_blog;
            }
            return count($allow) ? array('include_blogs', $allow) : null;
        } elseif ($blogs[0] == 'site' || $blogs[0] == 'children' || $blogs[0] == 'siblings') {
            $mt = MT::get_instance();
            $ctx = $mt->context();
            $blog = $ctx->stash('blog');
            if (!empty($blog) && $blog->class == 'blog') {
                require_once 'class.mt_blog.php';
                $blog_class = new Blog();
                $blogs = $blog_class->Find("blog_parent_id = " . $blog->parent_id);
                $allow = array();
                foreach ($blogs as $b) {
                    if ($b->id == $this_blog || isset($access_overrides[$b->id]) && $access_overrides[$b->id] == MULTIBLOG_ACCESS_ALLOWED) {
                        array_push($allow, $b->id);
                    }
//.........这里部分代码省略.........
开发者ID:benvanstaveren,项目名称:movabletype,代码行数:101,代码来源:init.MultiBlog.php


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