Conditions | 2 |
Paths | 2 |
Total Lines | 19 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
29 | public function title_search($search, $limit = 10) |
||
30 | { |
||
31 | $results = []; |
||
32 | $sql = 'SELECT idea_title, idea_id |
||
33 | FROM ' . $this->table_ideas . ' |
||
34 | WHERE idea_title ' . $this->db->sql_like_expression($this->db->get_any_char() . $search . $this->db->get_any_char()); |
||
35 | $result = $this->db->sql_query_limit($sql, $limit); |
||
36 | while ($row = $this->db->sql_fetchrow($result)) |
||
37 | { |
||
38 | $results[] = [ |
||
39 | 'idea_id' => $row['idea_id'], |
||
40 | 'result' => $row['idea_id'], |
||
41 | 'clean_title' => $row['idea_title'], |
||
42 | 'display' => "<span>{$row['idea_title']}</span>", // spans are expected in phpBB's live search JS |
||
43 | ]; |
||
44 | } |
||
45 | $this->db->sql_freeresult($result); |
||
46 | |||
47 | return $results; |
||
48 | } |
||
50 |