# HG changeset patch # User Dan # Date 1240230839 14400 # Node ID 3d96dbb770b530710acfd3d9a90ecd0307d650e2 # Parent f0cf0b512fbbb8a7f136950655d4d67b66243314 Added ability to change number of articles shown on portal. diff -r f0cf0b512fbb -r 3d96dbb770b5 plugins/Newsboy.php --- a/plugins/Newsboy.php Thu Apr 16 22:48:15 2009 -0400 +++ b/plugins/Newsboy.php Mon Apr 20 08:33:59 2009 -0400 @@ -428,12 +428,14 @@ if ( !$q ) $db->_die(); + $num_articles = intval(getConfig('nb_portal_num_articles', 5)); + if ( $row = $db->fetchrow() ) { $i = 0; do { - if ( $i < 5 ) + if ( $i < $num_articles ) { $content = $row['page_text']; @@ -1101,6 +1103,11 @@ setConfig('nb_announce_page', $_POST['announce_page']); else setConfig('nb_announce_page', ''); + + $num_articles = intval($_POST['num_articles']); + if ( $num_articles > 0 ) + setConfig('nb_portal_num_articles', $num_articles); + // Submit echo '