Extra Form
PHP PHP 7.3
CMS XpressEngine

첫번째 댓글 바로 아래 원하는 글이 노출이 되도록 하고 싶은데 

쉽지 않네요 ...

 

혹시 이렇게 하신분 계실까요 ...?

혼자서 별짓을 다하고 안되서 이렇게 질문올립니다 

 

감사 합니다

  • ?
    에..?
    설명을 좀 더 자세히 해주세요..;
  • ? ?
    첫번째 댓글 박스 바로 아래 임의 글이 노출이 되도록이요 ㅎㅎ
  • ? ?
    첫번째 댓글박스 바로밑에 랜덤글 노출이요?
  • ? ?
    아니요 임의글요 ㅎㅎ
  • profile
    댓글 클레스명에 임의값주는형식으로 진행하시는건 어떠세요?
    스킨에서 한다면
    루프문 상단에 {@ $i_dex=0} 초기설정하시고 댓글클레스명 뒤에 댓글클레스명_{$i_dex} 식으로 추가하시고 루프문 하단 쪽에 {$i_dex++} 되는식으로 증가시키시고 제이쿼리로 댓글클레스명_1 위에 html추가하시는방식으로 구현하시면 될거같아요
  • profile ?
    <div class="replyList">
    {@ $_comment_list = $oDocument->getComments() }
    <block loop="$oDocument->getComments()=>$key,$comment">
    <div class="round6 item <!--@if($comment->get('depth'))-->itemReply<!--@end-->" id="comment_{$comment->comment_srl}">
    <div class="indent" style="margin-left:{($comment->get('depth'))*15}px"|cond="$comment->get('depth')">

    <div class="itemAside">
    <img src="{$comment->getProfileImage()}" alt="profile" class="profile" cond="$comment->getProfileImage()" />
    <img src="img/common/profile_photo.gif" alt="profile" class="profile" cond="!$comment->getProfileImage()" />

    <div class="profile_info">
    <!-- // 작성자 이름 출력 -->
    <h4 class="header" cond="!$comment->member_srl">
    <a href="{$comment->homepage}" onclick="window.open(this.href);return false;" cond="$comment->homepage">{$comment->getNickName()}</a>
    <strong cond="!$comment->homepage">{$comment->getNickName()}</strong>
    </h4>
    <h4 class="header" cond="$comment->member_srl">
    <a href="#popup_menu_area" class="member_{$comment->member_srl}" onclick="return false">{$comment->getNickName()}</a>
    </h4>

    <span class="meta">
    {$comment->getRegdate('Y.m.d')} {$comment->getRegdate('H:i')}
    <block cond="$grant->manager || $module_info->display_ip_address!='N'"><br />{$comment->getIpaddress()}</block>
    </span>

    <!-- // 추천표시 출력 -->
    <dl class="vote" cond="$comment->get('voted_count')!=0 || $comment->get('blamed_count') != 0">
    <dt class="love"><span>{$lang->cmd_vote}</span></dt>
    <dd>{$comment->get('voted_count')?$comment->get('voted_count'):0}</dd>
    <dt class="hate"><span>{$lang->cmd_vote_down}</span></dt>
    <dd>{$comment->get('blamed_count')?$comment->get('blamed_count'):0}</dd>
    </dl>
    </div>

    </div><!-- // itemAside end -->

    <div class="itemContent">
    <!--@if(!$comment->isAccessible())-->
    <form action="/" method="get" onsubmit="return procFilter(this, input_password)" class="secretMessage">
    <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>&quot;{$lang->msg_is_secret}&quot;</p>
    <dl>
    <dt><label for="cpw">{$lang->password}</label> :</dt>
    <dd><input type="password" id="cpw" name="password" class="inputText" /><span class="buttonOfficial"><input type="submit" value="{$lang->cmd_input}" /></span></dd>
    </dl>
    </form>
    <!--@else-->

    <!-- // 댓글 출력 -->
    {$comment->getContent(false)}

    <!-- // 첨부파일 출력 -->
    <dl class="attachedFile" cond="$comment->hasUploadedFIles()">
    <dt><img src="/img/common/iconFiles.gif" width="27" height="11" alt="{$lang->uploaded_file}" />
    <button type="button" class="fileToggle" onclick="jQuery(this).parents('dl.attachedFile').toggleClass('open');return false;">{$lang->uploaded_file} ({$comment->get('uploaded_count')})</button>
    </dt>
    <dd>
    <ul class="files">
    {@ $_uploaded_files = $comment->getUploadedFiles() }
    <!--@foreach($_uploaded_files as $key => $file)-->
    <li><a href="{getUrl('')}{$file->download_url}">{$file->source_filename} <span class="bubble">[File Size:{FileHandler::filesize($file->file_size)}/Download{number_format($file->download_count)}]</span></a></li>
    <!--@end-->
    </ul>
    </dd>
    </dl>

    <ul class="option">
    <li class="wouldYou" cond="$is_logged"><a href="#popup_menu_area" class="comment_{$comment->comment_srl}">{$lang->cmd_comment_do}</a></li>
    <li><a href="{getUrl('act','dispBoardReplyComment','comment_srl',$comment->comment_srl)}">{$lang->cmd_reply}</a></li>
    <block cond="$comment->isGranted() || !$comment->get('member_srl')">
    <li><a href="{getUrl('act','dispBoardModifyComment','comment_srl',$comment->comment_srl)}">{$lang->cmd_modify}</a></li>
    <li><a href="{getUrl('act','dispBoardDeleteComment','comment_srl',$comment->comment_srl)}">{$lang->cmd_delete}</a></li>
    </block>
    </ul>
    <!--@end-->
    </div><!-- // itemContent end -->

    </div><!-- // indent end -->

    </div><!-- // item end -->
    </block>

    </div>
    <!-- // replyList end -->


    여기서 어떻게 된건가요 ...
    어느 지점부터 인지 감이 안옵니다
    죄송 하지만 알려주시면 좋겠습니다
    (--)(__)
  • ? profile
    {@ $_comment_list = $oDocument->getComments() }
    {@ $i_dex =0}
    <block loop="$oDocument->getComments()=>$key,$comment">
    <div class="round6 item <!--@if($comment->get('depth'))-->itemReply<!--@end--> {$i_dex}" id="comment_{$comment->comment_srl}">
    {@ $i_dex++}
    해서 댓글 class 명뒤에 숫자붙는지 확인해보세요 숫자 붙는거 확인되시면 첫번째 댓글에 해당되는 클레스 앞 뒤에 html추가하는 제이쿼리사용하시면될거에요
  • profile ?
    <div class="round6 item itemReply" id="comment_3539"> 이렇게 붙습니다
    그러면 html추가하는 제이쿼리를 어느 부분에 붙혀야 할까요...?
  • ? profile
    class명뒤에 붙지는않으신가요? itemReply 뒤쪽에요
  • profile ?
    지금 확인 해보니 <div class="round6 item 1" id="comment_3497"> 이렇게 붙어요
    이제야 어느정도 감을 잡았습니다
    이렇게 해서 어떻게 하는건지 좀 알려주시면 안될까요 ...?
    소스상으로 좀 부탁 드리겠습니다
  • profile ?
    {@ $_comment_list = $oDocument->getComments() }
    {@ $i_dex =0}
    <block loop="$oDocument->getComments()=>$key,$comment">
    <div class="round6 item <!--@if($comment->get('depth'))-->itemReply<!--@end--> {$i_dex}" id="comment_{$comment->comment_srl}">
    {@ $i_dex++}

    이것을 넣으니 붙는군요 제가 이것을 이해를 못했네요
    이 다음에 어떻게 하는지요 ...?
    고맙습니다
  • profile ?
    저기 숫자 1이 첫번째 댓글인되요
    저기서 저 1을 어떻게 응용을 하라는 것 같은되요
    광고를 어떻게 넣어하는지 도통 모르겠습니다
  • profile ?
    $(function(){
    //code
    })(jQuery);
    혹시 위 처럼 하면되나요
  • ? profile
    https://www.thewordcracker.com/jquery-examples/how-to-add-specific-content-to-html-using-jquery/
    제이쿼리를 이용해서 html추가하는방식입니다.
  • ? profile
    <script>
    $(document).ready(function(){
    $('.round6 .item .1').append($('<div>',{
    할말

    },'</div>'));
    });
    </script>
    이런식으로 사용하면되는걸로알고있습니다
  • ? profile
    <div class="inside" style="display:none">
    내용
    </div>
    <script>
    $(document).ready(function(){
    $('.round6 .item .1').append($('.inside'));
    $('.inside').show();
    });
    </script>
  • ? profile

    append보다 after가맞는거같아요
    그리고 굳이 $i_dex추가안하셔도될거같습니다.
    밑에처럼 사용하시면될거에요
    <div class="inside" style="display:none">
    내용
    </div>
    <script>
    $(document).ready(function(){
    $('.round6 .item:first-child').after($('.inside'));
    $('.inside').show();
    });
    </script>

  • profile ?
    확실한 답글 감사 합니다
    고맙습니다 ㅠㅠ
  • profile ?

    <div class="inside" style="display:none">
    내용
    </div>
    <script>
    $(document).ready(function(){
    $('.round6 .item:first-child').after($('.inside'));
    $('.inside').show();
    });
    </script>

    위에 있는 저 코드를 comment.html 여기서 위치 상관 없이 원하는 곳에 넣으면 되는 거죠

     

    현재 맨 하단에 넣고 해봤지만 출력이 맨 하단 코멘드 박스 아래로 가버리네요 

    .item:first-child 이거 샅은 경우 after 이거 말고 혹시 숫자를 넣어야 하는게 아닌가 싶어서요 

    여쭤 봅니다 전에 한번 해보고 나니 생각이 안나네요 

     

  • profile ?
    지금 적용하고 캐쉬를 삭제 하니 됩니다
    근대 이상한게 댓글이 하나 이상 달리니 안됩니다
    사라져버리네요
    이게 아마도 댓글이 2개면 안되는것 같습니다
    조금씩 알아보고는 있습니다 ㅎㅎ
    너무 고맙습니다
  • ? profile
    .round6 .item .itemReply가 댓글이 2개이상달렸을때 클레스명인거같습니다
    $('$('.round6 .item .itemReply:first-child').after($('.inside'));를 추가해주시면될거같습니다. 그리고
    first-child를 nth-child(숫자) 하시면 n번째 뒤에 생기게됩니다.
    nth-child css확인해보시면됩니다.
  • profile ?
    고맙습니다 다시 도전 ㅎㅎ
    감사합니다