shithub: werc

Download patch

ref: cdf3a515a5fa8d0191febf2e1eae858180ac3814
parent: 18734074da2a1e334bd66c161695993c01708c1c
author: uriel <[email protected]>
date: Fri Jun 12 19:44:21 EDT 2009

New configuration variable for blagh: conf_max_posts_per_page sets the maximum numbers to display in a blog feed, default is 32. Note that this also affects rss feeds.

--- a/apps/blagh/app.rc
+++ b/apps/blagh/app.rc
@@ -6,6 +6,7 @@
     conf_enable_app blagh
 }
 conf_blog_editors=blog-editors
+conf_max_posts_per_page=32
 
 fn blagh_init {
     if(~ $#blagh_dirs 0 && ~ $req_path */[bB]log/*) {
@@ -76,7 +77,7 @@
 fn get_post_list {
     # /./->/|/ done to sort -t| and order by date
     # Note: $paths in blagh_dirs should not contain '/./' or '|'
-    ls -F $*^/./[0-9][0-9][0-9][0-9]/[0-9][0-9]/[0-9][0-9]/ >[2]/dev/null | sed -n '/'^$forbidden_uri_chars^'/d; s,/\./,/|/,; /\/$/p' | sort -r '-t|' +1 | sed 's,/+\|/+,/,'
+    ls -F $*^/./[0-9][0-9][0-9][0-9]/[0-9][0-9]/[0-9][0-9]/ >[2]/dev/null | sed -n '/'^$forbidden_uri_chars^'/d; s,/\./,/|/,; /\/$/p' | sort -r '-t|' +1 | sed -e 's,/+\|/+,/,' -e $conf_max_posts_per_page^'q'
 }
 
 fn mkbpost {