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


PHP Blog::get方法代码示例

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


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

示例1: getCMSFields

 public function getCMSFields()
 {
     $fields = FieldList::create();
     $fields->push(DropdownField::create("BlogID", _t("BlogTagsWidget.Blog", "Blog"), Blog::get()->map()));
     $this->extend("updateCMSFields", $fields);
     return $fields;
 }
开发者ID:helpfulrobot,项目名称:micmania1-silverstripe-blog,代码行数:7,代码来源:BlogTagsWidget.php

示例2: getCMSFields

 public function getCMSFields()
 {
     $fields = FieldList::create();
     $fields->merge(array(DropdownField::create("BlogID", _t("BlogRecentPostsWidget.Blog", "Blog"), Blog::get()->map()), NumericField::create("NumberOfPosts", _t("BlogRecentPostsWidget.NumberOfPosts", "Number of Posts"))));
     $this->extend("updateCMSFields", $fields);
     return $fields;
 }
开发者ID:helpfulrobot,项目名称:micmania1-silverstripe-blog,代码行数:7,代码来源:BlogRecentPostsWidget.php

示例3: getCMSFields

 /**
  * {@inheritdoc}
  */
 public function getCMSFields()
 {
     $this->beforeUpdateCMSFields(function ($fields) {
         /**
          * @var FieldList $fields
          */
         $fields->merge(array(DropdownField::create('BlogID', _t('BlogRecentPostsWidget.Blog', 'Blog'), Blog::get()->map()), NumericField::create('NumberOfPosts', _t('BlogRecentPostsWidget.NumberOfPosts', 'Number of Posts'))));
     });
     return parent::getCMSFields();
 }
开发者ID:sunnysideup,项目名称:silverstripe-blog,代码行数:13,代码来源:BlogRecentPostsWidget.php

示例4: getCMSFields

 /**
  * {@inheritdoc}
  */
 public function getCMSFields()
 {
     $this->beforeUpdateCMSFields(function ($fields) {
         /**
          * @var FieldList $fields
          */
         $fields->push(DropdownField::create('BlogID', _t('BlogTagsWidget.Blog', 'Blog'), Blog::get()->map()));
     });
     return parent::getCMSFields();
 }
开发者ID:salted-herring,项目名称:silverstripe-blog,代码行数:13,代码来源:BlogTagsWidget.php

示例5: getCMSFields

 /**
  * {@inheritdoc}
  */
 public function getCMSFields()
 {
     $this->beforeUpdateCMSFields(function (FieldList $fields) {
         $fields[] = DropdownField::create('BlogID', _t('BlogCategoriesWidget.Blog', 'Blog'), Blog::get()->map());
         $fields[] = NumericField::create('Limit', _t('BlogCategoriesWidget.Limit.Label', 'Limit'), 0)->setDescription(_t('BlogCategoriesWidget.Limit.Description', 'Limit the number of categories shown by this widget (set to 0 to show all categories).'))->setMaxLength(3);
         $fields[] = DropdownField::create('Order', _t('BlogCategoriesWidget.Sort.Label', 'Sort'), array('Title' => 'Title', 'Created' => 'Created', 'LastUpdated' => 'Updated'))->setDescription(_t('BlogCategoriesWidget.Sort.Description', 'Change the order of categories shown by this widget.'));
         $fields[] = DropdownField::create('Direction', _t('BlogCategoriesWidget.Direction.Label', 'Direction'), array('ASC' => 'Ascending', 'DESC' => 'Descending'))->setDescription(_t('BlogCategoriesWidget.Direction.Description', 'Change the direction of ordering of categories shown by this widget.'));
     });
     return parent::getCMSFields();
 }
开发者ID:helpfulrobot,项目名称:silverstripe-blog,代码行数:13,代码来源:BlogCategoriesWidget.php

示例6: getCMSFields

 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $type = $this->dbObject("Type")->enumValues();
     foreach ($type as $k => $v) {
         $type[$k] = _t("BlogArchiveWidget." . ucfirst(strtolower($v)), $v);
     }
     $fields->merge(array(DropdownField::create("BlogID", _t("BlogArchiveWidget.Blog", "Blog"), Blog::get()->map()), DropdownField::create("Type", _t("BlogArchiveWidget.Type", "Type"), $type), NumericField::create("NumberToDisplay", _t("BlogArchiveWidget.NumberToDisplay", "No. to Display"))));
     $this->extend("updateCMSFields", $fields);
     return $fields;
 }
开发者ID:helpfulrobot,项目名称:micmania1-silverstripe-blog,代码行数:11,代码来源:BlogArchiveWidget.php

示例7: BlogLink

 function BlogLink()
 {
     if (empty($this->owner->BlogID)) {
         $entry = Director::get_current_page();
         if (is_a($entry, 'BlogPost')) {
             $this->owner->BlogID = $entry->Parent()->ID;
         } else {
             if (is_a($entry, 'Blog')) {
                 $this->owner->BlogID = $entry->ID;
             } else {
                 $this->owner->BlogID = Blog::get()->First()->ID;
             }
         }
     }
     return Blog::get()->byId($this->owner->BlogID)->Link();
 }
