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


PHP get_archives函数代码示例

本文整理汇总了PHP中get_archives函数的典型用法代码示例。如果您正苦于以下问题:PHP get_archives函数的具体用法?PHP get_archives怎么用?PHP get_archives使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: b_wp_archives_monthly_show

function b_wp_archives_monthly_show($options)
{
    $block_style = $options[0] ? $options[0] : 0;
    $with_count = $options[1] == 0 ? false : true;
    $id = 1;
    global $dateformat, $time_difference, $siteurl, $blogfilename;
    global $tablelinks, $tablelinkcategories;
    global $querystring_start, $querystring_equal, $querystring_separator, $month, $wpdb, $start_of_week;
    global $tableposts, $tablepost2cat, $tablecomments, $tablecategories;
    global $smilies_directory, $use_smilies, $wp_smiliessearch, $wp_smiliesreplace;
    global $wp_bbcode, $use_bbcode, $wp_gmcode, $use_gmcode, $use_htmltrans, $wp_htmltrans, $wp_htmltranswinuni;
    require_once dirname(__FILE__) . '/../wp-blog-header.php';
    ob_start();
    if ($block_style == 0) {
        // Simple Listing
        get_archives('monthly', '', 'html', '', '', $with_count);
    } else {
        // Dropdown Listing
        echo '<form name="archiveform" action="">';
        echo '<select name="archive_chrono" onchange="window.location = (document.forms.archiveform.archive_chrono[document.forms.archiveform.archive_chrono.selectedIndex].value);"> ';
        echo '<option value="">' . _WP_BY_MONTHLY . '</option>';
        get_archives('monthly', '', 'option', '', '', $with_count);
        echo '</select>';
        echo '</form>';
    }
    $block['content'] = ob_get_contents();
    ob_end_clean();
    return $block;
}
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:29,代码来源:wp_archives_monthly.php

示例2: b_wp_archives_monthly_show

 function b_wp_archives_monthly_show($options, $wp_num = "")
 {
     $block_style = $options[0] ? $options[0] : 0;
     $with_count = $options[1] == 0 ? false : true;
     global $wpdb, $siteurl, $wp_id, $wp_inblock, $use_cache;
     $id = 1;
     $use_cache = 1;
     if ($wp_num == "") {
         $wp_id = $wp_num;
         $wp_inblock = 1;
         require dirname(__FILE__) . '/../wp-config.php';
         $wp_inblock = 0;
     }
     ob_start();
     if ($block_style == 0) {
         // Simple Listing
         get_archives('monthly', '', 'html', '', '', $with_count);
     } else {
         // Dropdown Listing
         echo '<form name="archiveform' . $wp_num . '" action="">';
         echo '<select name="archive_chrono" onchange="window.location = (document.forms.archiveform' . $wp_num . '.archive_chrono[document.forms.archiveform' . $wp_num . '.archive_chrono.selectedIndex].value);"> ';
         echo '<option value="">' . _WP_BY_MONTHLY . '</option>';
         get_archives('monthly', '', 'option', '', '', $with_count);
         echo '</select>';
         echo '</form>';
     }
     $block['content'] = ob_get_contents();
     ob_end_clean();
     return $block;
 }
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:30,代码来源:wp_archives_monthly.php

示例3: smarty_get_archives

function smarty_get_archives($params)
{
    $type = '';
    $limit = '';
    $format = 'html';
    $before = '';
    $after = '';
    extract($params);
    return get_archives($type, $limit, $format, $before, $after);
}
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:10,代码来源:class-smarty.php

示例4: b_wp_archives_monthly_show

function b_wp_archives_monthly_show($option)
{
    $id = 1;
    require_once dirname(__FILE__) . '/../wp-blog-header.php';
    global $wpdb, $tablecomments, $tableposts;
    ob_flush();
    ob_start();
    get_archives('monthly');
    $block['content'] = ob_get_contents();
    ob_end_clean();
    return $block;
}
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:12,代码来源:wp_archives_monthly.php

示例5: b_wp_archives_monthly_show

function b_wp_archives_monthly_show($option)
{
    $id = 1;
    global $dateformat, $time_difference, $siteurl, $blogfilename;
    global $tablelinks, $tablelinkcategories;
    global $querystring_start, $querystring_equal, $querystring_separator, $month, $wpdb, $start_of_week;
    global $tableposts, $tablepost2cat, $tablecomments, $tablecategories;
    require_once dirname(__FILE__) . '/../wp-blog-header.php';
    ob_start();
    get_archives('monthly');
    $block['content'] = ob_get_contents();
    ob_end_clean();
    return $block;
}
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:14,代码来源:wp_archives_monthly.php

