本文整理汇总了PHP中Blog::get_blog_url方法的典型用法代码示例。如果您正苦于以下问题:PHP Blog::get_blog_url方法的具体用法?PHP Blog::get_blog_url怎么用?PHP Blog::get_blog_url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Blog
的用法示例。
在下文中一共展示了Blog::get_blog_url方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show_blog_navigation
function show_blog_navigation($index, $total, $count, $lastPostOfPage)
{
global $blogSettings;
// Declare GLOBAL variables
$Blog = new Blog();
// Create a new instance of the Blog class
$url = $Blog->get_blog_url('page');
// Get the "page" URL
if ($lastPostOfPage) {
// Only show navigation if we've past the last post on the page
echo '<div class="blog_page_navigation">';
}
if ($index < $total && $lastPostOfPage) {
// Generate "Next Page" link
?>
<div class="left blog-next-prev-link">
<a href="<?php
echo $url . ($index + 1);
?>
">
← <?php
echo $blogSettings["nextpage"];
?>
</a>
</div>
<?php
}
if ($index > 0 && $lastPostOfPage) {
// Generate "Previous Page" link
?>
<div class="right blog-next-prev-link">
<a href="<?php
echo $index > 1 ? $url . ($index - 1) : substr($url, 0, -6);
?>
">
<?php
echo $blogSettings["previouspage"];
?>
→
</a>
</div>
<?php
}
if ($lastPostOfPage) {
// Close off the navigation
echo '<div id="clear"></div>';
echo '</div>';
}
}
示例2: bootstrap_get_blog_archives
/**
* bootstrap_get_blog_archives()
*
* This creates the HTML mark-up for the Blog Archives Widget in the
* blog template sidebar.
* This function supports the following plugins:
* - GetSimple Blog v1.4 & v3.x
* - GetSimple Blog v4.0+
* - NewsManager v2.0+
*
* @return (string) : Echos the HTML mark-up
*/
function bootstrap_get_blog_archives()
{
if (function_exists('show_blog_archives')) {
# GetSimple Blog v1.4 & v3.x
$Blog = new Blog();
$arch = $Blog->get_blog_archives();
if (!empty($arch)) {
foreach ($arch as $key => $item) {
$url = $Blog->get_blog_url('archive') . $key;
echo '<li class="list-group-item"><a href="' . $url . '">' . $item['title'] . '</a><span class="badge">' . $item['count'] . '</span></li>';
}
} else {
echo '<li class="list-group-item">Nothing in the Archive!<span class="badge">0</span></li>';
}
} elseif (function_exists('gsblog_show_archives')) {
# SimpleBlog v4.0+
gsblog_show_archives();
} elseif (function_exists('nm_blog_archives')) {
# NewsManager v2.0+
nm_blog_archives();
} else {
# No supported plugins found
?>
<li class="list-group-item">
<span class="badge">0</span>
No archives to show!
</li>
<?php
}
}
示例3: show_blog_navigation
/**
* Blog posts navigation (pagination)
*
* @param $index the current page index
* @param $total total number of pages
* @param $count current post
* @return void
*/
function show_blog_navigation($index, $total, $count, $lastPostOfPage)
{
global $blogSettings;
$Blog = new Blog();
$url = $Blog->get_blog_url('page');
if ($lastPostOfPage) {
echo '<div class="blog_page_navigation">';
}
if ($index < $total && $lastPostOfPage) {
?>
<div class="left blog-next-prev-link">
<a href="<?php
echo $url . ($index + 1);
?>
">
← <?php
echo $blogSettings["nextpage"];
?>
</a>
</div>
<?php
}
?>
<?php
if ($index > 0 && $lastPostOfPage) {
?>
<div class="right blog-next-prev-link">
<a href="<?php
echo $index > 1 ? $url . ($index - 1) : substr($url, 0, -6);
?>
">
<?php
echo $blogSettings["previouspage"];
?>
→
</a>
</div>
<?php
}
?>
<?php
if ($lastPostOfPage) {
echo '<div id="clear"></div>';
echo '</div>';
}
}
示例4: edit_categories
/**
* Show Category management area
*
* @return void
*/
function edit_categories()
{
$Blog = new Blog();
$category_file = getXML(BLOGCATEGORYFILE);
?>
<h3><?php
i18n(BLOGFILE . '/MANAGE_CATEGORIES');
?>
</h3>
<form class="largeform" action="load.php?id=blog&categories&edit_category" method="post">
<div class="leftsec">
<p>
<label for="page-url"><?php
i18n(BLOGFILE . '/ADD_CATEGORY');
?>
</label>
<input class="text" type="text" name="new_category" value="" />
</p>
</div>
<div class="clear"></div>
<table class="highlight">
<tr>
<th><?php
i18n(BLOGFILE . '/CATEGORY_NAME');
?>
</th>
<th><?php
i18n(BLOGFILE . '/RSS_FEED');
?>
</th>
<th><?php
i18n(BLOGFILE . '/DELETE');
?>
</th>
</tr>
<?php
foreach ($category_file->category as $category) {
?>
<tr>
<td><?php
echo $category;
?>
</td>
<td><a href="<?php
echo $Blog->get_blog_url('rss') . '?filter=category&value=' . $category;
?>
" target="_blank"><img src="../plugins/blog/images/rss_feed.png" class="rss_feed" /></a></td>
<td class="delete" ><a href="load.php?id=blog&categories&delete_category=<?php
echo $category;
?>
" title="Delete Category: <?php
echo $category;
?>
" >X</a></td>
</tr>
<?php
}
?>
</table>
<p>
<span>
<input class="submit" type="submit" name="category_edit" value="<?php
i18n(BLOGFILE . '/ADD_CATEGORY');
?>
" />
</span>
<?php
i18n(BLOGFILE . '/OR');
?>
<a href="load.php?id=blog" class="cancel"><?php
i18n(BLOGFILE . '/CANCEL');
?>
</a>
</p>
</form>
<?php
}