本文整理匯總了PHP中CBlog::drawBlogs方法的典型用法代碼示例。如果您正苦於以下問題:PHP CBlog::drawBlogs方法的具體用法?PHP CBlog::drawBlogs怎麽用?PHP CBlog::drawBlogs使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CBlog
的用法示例。
在下文中一共展示了CBlog::drawBlogs方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: CBlog
// Include the essential config-file which also creates the $Orange variable with its defaults.
include __DIR__ . '/config.php';
// Do it and store it all in variables in the Orange container.
$Orange['title'] = "Edit blogpost";
$blog = new CBlog();
$filter = new CTextFilter();
if (isset($_POST['blogg'])) {
$name = $_POST['name'];
$content = $_POST['content'];
$content = $filter->doFilter(htmlentities($content, null, 'UTF-8'), 'markdown');
$published = date("Y-m-d H:i:s");
$blog->addPost($name, $content, $published);
header('Location: blog.php');
} else {
$res = $blog->getBlogContent();
$items = $blog->drawBlogs($res);
$Orange['main'] = <<<EOD
<div class="blogg">
<div class="rubrik"><p class="undertext">Bloggposter</p></div>
{$items}
</div>
<div class="blogg-form">
<div class="rubrik"><p class="undertext">Skriv ett blogg inlägg</p></div>
<form method="post" action="blog.php">
<p><label>Namn:<br/><input type='text' name='name' placeholder="Namn...."></label></p>
<p><label>Meddelande:<br/><textarea name='content' placeholder="Meddelande...."></textarea></label></p>
<div class="add"><input type='submit' name='blogg' value='Blogga'/></div>
</form>
</div>