최신글 문의 드립니다. > 그누4 질문답변

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.

최신글 문의 드립니다. 정보

최신글 문의 드립니다.

본문

최신글 스킨에 이런 소스 부분이 있는데요.




    // 제목
	if($list[$i]['ca_name'] != null && $list[$i]['ca_name'] != "")
		$subject = strip_tags("[".$list[$i]['ca_name']."]". $list[$i]['wr_subject']);
	else
		$subject = strip_tags($list[$i]['wr_subject']);




카테고리가 있으면 카테고리 명이랑 제목이 나오는데 원하는 거는

[카테고리명]
제목명


이렇게 하려구요.

카테고리명 나오면 한칸 밑에 제목이 나왔으면 합니다.

도움 좀 부탁 드립니다. ^^;
  • 복사

댓글 전체


    // 제목
	if($list[$i]['ca_name'] != null && $list[$i]['ca_name'] != "")
		$subject = strip_tags("[".$list[$i]['ca_name']."]")."<br />".strip_tags($list[$i]['wr_subject']);
	else
		$subject = strip_tags($list[$i]['wr_subject']);




이렇게 수정 했는데

[카테고리명]<br/>제목명


이렇게 나오네요
어렵네요 ㅎㅎㅎㅎ

<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
if (!function_exists("imagecopyresampled")) alert("GD 2.0.1 이상 버전이 설치되어 있어야 사용할 수 있는 스킨 입니다.");

// 썸네일 설정
$thumb_width = "120"; // 썸네일 가로
$thumb_height = "140"; // 썸네일 세로
$thumb_quality = "100"; // 썸네일 퀼리티
$thumb_content = "100"; // 내용길이

for ($i=0; $i<count($list); $i++) {

// 썸네일 경로
$data_path = $g4[path]."/data/file/{$list[$i][bo_tb]}";

$thumb_path = $data_path.'/'.$thumb_width.'x'.$thumb_height;

if (!is_dir($thumb_path)) {
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
}
    $filename = $list[$i][file][0][file]; // 파일명

    $thumb = $thumb_path.'/'.$filename; //썸네일
    if (!file_exists($thumb))
    {
	$file = $data_path.'/'.$filename; //원본
        if (preg_match("/\.(jp[e]?g|gif|png)$/i", $file) && file_exists($file))
        {
            $size = getimagesize($file);
            if ($size[2] == 1)
                $src = imagecreatefromgif($file);
            else if ($size[2] == 2)
                $src = imagecreatefromjpeg($file);
            else if ($size[2] == 3)
                $src = imagecreatefrompng($file);
            else
                continue;

            $rate = $thumb_width / $size[0];
            $height = (int)($size[1] * $rate);

            if ($height < $thumb_height)
                $dst = imagecreatetruecolor($thumb_width, $thumb_height);
            else
                $dst = imagecreatetruecolor($thumb_width, $thumb_height);
            imagecopyresampled($dst, $src, 0, 0, 0, 0, $thumb_width, $thumb_height, $size[0], $size[1]);
            imagejpeg($dst, $thumb_path.'/'.$filename, $thumb_quality);
            chmod($thumb_path.'/'.$filename, 0707);
        }
    }

    // 썸네일 파일명 체크
    if (file_exists($thumb) && $filename) {
	$img = "{$thumb}";
    } else {
	$img = "";
    }

    // 링크
    $href = "$g4[path]/bbs/board.php?bo_table={$list[$i][bo_tb]}&wr_id={$list[$i][wr_id]}";

    // 제목
	if($list[$i]['ca_name'] != null && $list[$i]['ca_name'] != "")
		$subject = strip_tags("[".$list[$i]['ca_name']."]". $list[$i]['wr_subject']);
	else
		$subject = strip_tags($list[$i]['wr_subject']);





    // 코드
    if ($i == '0') {

        $code = "'{$href}','{$img}','".conv_subject($subject,40,'..')."'";

    } else {

        $code = ",'{$href}','{$img}','".conv_subject($subject,40,'..')."'";

    }

    // 이미지
    if ($img) {

        echo $code;

    } else {

        echo $code;

    }

}
?>



해당 스킨의 소스 입니다.
플래시로 되는거 아니고 기냥 되는거에요.

이것저것 받아서 하다 보니 뭐였는지 기억이 안나네요 ;;
김처로님 신경 써주시니 정말 감사합니다. ^^;
제 생각으로는 저 자체로는 아무것도 안될것 같은데요.;;
아무튼 이렇게 해보세요.

<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
if (!function_exists("imagecopyresampled")) alert("GD 2.0.1 이상 버전이 설치되어 있어야 사용할 수 있는 스킨 입니다.");

// 썸네일 설정
$thumb_width = "120"; // 썸네일 가로
$thumb_height = "140"; // 썸네일 세로
$thumb_quality = "100"; // 썸네일 퀼리티
$thumb_content = "100"; // 내용길이

for ($i=0; $i<count($list); $i++) {

// 썸네일 경로
$data_path = $g4[path]."/data/file/{$list[$i][bo_tb]}";

$thumb_path = $data_path.'/'.$thumb_width.'x'.$thumb_height;

if (!is_dir($thumb_path)) {
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
}
    $filename = $list[$i][file][0][file]; // 파일명

    $thumb = $thumb_path.'/'.$filename; //썸네일
    if (!file_exists($thumb))
    {
	$file = $data_path.'/'.$filename; //원본
        if (preg_match("/\.(jp[e]?g|gif|png)$/i", $file) && file_exists($file))
        {
            $size = getimagesize($file);
            if ($size[2] == 1)
                $src = imagecreatefromgif($file);
            else if ($size[2] == 2)
                $src = imagecreatefromjpeg($file);
            else if ($size[2] == 3)
                $src = imagecreatefrompng($file);
            else
                continue;

            $rate = $thumb_width / $size[0];
            $height = (int)($size[1] * $rate);

            if ($height < $thumb_height)
                $dst = imagecreatetruecolor($thumb_width, $thumb_height);
            else
                $dst = imagecreatetruecolor($thumb_width, $thumb_height);
            imagecopyresampled($dst, $src, 0, 0, 0, 0, $thumb_width, $thumb_height, $size[0], $size[1]);
            imagejpeg($dst, $thumb_path.'/'.$filename, $thumb_quality);
            chmod($thumb_path.'/'.$filename, 0707);
        }
    }

    // 썸네일 파일명 체크
    if (file_exists($thumb) && $filename) {
	$img = "{$thumb}";
    } else {
	$img = "";
    }

    // 링크
    $href = "$g4[path]/bbs/board.php?bo_table={$list[$i][bo_tb]}&wr_id={$list[$i][wr_id]}";

    // 제목
	if($list[$i]['ca_name'] != null && $list[$i]['ca_name'] != "")
		$ca_name = strip_tags("[".$list[$i]['ca_name']."]");

	$subject = strip_tags($list[$i]['wr_subject']);





    // 코드
    if ($i == '0') {

        $code = "'{$href}','{$img}','".$ca_name."<br />".conv_subject($subject,40,'..')."'";

    } else {

        $code = ",'{$href}','{$img}','".$ca_name."<br />".conv_subject($subject,40,'..')."'";

    }

    // 이미지
    if ($img) {

        echo $code;

    } else {

        echo $code;

    }

}
?>
© SIRSOFT
현재 페이지 제일 처음으로