From 97069ea490b52181da8a434ff1a3e8603ac04adf Mon Sep 17 00:00:00 2001 From: Chen-Pang He Date: Mon, 30 Jun 2014 15:50:20 +0800 Subject: Introduce $config['gzip_static'] --- inc/functions.php | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'inc') diff --git a/inc/functions.php b/inc/functions.php index efc0594b..6854d8b7 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -1,7 +1,7 @@ = 1024) + if (file_put_contents($gzpath, gzencode($data), $simple ? 0 : LOCK_EX) === false) + error("Unable to write to file: $gzpath"); + if (!touch($gzpath, filemtime($path), fileatime($path))) + error("Unable to touch file: $gzpath"); + } + else { + @unlink($gzpath); + } + } + if (!$skip_purge && isset($config['purge'])) { // Purge cache if (basename($path) == $config['file_index']) { -- cgit v1.3 From f2809d47930bfd2570daa6bae16f563c0e0dcd6d Mon Sep 17 00:00:00 2001 From: 8chan Date: Tue, 24 Jun 2014 19:40:16 +0000 Subject: Fix issue #45 --- inc/display.php | 8 ++++---- templates/post_reply.html | 4 ++-- templates/post_thread.html | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'inc') diff --git a/inc/display.php b/inc/display.php index 4e8ab8fb..f02df433 100644 --- a/inc/display.php +++ b/inc/display.php @@ -377,10 +377,10 @@ class Post { $this->body ); } - public function link($pre = '') { + public function link($pre = '', $page = false) { global $config, $board; - return $this->root . $board['dir'] . $config['dir']['res'] . sprintf($config['file_page'], $this->thread) . '#' . $pre . $this->id; + return $this->root . $board['dir'] . $config['dir']['res'] . sprintf(($page ? $page : $config['file_page']), $this->thread) . '#' . $pre . $this->id; } public function postControls() { global $board, $config; @@ -482,10 +482,10 @@ class Thread { $this->body ); } - public function link($pre = '') { + public function link($pre = '', $page = false) { global $config, $board; - return $this->root . $board['dir'] . $config['dir']['res'] . sprintf($config['file_page'], $this->id) . '#' . $pre . $this->id; + return $this->root . $board['dir'] . $config['dir']['res'] . sprintf(($page ? $page : $config['file_page']), $this->id) . '#' . $pre . $this->id; } public function add(Post $post) { $this->posts[] = $post; diff --git a/templates/post_reply.html b/templates/post_reply.html index c2254844..ab0dc9da 100644 --- a/templates/post_reply.html +++ b/templates/post_reply.html @@ -12,8 +12,8 @@ {% include 'post/time.html' %} {% include 'post/poster_id.html' %}  - No. - {{ post.id }} + No. + {{ post.id }}

{% if post.embed %} {{ post.embed }} diff --git a/templates/post_thread.html b/templates/post_thread.html index 61d09636..cd8ba74a 100644 --- a/templates/post_thread.html +++ b/templates/post_thread.html @@ -44,8 +44,8 @@ {% include 'post/time.html' %} {% include 'post/poster_id.html' %}  - No. - {{ post.id }} + No. + {{ post.id }} {% if post.sticky %} {% if config.font_awesome %} -- cgit v1.3