From 0a1e8f2af4db3cf722aa80a678f27d16fc17993c Mon Sep 17 00:00:00 2001 From: "green-ponies (jgen)" Date: Sat, 4 Feb 2012 12:20:49 -0500 Subject: [PATCH] Store config values that are used inside a loop. --- ext/tag_list/theme.php | 16 ++++++++++------ ext/upload/main.php | 2 ++ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/ext/tag_list/theme.php b/ext/tag_list/theme.php index 99d83664..7014bb3c 100644 --- a/ext/tag_list/theme.php +++ b/ext/tag_list/theme.php @@ -69,23 +69,27 @@ class TagListTheme extends Themelet { */ public function display_popular_block(Page $page, $tag_infos) { global $config; + + $info_link = $config->get_string('info_link'); + $tag_list_num = $config->get_bool("tag_list_numbers"); $html = ""; $n = 0; + foreach($tag_infos as $row) { $tag = $row['tag']; $h_tag = html_escape($tag); $h_tag_no_underscores = str_replace("_", " ", $h_tag); $count = $row['count']; if($n++) $html .= "\n
"; - if(!is_null($config->get_string('info_link'))) { - $link = str_replace('$tag', $tag, $config->get_string('info_link')); - $html .= " ?"; + if(!is_null($info_link)) { + $link = str_replace('$tag', $tag, $info_link); + $html .= ' ?'; } $link = $this->tag_link($row['tag']); - $html .= " $h_tag_no_underscores"; - if($config->get_bool("tag_list_numbers")) { - $html .= " $count"; + $html .= ' '.$h_tag_no_underscores.''; + if($tag_list_num) { + $html .= ' '.$count.''; } } diff --git a/ext/upload/main.php b/ext/upload/main.php index 979ab413..8d2281fa 100644 --- a/ext/upload/main.php +++ b/ext/upload/main.php @@ -58,6 +58,8 @@ class Upload extends SimpleExtension { $this->is_full = false; } else { + // TODO: This size limit should be configureable by the admin... + // currently set to 100 MB $this->is_full = $free_num < 100*1024*1024; }