최신글 추출 글자색 바꾸기 정보
최신글 추출 글자색 바꾸기본문
첨부한 이미지과 같은 최신글 추출을 쓰고있습니다.
빨간색 선안의 글자색과 폰트크기를 주고싶은데.. 아무리 소스를 고처봐도 적용되지 않습니다.
어떻게해면 되는지 아시는분 답변 부탁드립니다.
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
//링크 썸네일 게시판을 위해 수정 - 2007년 1월 22일 월요일 - 플록
if (!function_exists("imagecopyresampled")) alert("GD 2.0.1 이상 버전이 설치되어 있어야 사용할 수 있는 갤러리 게시판 입니다.");
include_once($latest_skin_path . "/Ylink_thumb.lib.php");//본문 링크 이미지 썸네일 생성
//여분필드 기본값 설정 - 리자언니 free_img3 스킨에서
if (empty($board['bo_1'])) {
$board['bo_1'] = "50,50";
$sql = " update ".$g4['board_table']." set bo_1 = '".$board['bo_1']."' where bo_table = '".$bo_table."' ";
sql_query($sql);
}
list($w, $h) = explode(",", $board['bo_1']);
if (empty($board['bo_2'])) {
$board['bo_2'] = "50";
$sql = " update ".$g4['board_table']." set bo_2 = '".$board['bo_2']."' where bo_table = '".$bo_table."' ";
sql_query($sql);
}
if (empty($board['bo_3'])) {
$board['bo_3'] = "50";
$sql = " update ".$g4['board_table']." set bo_3 = '".$board['bo_3']."' where bo_table = '".$bo_table."' ";
sql_query($sql);
}
list($w, $h) = explode(",", $board['bo_1']);
$data_path = $g4['path'] . "/data/file/" . $bo_table;
$thumb_path = $data_path . '/thumb';
if (!is_dir($thumb_path)) {
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
}
?>
<table width=100% border=0 align="center" cellpadding=0 cellspacing=0>
<tr>
<td width="5" height="5"><img src="<?=$latest_skin_path?>/img/box01_tl.gif" width="5" height="5"></td>
<td background="<?=$latest_skin_path?>/img/box01_top.gif"></td>
<td width="5" height="5"><img src="<?=$latest_skin_path?>/img/box01_tr.gif" width="5" height="5"></td>
</tr>
<tr>
<td background="<?=$latest_skin_path?>/img/box01_left.gif"></td>
<td valign="top" ><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top" style="padding-bottom:5px"><table width="100%" height="25" border="0" cellpadding="0" cellspacing="0">
<tr>
<td style="PADDING-left: 10px"><strong><img src="<?=$latest_skin_path?>/img/title_z2_1.gif" align="absmiddle"></strong></td>
<td width="60" align="left"><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><img src="<?=$latest_skin_path?>/img/box01_more.gif" border="0"></a></td>
</tr>
</table></td>
</tr>
<tr>
<td valign="top"><table width=100% border=0 align="center" cellpadding=0 cellspacing=0>
<tr>
<td width="5" height="1">
</td>
<td height="1" align="left" bgcolor="#D9D9D9"><table width="31" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="5F7B85"></td>
</tr>
</table></td>
<td width="5" height="1"></td>
</tr>
<tr>
<td></td>
<td valign="top" style="padding:5px"><!--
<table width=100% cellpadding=0 cellspacing=0 border=0 style="background:#eeeeee;border-top:1 solid #dddddd;">
<tr height="25">
<td style="font:bold 9pt tahoma; padding-left:10">
<a href="<?=$g4['bbs_path']?>/board.php?bo_table=<?=$bo_table?>"><?=$board['bo_subject']?></a></td>
<td align="right" style="padding-right:10"> </td>
</tr>
</table> -->
<?
for ($i=0; $i<count($list); $i++){
//------------------------------
//본문에 링크한 이미지 레코드별 배열 - 한페이지에서 중복사용가능
$re = '/src[ =]+[\'"]([^\'"]+\.(?:gif|jpg|png|bmp))[\'"]/i';
preg_match_all($re, $list[$i]['wr_content'], $match, PREG_PATTERN_ORDER);
//$imgs[$i] = $match[1][0]; //$url = $match[1][0];
$dest_link[] = array( 'wr_id' => $list[$i]['wr_id'], 'url' => $match[1]);
//print_r2($dest_link[$i]);
$url = $dest_link[$i]['url']['0'];//첫번째 링크된 이미지, 두번째는 $dest_link[$i]['url'][1]
//------------------------------
$save_dir = $thumb_path;//임시 저장경로
$referer = "";//속일 리퍼러, 넣지 않아도 됨
$thumb = $save_dir . '/s_' . base64_encode($url);
//썸네일이 없다면 본문 첫번째 링크된 이미지 파일의 썸네일을 생성합니다.
if (!file_exists($thumb)) {
//if ((is_file($url)) && (!file_exists($thumb))) {//원본이미지 있고 썸네일 없을때
//유효하지 않는 링크에 대한 에러를 표시하지 않는다.
$result = @Ymake_sumnail_remoteimage($url, $save_dir, $w, $h, $referer);
}
//링크에서 파일명 가져옴
$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.'/' . $filename;
if (!file_exists($thumb)){
$size = getimagesize($dest_file);
if ($size[2] == 1)
$src = imagecreatefromgif($dest_file);
else if ($size[2] == 2)
$src = imagecreatefromjpeg($dest_file);
else if ($size[2] == 3)
$src = imagecreatefrompng($dest_file);
else
break;
if ($size[0] >= $size[1]){
$rate = $w / $size[0];
$width = $w;
$height = (int)($size[1] * $rate);
}
else{
$rate = $h / $size[1];
$width = (int)($size[0] * $rate);
$height = $h;
}
$dst = imagecreatetruecolor($width, $height);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $width, $height, $size[0], $size[1]);
imagejpeg($dst, $thumb, $board['bo_2']);
chmod($thumb, 0707);
}
}
}
//----------------------------------------------------------------
$f_title = $list[$i]['file'][0]['file']?" ".$list[$i]['file'][0]['source']."":"".$filename."";
if (file_exists($thumb)){
$img = "<img src='".$thumb. "' style='border: 1px solid silver;' align='left' title='".$f_title." Hit: ".$list[$i]['wr_hit']."'>";
}
//----------------------------------------------------------------
if ($list[$i]['comment_cnt']){
$comment_cnt ="<a href=\"javascript:{$list[$i][comment_href]}\">{$list[$i]['comment_cnt']}</a>";
}
if (($i==0)||($i==1)||($i==2)){//세번째 까지 이미지 제어
if ((empty($list[$i][file][0][file])) && (empty($url))) {//파일1,링크1 체크 - 제목,쪽글만 표시
$subject = ($list[$i]['is_notice'])?"<a href='".$list[$i]['href']."' style='color:#2C8CB9;font-weight:bold;'>".$list[$i]['subject']."</a>":"<a href='".$list[$i]['href']."' style='font-weight:bold;'>".$list[$i]['subject']."</a>";
$wr_content = "<a href='{$list[$i]['href']}'>".cut_str(strip_tags($list[$i]['wr_content']), 200, '...')."</a>";
?><div style='width:100%;border-bottom:1px dashed silver;margin-top:3px;'>
<div style='width:100%;border:0px solid silver;margin:0;padding-top:7;'><img src="<?=$latest_skin_path?>/img/icon_li.gif" style="vertical-align: middle;"><a href="<?=$list[$i]['href']?>" style="font-family:굴림;font-size:12px;font-weight:bold;"><?=$subject?></a><?=$list[$i]['comment_cnt']?> <?=$list[$i]['icon_new']?></div>
<div style="width:100%;text-align:left;line-height:155%;margin-right:1; margin-left:1;"><?=$wr_content?><span style="font-size:8pt;color:cornflowerblue;padding-left:5">(ddddd<?=$list[$i]['datetime']?>)</span></div>
<div style='clear:both;'></div>
</div><?
}
else{//이미지,제목,쪽글 표시
$subject = ($list[$i]['is_notice'])?"<a href='".$list[$i]['href']."' style='color:#2C8CB9;font-weight:bold;'>".$list[$i]['subject']."</a>":"<a href='".$list[$i]['href']."' style='color:#6A6A6A;font-weight:bold;font-size:9pt;'>".$list[$i]['subject']."</a>";
$wr_content = "<a href='{$list[$i]['href']}'>".cut_str(strip_tags($list[$i]['wr_content']), 200, '...')."</a>";
?><div style='width:100%;border-bottom:1px dashed silver;margin-top:3px;'>
<div style='width:100%;border:0px solid silver;margin:0;padding-top:3px;'><img src="<?=$latest_skin_path?>/img/icon_li.gif" style="vertical-align: middle;"><a href="<?=$list[$i]['href']?>"><?=$subject?></a><?=$list[$i]['comment_cnt']?> <?=$list[$i]['icon_new']?></div>
<div style="width:100%;text-align:left;line-height:155%;margin-right:1; margin-left:1;"><a href="<?=$list[$i]['href']?>"><?=$img?></a><span style="font-size:8pt;color:#6A6A6A;"><?=$wr_content?></span><span style="font-size:8pt;color:cornflowerblue;padding-left:5">(<?=$list[$i]['datetime']?>)</span></div>
<div style='clear:both;'></div>
</div><?
}
}
else {//세번째 글 이후 (제목, 날짜만)
?><div style='width:100%;border-bottom:1px dashed silver;margin-top:3px;padding:2px'><img src="<?=$latest_skin_path?>/img/icon_li.gif" style="vertical-align: middle;"><a href="<?=$list[$i]['href']?>" style="font-family:굴림;font-size:12px;font-weight:bold;"><?=$list[$i]['subject']?></a><?=$list[$i]['comment_cnt']?> <?=$list[$i]['icon_new']?><span style="font-size:8pt;color:cornflowerblue;padding-left:5">(<?=$list[$i]['datetime']?>)</span></div>
<div style='clear:both;'></div><?
}
}//for
if (count($list) == 0){
?><div style='width:100%;border:0px solid silver;margin:0;'>자료가 없습니다.</div><?
}
?>
</td>
<td></td>
</tr>
<tr>
<td width="5" height="1"></td>
<td></td>
<td width="5" height="1"></td>
</tr>
</table></td>
</tr>
</table></td>
<td background="<?=$latest_skin_path?>/img/box01_right.gif"></td>
</tr>
<tr>
<td width="5" height="5"><img src="<?=$latest_skin_path?>/img/box01_bl.gif" width="5" height="5"></td>
<td background="<?=$latest_skin_path?>/img/box01_bottom.gif"></td>
<td width="5" height="5"><img src="<?=$latest_skin_path?>/img/box01_br.gif" width="5" height="5"></td>
</tr>
</table>
빨간색 선안의 글자색과 폰트크기를 주고싶은데.. 아무리 소스를 고처봐도 적용되지 않습니다.
어떻게해면 되는지 아시는분 답변 부탁드립니다.
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
//링크 썸네일 게시판을 위해 수정 - 2007년 1월 22일 월요일 - 플록
if (!function_exists("imagecopyresampled")) alert("GD 2.0.1 이상 버전이 설치되어 있어야 사용할 수 있는 갤러리 게시판 입니다.");
include_once($latest_skin_path . "/Ylink_thumb.lib.php");//본문 링크 이미지 썸네일 생성
//여분필드 기본값 설정 - 리자언니 free_img3 스킨에서
if (empty($board['bo_1'])) {
$board['bo_1'] = "50,50";
$sql = " update ".$g4['board_table']." set bo_1 = '".$board['bo_1']."' where bo_table = '".$bo_table."' ";
sql_query($sql);
}
list($w, $h) = explode(",", $board['bo_1']);
if (empty($board['bo_2'])) {
$board['bo_2'] = "50";
$sql = " update ".$g4['board_table']." set bo_2 = '".$board['bo_2']."' where bo_table = '".$bo_table."' ";
sql_query($sql);
}
if (empty($board['bo_3'])) {
$board['bo_3'] = "50";
$sql = " update ".$g4['board_table']." set bo_3 = '".$board['bo_3']."' where bo_table = '".$bo_table."' ";
sql_query($sql);
}
list($w, $h) = explode(",", $board['bo_1']);
$data_path = $g4['path'] . "/data/file/" . $bo_table;
$thumb_path = $data_path . '/thumb';
if (!is_dir($thumb_path)) {
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
}
?>
<table width=100% border=0 align="center" cellpadding=0 cellspacing=0>
<tr>
<td width="5" height="5"><img src="<?=$latest_skin_path?>/img/box01_tl.gif" width="5" height="5"></td>
<td background="<?=$latest_skin_path?>/img/box01_top.gif"></td>
<td width="5" height="5"><img src="<?=$latest_skin_path?>/img/box01_tr.gif" width="5" height="5"></td>
</tr>
<tr>
<td background="<?=$latest_skin_path?>/img/box01_left.gif"></td>
<td valign="top" ><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top" style="padding-bottom:5px"><table width="100%" height="25" border="0" cellpadding="0" cellspacing="0">
<tr>
<td style="PADDING-left: 10px"><strong><img src="<?=$latest_skin_path?>/img/title_z2_1.gif" align="absmiddle"></strong></td>
<td width="60" align="left"><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><img src="<?=$latest_skin_path?>/img/box01_more.gif" border="0"></a></td>
</tr>
</table></td>
</tr>
<tr>
<td valign="top"><table width=100% border=0 align="center" cellpadding=0 cellspacing=0>
<tr>
<td width="5" height="1">
</td>
<td height="1" align="left" bgcolor="#D9D9D9"><table width="31" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="5F7B85"></td>
</tr>
</table></td>
<td width="5" height="1"></td>
</tr>
<tr>
<td></td>
<td valign="top" style="padding:5px"><!--
<table width=100% cellpadding=0 cellspacing=0 border=0 style="background:#eeeeee;border-top:1 solid #dddddd;">
<tr height="25">
<td style="font:bold 9pt tahoma; padding-left:10">
<a href="<?=$g4['bbs_path']?>/board.php?bo_table=<?=$bo_table?>"><?=$board['bo_subject']?></a></td>
<td align="right" style="padding-right:10"> </td>
</tr>
</table> -->
<?
for ($i=0; $i<count($list); $i++){
//------------------------------
//본문에 링크한 이미지 레코드별 배열 - 한페이지에서 중복사용가능
$re = '/src[ =]+[\'"]([^\'"]+\.(?:gif|jpg|png|bmp))[\'"]/i';
preg_match_all($re, $list[$i]['wr_content'], $match, PREG_PATTERN_ORDER);
//$imgs[$i] = $match[1][0]; //$url = $match[1][0];
$dest_link[] = array( 'wr_id' => $list[$i]['wr_id'], 'url' => $match[1]);
//print_r2($dest_link[$i]);
$url = $dest_link[$i]['url']['0'];//첫번째 링크된 이미지, 두번째는 $dest_link[$i]['url'][1]
//------------------------------
$save_dir = $thumb_path;//임시 저장경로
$referer = "";//속일 리퍼러, 넣지 않아도 됨
$thumb = $save_dir . '/s_' . base64_encode($url);
//썸네일이 없다면 본문 첫번째 링크된 이미지 파일의 썸네일을 생성합니다.
if (!file_exists($thumb)) {
//if ((is_file($url)) && (!file_exists($thumb))) {//원본이미지 있고 썸네일 없을때
//유효하지 않는 링크에 대한 에러를 표시하지 않는다.
$result = @Ymake_sumnail_remoteimage($url, $save_dir, $w, $h, $referer);
}
//링크에서 파일명 가져옴
$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.'/' . $filename;
if (!file_exists($thumb)){
$size = getimagesize($dest_file);
if ($size[2] == 1)
$src = imagecreatefromgif($dest_file);
else if ($size[2] == 2)
$src = imagecreatefromjpeg($dest_file);
else if ($size[2] == 3)
$src = imagecreatefrompng($dest_file);
else
break;
if ($size[0] >= $size[1]){
$rate = $w / $size[0];
$width = $w;
$height = (int)($size[1] * $rate);
}
else{
$rate = $h / $size[1];
$width = (int)($size[0] * $rate);
$height = $h;
}
$dst = imagecreatetruecolor($width, $height);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $width, $height, $size[0], $size[1]);
imagejpeg($dst, $thumb, $board['bo_2']);
chmod($thumb, 0707);
}
}
}
//----------------------------------------------------------------
$f_title = $list[$i]['file'][0]['file']?" ".$list[$i]['file'][0]['source']."":"".$filename."";
if (file_exists($thumb)){
$img = "<img src='".$thumb. "' style='border: 1px solid silver;' align='left' title='".$f_title." Hit: ".$list[$i]['wr_hit']."'>";
}
//----------------------------------------------------------------
if ($list[$i]['comment_cnt']){
$comment_cnt ="<a href=\"javascript:{$list[$i][comment_href]}\">{$list[$i]['comment_cnt']}</a>";
}
if (($i==0)||($i==1)||($i==2)){//세번째 까지 이미지 제어
if ((empty($list[$i][file][0][file])) && (empty($url))) {//파일1,링크1 체크 - 제목,쪽글만 표시
$subject = ($list[$i]['is_notice'])?"<a href='".$list[$i]['href']."' style='color:#2C8CB9;font-weight:bold;'>".$list[$i]['subject']."</a>":"<a href='".$list[$i]['href']."' style='font-weight:bold;'>".$list[$i]['subject']."</a>";
$wr_content = "<a href='{$list[$i]['href']}'>".cut_str(strip_tags($list[$i]['wr_content']), 200, '...')."</a>";
?><div style='width:100%;border-bottom:1px dashed silver;margin-top:3px;'>
<div style='width:100%;border:0px solid silver;margin:0;padding-top:7;'><img src="<?=$latest_skin_path?>/img/icon_li.gif" style="vertical-align: middle;"><a href="<?=$list[$i]['href']?>" style="font-family:굴림;font-size:12px;font-weight:bold;"><?=$subject?></a><?=$list[$i]['comment_cnt']?> <?=$list[$i]['icon_new']?></div>
<div style="width:100%;text-align:left;line-height:155%;margin-right:1; margin-left:1;"><?=$wr_content?><span style="font-size:8pt;color:cornflowerblue;padding-left:5">(ddddd<?=$list[$i]['datetime']?>)</span></div>
<div style='clear:both;'></div>
</div><?
}
else{//이미지,제목,쪽글 표시
$subject = ($list[$i]['is_notice'])?"<a href='".$list[$i]['href']."' style='color:#2C8CB9;font-weight:bold;'>".$list[$i]['subject']."</a>":"<a href='".$list[$i]['href']."' style='color:#6A6A6A;font-weight:bold;font-size:9pt;'>".$list[$i]['subject']."</a>";
$wr_content = "<a href='{$list[$i]['href']}'>".cut_str(strip_tags($list[$i]['wr_content']), 200, '...')."</a>";
?><div style='width:100%;border-bottom:1px dashed silver;margin-top:3px;'>
<div style='width:100%;border:0px solid silver;margin:0;padding-top:3px;'><img src="<?=$latest_skin_path?>/img/icon_li.gif" style="vertical-align: middle;"><a href="<?=$list[$i]['href']?>"><?=$subject?></a><?=$list[$i]['comment_cnt']?> <?=$list[$i]['icon_new']?></div>
<div style="width:100%;text-align:left;line-height:155%;margin-right:1; margin-left:1;"><a href="<?=$list[$i]['href']?>"><?=$img?></a><span style="font-size:8pt;color:#6A6A6A;"><?=$wr_content?></span><span style="font-size:8pt;color:cornflowerblue;padding-left:5">(<?=$list[$i]['datetime']?>)</span></div>
<div style='clear:both;'></div>
</div><?
}
}
else {//세번째 글 이후 (제목, 날짜만)
?><div style='width:100%;border-bottom:1px dashed silver;margin-top:3px;padding:2px'><img src="<?=$latest_skin_path?>/img/icon_li.gif" style="vertical-align: middle;"><a href="<?=$list[$i]['href']?>" style="font-family:굴림;font-size:12px;font-weight:bold;"><?=$list[$i]['subject']?></a><?=$list[$i]['comment_cnt']?> <?=$list[$i]['icon_new']?><span style="font-size:8pt;color:cornflowerblue;padding-left:5">(<?=$list[$i]['datetime']?>)</span></div>
<div style='clear:both;'></div><?
}
}//for
if (count($list) == 0){
?><div style='width:100%;border:0px solid silver;margin:0;'>자료가 없습니다.</div><?
}
?>
</td>
<td></td>
</tr>
<tr>
<td width="5" height="1"></td>
<td></td>
<td width="5" height="1"></td>
</tr>
</table></td>
</tr>
</table></td>
<td background="<?=$latest_skin_path?>/img/box01_right.gif"></td>
</tr>
<tr>
<td width="5" height="5"><img src="<?=$latest_skin_path?>/img/box01_bl.gif" width="5" height="5"></td>
<td background="<?=$latest_skin_path?>/img/box01_bottom.gif"></td>
<td width="5" height="5"><img src="<?=$latest_skin_path?>/img/box01_br.gif" width="5" height="5"></td>
</tr>
</table>
댓글 전체

$wr_content = "<a href='{$list[$i]['href']}'>".cut_str(strip_tags($list[$i]['wr_content']), 200, '...')."</a>";
이부분의 코드를 수정하셔야 할 것 같습니다.
$wr_content = "<a href='{$list[$i]['href']}'><span style=\"font-size:8pt;color:#6A6A6A;\">".cut_str(strip_tags($list[$i]['wr_content']), 200, '...')."</span></a>";
이부분의 코드를 수정하셔야 할 것 같습니다.
$wr_content = "<a href='{$list[$i]['href']}'><span style=\"font-size:8pt;color:#6A6A6A;\">".cut_str(strip_tags($list[$i]['wr_content']), 200, '...')."</span></a>";
답변감사합니다. 복받으실꺼에요 ^^