示例6: b_wp_archives_monthly_show

 function b_wp_archives_monthly_show($options, $wp_num = "")
 {
     $block_style = $options[0] ? $options[0] : 0;
     $with_count = $options[1] == 0 ? false : true;
     $id = 1;
     $GLOBALS['use_cache'] = 1;
     if ($wp_num == "") {
         $GLOBALS['wp_id'] = $wp_num;
         $GLOBALS['wp_inblock'] = 1;
         require dirname(__FILE__) . '/../wp-config.php';
         $GLOBALS['wp_inblock'] = 0;
     }
     $sel_value = '';
     if (current_wp()) {
         init_param('GET', 'm', 'string', '');
         init_param('GET', 'year', 'integer', '');
         init_param('GET', 'monthnum', 'integer', '');
         if (strlen(get_param('m')) == 6) {
             $sel_value = get_param('m');
         } else {
             if (test_param('year') && test_param('monthnum')) {
                 $sel_value = get_param('year') . zeroise(get_param('monthnum'), 2);
             }
         }
     }
     ob_start();
     block_style_get($wp_num);
     if ($block_style == 0) {
         // Simple Listing
         echo "<ul class='wpBlockList'>\n";
         get_archives('monthly', '', 'html', '', '', $with_count);
         echo "</ul>\n";
     } else {
         // Dropdown Listing
         echo '<form name="archiveform' . $wp_num . '" id="archiveform' . $wp_num . '" action="#">';
         echo '<select name="archive_chrono" onchange="window.location = (document.forms.archiveform' . $wp_num . '.archive_chrono[document.forms.archiveform' . $wp_num . '.archive_chrono.selectedIndex].value);"> ';
         echo '<option value="">' . _WP_BY_MONTHLY . '</option>';
         get_archives('monthly', '', 'option', '', '', $with_count, $sel_value);
         echo '</select>';
         echo '</form>';
     }
     $block['content'] = ob_get_contents();
     ob_end_clean();
     return $block;
 }
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:45,代码来源:wp_archives_monthly.php

示例7: _b_wp_archives_monthly_show

 function _b_wp_archives_monthly_show($options, $wp_num = '')
 {
     $block_style = $options[0] ? $options[0] : 0;
     $with_count = $options[1] == 0 ? false : true;
     $sel_value = '';
     if (current_wp()) {
         if (!empty($_SERVER['PATH_INFO'])) {
             permlink_to_param();
         }
         init_param('GET', 'm', 'string', '');
         init_param('GET', 'year', 'integer', '');
         init_param('GET', 'monthnum', 'integer', '');
         if (strlen(get_param('m')) == 6) {
             $sel_value = get_param('m');
         } else {
             if (test_param('year') && test_param('monthnum')) {
                 $sel_value = get_param('year') . zeroise(get_param('monthnum'), 2);
             }
         }
     }
     ob_start();
     block_style_get($wp_num);
     if ($block_style == 0) {
         // Simple Listing
         echo '<ul class="wpBlockList">' . "\n";
         get_archives('monthly', '', 'html', '', '', $with_count);
         echo '</ul>' . "\n";
     } else {
         // Dropdown Listing
         echo '<form name="archiveform' . $wp_num . '" id="archiveform' . $wp_num . '" action="#">';
         echo '<select name="archive_chrono" onchange="window.location = (document.forms.archiveform' . $wp_num . '.archive_chrono[document.forms.archiveform' . $wp_num . '.archive_chrono.selectedIndex].value);"> ';
         echo '<option value="' . wp_siteurl() . '">' . _WP_BY_MONTHLY . '</option>';
         get_archives('monthly', '', 'option', '', '', $with_count, $sel_value);
         echo '</select>';
         echo '</form>';
     }
     $block['content'] = ob_get_contents();
     ob_end_clean();
     return $block;
 }
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:40,代码来源:wp_archives_monthly.php

示例8: widget_oceanmist_browse

function widget_oceanmist_browse()
{
    ?>
	<div class="widget">
	<div class="title"><h2><?php 
    _e('Browse');
    ?>
</h2></div>
		<select name="archivemenu" onchange="document.location.href=this.options[this.selectedIndex].value;">
		<option value=""><?php 
    _e('Monthly Archives');
    ?>
</option>
<?php 
    get_archives('monthly', '', 'option', '', '', '');
    ?>
		</select>
<?php 
    get_search_form();
    ?>
	</div>
<?php 
}
开发者ID:rmccue,项目名称:wordpress-unit-tests,代码行数:23,代码来源:functions.php

示例9: the_header

 * The archive page template file
 *
 * This file will be loaded whenever a
 * request for a the archive is made
 * e.g http://example.com/archive/
 *
 */
the_header();
?>

<div class="col col-12 no-gutter tablet-col tablet-huge-gutter tablet-col-9 tablet-right-gutter">

	<h1>Archives</h1>

	<?php 
$archive = get_archives();
?>

	<?php 
