本文整理汇总了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;
}
示例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;
}
示例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());
}
示例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'));
}
示例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;
}
}
示例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);
}
示例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;
}