모바일 스킨, PC에서 나오도록 하려면?

모바일 스킨, PC에서 나오도록 하려면?

QA

모바일 스킨, PC에서 나오도록 하려면?

본문

http://sir.kr/g5_skin/2736?sca=%EA%B2%8C%EC%8B%9C%ED%8C%90&sfl=wr_subject%7C%7Cwr_content&stx=%EB%8D%94%EB%B3%B4%EA%B8%B0

 

위 스킨은 모바일 전용 스킨입니다.

이걸 PC버전에서 사용하려고 하는데요,, 게시글을 불러오지 못하네요..

 

위 스킨에서 필요한 기능이 더보기 하면 이전글을 불러오는 기능입니다.

그대로 PC스킨에 걸었더니 오류나서 확인해보니

 

일반 list.skin.php 파일 외에 list.more.php 라는 파일에서 처리가 되고 있습니다.

혹시 아래 소스중에서 어떤부분을 변경해야 PC에서도 제대로 나오는지

팁을 좀 구합니다...

 




<?php 
include_once('../../../../common.php');
/* 출력할 페이지 리스트 */
$sop = strtolower($sop);
if ($sop != 'and' && $sop != 'or')
    $sop = 'and';
// 분류 선택 또는 검색어가 있다면
$stx = trim($stx);
if ($sca || $stx) {
    $sql_search = get_sql_search($sca, $sfl, $stx, $sop);
    // 가장 작은 번호를 얻어서 변수에 저장 (하단의 페이징에서 사용)
    $sql = " select MIN(wr_num) as min_wr_num from {$write_table} ";
    $row = sql_fetch($sql);
    $min_spt = (int)$row['min_wr_num'];
    if (!$spt) $spt = $min_spt;
    $sql_search .= " and (wr_num between {$spt} and ({$spt} + {$config['cf_search_part']})) ";
    // 원글만 얻는다. (코멘트의 내용도 검색하기 위함)
    $sql = " select distinct wr_parent from {$write_table} where {$sql_search} ";
    $result = sql_query($sql);
    $total_count = mysql_num_rows($result);
} else {
    $sql_search = "";
    $total_count = $board['bo_count_write'];
}
if(G5_IS_MOBILE) {
    $page_rows = $board['bo_mobile_page_rows'];
} else {
    $page_rows = $board['bo_page_rows'];
}
if ($page < 1) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
// 년도 2자리
$today2 = G5_TIME_YMD;
$list = array();
$i = 0;
$notice_count = 0;
$notice_array = array();
// 공지 처리
if (!$sca && !$stx && $pg==1 ) {
    $arr_notice = explode(',', trim($board['bo_notice']));
    for ($k=0; $k<count($arr_notice); $k++) {
        if (trim($arr_notice[$k])=='') continue;
        $row = sql_fetch(" select * from {$write_table} where wr_id = '{$arr_notice[$k]}' ");
        if (!$row['wr_id']) continue;
        if($page == 1) {
            $list[$i] = get_list($row, $board, $board_skin_url, G5_IS_MOBILE ? $board['bo_mobile_subject_len'] : $board['bo_subject_len']);
            $list[$i]['is_notice'] = true;
            $i++;
        }
        $notice_array[] = $row['wr_id'];
        $notice_count++;
    }
}
$total_page  = ceil($total_count / $page_rows);  // 전체 페이지 계산
$from_record = ( $pg - 1) * $page_rows; // 시작 열을 구함
$nextPg      = $pg + 1;
if($page > 1 && $notice_count)
    $from_record -= $notice_count;
if($page == 1 && $notice_count)
    $page_rows -= $notice_count;
// 관리자라면 CheckBox 보임
$is_checkbox = false;
if ($is_member && ($is_admin == 'super' || $group['gr_admin'] == $member['mb_id'] || $board['bo_admin'] == $member['mb_id']))
    $is_checkbox = true;
