내용관리에서 내용하고 모바일내용을 동시에..

내용관리에서 내용하고 모바일내용을 동시에..

QA

내용관리에서 내용하고 모바일내용을 동시에..

본문

$co['co_content']

$co['co_mobile_content']

필드가 부족하여 2개 같이 PC화면에 보여주고 싶은데 같이 안나오네요..

해결방법 아시는분? 

3667614620_1553679678.5293.jpg

두 필드에 내용 넣고 pc 내용 페이지 만들때 같이 쓰고 픈데 같이 안나오네요 ㅠㅠ

 

bbs/content.php 관련소스입니다.

<?php
include_once('./_common.php');

$co_id = preg_replace('/[^a-z0-9_]/i', '', $co_id);

//dbconfig파일에 $g5['content_table'] 배열변수가 있는지 체크
if( !isset($g5['content_table']) ){
    die('<meta charset="utf-8">관리자 모드에서 게시판관리->내용 관리를 먼저 확인해 주세요.');
}

if (G5_IS_MOBILE) {
    include_once(G5_MOBILE_PATH.'/content.php');
    return;
}

// 내용
$sql = " select * from {$g5['content_table']} where co_id = '$co_id' ";
$co = sql_fetch($sql);
if (!$co['co_id'])
    alert('등록된 내용이 없습니다.');

$g5['title'] = $co['co_subject'];

if ($co['co_include_head'] && is_include_path_check($co['co_include_head']))
    @include_once($co['co_include_head']);
else
    include_once('./_head.php');

$str = conv_content($co['co_content'], $co['co_html'], $co['co_tag_filter_use']);
$mobile = conv_content($co['co_mobile_content'], $co['co_html'], $co['co_tag_filter_use']);

// $src 를 $dst 로 변환
unset($src);
unset($dst);
$src[] = "/{{쇼핑몰명}}|{{홈페이지제목}}/";
$dst[] = $config['cf_title'];
$src[] = "/{{회사명}}|{{상호}}/";
$dst[] = $default['de_admin_company_name'];
$src[] = "/{{대표자명}}/";
$dst[] = $default['de_admin_company_owner'];
$src[] = "/{{사업자등록번호}}/";
$dst[] = $default['de_admin_company_saupja_no'];
$src[] = "/{{대표전화번호}}/";
$dst[] = $default['de_admin_company_tel'];
$src[] = "/{{팩스번호}}/";
$dst[] = $default['de_admin_company_fax'];
$src[] = "/{{통신판매업신고번호}}/";
$dst[] = $default['de_admin_company_tongsin_no'];
$src[] = "/{{사업장우편번호}}/";
$dst[] = $default['de_admin_company_zip'];
$src[] = "/{{사업장주소}}/";
$dst[] = $default['de_admin_company_addr'];
$src[] = "/{{운영자명}}|{{관리자명}}/";
$dst[] = $default['de_admin_name'];
$src[] = "/{{운영자e-mail}}|{{관리자e-mail}}/i";
$dst[] = $default['de_admin_email'];
$src[] = "/{{정보관리책임자명}}/";
$dst[] = $default['de_admin_info_name'];
$src[] = "/{{정보관리책임자e-mail}}|{{정보책임자e-mail}}/i";
$dst[] = $default['de_admin_info_email'];

//$str = preg_replace($src, $dst, $str);
//$mobile = preg_replace($src, $dst, $mobile);

// 스킨경로
if(trim($co['co_skin']) == '')
    $co['co_skin'] = 'basic';

$content_skin_path = get_skin_path('content', $co['co_skin']);
$content_skin_url  = get_skin_url('content', $co['co_skin']);
$skin_file = $content_skin_path.'/content.skin.php';

if ($is_admin)
    echo '<div class="ctt_admin"><a href="'.G5_ADMIN_URL.'/contentform.php?w=u&co_id='.$co_id.'" class="btn_admin btn">내용 수정</a></div>';
?>

<?php
if(is_file($skin_file)) {
    include($skin_file);

    $himg = G5_DATA_PATH.'/content/'.$co_id.'_h';
    if (file_exists($himg)) // 상단 이미지
        echo '<div id="ctt_himg" class="ctt_img"><img src="'.G5_DATA_URL.'/content/'.$co_id.'_h" alt=""></div>';


    $timg = G5_DATA_PATH.'/content/'.$co_id.'_t';
    if (file_exists($timg)) // 하단 이미지
        echo '<div id="ctt_timg" class="ctt_img"><img src="'.G5_DATA_URL.'/content/'.$co_id.'_t" alt=""></div>';
} else {
    echo '<p>'.str_replace(G5_PATH.'/', '', $skin_file).'이 존재하지 않습니다.</p>';
}

if ($co['co_include_tail'] && is_include_path_check($co['co_include_tail']))
    @include_once($co['co_include_tail']);
else
    include_once('./_tail.php');
?>

 


$str = conv_content($co['co_content'], $co['co_html'], $co['co_tag_filter_use']);
$mobile = conv_content($co['co_mobile_content'], $co['co_html'], $co['co_tag_filter_use']);

이렇게 하면 나올줄 알았더만 안나오네요 ㅠㅠ 왜 그럴가요?

이 질문에 댓글 쓰기 :

답변 1

참고 : http://gnustudy.com/bbs/board.php?bo_table=skin_etc&wr_id=53

 

bbs/content.php 파일 수정

 

$str = conv_content($co['co_content'], $co['co_html'], $co['co_tag_filter_use']);

여기 밑에 추가
$str_mobile = conv_content($co['co_mobile_content'], $co['co_html'], $co['co_tag_filter_use']);

 

스킨에서 출력

skin/content/basic/content.skin.php

원하는 곳에 이렇게..

<?php echo $str_mobile; ?>

 

저도 직접 해봤습니다. 잘 나옵니다.
테마용 스킨인지 아닌지 확인하셔서 다른 스킨을 수정하진 않았는지 체크하시고
혹시 반응형인가요? 반응형은 mobile/content.php 파일을 수정해야 합니다. 코드가 조금 차이가 있지만 방법은 같습니다.

헐 그렇게 하는게 맞았네요
내용관리 설정에서 자세히 보니
베이직이 있고
(테마)베이직이 있었네요 전 같은건줄 알았는데..
전혀 틀린거였나봅니다...ㅠㅠ
하이튼 감사합니다.

답변을 작성하시기 전에 로그인 해주세요.
전체 24
QA 내용 검색

회원로그인

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