From 0910dca1e4c531f4534ce6c9a55b39037bda5545 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 14 May 2012 11:44:59 +0200 Subject: [PATCH] speedup for recents --- htdocs/application/models/pastes.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/application/models/pastes.php b/htdocs/application/models/pastes.php index abf76b3..3aaac7a 100755 --- a/htdocs/application/models/pastes.php +++ b/htdocs/application/models/pastes.php @@ -346,6 +346,7 @@ class Pastes extends CI_Model { $page = $this->uri->segment(2); } + $this->db->select('title, name, created, pid, lang, raw'); $this->db->where('private', 0); $this->db->order_by('created', 'desc'); $query = $this->db->get('pastes', $amount, $page); @@ -360,7 +361,11 @@ class Pastes extends CI_Model $data['pastes'][$n]['created'] = $row['created']; $data['pastes'][$n]['lang'] = $row['lang']; $data['pastes'][$n]['pid'] = $row['pid']; - $data['pastes'][$n]['paste'] = $this->process->syntax(htmlspecialchars_decode($row['raw']) , $row['lang']); + + if ($this->uri->segment(2) == 'rss') + { + $data['pastes'][$n]['paste'] = $this->process->syntax(htmlspecialchars_decode($row['raw']) , $row['lang']); + } $data['pastes'][$n]['raw'] = $row['raw']; $n++; }