mirror of
https://bitbucket.org/jsuto/piler.git
synced 2025-06-12 23:27:03 +02:00
added tagging the search results
This commit is contained in:
@ -53,7 +53,7 @@ class ControllerSearchHelper extends Controller {
|
||||
$this->preprocess_post_advanced_request($this->request->post);
|
||||
$this->fixup_post_request();
|
||||
|
||||
list ($this->data['n'], $this->data['messages']) = $this->model_search_search->search_messages($this->a, ADVANCED_SEARCH, $this->data['page']);
|
||||
list ($this->data['n'], $this->data['all_ids'], $this->data['messages']) = $this->model_search_search->search_messages($this->a, ADVANCED_SEARCH, $this->data['page']);
|
||||
}
|
||||
|
||||
else if($this->request->post['searchtype'] == 'expert'){
|
||||
@ -61,14 +61,15 @@ class ControllerSearchHelper extends Controller {
|
||||
$this->preprocess_post_expert_request($this->request->post);
|
||||
$this->fixup_post_request();
|
||||
|
||||
list ($this->data['n'], $this->data['messages']) = $this->model_search_search->search_messages($this->a, ADVANCED_SEARCH, $this->data['page']);
|
||||
list ($this->data['n'], $this->data['all_ids'], $this->data['messages']) = $this->model_search_search->search_messages($this->a, ADVANCED_SEARCH, $this->data['page']);
|
||||
}
|
||||
|
||||
else {
|
||||
$this->fixup_post_simple_request();
|
||||
list ($this->data['n'], $this->data['messages']) = $this->model_search_search->search_messages($this->request->post, SIMPLE_SEARCH, $this->data['page']);
|
||||
list ($this->data['n'], $this->data['all_ids'], $this->data['messages']) = $this->model_search_search->search_messages($this->request->post, SIMPLE_SEARCH, $this->data['page']);
|
||||
}
|
||||
|
||||
if($this->a['ref']) { $this->data['_ref'] = $this->a['ref']; }
|
||||
|
||||
/* paging info */
|
||||
|
||||
|
42
webui/controller/search/tag.php
Normal file
42
webui/controller/search/tag.php
Normal file
@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
|
||||
class ControllerSearchTag extends Controller {
|
||||
private $error = array();
|
||||
|
||||
public function index(){
|
||||
|
||||
$this->id = "content";
|
||||
$this->template = "search/tag.tpl";
|
||||
$this->layout = "common/layout-empty";
|
||||
|
||||
|
||||
$request = Registry::get('request');
|
||||
$db = Registry::get('db');
|
||||
|
||||
$this->load->model('search/search');
|
||||
$this->load->model('search/message');
|
||||
|
||||
if(isset($this->request->post['tag']) && isset($this->request->post['idlist'])) {
|
||||
$idlist = explode(",", $this->request->post['idlist']);
|
||||
if(count($idlist) > 0) {
|
||||
|
||||
$q = '';
|
||||
|
||||
$ids = $this->model_search_search->check_your_permission_by_id_list($idlist);
|
||||
|
||||
for($i=0; $i<count($ids); $i++) { $q .= ",?"; }
|
||||
$q = preg_replace("/^\,/", "", $q);
|
||||
|
||||
$this->model_search_message->bulk_add_message_tag($ids, $_SESSION['uid'], $this->request->post['tag'], $q);
|
||||
}
|
||||
}
|
||||
|
||||
/*$this->data['message'] = 'I tagged this!';
|
||||
|
||||
$this->render();*/
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
Reference in New Issue
Block a user