테스트 사이트 - 개발 중인 베타 버전입니다

테마 여러개를 한 계정에서 보기 채택완료

모노패러다임 6년 전 조회 4,111

한 계정안에 테마를 A,B, C 요렇게 3개정도 있다고 했을때...

게시물은 다동일하게 보일테고 단지 테마형만 다르게 보이게 하고 싶은데...

 

샘플 제작된 홈페이지를 여러개 만들어서 보여주고 싶은데.... 각 홈페이지마다 재설치해서 보여주기는 좀 불편해보이고 좀 좋은 방법 없을까요?

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

답변 3개

채택된 답변
+20 포인트
티로그
6년 전

관리자모드의 

/adm/theme_preview.php?theme=테마명

화일 참고하시어 작업하시면 될것 같습니다. 

/로 복사하시어 권한 부분만 확인하시면 될것 같습니다.

 

복사후 화일 상단에

</p>

<p>// 테마

function get_theme_dir()

{

    $result_array = array();</p>

<p>    $dirname = G5_PATH.'/'.G5_THEME_DIR.'/';

    $handle = opendir($dirname);

    while ($file = readdir($handle)) {

        if($file == '.'||$file == '..') continue;</p>

<p>        if (is_dir($dirname.$file)) {

            $theme_path = $dirname.$file;

            if(is_file($theme_path.'/index.php') && is_file($theme_path.'/head.php') && is_file($theme_path.'/tail.php'))

                $result_array[] = $file;

        }

    }

    closedir($handle);

    natsort($result_array);</p>

<p>    return $result_array;

}</p>

<p>

// 테마정보

function get_theme_info($dir)

{

    $info = array();

    $path = G5_PATH.'/'.G5_THEME_DIR.'/'.$dir;</p>

<p>    if(is_dir($path)) {

        $screenshot = $path.'/screenshot.png';

        if(is_file($screenshot)) {

            $size = @getimagesize($screenshot);</p>

<p>            if($size[2] == 3)

                $screenshot_url = str_replace(G5_PATH, G5_URL, $screenshot);

        }</p>

<p>        $info['screenshot'] = $screenshot_url;</p>

<p>        $text = $path.'/readme.txt';

        if(is_file($text)) {

            $content = file($text, false);

            $content = array_map('trim', $content);</p>

<p>            preg_match('#^Theme Name:(.+)$#i', $content[0], $m0);

            preg_match('#^Theme URI:(.+)$#i', $content[1], $m1);

            preg_match('#^Maker:(.+)$#i', $content[2], $m2);

            preg_match('#^Maker URI:(.+)$#i', $content[3], $m3);

            preg_match('#^Version:(.+)$#i', $content[4], $m4);

            preg_match('#^Detail:(.+)$#i', $content[5], $m5);

            preg_match('#^License:(.+)$#i', $content[6], $m6);

            preg_match('#^License URI:(.+)$#i', $content[7], $m7);</p>

<p>            $info['theme_name'] = trim($m0[1]);

            $info['theme_uri'] = trim($m1[1]);

            $info['maker'] = trim($m2[1]);

            $info['maker_uri'] = trim($m3[1]);

            $info['version'] = trim($m4[1]);

            $info['detail'] = trim($m5[1]);

            $info['license'] = trim($m6[1]);

            $info['license_uri'] = trim($m7[1]);

        }</p>

<p>        if(!$info['theme_name'])

            $info['theme_name'] = $dir;

    }</p>

<p>    return $info;

}

// 테마설정 정보

function get_theme_config_value($dir, $key='*')

{

    $tconfig = array();</p>

<p>    $theme_config_file = G5_PATH.'/'.G5_THEME_DIR.'/'.$dir.'/theme.config.php';

    if(is_file($theme_config_file)) {

        include($theme_config_file);</p>

<p>        if($key == '*') {

            $tconfig = $theme_config;

        } else {

            $keys = array_map('trim', explode(',', $key));

            foreach($keys as $v) {

                $tconfig[$v] = trim($theme_config[$v]);

            }

        }

    }</p>

<p>    return $tconfig;

}

추가하시면 되겠습니다.

로그인 후 평가할 수 있습니다

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

6년 전

테마 미리보기 페이지 생성하기 https://sir.kr/g5_tip/7147

로그인 후 평가할 수 있습니다

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

그누위즈

해당 url뒤에 ?theme=테마명 형식으로

파라미터를 넘겨주고

head.php 파일 부분에서

넘어온 테마명이 하단에 적용되도록 하시면됩니다.

이런 작업을 많이해봣는데 설명을 드리리가 힘드네요

로그인 후 평가할 수 있습니다

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

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

로그인