diff options
| author | Savetheinternet <savetheinternet@tinyboard.org> | 2011-05-19 21:59:25 +1000 |
|---|---|---|
| committer | Savetheinternet <savetheinternet@tinyboard.org> | 2011-05-19 21:59:25 +1000 |
| commit | 0794f9c53bcda5e7436fe30209df26a1ce262868 (patch) | |
| tree | 709b1ce6ef92033f17d51d204065ba0a5a9ae759 /inc/display.php | |
| parent | e60a6a1a582478d76893beec7408e7ea752c876c (diff) | |
few bug fixes
Diffstat (limited to 'inc/display.php')
| -rw-r--r-- | inc/display.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/inc/display.php b/inc/display.php index 9c7843b9..b8fd9d0d 100644 --- a/inc/display.php +++ b/inc/display.php @@ -263,7 +263,7 @@ global $board, $config, $memcached; if(!$this->mod && $config['memcached']['enabled']) { - if($built = $memcached->get('post_' . ($index ? 'index_' : '') . $board['uri'] . '_' . $this->id)) + if($built = $memcached->get($this->memcached_key($index))) return $built; } @@ -353,11 +353,16 @@ $built .= '<p class="body">' . ($index ? truncate($this->body, $this->link()) : $this->body) . '</p></div><br class="clear"/>'; if(!$this->mod && $config['memcached']['enabled']) { - $memcached->set('post_' . ($index ? 'index_' : '') . $board['uri'] . '_' . $this->id, $built, time() + $config['memcached']['timeout']); + $memcached->set($this->memcached_key($index), $built, time() + $config['memcached']['timeout']); } return $built; } + + function memcached_key($index) { + global $board; + return 'post_' . md5($this->body) . '_' . ($this->file ? $this->file : '-') . '_' . ($index ? 'index_' : '') . $board['uri'] . '_' . $this->id; + } }; class Thread { |
