최근게시물 글목록 앞부분에 이미지 넣는방법? 정보
최근게시물 글목록 앞부분에 이미지 넣는방법?본문
최근게시물 스킨을 사용하고 있습니다.
그런데..
최신글들이 나오면 앞부분에 저 그림처럼 글목록마다 화살표(arrow.gif) 이미지를
하나씩 나타나게 할려고 합니다. 밑줄라인도 함께 넣으면 좋을련만..
우선..화살표라도 띄우고 싶습니다.
그런데 도저히 어느부분에 넣어야 할지요?
좀 알려주세요.
/////////////////////////////////////////////////////////////////////////////////
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가(특정페이지에 include시키는 경우만 출력시켜 줌)
include_once("./_common.php");
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가(특정페이지에 include시키는 경우만 출력시켜 줌)
include_once("./_common.php");
$g4['title'] = "나의 최근 게시물";
$wid = "220";//전체적인 폭
$hgt = "20";//(예비) 전체적인 높이(셀당 높이)
?>
<?
$new_count = 5;//출력될 목록 수
$cnt = 0;
$sql = " select bo_table, wr_parent from $g4[board_new_table] a
where a.wr_id = a.wr_parent
group by bo_table, wr_parent
order by bn_id desc
limit $new_count ";
$res = sql_query($sql);
echo "
<table width='{$wid}' height='{$hgt}' border='0' bgcolor='#ffffff' cellspacing='0' cellpadding='0' background='' nowrap>
";
echo "<tr>";
echo "<td>";
$wid = "220";//전체적인 폭
$hgt = "20";//(예비) 전체적인 높이(셀당 높이)
?>
<?
$new_count = 5;//출력될 목록 수
$cnt = 0;
$sql = " select bo_table, wr_parent from $g4[board_new_table] a
where a.wr_id = a.wr_parent
group by bo_table, wr_parent
order by bn_id desc
limit $new_count ";
$res = sql_query($sql);
echo "
<table width='{$wid}' height='{$hgt}' border='0' bgcolor='#ffffff' cellspacing='0' cellpadding='0' background='' nowrap>
";
echo "<tr>";
echo "<td>";
echo "<table width=98% cellpadding=0 cellspacing=0 align=center>";
//echo "<tr height='{$hgt}'><td><a href='$g4[bbs_path]/new.php'><img src='$g4[path]/files/arrow.gif'><span style='color:#333333;'></span></a></td></tr>";
echo "<tr height='{$hgt}'><td><a href='$g4[bbs_path]/new.php'><img src='files/text_list.gif' align='absmiddle'><span style='color:#333333;'></span></a></td></tr>";
for ($i=0; $row=sql_fetch_array($res), $i<$new_count; $i++)
{
if (!$row[bo_table])
{
continue;
}
//echo "<tr height='{$hgt}'><td><a href='$g4[bbs_path]/new.php'><img src='$g4[path]/files/arrow.gif'><span style='color:#333333;'></span></a></td></tr>";
echo "<tr height='{$hgt}'><td><a href='$g4[bbs_path]/new.php'><img src='files/text_list.gif' align='absmiddle'><span style='color:#333333;'></span></a></td></tr>";
for ($i=0; $row=sql_fetch_array($res), $i<$new_count; $i++)
{
if (!$row[bo_table])
{
continue;
}
$tmp_table = $g4[write_prefix].$row[bo_table];
$sql2 = " select wr_subject, wr_comment from $tmp_table where wr_id = '$row[wr_parent]' ";
$row2 = sql_fetch($sql2);
$subj = get_text($row2[wr_subject]);
$comment = "";
if ($row2[wr_comment])
$comment = "<span class=small>($row2[wr_comment])</span>";
$sql2 = " select wr_subject, wr_comment from $tmp_table where wr_id = '$row[wr_parent]' ";
$row2 = sql_fetch($sql2);
$subj = get_text($row2[wr_subject]);
$comment = "";
if ($row2[wr_comment])
$comment = "<span class=small>($row2[wr_comment])</span>";
echo "<tr height='{$hgt}'><td class=bg_menu2 title='$subj'>";
echo "<nobr style='display:block;overflow:hidden;width:176px;'>"; //추출되는 제목의 길이를 제어
echo " <a href='$g4[bbs_path]/board.php?bo_table=$row[bo_table]&wr_id=$row[wr_parent]'>";
echo "<nobr style='display:block;overflow:hidden;width:176px;'>"; //추출되는 제목의 길이를 제어
echo " <a href='$g4[bbs_path]/board.php?bo_table=$row[bo_table]&wr_id=$row[wr_parent]'>";
if ($comment) {
echo "<span style='color:#666666;'> $comment $subj</span></a>";//코멘트 있을 경우 출력
//} else if ($comcol) {
} else {
echo "<span style='color:#666666;'> $subj</span></a>";//코멘트 없을 경우 출력
}
echo "</nobr></td></tr>";
echo "<span style='color:#666666;'> $comment $subj</span></a>";//코멘트 있을 경우 출력
//} else if ($comcol) {
} else {
echo "<span style='color:#666666;'> $subj</span></a>";//코멘트 없을 경우 출력
}
echo "</nobr></td></tr>";
$cnt++;
}
if (!$cnt)
echo "<tr><td><span style='color:gray;'>게시글이 없습니다.</span></td></tr>";
echo "</table>";
echo "</td>";
echo "<td></td>";
echo "</tr>";
echo "</table>\n";
?>
}
if (!$cnt)
echo "<tr><td><span style='color:gray;'>게시글이 없습니다.</span></td></tr>";
echo "</table>";
echo "</td>";
echo "<td></td>";
echo "</tr>";
echo "</table>\n";
?>
//////////////////////////////////////////////////////////////////////////////
댓글 전체