开发者ID:christopherbolt,项目名称:silverstripe-bolttools,代码行数:16,代码来源:BoltBlogCategory.php

示例8: getCMSFields

 /**
  * {@inheritdoc}
  */
 public function getCMSFields()
 {
     $self =& $this;
     $this->beforeUpdateCMSFields(function ($fields) use($self) {
         /**
          * @var Enum $archiveType
          */
         $archiveType = $self->dbObject('ArchiveType');
         $type = $archiveType->enumValues();
         foreach ($type as $k => $v) {
             $type[$k] = _t('BlogArchiveWidget.' . ucfirst(strtolower($v)), $v);
         }
         /**
          * @var FieldList $fields
          */
         $fields->merge(array(DropdownField::create('BlogID', _t('BlogArchiveWidget.Blog', 'Blog'), Blog::get()->map()), DropdownField::create('ArchiveType', _t('BlogArchiveWidget.ArchiveType', 'ArchiveType'), $type), NumericField::create('NumberToDisplay', _t('BlogArchiveWidget.NumberToDisplay', 'No. to Display'))));
     });
     return parent::getCMSFields();
 }
开发者ID:sunnysideup,项目名称:silverstripe-blog,代码行数:22,代码来源:BlogArchiveWidget.php

示例9: isset

    include "notification_system.inc.php";
}
?>
			<?php 
