제목 그대로입니다.

 

메뉴 새글 표시 모듈: https://xetown.com/xepoint/12592

 

스티커 모듈: https://xetown.com/lakepark/448113

 

스티커 모듈로 생성한 게시판(참고로 메뉴 편집목록에서 보니까 메뉴 타입이 "게시판"이 아니라 "스티커"로 되어 있더군요) 목록의 경우에는 새글 표시 모듈이 작동하지 않는데요

 

아무래도 메뉴 타입이 게시판이 아니라 스티커라서 그런거 같은데

 

이거 작동하게 수정하려면 어떻게 해야 할까요?

  • ?
    새글 표시 모듈에 보면 아이템샵 처리 코드가 있습니다.
    스티커 모듈 구조를 모르겠는데 regdate값은 있겠죠?
    아이템샵처럼 스티커모듈 최근 regdate값을 가져오면 됩니다.
  • ? ?
    코드를 아무리 살펴봐도 어떻게 하는건지 모르겠네요.. 그냥 포기해야겠습니다. 어쨌든 감사합니다
  • ?

    modules/menunew/queries/getStickerListMenunew.xml

     

    <query id="getStickerListMenunew" action="select">
        <tables>
            <table name="sticker" />
        </tables>
        <columns>
            <column name="regdate" />
        </columns>
        <conditions>
            <condition operation="equal" column="status" default="PUBLIC" var="status" />
        </conditions>
        <navigation>
            <index var="sort_index" default="regdate" order="desc" />
            <list_count var="list_count" default="1" />
        </navigation>
    </query>

     

     

    menunew.controller.php

    아이템샵 코드 아래 추가

     

    // 새 스티커 표시
    if($mid == 'sticker' && is_dir('modules/sticker'))
    {
        $oCacheHandler = CacheHandler::getInstance('object');
        if($oCacheHandler->isSupport())
        {
            $regdate = $oCacheHandler->get('menunew:sticker', strtotime('-10 minutes'));
        }
    
        if(!$regdate)
        {
            $output = executeQueryArray('menunew.getStickerListMenunew');
            if(!$output->toBool() || empty($output->data))
            {
                continue;
            }
    
            if(is_object($latest = reset($output->data)) && $regdate = strtotime($latest->regdate))
            {
                if($oCacheHandler->isSupport())
                {
                    $oCacheHandler->put('menunew:sticker', $regdate, 600);
                }
            }
        }
    }

     

  • ? ?
    적용했더니 잘되네요. 정말 감사합니다.