projects
/
living-lab-site.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
search improved but not finished
[living-lab-site.git]
/
application
/
models
/
videos_model.php
diff --git
a/application/models/videos_model.php
b/application/models/videos_model.php
index
c887b70
..
0d9fe7b
100644
(file)
--- a/
application/models/videos_model.php
+++ b/
application/models/videos_model.php
@@
-16,8
+16,6
@@
class Videos_model extends CI_Model {
$this->load->library('singleton_db');
$this->db = $this->singleton_db->connect();
}
$this->load->library('singleton_db');
$this->db = $this->singleton_db->connect();
}
-
- $this->load->helper('url');
}
/**
}
/**
@@
-208,23
+206,23
@@
class Videos_model extends CI_Model {
$count = 100;
$str_search = trim($str_search);
$count = 100;
$str_search = trim($str_search);
-
- $this->load->helper('text');
$query = $this->db->query(
"SELECT id, name, title, duration, user_id, views, thumbs_count,
default_thumb
FROM `videos`
$query = $this->db->query(
"SELECT id, name, title, duration, user_id, views, thumbs_count,
default_thumb
FROM `videos`
- WHERE
title LIKE '%". $str_search . "%'
+ WHERE
MATCH (title, description, tags) AGAINST (?)
ORDER BY name
ORDER BY name
- LIMIT ?, ?",
// TODO summary order
- array($offset, $count));
+ LIMIT ?, ?",
+ array($
str_search, $
offset, $count));
if ($query->num_rows() > 0)
$videos = $query->result_array();
else
return NULL;
if ($query->num_rows() > 0)
$videos = $query->result_array();
else
return NULL;
+ $this->load->helper('text');
+
foreach ($videos as & $video)
{
// P2P-Tube Video URL
foreach ($videos as & $video)
{
// P2P-Tube Video URL