本文整理汇总了PHP中Blog::getTaggedPostsIt方法的典型用法代码示例。如果您正苦于以下问题:PHP Blog::getTaggedPostsIt方法的具体用法?PHP Blog::getTaggedPostsIt怎么用?PHP Blog::getTaggedPostsIt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Blog
的用法示例。
在下文中一共展示了Blog::getTaggedPostsIt方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Blog
echo "<p>", $words->get("AboutUs_Greetings"), "</p>";
echo "<h3>", $words->get("AboutUs_GiveFeedback"), "</h3>";
echo "<p>", $words->get("AboutUs_GiveFeedbackText"), "</p>";
?>
</div>
</div>
<div class="c50r">
<div class="subcr">
<?php
echo "<h3>", $words->get("AboutUs_HowOrganized"), "</h3>";
echo "<p>", $words->get("AboutUs_HowOrganizedText"), "</p>";
//Blog model to fetch the Community News
$Blog = new Blog();
$postIt = $Blog->getTaggedPostsIt('Community News for the frontpage', true);
$format = array('short' => $words->getSilent('DateFormatShort'));
?>
<h3 class="first" ><a href="blog/tags/Community News for the frontpage"><?php
echo $words->getFormatted('CommunityNews');
?>
</a> <a href="rss/blog/tags/Community%20News%20for%20the%20frontpage"><img src="images/icons/feed.png" alt="<?php
echo $words->getSilent('GetRSSFeed');
?>
"></a><?php
echo $words->flushBuffer();
?>
</h3>
<div class="floatbox">
<?php
$i = 1;
示例2: htmlentities
echo $words->get('posts_tagged_with');
?>
: <em><?php
echo htmlentities($tag, ENT_COMPAT, 'utf-8');
?>
</em></h3>
<?php
$request = PRequest::get()->request;
$requestStr = implode('/', $request);
$matches = array();
if (preg_match('%/page(\\d+)%', $requestStr, $matches)) {
$page = $matches[1];
} else {
$page = 1;
}
$requestStr = preg_replace('%[/]page\\d+%', '', $requestStr);
// display matching tags and matching posts.
$postIt = $Blog->getTaggedPostsIt($tag, true);
$pages = PFunctions::paginate($postIt, $page);
$postIt = $pages[0];
$maxPage = $pages[2];
$pages = $pages[1];
$currentPage = $page;
foreach ($postIt as $blog) {
require 'blogitem.php';
}
$BlogView->pages($pages, $currentPage, $maxPage, $requestStr . '/page%d');
}
?>
</div>