aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/feed.php
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2009-12-20 19:46:48 +0000
committerAndreas Fischer <bantu@phpbb.com>2009-12-20 19:46:48 +0000
commit64898803af78a1d73be34c1ea85608f7fd293444 (patch)
tree21f9b01495b6760707789d9a5821356474e3256f /phpBB/feed.php
parentd7e8e4d9cb8c6a8a61345605152a9c18f4a3a564 (diff)
downloadforums-64898803af78a1d73be34c1ea85608f7fd293444.tar
forums-64898803af78a1d73be34c1ea85608f7fd293444.tar.gz
forums-64898803af78a1d73be34c1ea85608f7fd293444.tar.bz2
forums-64898803af78a1d73be34c1ea85608f7fd293444.tar.xz
forums-64898803af78a1d73be34c1ea85608f7fd293444.zip
Automatically lookup num_items in the config array if it is a string.
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10359 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/feed.php')
-rw-r--r--phpBB/feed.php38
1 files changed, 18 insertions, 20 deletions
diff --git a/phpBB/feed.php b/phpBB/feed.php
index 7f9e3dfcb2..0ab7d42fce 100644
--- a/phpBB/feed.php
+++ b/phpBB/feed.php
@@ -432,7 +432,21 @@ class phpbb_feed_base
*/
function phpbb_feed_base()
{
+ global $config;
+
$this->set_keys();
+
+ // Allow num_items to be string
+ if (is_string($this->num_items))
+ {
+ $this->num_items = (int) $config[$this->num_items];
+
+ // A precaution
+ if (!$this->num_items)
+ {
+ $this->num_items = 10;
+ }
+ }
}
/**
@@ -592,10 +606,10 @@ class phpbb_feed_base
*/
class phpbb_feed_post_base extends phpbb_feed_base
{
+ var $num_items = 'feed_limit';
+
function set_keys()
{
- global $config;
-
$this->set('title', 'post_subject');
$this->set('title2', 'topic_title');
@@ -610,8 +624,6 @@ class phpbb_feed_post_base extends phpbb_feed_base
$this->set('enable_bbcode', 'enable_bbcode');
$this->set('enable_smilies', 'enable_smilies');
$this->set('enable_magic_url', 'enable_magic_url');
-
- $this->num_items = (int) $config['feed_limit'];
}
function adjust_item(&$item_row, &$row)
@@ -1098,14 +1110,7 @@ class phpbb_feed_forums extends phpbb_feed_base
*/
class phpbb_feed_news extends phpbb_feed_topic_base
{
- function set_keys()
- {
- global $config;
-
- parent::set_keys();
-
- $this->num_items = (int) $config['feed_limit'];
- }
+ var $num_items = 'feed_limit';
function get_news_forums()
{
@@ -1188,14 +1193,7 @@ class phpbb_feed_news extends phpbb_feed_topic_base
*/
class phpbb_feed_topics extends phpbb_feed_topic_base
{
- function set_keys()
- {
- global $config;
-
- parent::set_keys();
-
- $this->num_items = (int) $config['feed_overall_topics_limit'];
- }
+ var $num_items = 'feed_overall_topics_limit';
function get_sql()
{