묻고답하기

며칠 전부터 해결 못한 새글 아이콘 넣기와 총 게시물, 하부 메뉴 총 게시물수 표현하기 입니다.
jjong님의 레이아웃이 자바스크립트를 이용한 트리구조를 쓰고 있는데
http://enjoyitaewon.com/zbxe/?mid=itaewonguide_sent_inbox

보통 쓰이는 총 게시물 수랑 다르게 해야할 것 같은데 어떻게 하는지 모르겠습니다.
쫑득이님이 올린 레이아웃 링크
http://www.zeroboard.com/zbxe_layout_skin/16560220/page/6
jjong.zip

새글 표시 아이콘, 총게시물수, 트리메뉴의 하부 메뉴 총 게시물 수
예를 들어 요렇게 아래처럼 구현되면 좋겠습니다!
모든 메뉴 옆에 총 게시물 수가 나와야겠죠~



쫑득이님의 자바스크립트 소스를 첨부할테니...고수님들의 도움 부탁드립니다.emoticon

아래가 보통 XE에서 쓰이는 방식인데요...그리곤 [{$val->document_count}] 식으로 넣어주잖아요~

    <div class="{$class}" id="category_parent_{$val->category_srl}">
        <div class="item <!--@if($val->selected)-->selected<!--@end-->">
            <a href="{getUrl('','mid'+ '+ ',$widget_info->mid, 'category',$val->category_srl)}">{$val->text}</a>
            <!--@if($val->document_count)--><strong>[{$val->document_count}]</strong><!--@end-->
        </div>
    </div>

제가 사용하려는 건...자바 스크립트 부분이 대략 아래와 같은 상황입니다.

// Creates the tree structure

dTree.prototype.addNode = function(pNode) {

 var str = '';

 var n=0;

 if (this.config.inOrder) n = pNode._ai;

 for (n; n<this.aNodes.length; n++) {

  if (this.aNodes[n].pid == pNode.id) {

   var cn = this.aNodes[n];

   cn._p = pNode;

   cn._ai = n;

   this.setCS(cn);

   if (!cn.target && this.config.target) cn.target = this.config.target;

   if (cn._hc && !cn._io && this.config.useCookies) cn._io = this.isOpen(cn.id);

   if (!this.config.folderLinks && cn._hc) cn.url = null;

   if (this.config.useSelection && cn.id == this.selectedNode && !this.selectedFound) {

     cn._is = true;

     this.selectedNode = n;

     this.selectedFound = true;

   }

   str += this.node(cn, n);

   if (cn._ls) break;

  }

 }

 return str;

};

 

// Creates the node icon, url and text

dTree.prototype.node = function(node, nodeId) {

 var str = '<div class="dTreeNode">' + this.indent(node, nodeId);

 if (this.config.useIcons) {

  if (!node.icon) node.icon = (this.root.id == node.pid) ? this.icon.root : ((node._hc) ? this.icon.folder : this.icon.node);

  if (!node.iconOpen) node.iconOpen = (node._hc) ? this.icon.folderOpen : this.icon.node;

  if (this.root.id == node.pid) {

   node.icon = this.icon.root;

   node.iconOpen = this.icon.root;

  }

  str += '<img id="i' + this.obj + nodeId + '" src="' + ((node._io) ? node.iconOpen : node.icon) + '" alt="" />';

 }

 if (node.url) {

  str += '<a id="s' + this.obj + nodeId + '" class="' + ((this.config.useSelection) ? ((node._is ? 'nodeSel' : 'node')) : 'node') + '" href="' + node.url + '"';

  if (node.title) str += '+ ' title="' + node.title + '"';

  if (node.target) str += ' target="' + node.target + '"';

  if (this.config.useStatusText) str += ' onmouseover="window.status=\'' + node.name + '\';return true;" onmouseout="window.status=\'\';return true;" ';

  if (this.config.useSelection && ((node._hc && this.config.folderLinks) || !node._hc))

   str += ' onclick="javascript: ' + this.obj + '+ '.s('+ ' + nodeId + ');"';

  str += '>';

 }

 else if ((!this.config.folderLinks || !node.url) && node._hc && node.pid != this.root.id)

  str += '<a href="javascript: ' + this.obj + '.o('+ ' + nodeId + ');" class="node">';

 str += node.name;

 if (node.url || ((!this.config.folderLinks || !node.url) && node._hc)) str += '</a>';

 str += '</div>';

 if (node._hc) {

  str += '<div id="d' + this.obj + nodeId + '" class="clip" style="display:' + ((this.root.id == node.pid || node._io) ? 'block' : 'none') + ';">';

  str += this.addNode(node);

  str += '</div>';

 }

 this.aIndent.pop();

 return str;

};

