mirror of
https://github.com/claudehohl/Stikked.git
synced 2025-04-25 20:41:20 -05:00
search optimisation
This commit is contained in:
parent
9ea9327a1d
commit
64a5a097d1
@ -455,10 +455,11 @@ class Pastes extends CI_Model
|
|||||||
$this->load->library('process');
|
$this->load->library('process');
|
||||||
$amount = $this->config->item('per_page');
|
$amount = $this->config->item('per_page');
|
||||||
$page = ($this->uri->segment($seg) ? $this->uri->segment($seg) : 0);
|
$page = ($this->uri->segment($seg) ? $this->uri->segment($seg) : 0);
|
||||||
$search = '%' . $this->input->get('search') . '%';
|
$search = $this->input->get('search');
|
||||||
|
|
||||||
if ($search)
|
if ($search)
|
||||||
{
|
{
|
||||||
|
$search = '%' . $search . '%';
|
||||||
|
|
||||||
// count total results
|
// count total results
|
||||||
$sql = "SELECT id FROM pastes WHERE private = 0 AND (title LIKE ? OR raw LIKE ?)";
|
$sql = "SELECT id FROM pastes WHERE private = 0 AND (title LIKE ? OR raw LIKE ?)";
|
||||||
@ -549,10 +550,11 @@ class Pastes extends CI_Model
|
|||||||
$this->load->library('pagination');
|
$this->load->library('pagination');
|
||||||
$amount = $this->config->item('per_page');
|
$amount = $this->config->item('per_page');
|
||||||
$page = ($this->uri->segment(2) ? $this->uri->segment(2) : 0);
|
$page = ($this->uri->segment(2) ? $this->uri->segment(2) : 0);
|
||||||
$search = '%' . $this->input->get('search') . '%';
|
$search = $this->input->get('search');
|
||||||
|
|
||||||
if ($search)
|
if ($search)
|
||||||
{
|
{
|
||||||
|
$search = '%' . $search . '%';
|
||||||
|
|
||||||
// count total results
|
// count total results
|
||||||
$sql = "SELECT id FROM pastes WHERE private = 0 AND (title LIKE ? OR raw LIKE ?)";
|
$sql = "SELECT id FROM pastes WHERE private = 0 AND (title LIKE ? OR raw LIKE ?)";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user