\E(.+?)\Q
\E~; return $html_header; } =head2 PrintHibernalHeader Prints the title and subtitle for other hibernal and hibernal archive pages. (This does not print the title or subtitle for the hibernal front page, as that's embedded in the physical markup for that page.) =cut sub PrintHibernalHeader { my ($page_title_default, $page_subtitle_default, $suffix) = @_; $page_title = GetParam('title', $page_title_default); $page_subtitle = GetParam('subtitle', $page_subtitle_default); # Avoid tainting the $page_title and $page_subtitle globals with the suffix. my ($page_title_suffixed, $page_subtitle_suffixed) = ($page_title, $page_subtitle); if ($is_smarttitles_installed and $page_subtitle) { $page_subtitle_suffixed .= $suffix; } else { $page_title_suffixed .= $suffix; } # Note: we musn't call "GetHibernalHeader", as that could, conceivably, record # the suffix for this page's title or subtitle within the string for # that title or subtitle - which, in recursive turn, would badly cause # that suffix to be appended to the "next" page's title or subtitle, # again. (Good grief, eh? There's little relief, here, for insanity...) print GetHibernalHeaderOld(undef, $page_title_suffixed, undef, undef, undef, undef, $page_subtitle_suffixed); } # ....................{ HIBERNAL }.................... =head2 DoHibernal Prints all blog posts matched by the passed regular expression and limit bounds. =cut sub DoHibernal { my $post_name_regexp = GetParam('post_name_regexp', $HibernalDefaultPostNameRegexp); my $post_body_regexp = GetParam('post_body_regexp', ''); my $posts_start_at = GetParam('posts_start_at', 0); my $posts_per_page = GetParam('posts_per_page', $HibernalDefaultPostsPerPage); my $posts_ordering = GetParam('posts_ordering', ''); PrintHibernalHeader(T($HibernalDefaultTitle), T($HibernalDefaultSubtitle), Tss($HibernalTitleOrSubtitleSuffix, $posts_start_at, $posts_start_at + $posts_per_page - 1)); print $q->start_div({-class=> 'content'}); PrintHibernal($post_name_regexp, $post_body_regexp, $posts_start_at, $posts_per_page, $posts_ordering); print $q->end_div(); PrintFooter(); } =head2 PrintHibernal Prints all blog posts for the current set of blog posts, followed by a set of links for navigating, managing, and otherwise munging those entries. =cut sub PrintHibernal { return if $HibernalIsCurrentlyPrinting; # avoid infinite loops local $HibernalIsCurrentlyPrinting = 1; my ($post_name_regexp, $post_body_regexp, $posts_start_at, $posts_per_page, $posts_ordering) = @_; # As this function may, also, be called by HibernalRule(), we must establish # some decent defaults. $post_name_regexp = $HibernalDefaultPostNameRegexp unless $post_name_regexp; $posts_start_at = 0 unless $posts_start_at; $posts_per_page = $HibernalDefaultPostsPerPage unless $posts_per_page > 0; $posts_per_page = $HibernalMaximumPostsPerPage unless $posts_per_page <= $HibernalMaximumPostsPerPage; # Implicitly ensure the regular expression also includes comments on all # pages matched by this regular expression. if ($post_name_regexp !~ m~^\Q^($CommentsPrefix)?\E~ and not $post_name_regexp =~ s~^\^~^($CommentsPrefix)?~) { $post_name_regexp = "^($CommentsPrefix)?.*$post_name_regexp"; } my @post_names = sort SortHibernalPostNames ( # passes, not calls, SortHibernalPostNames() grep(/$post_name_regexp/, $post_body_regexp ? SearchTitleAndBody($post_body_regexp) : AllPagesList())); $posts_ordering and OrderHibernalPostNames(\@post_names, $posts_ordering); if (defined $post_names[$posts_start_at]) { my $posts_end_at; # If this Oddmuse Wiki supports comment pages, the determination of how many # posts to display becomes a complex to this linear calculation. if ($CommentsPrefix) { ($posts_start_at, $posts_end_at) = AssayHibernalPostBounds(\@post_names, $posts_start_at, $posts_end_at, $posts_per_page); } # If this Oddmuse Wiki doesn't support comment pages, the determination of # how many posts P to display devolves to this linear calculation. else { $posts_end_at = Max($posts_start_at + $posts_per_page - 1, $#post_names); } # Calculate this prior to performing array splices. my $is_older_posts = $#post_names > $posts_end_at; @post_names = @post_names[$posts_start_at..$posts_end_at]; # ...now, do it! # Note: we pass the boolean signifying whether there are older posts; since # we have truncated the @post_names array, it's no longer sufficient to test # that array's length to determine whether there are such posts. @post_names and PrintHibernalContent(\@post_names, $post_name_regexp, $post_body_regexp, $posts_start_at, $posts_end_at, $posts_per_page, $posts_ordering, $is_older_posts); } } =head2 SortHibernalPostNames Sorts the posts on a hibernal page, according to the Wiki names for those posts and ensuring that the comment page for a post is sorted after that post. This function should, probably, be the C' . GetHibernalArchiveMonth($post_name_regexp, $year, $month) . ' | '; # Enforce the customary calendar layout of three months per calendar row. print '