// 정렬에 사용하는 QUERY_STRING
$qstr2 = 'bo_table='.$bo_table.'&sop='.$sop;
// 0 으로 나눌시 오류를 방지하기 위하여 값이 없으면 1 로 설정
$bo_gallery_cols = $board['bo_gallery_cols'] ? $board['bo_gallery_cols'] : 1;
$td_width = (int)(100 / $bo_gallery_cols);
// 정렬
// 인덱스 필드가 아니면 정렬에 사용하지 않음
//if (!$sst || ($sst && !(strstr($sst, 'wr_id') || strstr($sst, "wr_datetime")))) {
if (!$sst) {
    if ($board['bo_sort_field']) {
        $sst = $board['bo_sort_field'];
    } else {
        $sst  = "wr_num, wr_reply";
        $sod = "";
    }
} else {
    // 게시물 리스트의 정렬 대상 필드가 아니라면 공백으로 (nasca 님 09.06.16)
    // 리스트에서 다른 필드로 정렬을 하려면 아래의 코드에 해당 필드를 추가하세요.
    // $sst = preg_match("/^(wr_subject|wr_datetime|wr_hit|wr_good|wr_nogood)$/i", $sst) ? $sst : "";
    $sst = preg_match("/^(wr_datetime|wr_hit|wr_good|wr_nogood)$/i", $sst) ? $sst : "";
}
if ($sst) {
    $sql_order = " order by {$sst} {$sod} ";
}
if ($sca || $stx) {
    $sql = " select distinct wr_parent from {$write_table} where {$sql_search} {$sql_order} limit {$from_record}, $page_rows ";
} else {
    $sql = " select * from {$write_table} where wr_is_comment = 0 ";
    if($notice_count && !empty($notice_array))
        $sql .= " and wr_id not in (".implode(', ', $notice_array).") ";
    $sql .= " {$sql_order} limit {$from_record}, $page_rows ";
}
$result = sql_query($sql);
$k = 0;
while ($row = sql_fetch_array($result))
{
    // 검색일 경우 wr_id만 얻었으므로 다시 한행을 얻는다
    if ($sca || $stx)
        $row = sql_fetch(" select * from {$write_table} where wr_id = '{$row['wr_parent']}' ");
    $list[$i] = get_list($row, $board, $board_skin_url, G5_IS_MOBILE ? $board['bo_mobile_subject_len'] : $board['bo_subject_len']);
    if (strstr($sfl, 'subject')) {
        $list[$i]['subject'] = search_font($stx, $list[$i]['subject']);
    }
    $list[$i]['is_notice'] = false;
    $list_num = $total_count - ($page - 1) * $page_rows;
    if($page == 1)
        $list_num -= $notice_count;
    $list[$i]['num'] = $list_num - $k;
    $i++;
    $k++;
}
?>      
        <table>
        <tbody>
        <?php
        for ($i=0; $i<count($list); $i++) {
        ?>
        <tr class="<?php if ($list[$i]['is_notice']) echo "bo_notice"; ?>">
            <?php if ($is_checkbox) { ?>
            <td class="td_chk">
                <label for="chk_wr_id_<?php echo $i ?>" class="sound_only"><?php echo $list[$i]['subject'] ?></label>
                <input type="checkbox" name="chk_wr_id[]" value="<?php echo $list[$i]['wr_id'] ?>" id="chk_wr_id_<?php echo $i ?>">
            </td><?php } ?>
            <td class="td_subject">
                <?php
                echo $list[$i]['icon_reply'];
                if ($is_category && $list[$i]['ca_name']) {
                ?>
                <a href="<?php echo $list[$i]['ca_name_href'] ?>" class="bo_cate_link"><?php echo $list[$i]['ca_name'] ?></a>
                <?php } ?>
                <a href="<?php echo $list[$i]['href'] ?>">
                    <?php echo $list[$i]['subject'] ?>
                    <?php if ($list[$i]['comment_cnt']) { ?><span class="sound_only">댓글</span><?php echo $list[$i]['comment_cnt']; ?><span class="sound_only">개</span><?php } ?>
                    <?php
                    // if ($list[$i]['link']['count']) { echo '['.$list[$i]['link']['count']}.']'; }
                    // if ($list[$i]['file']['count']) { echo '<'.$list[$i]['file']['count'].'>'; }
                    if (isset($list[$i]['icon_new'])) echo $list[$i]['icon_new'];
                    if (isset($list[$i]['icon_hot'])) echo $list[$i]['icon_hot'];
                    if (isset($list[$i]['icon_file'])) echo $list[$i]['icon_file'];
                    if (isset($list[$i]['icon_link'])) echo $list[$i]['icon_link'];
                    if (isset($list[$i]['icon_secret'])) echo $list[$i]['icon_secret'];
                    ?>
                </a>
            </td>
            <td class="td_date"><?php echo $list[$i]['datetime2'] ?></td>
        </tr>
        <?php } ?>
       
        </tbody>
        </table>
        <?if( $pg >= $total_page ){?>
  <div class="m_more01 morebox" id="more2" ><span>END</span></div>
  <?}else{?>
  <div class="m_more01 morebox" id="more<?=$nextPg?>" onclick="addList(<?=$nextPg?>)"><span name=mc id="<?=$nextPg?>">MORE ▼</span></div>
  <?}?>
 

이 질문에 댓글 쓰기 :

답변 1

include_once('../../../../common.php'); 

 

이부분을

 

include_once('../../../common.php');

 

이렇게 한번 해보실래요?.

 

 

그리고 G5_IS_MOBILE 이부분 찾아서 수정

 

bo_mobile_

 

이부분은 모두 모바일 셋팅 설정입니다.. 찾아서 mobile 빼고 확인 해보세요~

답변을 작성하시기 전에 로그인 해주세요.
전체 124,241 | RSS
QA 내용 검색
  • 개별 목록 구성 제목 답변작성자조회작성일
  • 질문이 없습니다.

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT