새창으로 이미지 보이는 스킨에서 회원권한에 따라 제어 가능한가요

이미지 갤러리의 리스트에서 새창으로 이미지 보이는 스킨에서 회원권한에 따라 제어 가능한가요/
 
즉,, 권한이 안되면 썸네일은 보이나 클릭시 새창으로 이미지가 안뜨게 할 수 있나요..
 
|

댓글 6개

참조 : http://www.sir.co.kr/bbs/board.php?bo_table=g4_skin&wr_id=17195
답변감사합니다..

그런데 잘 안되네요..어제 오늘 궁리하다가 다시 질문올립니다

<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>

<table width=100% cellpadding=0 cellspacing=0>

<tr height='25'>
<?
if (!$member[mb_id]) { ?>
<td align="left" bgcolor='#eaeaea' style='padding-left:10px;cursor:pointer;cursor:hand;border:1px solid #BFBFBF;' onClick="javascript:alert('레벨이 모자라거나 로그인하셔야 보실 수 있습니다.');">▒&nbsp;&nbsp;<strong><?=$board['bo_subject']?></strong></td>
<? } else { ?>
<td align="left" bgcolor='#eaeaea' style="padding-left:10px;cursor:pointer;cursor:hand;border:1px solid #BFBFBF;" onClick="javascript:location.href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'">▒&nbsp;&nbsp;<strong><?=$board['bo_subject']?></strong></td>
<? } ?>
</tr>

<? for ($i=0; $i<count($list); $i++) { ?>
<tr height='25'>
<?
if (!$member[mb_id]) { ?>
<td align="left" style="padding-left:10px;word-break:break-all;cursor:pointer;cursor:hand;border-bottom:1px solid #BFBFBF;" onClick="javascript:alert('레벨이 모자라거나 로그인하셔야 보실 수 있습니다.');">+&nbsp;&nbsp;<?=$list[$i][subject]?>&nbsp;<?=$list[$i][comment_cnt]?>&nbsp;<? if($list[$i][icon_new]) echo "<font color='#ff8040'>New</font>"; ?></td>
<? } else { ?>
<td align="left" style="padding-left:10px;word-break:break-all;cursor:pointer;cursor:hand;border-bottom:1px solid #BFBFBF;" onClick="javascript:location.href='<?=$list[$i][href]?>'">+&nbsp;&nbsp;<?=$list[$i][subject]?>&nbsp;<?=$list[$i][comment_cnt]?>&nbsp;<? if($list[$i][icon_new]) echo "<font color='#ff8040'>New</font>"; ?></td>
<? } ?>
</tr>

<? } ?>

