최신글 스킨 중복 적용시 오류문제.. 정보
최신글 스킨 중복 적용시 오류문제..본문
아래의latest.skin.php 와 첨부한 YouChangWha.lib.php 파일의 스킨인데요(그누회원스킨)
메인에 같은 스킨을 폴더명을 바꾸어서 2개로 올릴경우 오류가 나는데요
중복되어서 올려도 오류 안나게 하려면 수정 어떻게 해주어야 하는지 알려주시면 감사하겠습니다~
latest 같은 스킨을 폴더명만 test .test2 바꾸어서 동시에 중복 적용할경우 소스충돌때문인지 오류가납니다
<?=latest("test", 'test', 10, 10); ?>
<?=latest("test2", 'test', 10, 10); ?>
-----------------------------------------------------------------------------------
latest.skin.php
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$latest_img = "$g4[path]/img/latest/";
// 썸네일방식은 유창화님의 소스.
include_once($latest_skin_path . "/YouChangWha.lib.php");//본문 링크 이미지 썸네일 생성
//여분필드 기본값 설정
//$thumbboard_bo_2 = $board['bo_2'];
//$thumb_board = explode("/",$thumbboard_bo_2);
//$thumb_width = $thumb_board[0];
//$thumb_height = $thumb_board[1];
$thumb_width = "110";
$thumb_height = "80";
//$thumb_style = $thumb_board[2];
//$letters = $thumb_board[3]; // 글자수
//$letters2 = $thumb_board[4]; // 글자수2
$letters = "290"; // 글자수
$letters2 = "370"; // 글자수2
$data_path = $g4['path'] . "/data/file/" . $bo_table;
$lt_path = $data_path . "/lt_file";
$thumb_path = $data_path . "/thumb";
if (!is_dir($lt_path)){
@mkdir($lt_path, 0707);
@chmod($lt_path, 0707);
}
if (!is_dir($thumb_path)){
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
}
?>
<STYLE>P.BigFirst:first-letter { color:red; font-size: 200%; float: left; line-height:1.2em; padding:7 7 7 3; }</STYLE>
<table width=100% cellpadding=0 cellspacing=3 style="border:1 solid #FFCC00;">
<tr>
<td width=2></td>
<td bgcolor="#A7CE31" width="10"></td>
<td height=17 valign="bottom">
<a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>' style="font-size:13px;text-decoration:none;"><b><?=$board[bo_subject]?></b></a>
</td>
</tr>
</table>
<?
for ($i=0; $i<count($list); $i++)
{
if($i >=0 && $i<2) {
//------------------------------
//본문에 링크한 이미지 레코드별 배열
$dest_link[] = array( 'wr_id' => $list[$i]['wr_id'], 'url' => extract_img($list[$i]['wr_content']));
//print_r2($dest_link[$i]);
$url = $dest_link[$i]['url']['0'];//첫번째 링크된 이미지, 두번째는 $dest_link[$i]['url'][1]
//------------------------------
$save_path = $thumb_path;//임시 저장경로
$referer = "";//속일 리퍼러, 넣지 않아도 됨
$thumb = $save_path . '/sm_' . base64_encode($url);
//썸네일이 없다면 본문 첫번째 링크된 이미지 파일의 썸네일을 생성합니다.
if (!file_exists($thumb)) {
//if ((is_file($url)) && (!file_exists($thumb))) {//원본이미지 있고 썸네일 없을때
//유효하지 않는 링크에 대한 에러를 표시하지 않는다.
make_small_remoteimage($url, $referer, $save_path, $thumb, $thumb_width, $thumb_height, $copy_rule='width', $copy_pos='2');
}
//링크에서 파일명 가져옴
$filename = strrchr($url,"/");
$filename = substr($filename, 1);
$filename = urlencode($filename); //타이틀
//---------------------------------
//첨부파일1번이 있다면 우선사용합니다.
if ($list[$i]['file'][0]['file']){
$filename = $list[$i]['file'][0]['file']; //첫번째 이미지 파일로 지정
$dest_file = $data_path .'/'. $filename;//원본 이미지
if (preg_match("/\.(jp[e]?g|gif|png)$/i", $filename) && file_exists($dest_file)){
$thumb = $thumb_path.'/m_' . $filename;
if (!file_exists($thumb)){
$thumb = get_smallimg_in_list($board['bo_table'], $list[$i]['file'], 0, $thumb_width, $thumb_height, '/img/errorimg.gif', 'style="border:0px solid #000000;"', $copy_rule='width', $copy_pos='2'); //'width'부분이 치환되지않고있음
}
}
}
$wr_content = preg_replace("/<(.*?)\>/"," ",$list[$i][wr_content]);
$wr_content = preg_replace("/ /"," ",$wr_content);
$wr_content = str_replace("//##", " ", $wr_content);
$wr_content1 = cut_str(get_text($wr_content), $letters, '…');
$wr_content2 = cut_str(get_text($wr_content), $letters2, '…');//본문 글 줄이는 함수
$subject1 = cut_str($list[$i][subject], 25, '..');
$subject2 = cut_str($list[$i][subject], 30, '..');
$href = $list[$i]['href'];
$num = $list[$i][num];
if (file_exists($thumb)) {
echo "<table width='100%' border='0' cellspacing='0' cellpadding='0' align='center'>
<tr>
<td style='padding:5;'><span style='float:left' style='padding:0 5 0 5;'>
<a href='{$list[$i][href]}'><img src='$thumb' border=0></a></span>
 <img src='{$latest_skin_path}/img/icon_li.gif' border='0' align='absmiddle'> 
<a href='{$list[$i][href]}' style='font-size:10px; text-decoration:none;'><b>$subject1</b></a>";
if ($list[$i]['comment_cnt']) {
echo " <a href=\"{$list[$i]['comment_href']}\"><span style='font-family:돋움; font-size:8pt; color:#9A9A9A;'>{$list[$i]['comment_cnt']}</span></a>";
echo " " . $list[$i]['icon_new'];
echo " " . $list[$i]['icon_file'];
echo " " . $list[$i]['icon_link'];
echo " " . $list[$i]['icon_hot'];
echo " " . $list[$i]['icon_secret'];
}
echo"<br><a href='{$list[$i][href]}' style='font-size:10px; line-height:170%; text-decoration:none;'>$wr_content1</a> {$list[$i][datetime2]}
</td>
</tr><tr><td height=1 background='$g4[path]/img/dot_line.gif'></td></tr>
</table>";
}
else
{
echo "<table width='100%' border='0' cellspacing='0' cellpadding='0' align='center'><tr>
<td style='padding:5 0 0 5;'>
  <img src='{$latest_skin_path}/img/icon_li.gif' border='0' align='absmiddle'> <a href='{$list[$i][href]}' style='font-size:10px;text-decoration:none;'><b>$subject2</b></a>";
if ($list[$i]['comment_cnt']) {
echo " <a href=\"{$list[$i]['comment_href']}\"><span style='font-family:돋움; font-size:8pt; color:#9A9A9A;'>{$list[$i]['comment_cnt']}</span></a>";
echo " " . $list[$i]['icon_new'];
echo " " . $list[$i]['icon_file'];
echo " " . $list[$i]['icon_link'];
echo " " . $list[$i]['icon_hot'];
echo " " . $list[$i]['icon_secret'];
}
echo"</td></tr><tr><td style='padding:0 0 5 5;'>";
echo"<P class='BigFirst'><a href='{$list[$i][href]}' style='font-size:10px; line-height:170%; text-decoration:none;'>$wr_content2</a> {$list[$i][datetime2]}</P>
</td>
</tr><tr><td height=1 background='$g4[path]/img/dot_line.gif'></td></tr>
</table>";
}
}
else
{ $subject = cut_str($list[$i][subject], 70, '..');
echo "<table width='100%' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td height='20' align='left'> <img src='{$latest_skin_path}/img/icon_li.gif' border='0' align='absmiddle'>
<a href='{$list[$i][href]}' style='font-size:10px;text-decoration:none;'>$subject</a>  {$list[$i][datetime2]}";
if ($list[$i]['comment_cnt']) {
echo " <a href=\"{$list[$i]['comment_href']}\"><span style='font-family:돋움; font-size:8pt; color:#9A9A9A;'>{$list[$i]['comment_cnt']}</span></a>";
echo " " . $list[$i]['icon_new'];
echo " " . $list[$i]['icon_file'];
echo " " . $list[$i]['icon_link'];
echo " " . $list[$i]['icon_hot'];
echo " " . $list[$i]['icon_secret'];
}
echo" </td>
</tr>
</table>";
}
}
?>
댓글 전체

최신글을 보여주는 페이지에 기재를 하시기 바랍니다.
include_once($latest_skin_path . "/YouChangWha.lib.php");//본문 링크 이미지 썸네일 생성
최신글이 두번이면 위 함수도 두번 뜨는데, 한번만 떠야 되거든요~
include_once($latest_skin_path . "/YouChangWha.lib.php");//본문 링크 이미지 썸네일 생성
위부분을 스킨출력소스옆에다가 붙이라는것인지 잘 모르겟네요
최신글을 보여주는 페이지에 메인페이지파일에 적용하라는 말씀인가요?