ip표시 질문
본문
갤러리게시판의 list.skin 에 ip를 표시하고 싶습니다, 뷰스킨이나 댓글 등에 사용한 방법을 써봤는데 으어 몇시간을 다르게 해봐도 안되는군요, 도와주셔요ㅜㅜ
echo "<a href='".$list[$i][href]."#board'>".stripslashes($list[$i][subject])."</a>";
if ($list[$i][comment_cnt])
echo " <font style='font:normal 12px Tahoma; color:#ff8700'>({$list[$i][comment_cnt]})</font>";
echo " " . $list[$i][icon_new];
echo "</div></td></tr>";
echo "<tr><td align=center height='20'>";
echo "<font style='font:normal 13px ; color:#a9a7a7;'>{$list[$i][wr_name]}</font>";
echo "<br />";
echo "<font style='font:normal 9px Tahoma; color:#c7c7c7'>{$list[$i][datetime2]} View:{$list[$i][wr_hit]}</font>";
이런식으로 리스트에 제목옆에 댓글수, 글쓴이, 날짜시간, 조횟수 등을 표시해 주는데요, 관리자가 쓴 글일경우 ip를 표시해주지 않게하구요, 다른사람들이 쓴 글에는 ip를 표시해주고 싶습니다
밑에는 전체 코드입니다
<?
for ($i=0; $i<count($list); $i++)
{
$e_text = array("(",")"); //괄호 표시
$list[$i][comment_cnt] = str_replace($e_text, "", $list[$i][comment_cnt]); //괄호 표시 변환으로 삭제
// 이미지가 있으면 썸을 생성, 아니면 pass~!
if ($list[$i][file][0][file])
{
$file = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];
$img = "<div style='width:{$img2_width}px; padding:4px;'><a href=\"{$list[$i][href]}#board\"><img src='" . thumbnail($file,$board[bo_1],$board[bo_2],false,1,100) . "' style='border:0px solid #797979;'></a></div>";
}
else
{
$img = "<div style='width:{$img2_width}px; padding:4px;'><a href=\"{$list[$i][href]}#board\"><img src='../skin/board/nine_navy_gallery_utf8/img/noimage.gif' width='76% 'style='border:0px solid #797979; /></a></div>";
}
if ($i && $i%$mod==0)
echo "</tr><tr><td colspan='{$mod}' height='0' bgcolor='#e8e8e8';\"></td></tr><tr>";
echo "<td width='{$td_width}%' valign=top style='word-break:break-all;'>";
echo "<table width='100%' border='0' cellspacing='0' cellpadding='0'>";
echo "<tr><td height=15></td></tr>";
echo "<tr><td align=center>";
echo "$img";
echo "</td></tr>";
echo "<tr><td align=center style='padding-top:3px;padding-bottom:5px;'><div style='width:150px;'>";
// if ($is_category) {
// echo "<font class='color_category'>[".$list[$i][ca_name]."]</font><br>"; }
echo "<a href='".$list[$i][href]."#board'>".stripslashes($list[$i][subject])."</a>";
if ($list[$i][comment_cnt])
echo " <font style='font:normal 12px Tahoma; color:#ff8700'>({$list[$i][comment_cnt]})</font>";
echo " " . $list[$i][icon_new];
echo "</div></td></tr>";
echo "<tr><td align=center height='20'>";
echo "<font style='font:normal 13px ; color:#a9a7a7;'>{$list[$i][wr_name]}</font>";
echo "<br />";
echo "<font style='font:normal 9px Tahoma; color:#c7c7c7'>{$list[$i][datetime2]} View:{$list[$i][wr_hit]}</font>";
if ($is_checkbox) {
echo "<br /><input type=checkbox name=chk_wr_id[] value='".$list[$i][wr_id]."'> "; }
echo "</td></tr>";
echo "</table><br></td>\n";
}
// 나머지 td
$cnt = $i%$mod;
if ($cnt)
for ($i=$cnt; $i<$mod; $i++)
echo "<td width='{$td_width}%'> </td>";
echo "</tr>";
//echo "<tr><td colspan='{$mod}' height='1' bgcolor=000000 left;\"></td></tr>";
if (count($list) == 0) { echo "<tr><td colspan='$mod' height=100 align=center>게시물이 없습니다.</td></tr>"; }
?>
답변 1
이렇게 넣어보세요.
if ($list[$i]['mb_id'] != 'admin') { echo "<span style=\"color:#B2B2B2; font-size:11px;\">{$list[$i][wr_ip]}</span>"; }