레이아웃에서 뿌려줄 땐
   <div id="dtree">
    <script type="text/javascript">

     d = new dTree('d');

     var x,y,z,cnt;
     x=0;
     y=10;
     z=100;
     cnt=0;

     d.add(0,-1,'Home','','','');

     <!--@foreach($main_menu->list as $key => $val)--><!--@if($val['text'])-->
      x=x+1;d.add(x,0,"{$val['link']}","{$val['href']}",'+ ''<!--@if($val['open_window']=='Y')-->,true<!--@end-->);
      <!--@if($val['selected']) -->
       cnt=x;
      <!--@end-->
      <!--@foreach($val['list'] as $key1 => $val1)--><!--@if($val1['text'])-->
       y=y+1;d.add(y,x,"{$val1['+ 'link']}","{$val1['href']}",''<!--@if($val1['open_window']=='Y')-->,true<!--@end-->);
       <!--@foreach($val1['list'] as $key2 => $val2)--><!--@if($val2['text'])-->
        z=z+1;d.add(z,y,"{$val2['link']}","{$val2['href']}",''<!--@if($val2['open_window']=='Y')-->,true<!--@end-->);
       <!--@end--><!--@end-->
      <!--@end--><!--@end-->
     <!--@end--><!--@end-->

     document.write(d);

     d.openTo(cnt, true);

    </script>
    <p><a href="javascript: d.openAll();">open all</a> | <a href="javascript: d.closeAll();">close all</a></p>
   </div>

이런식이구요.

쫑득이님의 자바스크립트 소스를 첨부할테니...고수님들의 도움 부탁드립니다.
새글 표시 아이콘, 총게시물수, 트리메뉴의 하부 메뉴 총 게시물 수
예를 들어 요렇게 아래처럼 구현되면 좋겠습니다!
모든 메뉴 옆에 총 게시물 수가 나와야겠죠~



요것만 더 넣고 싶은데...부탁드려요!
쫑득이님이 올린 레이아웃 링크
http://www.zeroboard.com/zbxe_layout_skin/16560220/page/6
jjong.zip

글쓴이 제목 최종 글
XE 공지 글 쓰기,삭제 운영방식 변경 공지 [16] 2019.03.05 by 남기남
eJungHyun xe_blog 레이아웃에서요.. file  
엠™ 게시물 분류 출력기. 제목에 브라우저 제목 대신 원하는 이름 넣기..  
elmtree 위지윅 에디터 아이콘이 없어집니다. [4] 2008.12.01 by elmtree
Jiyoung540 새글 아이콘,총게시물 관련 자바스크립트와 PHP 고수님의 도움이 절실합니다! [3] file 2008.12.18 by Jiyoung540
송군223 가입 약관에 이미지 넣을 수 없나요? [2] 2008.12.20 by 송군223
왕초보 글 쓸 때 HTML 체크버튼을 눌러도 오류나면서 반응이 없습니다. [4] 2008.12.22 by 왕초보
Jiyoung540 다른 계정에서 데이터 이전 가능한가요? [1] 2008.12.25 by 느까끼
낭만홀리님 회원가입 없이 Open ID 사용으로만 가능할까요? [1] 2009.01.06 by test
alias 첨부파일 문제 해결법 (본인의경우임), 세션 문제로 해결함 [3] 2009.01.20 by 박세홍659
개돌 SSL 마이그레이션 질문 [1] 2009.02.02 by 개돌
earthhero.me 오픈아이디 회원가입은 어디서 하나요? [3] 2009.02.03 by earthhero.me
Newage Love 아으...답답하닷,,,,ㅋ [1] 2009.02.03 by 뭥미?
dusskapark 이슈크래커를 써보고 싶습니다...도와주세요..ㅠ [2] 2009.02.14 by 비나무
seanwiz 이슈트래커 - svn, diff 실행 파일 위치 설정 관련 [4] 2009.02.17 by 뽀여니
다방짱 통합검색에서 검색어에 따라 다운되거나 화면이 안나옵니다ㅠ.ㅠ [1] file 2009.02.18 by 지연아빠
impre 글쓰기, 회원가입 시 페이지에 오류(javascript 오류) 문의 file  
B.G.M^^ 이미지 첨부시 용량편집을 해서 첨부할수 있는 기능이 있는지요? [2] 2009.02.21 by B.G.M^^
상오기 게시판내에 아이프레임 사용시 폼값 문제... (내용수정)  
리어코리아 고영수 과장님만이 확답을 주실 듯 ... [3] 2009.02.28 by 리어코리아
개돌 XML 파일을 받아서 입/출력이 가능할까요?? [2] 2009.03.05 by 愛人