최근게시물 new.skin.php에서 새창 띄우기 정보
최근게시물 new.skin.php에서 새창 띄우기본문
최근게시물 skin/new/basic/new.skin.php에서 새창 띄우기를 하려니 안되는군요.
최신글에서는 답변이 많은데요.
최신글에서는 답변이 많은데요.
댓글 전체

링크 걸린곳
<a href="list[$i][href]" target="_blank">
뒤에 target="_blank" 붙이시면 될거에요
앞에는 기억이 안나서 그냥 썼습니다....
<a href="list[$i][href]" target="_blank">
뒤에 target="_blank" 붙이시면 될거에요
앞에는 기억이 안나서 그냥 썼습니다....
답변 감사합니다만 도움이 되질 못하는군요. new.skin.php 는 이렇습니다
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<!-- 분류 시작 -->
<form name=fnew method=get style="margin:0px;">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height=30>
<?=$group_select?>
<select id=view name=view onchange="select_change()">
<option value=''>전체게시물
<option value='w'>원글만
<option value='c'>코멘트만
</select>
<b>회원아이디 : </b>
<input type=text id='mb_id' name='mb_id' value='<?=$mb_id?>'>
<input type=submit value='검색'>
<script language="JavaScript">
function select_change()
{
document.fnew.submit();
}
document.getElementById("gr_id").value = "<?=$gr_id?>";
document.getElementById("view").value = "<?=$view?>";
</script>
</td>
</tr>
</table>
</form>
<!-- 분류 끝 -->
<!-- 제목 시작 -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="1" bgcolor="#CCCCCC"></td>
</tr>
<?
for ($i=0; $i<count($list); $i++)
{
$gr_subject = $list[$i][gr_subject];
$bo_subject = $list[$i][bo_subject];
$wr_subject = get_text(cut_str($list[$i][wr_subject], 40));
$wr_content = cut_str($list[$i][wr_content], 300);
$wr_content = strip_tags($wr_content);
if($list[$i][gr_id] == "cafe"){
if (!$list[$i][comment]){
$icon = "<img src='{$new_skin_path}/img/sub_icon.gif' border='0' align='absmiddle' title='subject'>";
$java_act2 = $list[$i][bo_table].$i;
$list[$i][doc] = "$g4[bbs_path]/board.php?bo_table=".$list[$i][bo_table]."&wr_id=".$list[$i][wr_id]."&sca=".$list[$i][ca_name];
$href = "<SCRIPT LANGUAGE=\"JavaScript\">
function ex".$java_act2."()
{
var f = document.form".$java_act2.";
f.action = \"$g4[path]/cafe/cafe_main.php?cb_id=".$list[$i][bo_table]."\";
f.submit();
}
</SCRIPT>
<table width=\"97%\" align=center border=\"0\" cellspacing=\"0\">
<tr>
<form method=\"post\" name=\"form".$java_act2."\">
<td width='' style='word-break:break-all;' height=20>
<INPUT TYPE=\"hidden\" name=doc value=\"".$list[$i][doc]."\">
{$icon}
<a class=\"n_title3\" href=\"javascript:ex".$java_act2."();\"><B>".$wr_subject."</B></a>
</td>
</tr>
<tr>
<td width='' style='word-break:break-all;'>
<a href='".$list[$i][href]."'>$wr_content</a>
</td>
</tr>
<tr>
<td width='' align=right style='word-break:break-all;'>
<span class=\"n_title1\">[ <a class=\"n_title1\" href='./new.php?gr_id=".$list[$i][gr_id]."'>{$gr_subject}</a> : <a class=\"n_title1\" href='./board.php?bo_table=".$list[$i][bo_table]."'>{$bo_subject}</a> ]→[".$list[$i][datetime2]." ".$list[$i][name]."]</span>
</td>
</form>
</tr>
</table>";
} else {
$icon = str_replace("[코]", "<img src='{$new_skin_path}/img/com_icon.gif' border='0' align='absmiddle' title='코멘트'>", $list[$i][comment]);
$java_act2 = $list[$i][bo_table].$i;
$list[$i][doc] = "$g4[bbs_path]/board.php?bo_table=".$list[$i][bo_table]."&wr_id=".$list[$i][wr_id]."&sca=".$list[$i][ca_name];
$href = "<SCRIPT LANGUAGE=\"JavaScript\">
function ex".$java_act2."()
{
var f = document.form".$java_act2.";
f.action = \"$g4[path]/cafe/cafe_main.php?cb_id=".$list[$i][bo_table]."\";
f.submit();
}
</SCRIPT>
<table width=\"97%\" align=center border=\"0\" cellspacing=\"0\">
<tr>
<form method=\"post\" name=\"form".$java_act2."\">
<td width='' style='word-break:break-all;' height=20>
<INPUT TYPE=\"hidden\" name=doc value=\"".$list[$i][doc]."\">
{$icon} <img src='{$new_skin_path}/img/sub_icon.gif' border='0' align='absmiddle' title='subject'>
<a class=\"n_title2\" href=\"javascript:ex".$java_act2."();\"><B>".$wr_subject."</B></a>
<span class=\"n_title1\">[ <a class=\"n_title1\" href='./new.php?gr_id=".$list[$i][gr_id]."'>{$gr_subject}</a> : <a class=\"n_title1\" href='./board.php?bo_table=".$list[$i][bo_table]."'>{$bo_subject}</a> ]→[".$list[$i][datetime2]." ".$list[$i][name]."]</span>
</td>
</form>
</tr>
</table>";
}
} else {
if (!$list[$i][comment]){
$icon = "<img src='{$new_skin_path}/img/sub_icon.gif' border='0' align='absmiddle' title='subject'>";
$href = "<table width=\"97%\" align=center border=\"0\" cellspacing=\"0\">
<tr>
<td width='' style='word-break:break-all;' height=20>
{$icon}
<a class=\"n_title3\" href=\"".$list[$i][href]."\"><B>".$wr_subject."</B></a>
</td>
</tr>
<tr>
<td width='' style='word-break:break-all;'>
<a href='".$list[$i][href]."'>$wr_content</a>
</td>
</tr>
<tr>
<td width='' align=right style='word-break:break-all;'>
<span class=\"n_title1\">[ <a class=\"n_title1\" href='./new.php?gr_id=".$list[$i][gr_id]."'>{$gr_subject}</a> : <a class=\"n_title1\" href='./board.php?bo_table=".$list[$i][bo_table]."'>{$bo_subject}</a> ]→[".$list[$i][datetime2]." ".$list[$i][name]."]</span>
</td>
</tr>
</table>";
} else {
$icon = str_replace("[코]", "<img src='{$new_skin_path}/img/com_icon.gif' border='0' align='absmiddle' title='코멘트'>", $list[$i][comment]);
$href = "<table width=\"97%\" align=center border=\"0\" cellspacing=\"0\">
<tr>
<td width='' style='word-break:break-all;' height=20>
{$icon}
<a class=\"n_title2\" href=\"".$list[$i][href]."\"><B>".$wr_subject."</B></a>
<span class=\"n_title1\">[ <a class=\"n_title1\" href='./new.php?gr_id=".$list[$i][gr_id]."'>{$gr_subject}</a> : <a class=\"n_title1\" href='./board.php?bo_table=".$list[$i][bo_table]."'>{$bo_subject}</a> ]→[".$list[$i][datetime2]." ".$list[$i][name]."]</span>
</td>
</tr>
</table>";
}
}
$_width = "100";
$_height = "70";
$quality = "80";
$data_path = $g4['path']."/data/file/".$list[$i][bo_table];
$thumb_path = $data_path.'/thumb';
$thumb = $thumb_path."/".$list[$i][wr_id];
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
$sql=" select * from $g4[board_file_table] where bo_table = '".$list[$i][bo_table]."' and wr_id = '".$list[$i][wr_id]."' and bf_no = '0' order by bf_no asc";
$_file = sql_fetch($sql);
if (!file_exists($thumb))
{
$file = $data_path .'/'. $_file[bf_file];
// 업로드된 파일이 이미지라면
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
break;
$rate = $_width / $size[0];
$height = (int)($size[1] * $rate);
@unlink($thumb_path.'/'.$list[$i][wr_id]);
// 계산된 썸네일 이미지의 높이가 설정된 이미지의 높이보다 작다면
if ($height < $_height){
// 계산된 이미지 높이로 복사본 이미지 생성
$dst = imagecreatetruecolor($_width, $height);
} else {
// 설정된 이미지 높이로 복사본 이미지 생성
$dst = imagecreatetruecolor($_width, $_height);
}
imagecopyresampled($dst, $src, 0, 0, 0, 0, $_width, $height, $size[0], $size[1]);
imagejpeg($dst, $thumb_path.'/'.$list[$i][wr_id], $quality);
chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
}
}
if (file_exists($thumb)){
$image_t = "<td align='center' height='30' width='80'><img src='$thumb' border=1 width='80'></td><td align='center' width='5'> </td>";
} else {
$image_t = "";
}
if(!$list[$i][comment]){
echo <<<HEREDOC
<tr>
<td height="5"></td>
</tr>
<tr>
<td width="">
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
$image_t
<TD valign="top">
$href
</TD>
</TR>
</TABLE>
</td>
</tr>
<tr>
<td height="5"></td>
</tr>
<tr>
<td height="1" background="{$new_skin_path}/img/dot_bg.gif"></td>
</tr>
HEREDOC;
} else {
echo <<<HEREDOC
<tr>
<td colspan="$colspan" height="5"></td>
</tr>
<tr>
<td width="">
$href
</td>
</tr>
<tr>
<td colspan="$colspan" height="5"></td>
</tr>
<tr>
<td colspan="$colspan" height="1" background="{$new_skin_path}/img/dot_bg.gif"></td>
</tr>
HEREDOC;
}
}
?>
<? if ($i == 0) { ?>
<tr><td height=50 align=center>게시물이 없습니다.</td></tr>
<? } ?>
<tr>
<td height="30" align="center"><?=$write_pages?></td>
</tr>
</table>
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<!-- 분류 시작 -->
<form name=fnew method=get style="margin:0px;">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height=30>
<?=$group_select?>
<select id=view name=view onchange="select_change()">
<option value=''>전체게시물
<option value='w'>원글만
<option value='c'>코멘트만
</select>
<b>회원아이디 : </b>
<input type=text id='mb_id' name='mb_id' value='<?=$mb_id?>'>
<input type=submit value='검색'>
<script language="JavaScript">
function select_change()
{
document.fnew.submit();
}
document.getElementById("gr_id").value = "<?=$gr_id?>";
document.getElementById("view").value = "<?=$view?>";
</script>
</td>
</tr>
</table>
</form>
<!-- 분류 끝 -->
<!-- 제목 시작 -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="1" bgcolor="#CCCCCC"></td>
</tr>
<?
for ($i=0; $i<count($list); $i++)
{
$gr_subject = $list[$i][gr_subject];
$bo_subject = $list[$i][bo_subject];
$wr_subject = get_text(cut_str($list[$i][wr_subject], 40));
$wr_content = cut_str($list[$i][wr_content], 300);
$wr_content = strip_tags($wr_content);
if($list[$i][gr_id] == "cafe"){
if (!$list[$i][comment]){
$icon = "<img src='{$new_skin_path}/img/sub_icon.gif' border='0' align='absmiddle' title='subject'>";
$java_act2 = $list[$i][bo_table].$i;
$list[$i][doc] = "$g4[bbs_path]/board.php?bo_table=".$list[$i][bo_table]."&wr_id=".$list[$i][wr_id]."&sca=".$list[$i][ca_name];
$href = "<SCRIPT LANGUAGE=\"JavaScript\">
function ex".$java_act2."()
{
var f = document.form".$java_act2.";
f.action = \"$g4[path]/cafe/cafe_main.php?cb_id=".$list[$i][bo_table]."\";
f.submit();
}
</SCRIPT>
<table width=\"97%\" align=center border=\"0\" cellspacing=\"0\">
<tr>
<form method=\"post\" name=\"form".$java_act2."\">
<td width='' style='word-break:break-all;' height=20>
<INPUT TYPE=\"hidden\" name=doc value=\"".$list[$i][doc]."\">
{$icon}
<a class=\"n_title3\" href=\"javascript:ex".$java_act2."();\"><B>".$wr_subject."</B></a>
</td>
</tr>
<tr>
<td width='' style='word-break:break-all;'>
<a href='".$list[$i][href]."'>$wr_content</a>
</td>
</tr>
<tr>
<td width='' align=right style='word-break:break-all;'>
<span class=\"n_title1\">[ <a class=\"n_title1\" href='./new.php?gr_id=".$list[$i][gr_id]."'>{$gr_subject}</a> : <a class=\"n_title1\" href='./board.php?bo_table=".$list[$i][bo_table]."'>{$bo_subject}</a> ]→[".$list[$i][datetime2]." ".$list[$i][name]."]</span>
</td>
</form>
</tr>
</table>";
} else {
$icon = str_replace("[코]", "<img src='{$new_skin_path}/img/com_icon.gif' border='0' align='absmiddle' title='코멘트'>", $list[$i][comment]);
$java_act2 = $list[$i][bo_table].$i;
$list[$i][doc] = "$g4[bbs_path]/board.php?bo_table=".$list[$i][bo_table]."&wr_id=".$list[$i][wr_id]."&sca=".$list[$i][ca_name];
$href = "<SCRIPT LANGUAGE=\"JavaScript\">
function ex".$java_act2."()
{
var f = document.form".$java_act2.";
f.action = \"$g4[path]/cafe/cafe_main.php?cb_id=".$list[$i][bo_table]."\";
f.submit();
}
</SCRIPT>
<table width=\"97%\" align=center border=\"0\" cellspacing=\"0\">
<tr>
<form method=\"post\" name=\"form".$java_act2."\">
<td width='' style='word-break:break-all;' height=20>
<INPUT TYPE=\"hidden\" name=doc value=\"".$list[$i][doc]."\">
{$icon} <img src='{$new_skin_path}/img/sub_icon.gif' border='0' align='absmiddle' title='subject'>
<a class=\"n_title2\" href=\"javascript:ex".$java_act2."();\"><B>".$wr_subject."</B></a>
<span class=\"n_title1\">[ <a class=\"n_title1\" href='./new.php?gr_id=".$list[$i][gr_id]."'>{$gr_subject}</a> : <a class=\"n_title1\" href='./board.php?bo_table=".$list[$i][bo_table]."'>{$bo_subject}</a> ]→[".$list[$i][datetime2]." ".$list[$i][name]."]</span>
</td>
</form>
</tr>
</table>";
}
} else {
if (!$list[$i][comment]){
$icon = "<img src='{$new_skin_path}/img/sub_icon.gif' border='0' align='absmiddle' title='subject'>";
$href = "<table width=\"97%\" align=center border=\"0\" cellspacing=\"0\">
<tr>
<td width='' style='word-break:break-all;' height=20>
{$icon}
<a class=\"n_title3\" href=\"".$list[$i][href]."\"><B>".$wr_subject."</B></a>
</td>
</tr>
<tr>
<td width='' style='word-break:break-all;'>
<a href='".$list[$i][href]."'>$wr_content</a>
</td>
</tr>
<tr>
<td width='' align=right style='word-break:break-all;'>
<span class=\"n_title1\">[ <a class=\"n_title1\" href='./new.php?gr_id=".$list[$i][gr_id]."'>{$gr_subject}</a> : <a class=\"n_title1\" href='./board.php?bo_table=".$list[$i][bo_table]."'>{$bo_subject}</a> ]→[".$list[$i][datetime2]." ".$list[$i][name]."]</span>
</td>
</tr>
</table>";
} else {
$icon = str_replace("[코]", "<img src='{$new_skin_path}/img/com_icon.gif' border='0' align='absmiddle' title='코멘트'>", $list[$i][comment]);
$href = "<table width=\"97%\" align=center border=\"0\" cellspacing=\"0\">
<tr>
<td width='' style='word-break:break-all;' height=20>
{$icon}
<a class=\"n_title2\" href=\"".$list[$i][href]."\"><B>".$wr_subject."</B></a>
<span class=\"n_title1\">[ <a class=\"n_title1\" href='./new.php?gr_id=".$list[$i][gr_id]."'>{$gr_subject}</a> : <a class=\"n_title1\" href='./board.php?bo_table=".$list[$i][bo_table]."'>{$bo_subject}</a> ]→[".$list[$i][datetime2]." ".$list[$i][name]."]</span>
</td>
</tr>
</table>";
}
}
$_width = "100";
$_height = "70";
$quality = "80";
$data_path = $g4['path']."/data/file/".$list[$i][bo_table];
$thumb_path = $data_path.'/thumb';
$thumb = $thumb_path."/".$list[$i][wr_id];
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
$sql=" select * from $g4[board_file_table] where bo_table = '".$list[$i][bo_table]."' and wr_id = '".$list[$i][wr_id]."' and bf_no = '0' order by bf_no asc";
$_file = sql_fetch($sql);
if (!file_exists($thumb))
{
$file = $data_path .'/'. $_file[bf_file];
// 업로드된 파일이 이미지라면
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
break;
$rate = $_width / $size[0];
$height = (int)($size[1] * $rate);
@unlink($thumb_path.'/'.$list[$i][wr_id]);
// 계산된 썸네일 이미지의 높이가 설정된 이미지의 높이보다 작다면
if ($height < $_height){
// 계산된 이미지 높이로 복사본 이미지 생성
$dst = imagecreatetruecolor($_width, $height);
} else {
// 설정된 이미지 높이로 복사본 이미지 생성
$dst = imagecreatetruecolor($_width, $_height);
}
imagecopyresampled($dst, $src, 0, 0, 0, 0, $_width, $height, $size[0], $size[1]);
imagejpeg($dst, $thumb_path.'/'.$list[$i][wr_id], $quality);
chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
}
}
if (file_exists($thumb)){
$image_t = "<td align='center' height='30' width='80'><img src='$thumb' border=1 width='80'></td><td align='center' width='5'> </td>";
} else {
$image_t = "";
}
if(!$list[$i][comment]){
echo <<<HEREDOC
<tr>
<td height="5"></td>
</tr>
<tr>
<td width="">
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
$image_t
<TD valign="top">
$href
</TD>
</TR>
</TABLE>
</td>
</tr>
<tr>
<td height="5"></td>
</tr>
<tr>
<td height="1" background="{$new_skin_path}/img/dot_bg.gif"></td>
</tr>
HEREDOC;
} else {
echo <<<HEREDOC
<tr>
<td colspan="$colspan" height="5"></td>
</tr>
<tr>
<td width="">
$href
</td>
</tr>
<tr>
<td colspan="$colspan" height="5"></td>
</tr>
<tr>
<td colspan="$colspan" height="1" background="{$new_skin_path}/img/dot_bg.gif"></td>
</tr>
HEREDOC;
}
}
?>
<? if ($i == 0) { ?>
<tr><td height=50 align=center>게시물이 없습니다.</td></tr>
<? } ?>
<tr>
<td height="30" align="center"><?=$write_pages?></td>
</tr>
</table>