</div> </td> <td class="post-title"> <div class="content"><a href="../topic/%d?page=13#%d">ā%sā</a></div> <div class="desc">[<a href="../%d/" class="forum-source">%s</a>] <a href="../topic/%d?page=13#%d">%s</a> - %s</div> </td> <td class="post-pageNav"> </td> <td class="post-author"> <span class="type-blizzard">%s<img src="/wow/static/images/layout/cms/icon_blizzard.gif" alt="" /> </span> </td> </tr>', $post['thread_id'], $post['thread_id'], $post['post_id'], WoW_Locale::getString('template_blizztracker_jump_first'), $post['thread_id'], $post['thread_id'], $post['message_short'], $post['cat_id'], $post['categoryTitle'], $post['thread_id'], $post['post_id'], $post['threadTitle'], $before_text, $post['author']); } } ?> </tbody> </table> </div> <div class="forum-actions topic-bottom"> <div class="actions-panel"> <?php // paging echo WoW_Paginator::Initialize(WoW_Template::GetPageData('current_page'), $total_blizz_posts, 15, 'blizztracker'); ?> </div> </div> </div> </div> </div> </div>
public static function paginate() { $output = ''; self::$total_pages = ceil(self::$_total_results / self::$_per_page); if (self::$total_pages <= 1) { return false; } if (self::$_current_page > self::$total_pages) { self::$_current_page = self::$total_pages; } if (self::$total_pages <= 5) { self::$_padding_l = self::$_current_page; self::$_padding_r = self::$total_pages - self::$_current_page; self::$tpl_last = NULL; self::$tpl_first = NULL; } elseif (self::$total_pages > 5) { if (self::$_current_page < 4) { self::$tpl_first = NULL; self::$_padding_r = 4 - self::$_current_page; $remain = self::$total_pages - self::$_current_page; self::$_padding_l = $remain == 2 ? 1 : ($remain == 0 ? 3 : 2); } else { if (self::$total_pages - self::$_current_page > 2) { self::$_padding_l = 1; } else { $remain = self::$total_pages - self::$_current_page; self::$_padding_l = $remain == 2 ? 1 : ($remain == 0 ? 3 : 2); } self::$_padding_r = self::$total_pages - self::$_current_page > 2 ? 1 : self::$total_pages - self::$_current_page; if (self::$_current_page + 2 >= self::$total_pages) { self::$tpl_last = NULL; } } } $start = self::$_current_page - self::$_padding_l < 1 ? 1 : self::$_current_page - self::$_padding_l; $finish = self::$_current_page + self::$_padding_r; ########################################## # ADD PREV TO OUTPUT IF CURRENT PAGE > 1 # ########################################## if (self::$_current_page > 1 && self::$tpl_prev != NULL) { $output .= preg_replace('/\\{link\\}/i', self::$link_prefix . (self::$_current_page - 1) . self::$link_suffix, self::$tpl_prev); } ########################################### # ADD FIRST TO OUTPUT IF CURRENT PAGE > 1 # ########################################### if (self::$_current_page > 1 && self::$tpl_first != NULL) { $patterns = array('/\\{link\\}/i', '/\\{page\\}/i'); $replaces = array(self::$link_prefix . '1' . self::$link_suffix, '1'); $output .= preg_replace($patterns, $replaces, self::$tpl_first); } ################################################ # GET LIST OF LINKED NUMBERS AND ADD TO OUTPUT # ################################################ $nums = array(); for ($i = $start; $i <= $finish; $i++) { if ($i == self::$_current_page) { $nums[] = preg_replace('/\\{page\\}/i', $i, self::$tpl_cur_page_num); } else { $patterns = array('/\\{link\\}/i', '/\\{page\\}/i'); $replaces = array(self::$link_prefix . $i . self::$link_suffix, $i); $nums[] = preg_replace($patterns, $replaces, self::$tpl_page_nums); } } $output .= implode(self::$separator, $nums); ############################################ # ADD LAST TO OUTPUT IF FINISH < MAX PAGES # ############################################ if (self::$_current_page < $finish && self::$tpl_last != NULL) { $patterns = array('/\\{link\\}/i', '/\\{page\\}/i'); $replaces = array(self::$link_prefix . self::$total_pages . self::$link_suffix, self::$total_pages); $output .= preg_replace($patterns, $replaces, self::$tpl_last); } ################################################## # ADD NEXT TO OUTPUT IF CURRENT PAGE < MAX PAGES # ################################################## if (self::$_current_page < self::$total_pages && self::$tpl_next != NULL) { $output .= preg_replace('/\\{link\\}/i', self::$link_prefix . (self::$_current_page + 1) . self::$link_suffix, self::$tpl_next); } return self::$_output = sprintf(self::$outside_template, $output); }
<a class="ui-button button2 " href="#new-post" onclick="Cms.Topic.quote(%d);"><span><span><span class="icon-quote">%s</span></span></span></a> </div> <span class="clear"><!-- --></span> </div> </div> </div>', $post['post_id'], $post['blizzpost'] ? ' blizzard' : null, $post_num, $post['blizzpost'] ? 'javascript:;' : $character_url, $post['race'], $post['gender'], $post['author'], $post['blizzpost'] ? ' style="display: none; "' : null, $post['author'], $post['guildName'], $character_links, $post['blizzpost'] ? 'javascript:;' : $character_url, $post['blizzpost'] ? null : ' color-c' . $post['class'], $post['author'], $post['blizzpost'] ? ' class="blizzard-title"' : null, $post['blizzpost'] ? WoW_Locale::GetString('template_forum_blizz_title') : $character_description, $post['edit_date'] != null ? sprintf(WoW_Locale::GetString('template_forum_post_edited'), $post['author'], $post['formated_edit_date']) : null, $post['message'], $post_num, $post_num, $post['fully_formated_date'], $post['formated_date'], $blizz_icon_link, $post['bn_id'] == WoW_Account::GetUserID() ? $post_options : null, WoW_Locale::GetString('template_blog_answer'), $post['post_id'], WoW_Locale::GetString('template_forum_post_quote')); } ++$post_num; } } ?> </div> <div class="forum-actions bottom"> <div class="actions-panel"> <?php echo WoW_Paginator::Initialize(WoW_Template::GetPageData('current_page'), WoW_Forums::GetTotalThreadPosts(), 20, 'forum'); echo WoW_Template::NavigationMenu(); ?> <span class="clear"><!-- --></span> </div> </div> <div class="talkback"><a id="new-post"></a> <form method="post" onsubmit="return Cms.Topic.postValidate(this);" action="#new-post"> <div> <input type="hidden" name="xstoken" value="fbc9d52f-99bf-4639-b2b5-7a535e7f31fe"/> <input type="hidden" name="sessionPersist" value="forum.topic.post"/> <div class="post "> <?php if (WoW_Forums::IsClosedThread()) { echo sprintf('<table class="dynamic-center "><tr><td>%s</td></tr></table>', WoW_Locale::GetString('template_forum_topic_closed')); } elseif (!WoW_Account::IsLoggedIn()) {