채택완료

해결이 안된서 다시 질문 올립니다. 분류 순서 지정할 방법이 있을까요?

http://enterdh.enterweb.co.kr/bbs/board.php?bo_table=gallery&page=1&page=1

이 페이지 게시판은 https://sir.kr/g5_skin/2553  이 스킨을 사용중입니다.

분류 지정은 관리자 페이지에서 a|b|c|d 이렇게 했습니다.

그런데 게시글 올릴때 제가 분류 선택을 c 로하고 게시글 등록을 하면 게시판 분류 탭의 순서가 c|a|b|d 이렇게 바뀌게 됩니다.

분류 순서를 고정하고 싶은데 방법이 없을까요?? 아무리 찾아보려 해도 못찾겠습니다 ㅜㅜ

도와주세요 ㅜㅜ

답변 2개 / 댓글 2개

채택된 답변
+20 포인트
2019-04-23 (화) 13:37:40

list.skin.php를 좀 보고 이안에서 sql문을 건드렸는지 좀 봐야할거같은데요..

아니면 write.skin.php에서 저 select가 onchange됏을때도 뭔가 input hidden에서 뭘 보내고 list에서 받아서 뭘하는게 있는지도 좀 체크해봐야할거같고..음..

아..테스트글 하나 올려보니 가장 최근글이 올라간 분류가 맨앞으로 땅겨지게 해놨네요..그 해당소스가 어딧는지 좀 찾아야할듯.. 아마 순정list.php를 건드리지 않았다면 list.skin.php에 있을거같은데요?

답변에 대한 댓글 1개

답변 정말 감사합니다~! 알려주신 내용 참고해서 해결해 보겠습니다~! 정말 감사합니다~!

아르키어드님 답변 감사합니다.

list.php 는 건드리지 않았고 밑에 소스 부분 인거 같은데 초보자인 제가 찾으려다 보니 어디가 어딘지 모르겠습니다. ㅜ

Copy
$(document).ready(function(){

    

    var items = $('#stage li'),

        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);

        });

        

    });

    // Creating the "Everything" option in the menu:

    createList('All',items);

 

    // Looping though the arrays in itemsByTags:

    $.each(itemsByTags,function(k,v){

        createList(k,v);

    });

    

    $('#filter a').live('click',function(e){

        var link = $(this);

        

        link.addClass('active').siblings().removeClass('active');

        

        // Using the Quicksand plugin to animate the li items.

        // It uses data('list') defined by our createList function:

        

        $('#stage').quicksand(link.data('list').find('li'));

        e.preventDefault();

    });

    

    $('#filter a:first').click();

    

    function createList(text,items){

        

        // This is a helper function that takes the

        // text of a menu button and array of li items

        

        // Creating an empty unordered list:

        var ul = $('<ul>',{'class':'hidden'});

        

        $.each(items,function(){

            // Creating a copy of each li item

            // and adding it to the list:

            

$(this).clone().appendTo(ul);

        });

 

        ul.appendTo('#assets_container');

        // Creating a menu item. The unordered list is added

        // as a data parameter (available via .data('list'):

        

        var a = $('<a>',{

            html: text,

            href:'#',

data: { list: ul }

        }).appendTo('#filter');

    }

});

답변에 대한 댓글 1개

2019-04-23 (화) 17:53:05
var items = $('#stage li'),
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슬라이더 에러부터시작해서 에러가 좀많은데 그부분먼저 처리를 하심이..

답변을 작성하려면 로그인이 필요합니다.