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


PHP Blog::getBlog方法代码示例

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


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

示例1: get

	protected function get($year, $month, $day, $id, $language = null)
	{
		if ($language == null) $language = CoOrg::getLanguage();
		$this->_blog = Blog::getBlog($year, $month, $day, $id, $language);
		if (!$this->_blog)
		{
			$this->error(t('Blog item is not found'));
			$this->notFound();
			return false;
		}
		return true;
	}
开发者ID:nathansamson,项目名称:CoOrg,代码行数:12,代码来源:blog.controller.php

示例2: get

	protected function get($date, $ID, $language)
	{
		list($year, $month, $day) = explode('-', $date);
		$this->_blog = Blog::getBlog($year, $month, $day, $ID, $language);
		return true;
	}
开发者ID:nathansamson,项目名称:CoOrg,代码行数:6,代码来源:blog.tag.controller.php

示例3: testEnableCommentsTestExpirationDate

	public function testEnableCommentsTestExpirationDate()
	{
		$blog = Blog::getBlog('2010', '04', '11', 'xyz', 'en');
		$this->assertFalse($blog->allowComments());
		$blog->text = 'Update';
		$blog->commentsOpenFor = 14;
		$blog->commentsAllowed = true;
		$blog->save();
		
		$blog = Blog::getBlog('2010', '04', '11', 'xyz', 'en');
		$this->assertFalse($blog->allowComments());
		$blog->commentsOpenFor = 356*30; // ~30 year
		$blog->save();
		
		$blog = Blog::getBlog('2010', '04', '11', 'xyz', 'en');
		$this->assertTrue($blog->allowComments());
	}
开发者ID:nathansamson,项目名称:CoOrg,代码行数:17,代码来源:blog.model.Test.php

示例4: testTranslateSaveOtherLanguage

	public function testTranslateSaveOtherLanguage()
	{
		$this->login('nathan');
		$this->request('blog/translateSave', array('year'=>2010,
		                                       'month' => '04',
		                                        'day' => '10',
		                                        'id' => 'some-other-blog',
		                                        'fromLanguage' => 'en',
		                                        'title' => 'Vertaald',
		                                        'text' => 'Vertaalde tekst',
		                                        'language' => 'nl'));

		
		$this->assertFlashNotice('Your translation of the blog is saved');
		$this->assertRedirected('blog/show/2010/04/10/vertaald/nl');

		$this->assertNotNull(Blog::getBlog(2010, 4, 10, 'vertaald', 'nl'));
	}
开发者ID:nathansamson,项目名称:CoOrg,代码行数:18,代码来源:blog.controller.Test.php

示例5: findComment

	protected function findComment($ID)
	{
		$this->_comment = BlogComment::get($ID);
		if ($this->_comment)
		{
			$year = date('Y', $this->_comment->blogDatePosted);
			$month = date('m', $this->_comment->blogDatePosted);
			$day = date('d', $this->_comment->blogDatePosted);
			$this->_blog = Blog::getBlog($year, $month, $day,
			                             $this->_comment->blogID,
			                             $this->_comment->blogLanguage);
			return true;
		}
		else
		{
			return false;
		}
	}
开发者ID:nathansamson,项目名称:CoOrg,代码行数:18,代码来源:blog.comment.controller.php

示例6: testUnmarkSpam

	public function testUnmarkSpam()
	{
		$this->login('nathan');
		
		$this->request('blog/comment/notspam', array(
			'commentID' => 3));
		$this->assertFlashNotice('Comment unmarked as spam');
		$this->assertRedirected('blog/show/2010/4/11/xyz');
		$blog = Blog::getBlog('2010', '04', '11', 'xyz', 'en');
		$comment = $blog->comments[1];
		$this->assertEquals(3, $comment->ID);
		$this->assertEquals(PropertySpamStatus::OK, $comment->spamStatus);
	}
开发者ID:nathansamson,项目名称:CoOrg,代码行数:13,代码来源:blog.comment.controller.Test.php

示例7: Blog

<?php

$model = $_REQUEST['model'];
$action = $_REQUEST['action'];
include_once MODELS_ADMIN . "/" . $model . "_model.php";
switch (strtoupper($action)) {
    case 'ADD':
        if (isset($_REQUEST['btn_submit']) && $_REQUEST['btn_submit'] == 'Save') {
            $objBlog = new Blog();
            $objBlog->setBlog($_REQUEST);
            $objComm->redirect('index.php?model=' . $model);
        }
        break;
    case 'VIEW':
    case 'EDIT':
        if (isset($_REQUEST['btn_submit']) && $_REQUEST['btn_submit'] == 'Update') {
            $objBlog = new Blog();
            $objBlog->setBlog($_REQUEST);
            $objComm->redirect('index.php?model=' . $model . '&action=edit&id=' . $_REQUEST['pk_id']);
        } else {
            $objBlog = new Blog();
            $datum = $objBlog->getBlog($_REQUEST['id']);
        }
        break;
    default:
        $objBlog = new Blog();
        $data = $objBlog->getAllBlog();
        break;
}
开发者ID:business-expert,项目名称:prnsc,代码行数:29,代码来源:blog.php


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