function asdf_most_recent() { ?> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.js" type="text/javascript"></script> <script type="text/javascript" src="<?php echo bloginfo('stylesheet_directory'); ?> /asdf_most_recent.js"></script> <div class="widget"> <div class="asdf_most_recent"> <div class="buttons"> <h1 class="articles widget-title">ARTIKEL</h1> <h1 class="widget-title">·</h1> <h1 class="comments widget-title">KOMMENTARE</h1> <h1 class="widget-title">·</h1> <h1 class="tweets widget-title">TWEETS</h1> </div> <div class="content"> <div class="articles"> <?php display_articles(); ?> </div> <div class="comments"> <?php display_comments(); ?> </div> <div class="tweets"> <?php display_tweets(); ?> </div> </div> </div> </div> <?php }
$start = 0; } /* * 这里存在一个时间差的问题,可能会导致序号变乱。 * 原因在于两次调用 bbs_countarticles() 和 bbs_getarticles()。 */ if ($start == 0 || $start > $total - ARTCNT + 1) { if ($total <= ARTCNT) { $start = 1; $page = 1; } else { $start = $total - ARTCNT + 1; $page = ($start + ARTCNT - 1) / ARTCNT + 1; } } else { $page = ($start + ARTCNT - 1) / ARTCNT; } settype($page, "integer"); $articles = bbs_getarticles($brdarr["NAME"], $start, ARTCNT, $ftype); if ($articles == FALSE) { html_error_quit("读取文章列表失败"); } } else { $articles = 0; $start = 1; $page = 1; } bbs_safe_getboard($brdnum, $board, $brdarr); bbs_board_header($brdarr, $ftype, $managemode, $isnormalboard); display_articles($brdarr, $articles, $start, $ftype, $managemode, $page, $total, defined('BBS_NEWPOSTSTAT') && !$managemode && $isnormalboard && !$ftype, $isnormalboard); page_footer();