<? if (count($list) == 0) { ?><tr><td align=center height=50><font color=#6A6A6A>게시물이 없습니다.</a></td></tr><? } ?>

</table>
<?
include_once("$g4[path]/tail.sub.php");
?>
위 내용은 천상재회님의 최신글 스킨입니다..

<table width="100%" align="center" border="0">
<? if (count($list) == 0) { ?>
<tr><td colspan=4 align=center height=50>게시물이 없습니다.</td></tr>
<? } else { ?>
<tr>

<?
for ($i=0; $i<count($list); $i++)
{
if ($i > 0)
$title = get_text($list[$i][subject]);
// $content = cut_str(get_text($list[$i][wr_content]), 80);
$img = "$g4[path]/data/file/$bo_table/".urlencode($list[$i][file][0][file]);
if (!file_exists($img) || !$list[$i][file][0][file])
$img = "$latest_skin_path/img/noimage.gif";
$href = "$g4[bbs_path]/board.php?bo_table=$bo_table";

echo <<<HEREDOC
<td width='100' valign='top' align='center'>
<table width='100' border='0' cellpadding='0' cellspacing='0' align='center'>
<tr>
<td width='100' align='center'>
<div style='width:100px; border:0px solid #CCCCCC;padding:0px' align='center'>
<a href='{$img}' class='highslide' onclick='return hs.expand(this)'><img src='{$img}' width='100' border='0' align='absmiddle'></a>
</div>
</td>
</tr>
<tr>
<td width='100' height='20' align='center' valign='bottom'>
<a href='$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}' onfocus='this.blur()'>{$list[$i][subject]}</a>
</td>
</tr>
</table>
</td>
HEREDOC;
}
}
?>
위 내용은 제가 리스트에서 썸네일 클릭시 새창으로 이미자가 뜨도록 된 최신글 스킨 내용입니다..

제가 하고 싶은 것은


<?
if (!$member[mb_id]) { ?>

<? } else { ?>

<? } ?>
을 이용하여 갤러리 스킨의 이미지 출력부인
<a href='{$img}' class='highslide' onclick='return hs.expand(this)'> <img src='{$img}' width='100' border='0' align='absmiddle'> </a> 을

회원권한이 있으면 원본이미지가 링크가 걸리도록 하고 회원권한이 없으면 썸네일 <img src='{$img}' width='100' border='0' align='absmiddle'> 만 리스트에 출력되도록하여 새창으로 원본이미지를 보지 못하도록 하고 싶은데..계속 오류만 나서...해결을 못하고 있습니다 ..
오늘 목진철님이 올려주신 스킨에서도 언급 하였듯이 lib/latest.lib.php에 $member 함수가 추가 되어야 합니다.

출력부는

<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>

<table width=100% cellpadding=0 cellspacing=0>

<tr height='25'>
<?
if (!$member[mb_id]) { ?>
<td align="left" bgcolor='#eaeaea' style='padding-left:10px;cursor:pointer;cursor:hand;border:1px solid #BFBFBF;' onClick="javascript:alert('레벨이 모자라거나 로그인하셔야 보실 수 있습니다.');">▒&nbsp;&nbsp;<strong><?=$board['bo_subject']?></strong></td>
<? } else { ?>
<td align="left" bgcolor='#eaeaea' style="padding-left:10px;cursor:pointer;cursor:hand;border:1px solid #BFBFBF;" onClick="javascript:location.href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'">▒&nbsp;&nbsp;<strong><?=$board['bo_subject']?></strong></td>
<? } ?>
</tr>

<? for ($i=0; $i<count($list); $i++) { ?>
<tr height='25'>
<?
if (!$member[mb_id]) { ?>
여기는 비회원 코딩
<? } else { ?>
여기에 회원코딩
</tr>

<? } ?>

<? if (count($list) == 0) { ?><tr><td align=center height=50><font color=#6A6A6A>게시물이 없습니다.</a></td></tr><? } ?>

</table>


목록부분은 일반 베이직처럼 게시판으로 링크되도록 수정하시면 될듯 합니다.
답변감사합니다..

그런데 아무리해도 갤러리에서는 계속 오류만 납니다..

혹시 위의 갤러리 스킨 소스중 어는 부분을 비회원 회원 코딩해야 하는 부분에 넣어야 하는 지요..
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가


?>

<table width=100% cellpadding=0 cellspacing=0>
<colgroup width=14>
<colgroup>
<colgroup width=37>
<colgroup width=14>
<tr>
<td><img src='<?=$latest_skin_path?>/img/latest_t01.gif'></td>
<td background='<?=$latest_skin_path?>/img/bg_latest.gif'>&nbsp;&nbsp;<strong><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><?=$board[bo_subject]?></a></strong></td>
<td background='<?=$latest_skin_path?>/img/bg_latest.gif'><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><img src='<?=$latest_skin_path?>/img/more.gif' border=0></a></td>
<td><img src='<?=$latest_skin_path?>/img/latest_t02.gif'></td>
</tr>

<table width="100%" align="center" border="0">
<? if (count($list) == 0) { ?>
<tr><td colspan=4 align=center height=50>게시물이 없습니다.</td></tr>
<? } else { ?>
<tr>
<?
for ($i=0; $i<count($list); $i++)
{
if ($i > 0)
$title = get_text($list[$i][subject]);
// $content = cut_str(get_text($list[$i][wr_content]), 80);
$img = "$g4[path]/data/file/$bo_table/".urlencode($list[$i][file][0][file]);
if (!file_exists($img) || !$list[$i][file][0][file])
$img = "$latest_skin_path/img/noimage.gif";
$href = "$g4[bbs_path]/board.php?bo_table=$bo_table";

echo "<td width='100' valign='top' align='center'>
<table width='100' border='0' cellpadding='0' cellspacing='0' align='center'>
<tr>
<td width='100' align='center'>";

if($member[mb_id]) { //회원이라면
echo "<div style='width:100px; border:0px solid #CCCCCC;padding:0px' align='center'>
<a href='{$img}' class='highslide' onclick='return hs.expand(this)'><img src='{$img}' width='100' border='0' align='absmiddle'></a>
</div>";
} else { //회원이 아니라면
echo "<div style='width:100px; border:0px solid #CCCCCC;padding:0px' align='center'><img src='{$img}' width='100' border='0' align='absmiddle'></div>";
}
</td>
</tr>
<tr>
<td width='100' height='20' align='center' valign='bottom'>
<a href='$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}' onfocus='this.blur()'>{$list[$i][subject]}</a>
</td>
</tr>
</table>
</td>
";
}
}
?></tr>

</table>
감사합니다... 아주 잘 되네요..
댓글을 작성하시려면 로그인이 필요합니다. 로그인

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
18년 전 조회 1,506
18년 전 조회 1,914
18년 전 조회 1,589
18년 전 조회 1,463
18년 전 조회 1,378
18년 전 조회 1,761
18년 전 조회 1,971
18년 전 조회 1,523
18년 전 조회 1,378
18년 전 조회 1,423
18년 전 조회 1,670
18년 전 조회 1,934
18년 전 조회 1,709
18년 전 조회 1,402
18년 전 조회 2,023
18년 전 조회 1,473
18년 전 조회 1,696
18년 전 조회 1,457
18년 전 조회 1,607
18년 전 조회 1,514
🐛 버그신고