Extra Form
PHP PHP 7.2
CMS XpressEngine

여러가지 검색해서 

https://xe1.xpressengine.com/qna/19582363

이것도 적용해 봤는데 아직도 건재하게 첨부파일 목록에 이미지가 있네요.

https://xe1.xpressengine.com/qna/22270297

이걸 했을때는 오히려 이미지로 된 첨부파일만 남게 되었어요.

<!--@if($oDocument->hasUploadedFiles() && $mi->file_list == T)-->
<tr class="atc-file-list">
<th>{$lang->uploaded_file} <span class="num ptCl">{$oDocument->get('uploaded_count')}</span></th>
<td>
<ol>
<li loop="$oDocument->getUploadedFiles()=>$key,$file">
<a href="{getUrl('')}{$file->download_url}">{$file->source_filename}</a>
<span class="num">(File Size:{FileHandler::filesize($file->file_size)}/Download:{number_format($file->download_count)})</span>
</li>
</ol>
</td>
</tr>
<!--@end-->

 

여기부분에 적용하고자 하는데 어떻게 해야 하나요

 

 

  • profile
    <!--@if($oDocument->hasUploadedFiles() && $mi->file_list == T)-->
    <tr class="atc-file-list">
    <th>{$lang->uploaded_file} <span class="num ptCl">{$oDocument->get('uploaded_count')}</span></th>
    <td>
    <ol>
    <li loop="$oDocument->getUploadedFiles()=>$key,$file">
    <!--@if(!preg_match("/\.(jpg|jpeg|gif|png)$/i",$file->source_filename))-->
    <a href="{getUrl('')}{$file->download_url}">{$file->source_filename}</a>
    <span class="num">(File Size:{FileHandler::filesize($file->file_size)}/Download:{number_format($file->download_count)})</span>
    <!--@end-->
    </li>
    </ol>
    </td>
    </tr>
    <!--@end-->

     

  • profile ?

    앗! 잘됩니다!! 감사합니다!! ^o^
    첨부파일에 숫자는 그대로인데  숫자도 적용하는건 복잡한거겠지요?

  • ? profile
    무슨 숫자를 말씀하시는 건가요?
    화일사이즈? 다운로드?
    설마 숫자를 없애시는 것은 아닐게고..
    두가지 다 number_format(...) 식으로 바꾸시면 가능할텐데요.
  • profile ?
    첨부파일 갯수요.. 제가 설명을 좀 이상하게 했네요;
  • ? profile

    업로드된 화일 갯수를 말씀하시는 거군요.
    근데 그건 jQuery를 써야할 것같네요.
    먼저 뿌려놓은 숫자를 바꿔야하니...
     

    !--@if($oDocument->hasUploadedFiles() && $mi->file_list == T)-->
    <tr class="atc-file-list">
    <th>{$lang->uploaded_file} <span class="num ptCl">{$oDocument->get('uploaded_count')}</span></th>
    <td>
    <ol>
    <li loop="$oDocument->getUploadedFiles()=>$key,$file">
    {@$i=0]
    <!--@if(!preg_match("/\.(jpg|jpeg|gif|png)$/i",$file->source_filename))-->
    <a href="{getUrl('')}{$file->download_url}">{$file->source_filename}</a>
    <span class="num">(File Size:{FileHandler::filesize($file->file_size)}/Download:{number_format($file->download_count)})</span>
    {@$i++}
    <!--@end-->
    </li>
    </ol>
    </td>
    </tr>
    <script type="text/javascript">....여기 jQuery script .....</script>
    <!--@end-->

     

    저기 스크립트는

    (function($){ $('.ptcl').text({$i}); }); })(jQuery);

    식으로 짜야할 것같은데 제가 테스트할 수 있는 상황이 아니라서 잘 고쳐서 쓰시기 바랍니다.

    행운을 빕니다.

  • profile ?
    감사합니다!!!!! 연구해볼께요! :)
  • ? profile
    !--@if($oDocument->hasUploadedFiles() && $mi->file_list == T)-->
    <block loop="$oDocument->getUploadedFiles()=>$key,$file">
    {@$uploaded= array();}
    <!--@if(!preg_match("/\.(jpg|jpeg|gif|png)$/i",$file->source_filename))-->
    {@$uploaded[] = $file;}
    <!--@end-->
    </block>
    <block cond="count($uploaded)">
    <tr class="atc-file-list">
    <th>{$lang->uploaded_file} <span class="num ptCl">{count($uploaded)}</span></th>
    <td>
    <ol>
    <li loop="$uploaded=>$file">
    <a href="{getUrl('')}{$file->download_url}">{$file->source_filename}</a>
    <span class="num">(File Size:{FileHandler::filesize($file->file_size)}/Download:{number_format($file->download_count)})</span>
    </li>
    </ol>
    </td>
    </tr>
    </block>
    <!--@end-->

    식으로 루프를 한번 더 돌리면 jQuey 사용하지 않고도 가능하겠네요.

     

  • profile ?
    헐! 이제야 댓글을 보았습니다!
    적용해보겠습니다 정말 감사드려요!
  • profile ?

    정말 감사드립니다. 잘 되고있어요!!!!!!!! >.< 첨부파일 숫자도 이미지 제외하고 나오구 , 이미지 첨부파일 앞에 붙는 숫자는 남아있었는데 그것마저도 말끔하게 사라졌습니다.
    정말 감사합니다!!!!!!