해결이 안된서 다시 질문 올립니다. 분류 순서 지정할 방법이 있을까요? 채택완료
http://enterdh.enterweb.co.kr/bbs/board.php?bo_table=gallery&page=1&page=1">http://enterdh.enterweb.co.kr/bbs/board.php?bo_table=gallery&page=1&page=1
이 페이지 게시판은 https://sir.kr/g5_skin/2553" rel="nofollow noreferrer noopener" target="_blank">https://sir.kr/g5_skin/2553 이 스킨을 사용중입니다.
분류 지정은 관리자 페이지에서 a|b|c|d 이렇게 했습니다.
그런데 게시글 올릴때 제가 분류 선택을 c 로하고 게시글 등록을 하면 게시판 분류 탭의 순서가 c|a|b|d 이렇게 바뀌게 됩니다.
분류 순서를 고정하고 싶은데 방법이 없을까요?? 아무리 찾아보려 해도 못찾겠습니다 ㅜㅜ
도와주세요 ㅜㅜ
답변 2개
list.skin.php를 좀 보고 이안에서 sql문을 건드렸는지 좀 봐야할거같은데요..
아니면 write.skin.php에서 저 select가 onchange됏을때도 뭔가 input hidden에서 뭘 보내고 list에서 받아서 뭘하는게 있는지도 좀 체크해봐야할거같고..음..
아..테스트글 하나 올려보니 가장 최근글이 올라간 분류가 맨앞으로 땅겨지게 해놨네요..그 해당소스가 어딧는지 좀 찾아야할듯.. 아마 순정list.php를 건드리지 않았다면 list.skin.php에 있을거같은데요?
답변에 대한 댓글 1개
댓글을 작성하려면 로그인이 필요합니다.
아르키어드님 답변 감사합니다.
list.php 는 건드리지 않았고 밑에 소스 부분 인거 같은데 초보자인 제가 찾으려다 보니 어디가 어딘지 모르겠습니다. ㅜ
</p>
<p> </p>
<p>$(document).ready(function(){</p>
<p> </p>
<p> var items = $('#stage li'),</p>
<p> itemsByTags = {};</p>
<p> </p>
<p> // Looping though all the li items:</p>
<p> </p>
<p> items.each(function(i){</p>
<p> var elem = $(this),</p>
<p> tags = elem.data('tags').split(',');</p>
<p> </p>
<p> // Adding a data-id attribute. Required by the Quicksand plugin:</p>
<p> elem.attr('data-id',i);</p>
<p> </p>
<p> $.each(tags,function(key,value){</p>
<p> </p>
<p> // Removing extra whitespace:</p>
<p> value = $.trim(value);</p>
<p> </p>
<p> if(!(value in itemsByTags)){</p>
<p> // Create an empty array to hold this item:</p>
<p> itemsByTags[value] = [];</p>
<p> }</p>
<p> </p>
<p> // Each item is added to one array per tag:</p>
<p> itemsByTags[value].push(elem);</p>
<p> });</p>
<p> </p>
<p> });</p>
<p> // Creating the "Everything" option in the menu:</p>
<p> createList('All',items);</p>
<p> </p>
<p> // Looping though the arrays in itemsByTags:</p>
<p> $.each(itemsByTags,function(k,v){</p>
<p> createList(k,v);</p>
<p> });</p>
<p> </p>
<p> $('#filter a').live('click',function(e){</p>
<p> var link = $(this);</p>
<p> </p>
<p> link.addClass('active').siblings().removeClass('active');</p>
<p> </p>
<p> // Using the Quicksand plugin to animate the li items.</p>
<p> // It uses data('list') defined by our createList function:</p>
<p> </p>
<p> $('#stage').quicksand(link.data('list').find('li'));</p>
<p> e.preventDefault();</p>
<p> });</p>
<p> </p>
<p> $('#filter a:first').click();</p>
<p> </p>
<p> function createList(text,items){</p>
<p> </p>
<p> // This is a helper function that takes the</p>
<p> // text of a menu button and array of li items</p>
<p> </p>
<p> // Creating an empty unordered list:</p>
<p> var ul = $('<ul>',{'class':'hidden'});</p>
<p> </p>
<p> $.each(items,function(){</p>
<p> // Creating a copy of each li item</p>
<p> // and adding it to the list:</p>
<p> </p>
<p>$(this).clone().appendTo(ul);</p>
<p> });</p>
<p> </p>
<p> ul.appendTo('#assets_container');</p>
<p> // Creating a menu item. The unordered list is added</p>
<p> // as a data parameter (available via .data('list'):</p>
<p> </p>
<p> var a = $('<a>',{</p>
<p> html: text,</p>
<p> href:'#',</p>
<p>data: { list: ul }</p>
<p> }).appendTo('#filter');</p>
<p> }</p>
<p>});</p>
<p> </p>
<p>
답변에 대한 댓글 1개
itemsByTags = {};
// Looping though all the li items:
items.each(function(i){
var elem = $(this),
tags = elem.data('tags').split(',');
// Adding a data-id attribute. Required by the Quicksand plugin:
elem.attr('data-id',i);
$.each(tags,function(key,value){
// Removing extra whitespace:
value = $.trim(value);
if(!(value in itemsByTags)){
// Create an empty array to hold this item:
itemsByTags[value] = [];
}
// Each item is added to one array per tag:
itemsByTags[value].push(elem);
});
});
요부분같네요 요소스코드 주석처리해보세요 근데 지금 왜케..에러가 많이나있죠?;;콘솔창을 보니..bx슬라이더 에러부터시작해서 에러가 좀많은데 그부분먼저 처리를 하심이..
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인