if (have_posts()) {
    ?>

		<?php 
    foreach ($archive as $year => $month_group) {
        ?>
			<ul class="year">
				<li>
					<span><?php 
        echo $year;
        ?>
</span>
开发者ID:kanso-cms,项目名称:cms,代码行数:31,代码来源:archive.php

示例10: _e

	<div id="sidebar">
      <?php 
if (!function_exists('dynamic_sidebar') || !dynamic_sidebar()) {
    ?>
		
	  <div class="title">
        <h2>Browse</h2>
      </div>
      <div class="post">
        <select name="archivemenu" onchange="document.location.href=this.options[this.selectedIndex].value;">
		<option value=""><?php 
    _e('Monthly Archives');
    ?>
</option>
          <?php 
    get_archives('monthly', '', 'option', '', '', '');
    ?>
        </select>		
        <?php 
    include TEMPLATEPATH . '/searchform.php';
    ?>
	  </div>
	  <div class="title">
        <h2>Links</h2>
      </div>
	  <div class="post">
	    <ul>
          <?php 
    get_linksbyname('', '<li>', '</li>', '', TRUE, 'name', FALSE);
    ?>
		</ul>
开发者ID:rmccue,项目名称:wordpress-unit-tests,代码行数:31,代码来源:sidebar.php

示例11: get_archives

<div id="sidebar">

<?php 
include TEMPLATEPATH . "/ads.php";
?>

<div id="sidebar_full">

<div id="tabber" class="tabber">

<div class="tabbertab" title="Recent Posts">
<ul>
<li><ul>
<?php 
get_archives('postbypost', 8);
?>
</ul></li>
</ul>
</div>

<div class="tabbertab" title="Your say">
<ul><li>
<?php 
include TEMPLATEPATH . '/simple_recent_comments.php';
/* recent comments plugin by: www.g-loaded.eu */
if (function_exists('src_simple_recent_comments')) {
    src_simple_recent_comments(8, 60, '', '');
}
?>
</li>
开发者ID:prabhu,项目名称:desistartups,代码行数:30,代码来源:sidebar.php

示例12: esc_url

<div id="sidebar">
	<form role="search" method="get" class="searchform" action="<?php 
echo esc_url(home_url('/'));
?>
">
		<div>
			<input placeholder="Search Posts..." type="text" value="<?php 
echo get_search_query();
?>
" name="s" id="s" />
			<input type="submit" id="searchsubmit" value="<?php 
echo esc_attr_x('Search', 'submit button');
?>
" />
		</div>
	</form>

	<h3>Recent Posts</h3>
    <ul>
    	<?php 
get_archives('postbypost', '5', 'custom', '<li>', '</li>');
?>
    </ul>
    <h3>Categories</h3>
    <ul>
    	<?php 
wp_list_cats('sort_column=name');
?>
    </ul>
</div><!-- #secondary -->
开发者ID:thirteen05,项目名称:icy-install,代码行数:30,代码来源:sidebar.php

示例13: wp_list_categories

				<ul><?php 
    wp_list_categories("title_li=");
    ?>
</ul>
			</li>

			<?php 
    if (is_single() or is_archive() or is_tag() or is_page()) {
        ?>
			<li id="recent-posts" class="widget-container">
				<h3 class="widget-title"><?php 
        _e("Recent Posts");
        ?>
</h3>
				<ul><?php 
        get_archives("postbypost", 10);
        ?>
</ul>
			</li>
			<?php 
    }
    ?>

			<?php 
    if (is_home()) {
        ?>
			<li id="random-posts" class="widget-container">
				<h3 class="widget-title"><?php 
        _e("Random Posts");
        ?>
</h3>
开发者ID:shuaica,项目名称:97world_GWhite,代码行数:31,代码来源:sidebar.php

示例14: get_archives

<!-- begin l_sidebar -->

	<div id="l_sidebar">

	<?php 
if (function_exists('dynamic_sidebar') && dynamic_sidebar(1)) {
} else {
    ?>
	

	<h2>Recently Written</h2>
		<ul>
		<?php 
    get_archives('postbypost', 10);
    ?>
		</ul>



	<h2>Categories</h2>
		<ul>
		<?php 
    wp_list_cats('sort_column=name');
    ?>
		</ul>

		

	<h2>Archives</h2>
		<ul>
		<?php 
开发者ID:serjmic,项目名称:Lite-Dance,代码行数:31,代码来源:l_sidebar.php

示例15: get_calendar

	<h3><em>Calendar</em></h3>

	<?php 
        get_calendar();
        ?>

	<?php 
        if (!is_page("archives")) {
            ?>

		<h3><em>Posts by Month</em></h3>

		<ul class="months">
		<?php 
            get_archives('monthly', '', '', '<li>', '</li>', '');
            ?>
		</ul>

	<?php 
        }
        ?>

	<h3><em>Posts by Category</em></h3>

	<ul class="categories">
	<?php 
        wp_list_cats('sort_column=name&hide_empty=0');
        ?>
 
	</ul>
开发者ID:rmccue,项目名称:wordpress-unit-tests,代码行数:30,代码来源:sidebar.php


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