diff --git a/core/page.class.php b/core/page.class.php
index 6570632b..356febdf 100644
--- a/core/page.class.php
+++ b/core/page.class.php
@@ -289,7 +289,11 @@ class Page {
{
global $config;
- if (!$config->get_bool("autocache_css") && !$config->get_bool("autocache_js")) {
+ // store local copy for speed.
+ $autocache_css = $config->get_bool("autocache_css");
+ $autocache_js = config->get_bool("autocache_js")
+
+ if (!$autocache_css && !$autocache_js) {
return false; // caching disabled
}
@@ -307,7 +311,7 @@ class Page {
$data_href = get_base_href();
/* ----- CSS Files ----- */
- if ($config->get_bool("autocache_css"))
+ if ($autocache_css)
{
// First get all the CSS from the lib directory
$contents_from_lib = '';
@@ -374,7 +378,7 @@ class Page {
/* ----- JavaScript Files ----- */
- if ($config->get_bool("autocache_js"))
+ if ($autocache_js)
{
$data = '';
$js_files = glob("lib/*.js");
diff --git a/ext/comment/theme.php b/ext/comment/theme.php
index 56afa513..15911c47 100644
--- a/ext/comment/theme.php
+++ b/ext/comment/theme.php
@@ -35,14 +35,17 @@ class CommentListTheme extends Themelet {
// parts for each image
$position = 10;
+
+ $comment_limit = $config->get_int("comment_list_count", 10);
+ $comment_captcha = $config->get_bool('comment_captcha');
+
foreach($images as $pair) {
$image = $pair[0];
$comments = $pair[1];
$thumb_html = $this->build_thumb_html($image);
-
$comment_html = "";
- $comment_limit = $config->get_int("comment_list_count", 10);
+
$comment_count = count($comments);
if($comment_limit > 0 && $comment_count > $comment_limit) {
$hidden = $comment_count - $comment_limit;
@@ -59,7 +62,7 @@ class CommentListTheme extends Themelet {
}
} else {
if ($can_post) {
- if(!$config->get_bool('comment_captcha')) {
+ if(!$comment_captcha) {
$comment_html .= $this->build_postbox($image->id);
}
else {
diff --git a/ext/tag_list/theme.php b/ext/tag_list/theme.php
index 7014bb3c..23065572 100644
--- a/ext/tag_list/theme.php
+++ b/ext/tag_list/theme.php
@@ -70,6 +70,7 @@ class TagListTheme extends Themelet {
public function display_popular_block(Page $page, $tag_infos) {
global $config;
+ // store local copies for speed.
$info_link = $config->get_string('info_link');
$tag_list_num = $config->get_bool("tag_list_numbers");
@@ -107,19 +108,23 @@ class TagListTheme extends Themelet {
public function display_refine_block(Page $page, $tag_infos, $search) {
global $config;
+ // store local copy for speed.
+ $info_link = $config->get_string('info_link');
+
$html = "";
$n = 0;
+
foreach($tag_infos as $row) {
$tag = $row['tag'];
$h_tag = html_escape($tag);
$h_tag_no_underscores = str_replace("_", " ", $h_tag);
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";
+ $html .= ' '.$h_tag_no_underscores.'';
$html .= $this->ars($tag, $search);
}
diff --git a/ext/upload/theme.php b/ext/upload/theme.php
index 9e66e457..c237493d 100644
--- a/ext/upload/theme.php
+++ b/ext/upload/theme.php
@@ -18,6 +18,7 @@ class UploadTheme extends Themelet {
$upload_list = "";
$upload_count = $config->get_int('upload_count');
+
for($i=0; $i<$upload_count; $i++)
{
$a=$i+1;
@@ -53,7 +54,7 @@ class UploadTheme extends Themelet {
".
"";
- if($a==$config->get_int('upload_count')){
+ if($a == $upload_count){
$upload_list .="";
}else{
$js1 = 'javascript:$(function() {
diff --git a/themes/danbooru/comment.theme.php b/themes/danbooru/comment.theme.php
index ff728eac..a9ee90e1 100644
--- a/themes/danbooru/comment.theme.php
+++ b/themes/danbooru/comment.theme.php
@@ -25,6 +25,10 @@ class CustomCommentListTheme extends CommentListTheme {
// parts for each image
$position = 10;
+
+ $comment_captcha = $config->get_bool('comment_captcha');
+ $comment_limit = $config->get_int("comment_list_count", 10);
+
foreach($images as $pair) {
$image = $pair[0];
$comments = $pair[1];
@@ -42,7 +46,7 @@ class CustomCommentListTheme extends CommentListTheme {
$r = class_exists("Ratings") ? "Rating ".Ratings::rating_to_human($image->rating) : "";
$comment_html = "Date $p $s User $un $s $r
Tags $t
"; - $comment_limit = $config->get_int("comment_list_count", 10); + $comment_count = count($comments); if($comment_limit > 0 && $comment_count > $comment_limit) { $hidden = $comment_count - $comment_limit; @@ -57,7 +61,7 @@ class CustomCommentListTheme extends CommentListTheme { $comment_html .= $this->build_postbox($image->id); } else { - if(!$config->get_bool('comment_captcha')) { + if(!$comment_captcha) { $comment_html .= $this->build_postbox($image->id); } else {