묻고답하기
송동우님, 저도 다시 질문 드립니다. ^^;
2011.12.18 17:14
http://www.xpressengine.com/index.php?document_srl=20337553&search_keyword=%EB%8F%99%EC%9A%B0
안녕하세요. 빠른 답변 감사합니다. 제가 확인이 늦었네요. ^^
그런데 알려주신 방법으로 파일을 열고 적용을 했는데 오류는 나지 않으나 번호를 매기는 숫자가 아예 나타나질 않습니다. ㅠㅠ
제가 적용한 소스는 아래와 같습니다. 무엇이 문제일까요? 숫자를 닉네임 바로 뒤에 출력하고 싶습니다.
{@
$oDB = &DB::getInstance();
$query = $oDB->_query('select regdate from xe_comments where document_srl = '.$document_srl);
$result = $oDB->_fetch($query);
$no = array();
}
<block loop="$i=0;$i<count($result);$i++">
{@ $no[] = $result[$i]->regdate}
</block>
{@ sort($no)}
<!--// Comment Tag -->
<div cond="!$mi->fdb_style" class="fdb_tag<cmt_wrt_position=='cmt_wrt_btm'">!--@if($mi->cmt_wrt_position=='cmt_wrt_btm')--> bg_f_f9<!--@end-->">
<a class="ui_font bubble" href="#" onclick="jQuery(this).parent().nextAll('ul,.bd_pg').slideToggle();return false" title="{$lang->comment} {$lang->cmd_view}">Comments <b>'{$oDocument->getCommentcount()}'</b></a>
</div><ul class="fdb_lst_ul {$mi->fdb_hide}">
<li loop="$oDocument->getComments()=>$key,$comment" id="comment_{$comment->comment_srl}" class="fdb_itm clear<get('depth'">!--@if($comment->get('depth'))--> re bg{($comment->get('depth'))%2}<!--@end-->" style="margin-left:{($comment->get('depth'))*20}px">
<b cond="$comment->get('depth')" class="ico_16px re"></b>
<!--// 프로필 -->
<block cond="!$mi->profile_img">
<img cond="$comment->getProfileImage()" class="profile img" src="{$comment->getProfileImage()}" alt="profile" />
<span cond="!$comment->getProfileImage()" class="profile img no_img">?</span>
</block>
<block loop="$no => $k,$v" cond="$v==$comment->variables[regdate]">
{@ $k++}
<? break ?>
</block>
<!--// 댓글 정보 -->
<div class="meta">
<a cond="$comment->member_srl" href="#popup_menu_area" class="member_{$comment->member_srl}" onclick="return false">{$comment->getNickName()}</a>{$k}
<a cond="!$comment->member_srl && $comment->homepage" href="{$comment->homepage}" target="_blank">{$comment->getNickName()}</a>
<b cond="!$comment->member_srl && !$comment->homepage">{$comment->getNickName()}</b>
<span class="date">{getTimeGap($comment->get('regdate'), "Y.m.d H:i")}</span><small cond="$grant->manager || $mi->display_ip_address">({$comment->getIpaddress()})</small>
<!--// 첨부파일 -->
<block cond="$comment->hasUploadedFiles()">
<a class="tg_btn2" href="#files_{$comment->comment_srl}"><b class="ui-icon ui-icon-disk">Files</b>{$lang->uploaded_file} <small>({$comment->get('uploaded_count')})</small></a>
<div id="files_{$comment->comment_srl}" class="cmt_files tg_cnt2">
<button type="button" class="tg_blur2"></button><button type="button" class="tg_close2" title="{$lang->cmd_close}"><b class="ui-icon ui-icon-closethick">X</b></button>
<ul class="wrp">
<li loop="$comment->getUploadedFiles()=>$key,$file"><em>•</em> <a class="bubble" href="{getUrl('')}{$file->download_url}" title="[File Size:{FileHandler::filesize($file->file_size)}/Download:{number_format($file->download_count)}]">{$file->source_filename}</a></li>
</ul>
<button type="button" class="tg_blur2"></button>
</div>
</block>
</div>
<!--// 댓글 본문 -->
<isAccessible">!--@if(!$comment->isAccessible())-->
<form action="./" method="get" onsubmit="return procFilter(this, input_password)">
<input type="hidden" name="mid" value="{$mid}" />
<input type="hidden" name="page" value="{$page}" />
<input type="hidden" name="document_srl" value="{$comment->get('document_srl')}" />
<input type="hidden" name="comment_srl" value="{$comment->get('comment_srl')}" />
<p>"{$lang->msg_is_secret}"</p>
<span class="itx_wrp">
<label for="cpw_{$comment->comment_srl}">{$lang->password}</label>
<input type="password" id="cpw_{$comment->comment_srl}" name="password" class="itx" />
<input type="submit" value="{$lang->cmd_input}" class="btn" />
</span>
</form>
<!--@else-->
{$comment->getContent(false)}
<!--@end-->
<!--// 편집 등 -->
<div class="fdb_nav img_tx">
<block cond="$mi->cmt_this_btn=='2' && $is_logged">
<a href="#" onclick="doCallModuleAction('comment','procCommentDeclare','{$comment->comment_srl}');return false"><span cond="$mi->declare_img" class="ico_16px" style="background:url({$mi->declare_img})"></span>{$lang->cmd_declare}</a>
<a href="#" onclick="doCallModuleAction('comment','procCommentVoteUp','{$comment->comment_srl}');return false"><span cond="$mi->cmt_vote_img" class="ico_16px" style="background:url({$mi->cmt_vote_img})"></span>{$lang->cmd_vote}</a>
<a cond="!$mi->cmt_vote_down" href="#" onclick="doCallModuleAction('comment','procCommentVoteDown','{$comment->comment_srl}');return false"><span cond="$mi->cmt_vote_down_img" class="ico_16px" style="background:url({$mi->cmt_vote_down_img})"></span>{$lang->cmd_vote_down}</a>
</block>
<a cond="(!$mi->cmt_this_btn && $is_logged) || $grant->manager" class="comment_{$comment->comment_srl}" href="#popup_menu_area" onclick="return false"><span class="tx_ico_chk">✔</span>{$lang->cmd_comment_do}</a>
<block cond="$comment->isGranted() || !$comment->get('member_srl')">
<a href="{getUrl('act','dispBoardModifyComment','comment_srl',$comment->comment_srl)}"><span class="ico_16px write"></span>{$lang->cmd_modify}</a>
<a href="{getUrl('act','dispBoardDeleteComment','comment_srl',$comment->comment_srl)}"><span class="ico_16px delete"></span>{$lang->cmd_delete}</a>
</block>
<a cond="$grant->write_comment && $oDocument->isEnableComment()" class="re_comment" href="{getUrl('act','dispBoardReplyComment','comment_srl',$comment->comment_srl)}"><span class="ico_16px reply"></span>{$lang->cmd_reply}</a>
<!--// 추천-비추천 -->
<span cond="$mi->cmt_vote!='N' && ($mi->cmt_vote=='2' || $comment->get('voted_count')!=0 || $comment->get('blamed_count')!=0)" class="vote">
<a class="bd_login" href="#" onclick="doCallModuleAction('comment','procCommentVoteUp','{$comment->comment_srl}');return false"|cond="$is_logged"><span cond="$mi->cmt_vote_img" class="ico_16px" style="background:url({$mi->cmt_vote_img})"></span> {$lang->cmd_vote}<b><em>{$comment->get('voted_count')?$comment->get('voted_count'):0}</em></b></a>
<a cond="!$mi->cmt_vote_down" class="bd_login" href="#" onclick="doCallModuleAction('+ 'comment','procCommentVoteDown','{$comment->comment_srl}');return false"|cond="$is_logged"><span cond="$mi->cmt_vote_down_img" class="ico_16px" style="background:url({$mi->cmt_vote_down_img})"></span> {$lang->cmd_vote_down}<b>{abs($comment->get('blamed_count')?$comment->get('blamed_count'):0)}</b></a>
</span>
</div>
</li>
</ul><!--// 페이지 -->
<div cond="$oDocument->comment_page_navigation" class="bd_pg {$mi->fdb_hide}">
<a href="{getUrl('cpage',1)}#comment" class="direction" title="{$lang->first_page}">« <span>First</span></a>
<block loop="$page_no=$oDocument->comment_page_navigation->getNextPage()">
<strong cond="$cpage==$page_no" class="this">{$page_no}</strong>
<a cond="$cpage!=$page_no" href="{getUrl('cpage',$page_no)}#comment">{$page_no}</a>
</block>
<a href="{getUrl('cpage',$oDocument->comment_page_navigation->last_page)}#comment" class="direction" title="{$lang->last_page}"><span>Last</span> »</a>
</div>
<script type="text/javascript">
jQuery(function($){
var t = $('<default_style=='blog')-->#comment_{$oDocument->document_srl">!--@if($mi->default_style=='blog')-->#comment_{$oDocument->document_srl} .bd_pg<#comment">!--@else-->#comment .bd_pg<'">!--@end-->');
t.clone().removeClass('bd_pg').addClass('cmt_pg').appendTo(t.prev().prev());
});
</script>
댓글 3
-
송동우
2011.12.18 17:36
-
죽염
2011.12.18 21:57
옮겨도 그대로네요ㅠㅠ 그리고 일부 글(가장 최근 글)을 클릭하고 들어가면 흰 화면에 오류가 나고요...
정말 왜 이러는지 모르겠네요ㅠㅠ 번거롭게 해드려서 죄송해요
-
송동우
2011.12.18 22:22
테스트 화면 스샷입니다.
붉은 색 숫자가 순서를 표시하는 숫자입니다.
입력날짜와 비교해보면 순서대로 표시된 것을 볼 수 있을 겁니다.
별로 많이 수정하는 것도 아닌데.....
안된다면......
저도 왜 그런지 모르겠습니다......
다시 한 번 잘 해보시라는 말 밖엔......
{$k} 위치만 바꾸면 됩니다.
몇 줄 아래에 span태그 앞에 위치시켜 보세요