$p = isset($_GET["p"]) ? $_GET["p"] : "add";
switch ($p) {
    case "mod":
    case "add":
        $blog = new Blog();
        $data = array("head" => "", "subh" => "", "body" => "");
        $meta = array("allow_comments" => 1, "tags" => "", "published" => 1, "author" => $_SESSION["admin_user"]);
        $root = get_entities("zombie_roots", $_SESSION["id"], array("groups"));
        $root = explode(", ", $root["groups"]);
        $meta["groups"] = array("all");
        if (isset($_GET["id"]) && isset($_GET["p"]) && $_GET["p"] == "mod") {
            $data = $blog->get($_GET["id"], array("head", "subh", "body"));
            $meta = $blog->get_sub("meta", $_GET["id"], array("allow_comments", "tags", "author", "groups", "published"));
            $groups = explode(", ", $meta["groups"]);
        }
        ?>
			<form method="post" id="article_form" action="engine.php?action=<?php 
        echo $p == "add" ? "add_article" : "mod_article";
        if (isset($_GET["id"])) {
            echo "&amp;id=" . $_GET["id"];
        }
        ?>
" enctype="plain/text">
				<p>
				<label for="head">Header</label> <input type="text" name="head" id="head" value="<?php 
        echo $data["head"];
        ?>
开发者ID:BGCX261,项目名称:zombiecms-svn-to-git,代码行数:31,代码来源:blog.php

示例10: getDynamicCredits

 /**
  * Resolves dynamic authors linked to this post.
  *
  * @return ArrayList
  */
 protected function getDynamicCredits()
 {
     // Find best page to host user profiles
     $parent = $this->Parent();
     if (!$parent instanceof Blog) {
         $parent = Blog::get()->first();
     }
     // If there is no parent blog, return list undecorated
     if (!$parent) {
         $items = $this->Authors()->toArray();
         return new ArrayList($items);
     }
     // Update all authors
     $items = new ArrayList();
     foreach ($this->Authors() as $author) {
         // Add link for each author
         $author = $author->customise(array('URL' => $parent->ProfileLink($author->URLSegment)));
         $items->push($author);
     }
     return $items;
 }
开发者ID:javabrett,项目名称:silverstripe-blog,代码行数:26,代码来源:BlogPost.php

示例11: doSearch

 /**
  * Search blog
  * 
  * @param  Array     $data
  * @param  FieldList $fields
  * @return FieldList
  */
 public function doSearch(array $data, FieldList $fields)
 {
     $this->redirect(Blog::get()->First()->Link() . '?Search=' . $data['Keyword']);
 }
开发者ID:sentromedia,项目名称:letsfund,代码行数:11,代码来源:BlogSearchWidget.php

示例12: strtolower

			<?php 
if (isset($_GET["type"]) && isset($_GET["query"])) {
    $type = $_GET["type"];
    $query = strtolower($_GET["query"]);
    $search = new Search();
    switch ($type) {
        case "blog":
            $blog = new Blog();
            $results = $search->find_articles($query);
            if ($search->num_results() > 0) {
                ?>
<p>Order By: <a href="#" id="order_relevance">Relevance</a> | <a href="#" id="order_name">Name</a></p><?php 
                $sum = array_sum($results);
                $q = explode(" ", $query);
                foreach ($results as $key => $value) {
                    $current = $blog->get($key);
                    $current_meta = $blog->get_sub("meta", $key, array("tags", "author"));
                    echo "<div class=\"search_result\"><h2><a href=\"blog.php?p=read&amp;id={$key}\" rel=\"{$value}\" id=\"r{$key}\">", $current["head"], "</a></h2><h3>", $current["subh"], "</h3><span>Relevance: <strong>", substr($value / $sum * 100, 0, 5), "%</strong> ({$value} pts)</span><div class=\"article_body\" style=\"display: none; margin: 10px;\">";
                    echo "<p>";
                    $special_chars = array(".", ",", "-", "[", "]", "\\", "/", "|", "(", ")", "!", "@", "#", "\$", "%", "&", "*", "_", "?");
                    $body = str_replace(array("\n\n", "\n"), array("</p><p>", " <br /> "), $current["body"]);
                    $body = str_replace($special_chars, "", $body);
                    $body = explode(" ", $body);
                    foreach ($q as $qk => $qv) {
                        $color = "ff" . dechex($qk . "20") . "0f";
                        foreach ($body as $bk => $bv) {
                            if (ereg($qv, $bv)) {
                                $body[$bk] = str_replace($bv, "<span style=\"color: #{$color}; font-size: 18px; font-family: Tahoma\">" . $bv . "</span>", $body[$bk]);
                            }
                        }
                    }
开发者ID:BGCX261,项目名称:zombiecms-svn-to-git,代码行数:31,代码来源:search.php

示例13: Blog

     break;
 case 'create':
     // Insert into DB:
     // Check that this action request is not a CSRF hacked request:
     $Session->assert_received_crumb('collection');
     // Check permissions:
     $current_User->check_perm('blogs', 'create', true);
     $edited_Blog = new Blog(NULL);
     $edited_Blog->set('owner_user_ID', $current_User->ID);
     param('kind', 'string', true);
     $edited_Blog->init_by_kind($kind);
     if (!$current_User->check_perm('blog_admin', 'edit', false, $edited_Blog->ID)) {
         // validate the urlname, which was already set by init_by_kind() function
         // It needs to validated, because the user can not set the blog urlname, and every new blog would have the same urlname without validation.
         // When user has edit permission to blog admin part, the urlname will be validated in load_from_request() function.
         $edited_Blog->set('urlname', urltitle_validate($edited_Blog->get('urlname'), '', 0, false, 'blog_urlname', 'blog_ID', 'T_blogs'));
     }
     param('skin_ID', 'integer', true);
     $edited_Blog->set_setting('normal_skin_ID', $skin_ID);
     if ($edited_Blog->load_from_Request(array())) {
         // create the new blog
         $edited_Blog->create($kind);
         // We want to highlight the edited object on next list display:
         // $Session->set( 'fadeout_array', array( 'blog_ID' => array($edited_Blog->ID) ) );
         header_redirect($dispatcher . '?ctrl=coll_settings&tab=features&blog=' . $edited_Blog->ID);
         // will save $Messages into Session
     }
     break;
 case 'delete':
     // ----------  Delete a blog from DB ----------
     // Check that this action request is not a CSRF hacked request:
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:31,代码来源:collections.ctrl.php

示例14: getAllArchive

 function getAllArchive()
 {
     $linkingMode = '';
     if (is_a($this->owner, 'Blog_Controller')) {
         $blog = $this->owner;
         $year = $blog->getArchiveYear();
         $month = $blog->getArchiveMonth();
         $day = $blog->getArchiveDay();
         if (!$year && !$month && !$day) {
             $linkingMode = 'current';
         }
     } else {
         if (is_a($this->owner, 'BlogPost_Controller')) {
             $blog = $this->owner->Parent();
         } else {
             $blog = Blog::get()->First();
         }
     }
     return new ArrayData(array('Title' => 'All', 'LinkingMode' => $linkingMode, 'Link' => $blog->Link()));
 }
开发者ID:christopherbolt,项目名称:silverstripe-bolttools,代码行数:20,代码来源:BoltBlog.php

示例15: Blog

        }
        ?>
/>
				<input type="submit" class="btn" <?php 
        echo $p == "add" ? "value=\"Create a bloody masterpiece\" id=\"add_article\"" : "value=\"Re-animate\" id=\"mod_article\"";
        ?>
 /><img src="images/btn_right.png" alt="btn_right" class="btn_right" />
				</p>
			</form>
			<?php 
        break;
    case "read":
        if (isset($_GET['id'])) {
            $id = $_GET["id"];
            $blog = new Blog();
            $article = $blog->get($id);
            $meta = $blog->get_sub("meta", $id, array("author"));
            echo "<a href=\"blog.php?p=mod&amp;id=", $id, "\">Modify this Article</a> or <a href=\"blog.php?p=del&amp;id=", $id, "\">delete it</a>";
            echo "<h2>", $article["head"], "</h2>";
            if ($article["subh"] != null) {
                echo "<h3>", $article["subh"], " - By: ", $meta["author"], "</h3>";
            }
            $body = str_replace(array("\n\n", "\n"), array("</p><p>", "<br />"), $article["body"]);
            echo "<p>", $body, "</p>";
            echo "<a href=\"blog.php?p=mod&amp;id=", $id, "\">Modify this Article</a> or <a href=\"blog.php?p=del&amp;id=", $id, "\">delete it</a>";
        } else {
            echo "No article selected";
        }
        break;
    case "del":
        $id = $_GET["id"];
开发者ID:BGCX261,项目名称:zombiecms-svn-to-git,代码行数:31,代码来源:blog.php


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