- }
-
- @list=sort { $pagectime{$b} <=> $pagectime{$a} } @list;
- return @list if ! $maxitems || @list <= $maxitems;
- return @list[0..$maxitems - 1];
-} #}}}
-
-sub get_inline_content ($$) { #{{{
- my $parentpage=shift;
- my $page=shift;
-
- my $file=$pagesources{$page};
- my $type=pagetype($file);
- if ($type ne 'unknown') {
- return htmlize($type, linkify(readfile("$config{srcdir}/$file"), $parentpage));
- }
- else {
- return "";
- }
-} #}}}
-
-sub postprocess_html_inline { #{{{
- my $parentpage=shift;
- my %params=@_;
-
- if (! exists $params{pages}) {
- return "";
- }
- if (! exists $params{archive}) {
- $params{archive}="no";
- }
- if (! exists $params{show} && $params{archive} eq "no") {
- $params{show}=10;
- }
- $inlinepages{$parentpage}=$params{pages};
-
- my $ret="";
-
- if (exists $params{rootpage}) {
- my $formtemplate=HTML::Template->new(blind_cache => 1,
- filename => "$config{templatedir}/blogpost.tmpl");
- $formtemplate->param(cgiurl => $config{cgiurl});
- $formtemplate->param(rootpage => $params{rootpage});
- my $form=$formtemplate->output;
- $ret.=$form;
- }
-
- my $template=HTML::Template->new(blind_cache => 1,
- filename => (($params{archive} eq "no")
- ? "$config{templatedir}/inlinepage.tmpl"
- : "$config{templatedir}/inlinepagetitle.tmpl"));
-
- foreach my $page (blog_list($params{pages}, $params{show})) {
- next if $page eq $parentpage;
- $template->param(pagelink => htmllink($parentpage, $page));
- $template->param(content => get_inline_content($parentpage, $page))
- if $params{archive} eq "no";
- $template->param(ctime => scalar(gmtime($pagectime{$page})));
- $ret.=$template->output;
- }
-
- return $ret;
-} #}}}