<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가(특정페이지에 include시키는 경우만 출력시켜 줌)
include_once("./_common.php");
$g4['title'] = "나의 최근 게시물";
$wid = "220";//전체적인 폭
$hgt = "20";//(예비) 전체적인 높이(셀당 높이)
?>
<?
$new_count = 5;//출력될 목록 수
$cnt = 0;
$sql = " select bo_table, wr_parent from $g4[board_new_table] a
where a.wr_id = a.wr_parent
group by bo_table, wr_parent
order by bn_id desc
limit $new_count ";
$res = sql_query($sql);
echo "
<table width='{$wid}' height='{$hgt}' border='0' bgcolor='#ffffff' cellspacing='0' cellpadding='0' background='' nowrap>
";
echo "<tr>";
echo "<td>";
echo "<table width=98% cellpadding=0 cellspacing=0 align=center>";
//echo "<tr height='{$hgt}'><td><a href='$g4[bbs_path]/new.php'><img src='$g4[path]/files/arrow.gif'><span style='color:#333333;'></span></a></td></tr>";
echo "<tr height='{$hgt}'><td>";
echo $list[$i]['icon_reply'] . "<img src='{$latest_skin_path}/img/latest_icon.gif' width='4' height='7'> ";
echo "<a href='$g4[bbs_path]/new.php'><img src='files/text_list.gif' align='absmiddle'><span style='color:#333333;'></span></a></td></tr>";
for ($i=0; $row=sql_fetch_array($res), $i<$new_count; $i++)
{
if (!$row[bo_table])
{
continue;
}
$tmp_table = $g4[write_prefix].$row[bo_table];
$sql2 = " select wr_subject, wr_comment from $tmp_table where wr_id = '$row[wr_parent]' ";
$row2 = sql_fetch($sql2);
$subj = get_text($row2[wr_subject]);
$comment = "";
if ($row2[wr_comment])
$comment = "<span class=small>($row2[wr_comment])</span>";
echo "<tr height='{$hgt}'><td class=bg_menu2 title='$subj'>";
echo "<nobr style='display:block;overflow:hidden;width:176px;'>"; //추출되는 제목의 길이를 제어
echo " <a href='$g4[bbs_path]/board.php?bo_table=$row[bo_table]&wr_id=$row[wr_parent]'>";
if ($comment) {
echo "<span style='color:#666666;'> $comment $subj</span></a>";//코멘트 있을 경우 출력
//} else if ($comcol) {
} else {
echo "<span style='color:#666666;'> $subj</span></a>";//코멘트 없을 경우 출력
}
echo "</nobr></td></tr>";
$cnt++;
}
if (!$cnt)
echo "<tr><td><span style='color:gray;'>게시글이 없습니다.</span></td></tr>";
echo "</table>";
echo "</td>";
echo "<td></td>";
echo "</tr>";
echo "</table>\n";
?>
24~26 째줄 수정했습니다.
그냥 복사해서 붙이시고.... /img/ 폴더에 latest_icon.gif 이미지 만들어 넣으세요.
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가(특정페이지에 include시키는 경우만 출력시켜 줌)
include_once("./_common.php");
$g4['title'] = "나의 최근 게시물";
$wid = "220";//전체적인 폭
$hgt = "20";//(예비) 전체적인 높이(셀당 높이)
?>
<?
$new_count = 5;//출력될 목록 수
$cnt = 0;
$sql = " select bo_table, wr_parent from $g4[board_new_table] a
where a.wr_id = a.wr_parent
group by bo_table, wr_parent
order by bn_id desc
limit $new_count ";
$res = sql_query($sql);
echo "
<table width='{$wid}' height='{$hgt}' border='0' bgcolor='#ffffff' cellspacing='0' cellpadding='0' background='' nowrap>
";
echo "<tr>";
echo "<td>";
echo "<table width=98% cellpadding=0 cellspacing=0 align=center>";
//echo "<tr height='{$hgt}'><td><a href='$g4[bbs_path]/new.php'><img src='$g4[path]/files/arrow.gif'><span style='color:#333333;'></span></a></td></tr>";
echo "<tr height='{$hgt}'><td>";
echo $list[$i]['icon_reply'] . "<img src='{$latest_skin_path}/img/latest_icon.gif' width='4' height='7'> ";
echo "<a href='$g4[bbs_path]/new.php'><img src='files/text_list.gif' align='absmiddle'><span style='color:#333333;'></span></a></td></tr>";
for ($i=0; $row=sql_fetch_array($res), $i<$new_count; $i++)
{
if (!$row[bo_table])
{
continue;
}
$tmp_table = $g4[write_prefix].$row[bo_table];
$sql2 = " select wr_subject, wr_comment from $tmp_table where wr_id = '$row[wr_parent]' ";
$row2 = sql_fetch($sql2);
$subj = get_text($row2[wr_subject]);
$comment = "";
if ($row2[wr_comment])
$comment = "<span class=small>($row2[wr_comment])</span>";
echo "<tr height='{$hgt}'><td class=bg_menu2 title='$subj'>";
echo "<nobr style='display:block;overflow:hidden;width:176px;'>"; //추출되는 제목의 길이를 제어
echo " <a href='$g4[bbs_path]/board.php?bo_table=$row[bo_table]&wr_id=$row[wr_parent]'>";
if ($comment) {
echo "<span style='color:#666666;'> $comment $subj</span></a>";//코멘트 있을 경우 출력
//} else if ($comcol) {
} else {
echo "<span style='color:#666666;'> $subj</span></a>";//코멘트 없을 경우 출력
}
echo "</nobr></td></tr>";
$cnt++;
}
if (!$cnt)
echo "<tr><td><span style='color:gray;'>게시글이 없습니다.</span></td></tr>";
echo "</table>";
echo "</td>";
echo "<td></td>";
echo "</tr>";
echo "</table>\n";
?>
24~26 째줄 수정했습니다.
그냥 복사해서 붙이시고.... /img/ 폴더에 latest_icon.gif 이미지 만들어 넣으세요.
답변 고맙습니다^^
그런데 img src='{$latest_skin_path} <====이 부분이 정확히 어떤 위치인지 모르겠습니다.
저는 sir_new.php 파일을 <? include_once("$g4[path]/sir_new.php"); //최근게시물 ?>
넣었는데..이미지 파일을 어디다 집어넣어야 하는지 이해가 안됩니다.
그런데 img src='{$latest_skin_path} <====이 부분이 정확히 어떤 위치인지 모르겠습니다.
저는 sir_new.php 파일을 <? include_once("$g4[path]/sir_new.php"); //최근게시물 ?>
넣었는데..이미지 파일을 어디다 집어넣어야 하는지 이해가 안됩니다.
echo "<tr height='{$hgt}'><td class=bg_menu2 title='$subj'>";
이곳을
echo "<tr height='{$hgt}'><td class=bg_menu2 title='$subj'><img src='file path/filename.gif'>";
이런식으로 넣어주면됩니다.
한줄 디스플레이 하고 다음에 라인을 표시하는 것은
<tr><Td background='image url'></td></tr>
이 테그를 최근게시물 한줄이 디스플레이되고 막아지는 </tr> 테그 다음에 넣으시면 됩니다.
이곳을
echo "<tr height='{$hgt}'><td class=bg_menu2 title='$subj'><img src='file path/filename.gif'>";
이런식으로 넣어주면됩니다.
한줄 디스플레이 하고 다음에 라인을 표시하는 것은
<tr><Td background='image url'></td></tr>
이 테그를 최근게시물 한줄이 디스플레이되고 막아지는 </tr> 테그 다음에 넣으시면 됩니다.
우선 답변 고맙습니다^^
그런데 화살표 이가 잘 맞질 않는군요.
글자앞에 보여야 하는데..
위로 올라가 버립니다.
그런데 화살표 이가 잘 맞질 않는군요.
글자앞에 보여야 하는데..
위로 올라가 버립니다.
수직정렬을 해주시면 됩니다.
<img src='file path/filename.gif' align="absmiddle">
위와 같이 수직 가운데 정렬 태그를 넣어 주면 됩니다.
<img src='file path/filename.gif' align="absmiddle">
위와 같이 수직 가운데 정렬 태그를 넣어 주면 됩니다.
echo "<tr height='{$hgt}'><td class=bg_menu2 title='$subj'><img src='files/arrow.gif' align='absmiddle'>";
그 이미지 파일 위치가 이렇게 되거든요.
이미지는 잘 나타납니다만, 글자위로 치우칩니다.
안되요 ㅡㅡ
그 이미지 파일 위치가 이렇게 되거든요.
이미지는 잘 나타납니다만, 글자위로 치우칩니다.
안되요 ㅡㅡ