묻고답하기

며칠 전부터 해결 못한 새글 아이콘 넣기와 총 게시물, 하부 메뉴 총 게시물수 표현하기 입니다.
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 남기남
nikkis 페이지 내용직접추가 위젯으로 삽입된 이미지 상단여백 발생  
랑이군 기본 회원 가입과 확장에 대한 문의  
머구리 "서버에 요청중입니다"메세지가 안 사라져요  
오스카 게시판에 자기가 쓴 글도 수정할 수 없도록 하는 게시판이 있나요? [2] 2010.10.12 by 백성찬
이혜경477 관리자 로그인이 안되요.  
emkdh 회원가입....경로및 설정..  
글로벌 메인레이아웃에 이미지 롤오버 에러  
김치파워 플래넷이 어디갔지요?  
Bokmani 업그레이드를 했는데... file  
놋네눨느. 글쓴이만! 닉네임을 임의로 바꿀수있을까요? 해당 글의 글쓴이만요.  
지오426 xe에서 제로보드4로 역마이그레이션 가능합니까?  
푸른여행 Core ver. 1.4.3.1 입니다. 메뉴 관리에서 메뉴Tree가 안보입니다. [3] 2010.10.12 by 푸른여행
ddddffdfd 게시판 목록 글과 글 사이 조정 [1] file 2010.10.11 by B.G.M^^
케이198 게시판에서.. [1] 2010.10.11 by 곰이넷
오스카 [페이지]에서 [내용직접추가]시 그림 파일 첨부가 안됩니다. [5] 2010.10.11 by 오스카
betaon 2010 져니 테마 적용 후 [1] 2010.10.11 by 곰이넷
몽키@매직 회원가입폼을 메인에 노출!!!? [1] 2010.10.11 by 곰이넷
스카이피아 레이아웃 제작중 입니다. 의견이 궁금해요.. file  
쇼오 XE 잘하려면 어떤 것을 공부해야 할까요? [1] 2010.10.11 by SMaker
강성민327 모듈 캐싱 [1] 2010.10.11 by SMaker