묻고답하기

며칠 전부터 해결 못한 새글 아이콘 넣기와 총 게시물, 하부 메뉴 총 게시물수 표현하기 입니다.
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