묻고답하기
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
게시판 제목앞에 별도로 만든 태그같은 것을 붙여 출력하고 싶습니다. 고수님들 도와주세요
2013.04.18 22:24
제로보드 xe최신버전을 사용하고있고 게시판은 1.4.5를 사용하고있습니다.
제가 원하는 것은 게시판 리스트에 제목이 출력되는 {$document->getTitle()} 앞에
게시글 등록시 별도로 작성한(태그같은것)을 출력하게 싶거든요
예를 들면
num 제목 작성자
335 (별도 태그) 게시글335 관리자
334 (별도 태그) 게시글334 관리자
333 (별도 태그) 게시글333 관리자
.
.
.
이렇게 만들고 싶습니다.
게시판 리스트소스는
-------------------------------
<include target="_header.html" />
<include cond="$oDocument->isExists()" target="_read.html" />
<p cond="!$document_list && !$notice_list" class="no_ducument">{$lang->no_documents}</p>
<div class="board_list" id="board_list">
<table width="100%" border="1" cellspacing="0" summary="List of Articles" cond="$document_list || $notice_list">
<thead>
<!-- LIST HEADER -->
<tr>
<block loop="$list_config=>$key,$val">
<th scope="col" cond="$val->type=='no' && $val->idx==-1"><span>{$lang->no}</span></th>
<th scope="col" class="title" cond="$val->type=='title' && $val->idx==-1"><span>{$lang->title}</span></th>
<th scope="col" cond="$val->type=='nick_name' && $val->idx==-1"><span>{$lang->writer}</span></th>
<th scope="col" cond="$val->type=='user_id' && $val->idx==-1"><span>{$lang->user_id}</span></th>
<th scope="col" cond="$val->type=='user_name' && $val->idx==-1"><span>{$lang->user_name}</span></th>
<th scope="col" cond="$val->type=='regdate' && $val->idx==-1"><span><a href="{getUrl('sort_index','regdate','order_type',$order_type)}">{$lang->date}</a></span></th>
<th scope="col" cond="$val->type=='last_update' && $val->idx==-1"><span><a href="{getUrl('sort_index','last_update','order_type',$order_type)}">{$lang->last_update}</a></span></th>
<th scope="col" cond="$val->type=='last_post' && $val->idx==-1"><span><a href="{getUrl('sort_index','last_update','order_type',$order_type)}">{$lang->last_post}</a></span></th>
<th scope="col" cond="$val->type=='readed_count' && $val->idx==-1"><span><a href="{getUrl('sort_index','readed_count','order_type',$order_type)}">{$lang->readed_count}</a></span></th>
<th scope="col" cond="$val->type=='voted_count' && $val->idx==-1"><span><a href="{getUrl('sort_index','voted_count','order_type',$order_type)}">{$lang->voted_count}</a></span></th>
<th scope="col" cond="$val->type=='blamed_count' && $val->idx==-1"><span><a href="{getUrl('sort_index','blamed_count','order_type',$order_type)}">{$lang->blamed_count}</a></span></th>
<th scope="col" cond="$val->idx!=-1"><span><a href="{getUrl('sort_index', $val->eid, 'order_type', $order_type)}">{$val->name}</a></span></th>
</block>
<th scope="col" cond="$grant->manager"><span><input type="checkbox" onclick="XE.checkboxToggleAll({ doClick:true });" class="iCheck" title="Check All" /></span></th>
</tr>
<!-- /LIST HEADER -->
</thead>
<tbody>
<!-- NOTICE -->
<tr class="notice" loop="$notice_list=>$no,$document">
<block loop="$list_config=>$key,$val">
<td class="notice" cond="$val->type=='no' && $val->idx==-1">
<block cond="$document_srl==$document->document_srl">»</block>
<block cond="$document_srl!=$document->document_srl">{$lang->notice}</block>
</td>
<td class="title" cond="$val->type=='title' && $val->idx==-1">
<a href="{getUrl('document_srl',$document->document_srl, 'listStyle', $listStyle, 'cpage','')}">
{$document->getTitle()}
</a>
<a cond="$document->getCommentCount()" href="{getUrl('document_srl', $document->document_srl)}#comment" class="replyNum" title="Replies">
[{$document->getCommentCount()}]
</a>
<a cond="$document->getTrackbackCount()" href="{getUrl('document_srl', $document->document_srl)}#trackback" class="trackbackNum" title="Trackbacks">
[{$document->getTrackbackCount()}]
</a>
</td>
<td class="author" cond="$val->type=='nick_name' && $val->idx==-1"><a href="#popup_menu_area" class="member_{$document->get('member_srl')}" onclick="return false">{$document->getNickName()}</a></td>
<td class="author" cond="$val->type=='user_id' && $val->idx==-1">{$document->getUserID()}</td>
<td class="author" cond="$val->type=='user_name' && $val->idx==-1">{$document->getUserName()}</td>
<td class="time" cond="$val->type=='regdate' && $val->idx==-1">{$document->getRegdate('Y.m.d')}</td>
<td class="time" cond="$val->type=='last_update' && $val->idx==-1">{zdate($document->get('last_update'),'Y.m.d')}</td>
<td class="lastReply" cond="$val->type=='last_post' && $val->idx==-1">
<block cond="(int)($document->get('comment_count'))>0">
<a href="{$document->getPermanentUrl()}#comment" title="Last Reply">
{zdate($document->get('last_update'),'Y.m.d')}
</a>
<span cond="$document->get('last_updater')">
<sub>by</sub>
{htmlspecialchars($document->get('last_updater'))}
</span>
</block>
<block cond="(int)($document->get('comment_count'))==0"> </block>
</td>
<td class="readNum" cond="$val->type=='readed_count' && $val->idx==-1">{$document->get('readed_count')>0?$document->get('readed_count'):'0'}</td>
<td class="voteNum" cond="$val->type=='voted_count' && $val->idx==-1">{$document->get('voted_count')!=0?$document->get('voted_count'):'0'}</td>
<td class="voteNum" cond="$val->type=='blamed_count' && $val->idx==-1">{$document->get('blamed_count')!=0?$document->get('blamed_count'):'0'}</td>
<td cond="$val->idx!=-1">{$document->getExtraValueHTML($val->idx)} </td>
</block>
<td cond="$grant->manager" class="check"><input type="checkbox" name="cart" value="{$document->document_srl}" class="iCheck" title="Check This Article" onclick="doAddDocumentCart(this)" checked="checked"|cond="$document->isCarted()" /></td>
</tr>
<!-- /NOTICE -->
<!-- LIST -->
<tr loop="$document_list=>$no,$document">
<block loop="$list_config=>$key,$val">
<td class="no" cond="$val->type=='no' && $val->idx==-1">
<block cond="$document_srl==$document->document_srl">»</block>
<block cond="$document_srl!=$document->document_srl">{$no}</block>
</td>
<td class="title" cond="$val->type=='title' && $val->idx==-1">
<a href="{getUrl('document_srl',$document->document_srl, 'listStyle', $listStyle, 'cpage','')}">{$document->getTitle()}</a>
<a cond="$document->getCommentCount()" href="{getUrl('document_srl', $document->document_srl)}#comment" class="replyNum" title="Replies">[{$document->getCommentCount()}]</a>
<a cond="$document->getTrackbackCount()" href="{getUrl('document_srl', $document->document_srl)}#trackback" class="trackbackNum" title="Trackbacks">[{$document->getTrackbackCount()}]</a>
{$document->printExtraImages(60*480*$module_info->duration_new)}
</td>
<td class="author" cond="$val->type=='nick_name' && $val->idx==-1"><a href="#popup_menu_area" class="member_{$document->get('member_srl')}" onclick="return false">{$document->getNickName()}</a></td>
<td class="author" cond="$val->type=='user_id' && $val->idx==-1">{$document->getUserID()}</td>
<td class="author" cond="$val->type=='user_name' && $val->idx==-1">{$document->getUserName()}</td>
<td class="time" cond="$val->type=='regdate' && $val->idx==-1">{$document->getRegdate('Y.m.d')}</td>
<td class="time" cond="$val->type=='last_update' && $val->idx==-1">{zdate($document->get('last_update'),'Y.m.d')}</td>
<td class="lastReply" cond="$val->type=='last_post' && $val->idx==-1">
<block cond="(int)($document->get('comment_count'))>0">
<a href="{$document->getPermanentUrl()}#comment" title="Last Reply">
{zdate($document->get('last_update'),'Y.m.d')}
</a>
<span cond="$document->get('last_updater')">
<sub>by</sub>
{htmlspecialchars($document->get('last_updater'))}
</span>
</block>
<block cond="(int)($document->get('comment_count'))==0"> </block>
</td>
<td class="readNum" cond="$val->type=='readed_count' && $val->idx==-1">{$document->get('readed_count')>0?$document->get('readed_count'):'0'}</td>
<td class="voteNum" cond="$val->type=='voted_count' && $val->idx==-1">{$document->get('voted_count')!=0?$document->get('voted_count'):'0'}</td>
<td class="voteNum" cond="$val->type=='blamed_count' && $val->idx==-1">{$document->get('blamed_count')!=0?$document->get('blamed_count'):'0'}</td>
<td cond="$val->idx!=-1">{$document->getExtraValueHTML($val->idx)} </td>
</block>
<td cond="$grant->manager" class="check"><input type="checkbox" name="cart" value="{$document->document_srl}" class="iCheck" title="Check This Article" onclick="doAddDocumentCart(this)" checked="checked"|cond="$document->isCarted()" /></td>
</tr>
<!-- /LIST -->
</tbody>
</table>
</div>
<div class="list_footer">
<div class="pagination" cond="$document_list || $notice_list">
<a href="{getUrl('page','','document_srl','','division',$division,'last_division',$last_division)}" class="direction prev"><span></span><span></span> {$lang->first_page}</a>
<block loop="$page_no=$page_navigation->getNextPage()">
<strong cond="$page==$page_no">{$page_no}</strong>
<a cond="$page!=$page_no" href="{getUrl('page',$page_no,'document_srl','','division',$division,'last_division',$last_division)}">{$page_no}</a>
</block>
<a href="{getUrl('page',$page_navigation->last_page,'document_srl','','division',$division,'last_division',$last_division)}" class="direction next">{$lang->last_page} <span></span><span></span></a>
</div>
<div class="btnArea">
<span class="btn"><a href="{getUrl('act','dispBoardWrite','document_srl','')}">{$lang->cmd_write}...</a></span>
<span class="btn" cond="$grant->manager"><a href="{getUrl('','module','document','act','dispDocumentManageDocument')}" onclick="popopen(this.href,'manageDocument'); return false;">{$lang->cmd_manage_document}</a></span>
</div>
<button type="button" class="bsToggle" title="{$lang->cmd_search}">{$lang->cmd_search}</button>
<form cond="$grant->view" action="{getUrl()}" method="get" onsubmit="return procFilter(this, search)" id="board_search" class="board_search" no-error-return-url="true">
<input type="hidden" name="vid" value="{$vid}" />
<input type="hidden" name="mid" value="{$mid}" />
<input type="hidden" name="category" value="{$category}" />
<input type="text" name="search_keyword" value="{htmlspecialchars($search_keyword)}" title="{$lang->cmd_search}" class="iText" />
<select name="search_target">
<option loop="$search_option=>$key,$val" value="{$key}" selected="selected"|cond="$search_target==$key">{$val}</option>
</select>
<span class="btn"><button type="submit" onclick="xGetElementById('board_search').submit();return false;">{$lang->cmd_search}</button></span>
<span class="btn" cond="$last_division"><a href="{getUrl('page',1,'document_srl','','division',$last_division,'last_division','')}">{$lang->cmd_search_next}</a></span>
</form>
<a href="{getUrl('act','dispBoardTagList')}" class="tagSearch" title="{$lang->tag}">{$lang->tag}</a>
</div>
<include target="_footer.html" />
----------------------------------------------------------
이렇게 되고 $document 라고 나오는 부분은
모듈/ document 에서 document.item.php 파일에서 담당하고 있다고 하셔서
{$document->getTitle()}에 해당하는 부분을 찾아보니
function getTitle($cut_size = 0, $tail='...') {
if(!$this->document_srl) return;
$title = $this->getTitleText($cut_size, $tail);
$attrs = array();
$this->add('title_color', trim($this->get('title_color')));
if($this->get('title_bold')=='Y') $attrs[] = "font-weight:bold;";
if($this->get('title_color') && $this->get('title_color') != 'N') $attrs[] = "color:#".$this->get('title_color');
if(count($attrs)) return sprintf("<span style=\"%s\">%s</span>", implode(';',$attrs), htmlspecialchars($title));
else return htmlspecialchars($title);
}
이렇게 정의되어 있는 것 같은데요. 데이터베이스에서 xe_documents안에 tags2라는 필드를 만들어 글작성시 그부분에 데이터를 저장하게 하고 그 데이터를 리스트에서 출력하게 해주려면 어떻게 해야 하나요? write.php에 폼액션 경로가 ./로 지정되어있던데 어디에서 손봐야 되는지 모르겠어요. db에 필드는 만들었는데 글쓰기폼에 폼하나만들어서 id만 필드이름으로 넣어주면 되나요? 또그걸 리스트에서 제목앞에 출력해주려면 어디를 손봐야하나요? 좀 도와주시면 감사하겠습니다. 도움좀 부탁드립니다.
감사합니다.
http://www.xeschool.com/xe/step2_9