mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 17:21:39 +09:00
Add search function to member's document and comment list
This commit is contained in:
parent
180b6668db
commit
2238679527
12 changed files with 138 additions and 35 deletions
|
|
@ -698,6 +698,7 @@ class commentModel extends comment
|
|||
$args->page = $obj->page ? $obj->page : 1;
|
||||
$args->list_count = $obj->list_count ? $obj->list_count : 20;
|
||||
$args->page_count = $obj->page_count ? $obj->page_count : 10;
|
||||
$args->s_member_srl = $obj->member_srl;
|
||||
$args->s_module_srl = $obj->module_srl;
|
||||
$args->exclude_module_srl = $obj->exclude_module_srl;
|
||||
$args->statusList = $obj->statusList;
|
||||
|
|
|
|||
|
|
@ -11,13 +11,13 @@
|
|||
<condition operation="equal" column="is_secret" var="s_is_secret" pipe="and" />
|
||||
<condition operation="equal" column="status" var="s_is_published" pipe="and" />
|
||||
<condition operation="in" column="status" var="statusList" pipe="and" />
|
||||
<group pipe="and">
|
||||
<condition operation="in" column="member_srl" var="s_member_srl" pipe="and" />
|
||||
<group pipe="and">
|
||||
<condition operation="like" column="content" var="s_content" pipe="or" />
|
||||
<condition operation="like_prefix" column="user_name" var="s_user_name" pipe="or" />
|
||||
<condition operation="like_prefix" column="nick_name" var="s_nick_name" pipe="or" />
|
||||
<condition operation="like" column="email_address" var="s_email_address" pipe="or" />
|
||||
<condition operation="like" column="homepage" var="s_homepage" pipe="or" />
|
||||
<condition operation="equal" column="member_srl" var="s_member_srl" pipe="or" />
|
||||
<condition operation="like_prefix" column="regdate" var="s_regdate" pipe="or" />
|
||||
<condition operation="like_prefix" column="last_update" var="s_last_upate" pipe="or" />
|
||||
<condition operation="like_prefix" column="ipaddress" var="s_ipaddress" pipe="or" />
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
<condition operation="equal" column="comments.is_secret" var="s_is_secret" pipe="and" />
|
||||
<condition operation="equal" column="comments.status" var="s_is_published" pipe="and" />
|
||||
<condition operation="in" column="comments.status" var="statusList" pipe="and" />
|
||||
<condition operation="in" column="comments.member_srl" var="s_member_srl" pipe="and" />
|
||||
<group pipe="and">
|
||||
<condition operation="like" column="comments.content" var="s_content" />
|
||||
<condition operation="like_prefix" column="comments.user_name" var="s_user_name" pipe="or" />
|
||||
|
|
|
|||
|
|
@ -9,10 +9,16 @@
|
|||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<form class="search" action="{Context::getRequestUri()}" method="get" no-error-return-url="true">
|
||||
<input type="hidden" name="mid" value="{$mid}" />
|
||||
<input type="hidden" name="act" value="{$act}" />
|
||||
<input type="search" name="search_keyword" value="{escape($search_keyword, false)}">
|
||||
<button type="submit">{$lang->cmd_search}</button>
|
||||
</form>
|
||||
<div class="pn">
|
||||
<a cond="$page != 1" href="{getUrl('page',$page-1,'module_srl','','document_srl','')}" class="prev">{$lang->cmd_prev}</a>
|
||||
<strong>{$page} / {$page_navigation->last_page}</strong>
|
||||
<a cond="$page != $page_navigation->last_page" href="{getUrl('page',$page+1,'module_srl','','document_srl','')}" class="next">{$lang->cmd_next}</a>
|
||||
</div>
|
||||
</div>
|
||||
<include target="./common_footer.html" />
|
||||
<include target="./common_footer.html" />
|
||||
|
|
|
|||
|
|
@ -53,6 +53,11 @@
|
|||
.lt .title em{font-size:12px;color:#333;color:#6352d2}
|
||||
.lt .auth{display:block;font-size:12px}
|
||||
.lt .auth .time{padding:0 5px;border-left:1px solid #bfbfbf}
|
||||
/* Search */
|
||||
.search { clear: both; text-align: center; padding: 4px 0; }
|
||||
.search input[type=search] { font-size: 12px; line-height: 16px; padding: 3px; width: 160px; height: 24px; box-sizing: border-box; }
|
||||
.search select { font-size: 12px; line-height: 16px; padding: 3px; height: 24px; box-sizing: border-box; }
|
||||
.search button { font-size: 12px; line-height: 16px; padding: 3px 8px; height: 24px; box-sizing: border-box; }
|
||||
/* Pagination */
|
||||
.pn{font-size:12px;text-align:center;background:#f2f0ec;padding:15px 0;border-top:1px solid #fff}
|
||||
.pn a{color:#333;text-decoration:none}
|
||||
|
|
@ -100,4 +105,4 @@
|
|||
}
|
||||
.xm ul.mtab>li:first-child a span {
|
||||
border-left: 0 none;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,10 +9,21 @@
|
|||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<form class="search" action="{Context::getRequestUri()}" method="get" no-error-return-url="true">
|
||||
<input type="hidden" name="mid" value="{$mid}" />
|
||||
<input type="hidden" name="act" value="{$act}" />
|
||||
<select name="search_target" title="{$lang->search_target}">
|
||||
<option value="title" selected="selected"|cond="$search_target == 'title'">{$lang->title}</option>
|
||||
<option value="title_content" selected="selected"|cond="$search_target == 'title_content'">{$lang->title_content}</option>
|
||||
<option value="content" selected="selected"|cond="$search_target == 'content'">{$lang->content}</option>
|
||||
</select>
|
||||
<input type="search" name="search_keyword" value="{escape($search_keyword, false)}">
|
||||
<button type="submit">{$lang->cmd_search}</button>
|
||||
</form>
|
||||
<div class="pn">
|
||||
<a cond="$page != 1" href="{getUrl('page',$page-1,'module_srl','','document_srl','')}" class="prev">{$lang->cmd_prev}</a>
|
||||
<strong>{$page} / {$page_navigation->last_page}</strong>
|
||||
<a cond="$page != $page_navigation->last_page" href="{getUrl('page',$page+1,'module_srl','','document_srl','')}" class="next">{$lang->cmd_next}</a>
|
||||
</div>
|
||||
</div>
|
||||
<include target="./common_footer.html" />
|
||||
<include target="./common_footer.html" />
|
||||
|
|
|
|||
|
|
@ -22,6 +22,12 @@
|
|||
</div>
|
||||
</section>
|
||||
<div class="pagination pagination-centered">
|
||||
<form class="search" action="{Context::getRequestUri()}" method="get" no-error-return-url="true">
|
||||
<input type="hidden" name="mid" value="{$mid}" />
|
||||
<input type="hidden" name="act" value="{$act}" />
|
||||
<input type="search" name="search_keyword" value="{escape($search_keyword, false)}">
|
||||
<button type="submit">{$lang->cmd_search}</button>
|
||||
</form>
|
||||
<ul>
|
||||
{@$rx_prn = FALSE}
|
||||
<!--@while($page_no = $page_navigation->getNextPage())-->
|
||||
|
|
|
|||
|
|
@ -454,6 +454,24 @@ script, style
|
|||
}
|
||||
}
|
||||
}
|
||||
.search {
|
||||
clear: both;
|
||||
text-align: center;
|
||||
padding: 0 0 14px 0;
|
||||
input[type=search] {
|
||||
font-size: 12px; line-height: 16px; padding: 3px; width: 160px; height: 24px; box-sizing: border-box;
|
||||
border: 1px solid #999;
|
||||
}
|
||||
select {
|
||||
font-size: 12px; line-height: 16px; padding: 3px; height: 24px; box-sizing: border-box;
|
||||
border: 1px solid #999;
|
||||
}
|
||||
button {
|
||||
font-size: 12px; line-height: 16px; padding: 3px 8px; height: 24px; box-sizing: border-box;
|
||||
border: 1px solid #ccc;
|
||||
background: #f4f4f4;
|
||||
}
|
||||
}
|
||||
.pagination ul
|
||||
{
|
||||
display:block;
|
||||
|
|
|
|||
|
|
@ -28,6 +28,17 @@
|
|||
</div>
|
||||
</section>
|
||||
<div class="pagination pagination-centered">
|
||||
<form class="search" action="{Context::getRequestUri()}" method="get" no-error-return-url="true">
|
||||
<input type="hidden" name="mid" value="{$mid}" />
|
||||
<input type="hidden" name="act" value="{$act}" />
|
||||
<select name="search_target" title="{$lang->search_target}">
|
||||
<option value="title" selected="selected"|cond="$search_target == 'title'">{$lang->title}</option>
|
||||
<option value="title_content" selected="selected"|cond="$search_target == 'title_content'">{$lang->title_content}</option>
|
||||
<option value="content" selected="selected"|cond="$search_target == 'content'">{$lang->content}</option>
|
||||
</select>
|
||||
<input type="search" name="search_keyword" value="{escape($search_keyword, false)}">
|
||||
<button type="submit">{$lang->cmd_search}</button>
|
||||
</form>
|
||||
<ul>
|
||||
{@$rx_prn = FALSE}
|
||||
<!--@while($page_no = $page_navigation->getNextPage())-->
|
||||
|
|
|
|||
|
|
@ -371,21 +371,32 @@ class memberView extends member
|
|||
throw new Rhymix\Framework\Exceptions\MustLogin;
|
||||
}
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
$member_srl = $logged_info->member_srl;
|
||||
|
||||
$module_srl = Context::get('module_srl');
|
||||
Context::set('module_srl',Context::get('selected_module_srl'));
|
||||
Context::set('search_target','member_srl');
|
||||
Context::set('search_keyword',$member_srl);
|
||||
|
||||
$oDocumentAdminView = getAdminView('document');
|
||||
$oDocumentAdminView->dispDocumentAdminList();
|
||||
$args = new stdClass;
|
||||
$args->list_count = 20;
|
||||
$args->page_count = 5;
|
||||
$args->page = intval(Context::get('page')) ?: 1;
|
||||
if(in_array(Context::get('search_target'), array('title', 'title_content', 'content')))
|
||||
{
|
||||
$args->search_target = Context::get('search_target');
|
||||
$args->search_keyword = Context::get('search_keyword');
|
||||
}
|
||||
$args->member_srl = array($this->user->member_srl, $this->user->member_srl * -1);
|
||||
$args->module_srl = intval(Context::get('selected_module_srl')) ?: null;
|
||||
$args->sort_index = 'list_order';
|
||||
$args->statusList = array('PUBLIC', 'SECRET');
|
||||
|
||||
$oDocumentModel = getModel('document');
|
||||
$columnList = array('document_srl', 'module_srl', 'category_srl', 'member_srl', 'title', 'nick_name', 'comment_count', 'trackback_count', 'readed_count', 'voted_count', 'blamed_count', 'regdate', 'ipaddress', 'status');
|
||||
$output = $oDocumentModel->getDocumentList($args, false, false, $columnList);
|
||||
Context::set('total_count', $output->total_count);
|
||||
Context::set('total_page', $output->total_page);
|
||||
Context::set('page', $output->page);
|
||||
Context::set('page_navigation', $output->page_navigation);
|
||||
Context::set('document_list', $output->data);
|
||||
|
||||
$oSecurity = new Security();
|
||||
$oSecurity->encodeHTML('document_list...title', 'search_target', 'search_keyword');
|
||||
|
||||
Context::set('module_srl', $module_srl);
|
||||
$this->setTemplateFile('document_list');
|
||||
}
|
||||
|
||||
|
|
@ -399,25 +410,37 @@ class memberView extends member
|
|||
throw new Rhymix\Framework\Exceptions\FeatureDisabled;
|
||||
}
|
||||
|
||||
$oMemberModel = getModel('member');
|
||||
// A message appears if the user is not logged-in
|
||||
if(!$oMemberModel->isLogged()) throw new Rhymix\Framework\Exceptions\MustLogin;
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
throw new Rhymix\Framework\Exceptions\MustLogin;
|
||||
}
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
$member_srl = $logged_info->member_srl;
|
||||
|
||||
$module_srl = Context::get('module_srl');
|
||||
Context::set('module_srl',Context::get('selected_module_srl'));
|
||||
Context::set('search_target','member_srl');
|
||||
Context::set('search_keyword',$member_srl);
|
||||
|
||||
$oCommentAdminView = getAdminView('comment');
|
||||
$oCommentAdminView->dispCommentAdminList();
|
||||
$args = new stdClass;
|
||||
$args->list_count = 20;
|
||||
$args->page_count = 5;
|
||||
$args->page = intval(Context::get('page')) ?: 1;
|
||||
if(Context::get('search_keyword'))
|
||||
{
|
||||
$args->search_target = 'content';
|
||||
$args->search_keyword = Context::get('search_keyword');
|
||||
}
|
||||
$args->member_srl = array($this->user->member_srl, $this->user->member_srl * -1);
|
||||
$args->module_srl = intval(Context::get('selected_module_srl')) ?: null;
|
||||
$args->sort_index = 'list_order';
|
||||
|
||||
$oCommentModel = getModel('comment');
|
||||
$columnList = array('comment_srl', 'document_srl', 'module_srl', 'is_secret', 'status', 'content', 'comments.member_srl', 'comments.nick_name', 'comments.regdate', 'ipaddress', 'voted_count', 'blamed_count');
|
||||
$output = $oCommentModel->getTotalCommentList($args, $columnList);
|
||||
Context::set('total_count', $output->total_count);
|
||||
Context::set('total_page', $output->total_page);
|
||||
Context::set('page', $output->page);
|
||||
Context::set('page_navigation', $output->page_navigation);
|
||||
Context::set('comment_list', $output->data);
|
||||
|
||||
$oSecurity = new Security();
|
||||
$oSecurity->encodeHTML('search_target', 'search_keyword');
|
||||
|
||||
Context::set('module_srl', $module_srl);
|
||||
$this->setTemplateFile('comment_list');
|
||||
}
|
||||
|
||||
|
|
@ -431,9 +454,11 @@ class memberView extends member
|
|||
throw new Rhymix\Framework\Exceptions\FeatureDisabled;
|
||||
}
|
||||
|
||||
$oMemberModel = getModel('member');
|
||||
// A message appears if the user is not logged-in
|
||||
if(!$oMemberModel->isLogged()) throw new Rhymix\Framework\Exceptions\MustLogin;
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
throw new Rhymix\Framework\Exceptions\MustLogin;
|
||||
}
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
||||
|
|
|
|||
|
|
@ -21,13 +21,20 @@
|
|||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="pagination pagination-centered">
|
||||
<ul>
|
||||
<div class="pagination">
|
||||
<form action="{Context::getRequestUri()}" method="get" no-error-return-url="true" style="float:left">
|
||||
<input type="hidden" name="mid" value="{$mid}" />
|
||||
<input type="hidden" name="act" value="{$act}" />
|
||||
<input type="text" name="search_keyword" value="{escape($search_keyword, false)}">
|
||||
<button type="submit" class="btn">{$lang->cmd_search}</button>
|
||||
</form>
|
||||
<ul style="float:right;margin:0;padding:0">
|
||||
<li><a href="{getUrl('page','','module_srl','')}" class="direction">« {$lang->first_page}</a></li>
|
||||
<!--@while($page_no = $page_navigation->getNextPage())-->
|
||||
<li class="active"|cond="$page == $page_no"><a href="{getUrl('page',$page_no,'module_srl','')}">{$page_no}</a></li>
|
||||
<!--@end-->
|
||||
<li><a href="{getUrl('page',$page_navigation->last_page,'module_srl','')}" class="direction">{$lang->last_page} »</a></li>
|
||||
</ul>
|
||||
<div style="clear:both"></div>
|
||||
</div>
|
||||
<include target="./common_footer.html" />
|
||||
|
|
|
|||
|
|
@ -28,13 +28,25 @@
|
|||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="pagination pagination-centered">
|
||||
<ul>
|
||||
<div class="pagination">
|
||||
<form action="{Context::getRequestUri()}" method="get" no-error-return-url="true" style="float:left">
|
||||
<input type="hidden" name="mid" value="{$mid}" />
|
||||
<input type="hidden" name="act" value="{$act}" />
|
||||
<select name="search_target" title="{$lang->search_target}">
|
||||
<option value="title" selected="selected"|cond="$search_target == 'title'">{$lang->title}</option>
|
||||
<option value="title_content" selected="selected"|cond="$search_target == 'title_content'">{$lang->title_content}</option>
|
||||
<option value="content" selected="selected"|cond="$search_target == 'content'">{$lang->content}</option>
|
||||
</select>
|
||||
<input type="text" name="search_keyword" value="{escape($search_keyword, false)}">
|
||||
<button type="submit" class="btn">{$lang->cmd_search}</button>
|
||||
</form>
|
||||
<ul style="float:right;margin:0;padding:0">
|
||||
<li><a href="{getUrl('page','','module_srl','')}" class="direction">« {$lang->first_page}</a></li>
|
||||
<!--@while($page_no = $page_navigation->getNextPage())-->
|
||||
<li class="active"|cond="$page == $page_no"><a href="{getUrl('page',$page_no,'module_srl','')}">{$page_no}</a></li>
|
||||
<!--@end-->
|
||||
<li><a href="{getUrl('page',$page_navigation->last_page,'module_srl','')}" class="direction">{$lang->last_page} »</a></li>
|
||||
</ul>
|
||||
<div style="clear:both"></div>
|
||||
</div>
|
||||
<include target="./common_footer.html" />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue