$src, "width"=>$w, "height"=>$h);
return $thumb;
}
function del_html($str)
{
$str = str_replace( ">", ">",$str );
$str = str_replace( "<", "<",$str );
$str = str_replace( "\"", """,$str );
$str = str_replace( "<br>","
",$str); //br은되게함
return $str;
}
// 입력 폼 안내문
function help($help="")
{
global $g5;
$str = ''.str_replace("\n", "
", $help).'';
return $str;
}
// 파일을 업로드 함
function upload_file($srcfile, $destfile, $dir)
{
if ($destfile == "") return false;
// 업로드 한후 , 퍼미션을 변경함
@move_uploaded_file($srcfile, $dir.'/'.$destfile);
@chmod($dir.'/'.$destfile, G5_FILE_PERMISSION);
return true;
}
function check_site_auth(){
global $g5, $config, $is_member;
$is_page_login = (strstr($_SERVER["REQUEST_URI"], 'login') == "") ? false : true;
// 사이트가 비공개 설정일 시, 로그인 페이지를 제외한 모든 페이지에서 외부인 접근 시
// 로그인 페이지로 이동 시킨다.
if(!$config['cf_open']) {
if(!$is_member && !$is_page_login) { goto_url(G5_BBS_URL.'/login.php'); }
}
}
// 메타태그를 이용한 URL 이동
// header("location:URL") 을 대체
function goto_url_top($url)
{
$url = str_replace("&", "&", $url);
//echo "";
if (!headers_sent())
header('Location: '.$url);
else {
echo '';
echo '';
}
exit;
}
// 로고 정보 가져오기
function get_logo($type) {
global $g5;
if($type == 'pc') {
$logo = sql_fetch("select cs_value from {$g5['css_table']} where cs_name = 'logo'");
} else {
$logo = sql_fetch("select cs_value from {$g5['css_table']} where cs_name = 'm_logo'");
}
return $logo['cs_value'];
}
// 스타일 가져오기
function get_style($code, $field = '*') {
global $g5;
if(!$field) $field = " * ";
$result = sql_fetch("select ".$field." from {$g5['css_table']} where cs_name = '".$code."'");
return $result;
}
// 사이트 화면 디자인 가져오기
function get_site_content($co_id) {
global $g5, $config, $is_member;
$result = "";
$co = sql_fetch( " select * from {$g5['content_table']} where co_id = '{$co_id}' ");
$pc_str = conv_content($co['co_content'], $co['co_html'], $co['co_tag_filter_use']);
$mo_str = conv_content($co['co_mobile_content'], $co['co_html'], $co['co_tag_filter_use']);
// 내용 변환 진행
$no_mem = "";
$use_mem = "";
if($is_member) { $no_mem = " style='display: none;' "; }
if(!$is_member) { $use_mem = " style='display: none;' "; }
if(strstr($pc_str, "{{LOGIN}}") || strstr($mo_str, "{{LOGIN}}")) {
ob_start();
include G5_PATH.'/templete/txt.login.php';
$login_str = ob_get_contents();
ob_end_clean();
$pc_str = str_replace("{{LOGIN}}", $login_str, $pc_str);
$mo_str = str_replace("{{LOGIN}}", $login_str, $mo_str);
}
if(strstr($pc_str, "{{LOGOUT}}") || strstr($mo_str, "{{LOGOUT}}")) {
ob_start();
include G5_PATH.'/templete/txt.logout.php';
$logout_str = ob_get_contents();
ob_end_clean();
$pc_str = str_replace("{{LOGOUT}}", $logout_str, $pc_str);
$mo_str = str_replace("{{LOGOUT}}", $logout_str, $mo_str);
}
if(strstr($pc_str, "{{JOIN}}") || strstr($mo_str, "{{JOIN}}")) {
ob_start();
include G5_PATH.'/templete/txt.join.php';
$join_str = ob_get_contents();
ob_end_clean();
$pc_str = str_replace("{{JOIN}}", $join_str, $pc_str);
$mo_str = str_replace("{{JOIN}}", $join_str, $mo_str);
}
if(strstr($pc_str, "{{MYPAGE}}") || strstr($mo_str, "{{MYPAGE}}")) {
ob_start();
include G5_PATH.'/templete/txt.mypage.php';
$mypage_str = ob_get_contents();
ob_end_clean();
$pc_str = str_replace("{{MYPAGE}}", $mypage_str, $pc_str);
$mo_str = str_replace("{{MYPAGE}}", $mypage_str, $mo_str);
}
if(strstr($pc_str, "{{BGM}}") || strstr($mo_str, "{{BGM}}")) {
ob_start();
include G5_PATH.'/templete/txt.bgm.php';
$visual_str = ob_get_contents();
ob_end_clean();
$pc_str = str_replace("{{BGM}}", $visual_str, $pc_str);
$mo_str = str_replace("{{BGM}}", $visual_str, $mo_str);
}
if(strstr($pc_str, "{{VISUAL_SLIDE}}") || strstr($mo_str, "{{VISUAL_SLIDE}}")) {
ob_start();
include G5_PATH.'/templete/txt.visual.php';
$visual_str = ob_get_contents();
ob_end_clean();
$pc_str = str_replace("{{VISUAL_SLIDE}}", $visual_str, $pc_str);
$mo_str = str_replace("{{VISUAL_SLIDE}}", $visual_str, $mo_str);
}
if(strstr($pc_str, "{{TWITTER}}") || strstr($mo_str, "{{TWITTER}}")) {
ob_start();
include G5_PATH.'/templete/txt.twitter.php';
$visual_str = ob_get_contents();
ob_end_clean();
$pc_str = str_replace("{{TWITTER}}", $visual_str, $pc_str);
$mo_str = str_replace("{{TWITTER}}", $visual_str, $mo_str);
}
if(strstr($pc_str, "{{OUTLOGIN}}") || strstr($mo_str, "{{OUTLOGIN}}")) {
ob_start();
include G5_PATH.'/templete/txt.outlogin.php';
$visual_str = ob_get_contents();
ob_end_clean();
$pc_str = str_replace("{{OUTLOGIN}}", $visual_str, $pc_str);
$mo_str = str_replace("{{OUTLOGIN}}", $visual_str, $mo_str);
}
if($co['co_content']) {
if($co['co_mobile_content']) {
$result .= "