메인의 최근 갤러리 이미지를 비회원이 못보도록 할려면 어째해야하나요? > 그누4 질문답변

그누4 질문답변

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

메인의 최근 갤러리 이미지를 비회원이 못보도록 할려면 어째해야하나요? 정보

메인의 최근 갤러리 이미지를 비회원이 못보도록 할려면 어째해야하나요?

본문

비회원상태에서는 메인의 최근갤러리 사진이 no image 의 이미지 파일 내용이 출력되고요.

회원가입하면 최근 갤러리 사진이 제대로 출력되게끔 할려면 어찌해야죠?

댓글 전체

답변 감사합니다만, 위 소스 적용하니 에러나는데요? 어디가 문제인가요? 그리고 해당 최근 스킨의 상단에
소스 붙여놓았는데..다시한번 죄송하지만 부탁드립니다.
view.skin.php 파일에서 이미지 파일출력하는 곳에
이미지들어갈 자리에 넣습니다. 상단에 넣으시면 안되구요.

<? if ($is_member) {  // 만약 회원이면
echo "<img src="$img~ ";  // 이미지를 뿌리고 (원래 이미지 출력하는 소스를 넣으세요 ="$img~ ")
} else {          // 회원이 아니면
<img src="noimg.gif~"  // noimg표시 noimg.gif 가 있는 파일링크를 넣어주세요
}
?>
아직 적용안해봤지만, 최근 갤러리 스킨파일인 lastest 폴더의 lastest.skin.php에 적용하는건 아닌가보네요?

혹시 laster.skin.php 파일에 적용할 방법은 없는지요?

올려주신 소스로 암튼 해보겠습니다.

감사합니다.
프로그램 지식이 없어서 님의 말대로 해도 잘 안되네요.,,ㅡ.ㅡ;
lastest.skin.php 파일의 이미지 출력되는 소스가 아래와 같습니다.
----------------------------------------------

  <?
$ex1_filed = explode("|", $list[$i][wr_1]);
$ext1_01  = explode(" ", $ex1_filed[1]);
$ext1_02  = explode(" ", $ex1_filed[2]);

$ext3_08  = explode(" ", $ex3_filed[8]);

    $title = get_text($list[$i][wr_subject]);
    $content = cut_str(get_text($list[$i][wr_content]), 75);
    $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";
$backimg = "$latest_skin_path/img/injaebox_bg.gif";
    $href = "$g4[bbs_path]/board.php?bo_table=$bo_table";

if (!$member['mb_id']) {  
$ext1_00 = substr($ex1_filed[0],0,2);
for($m=1;$m<ceil(strlen($ex1_filed[0])/2);$m++){
$ext1_00 .= "*";
}
} else {
$ext1_00  = $ex1_filed[0];
}

--이하 생략--

-------------------------------------------------------
위 소스에서 아래 소스가 이미지 출력되는 부분 아닌가요?

------------------------------------------------------------
  $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";
----------------------------------------------------------
위 $img = "$~" 바로 위에 " if ($is_member) {"을 주었고요.

" $img = "$g4[path]/data/file/$bo_table/".urlencode($list[$i][file][0][file]);"을 echo "<img src="$img = "$g4[path]/data/file/$bo_table/".urlencode($list[$i][file][0][file]);로 수정했습니다.

if (!file_exists($img) || !$list[$i][file][0][file]) 밑에는 아래와 같이 바꿨습니다.

} else {          // 회원이 아니면
$img = "$latest_skin_path/img/noimage.gif";
------------------------------------------------------------------

정리하면 아래와 바꿨습니다.

----------------------------------------------------

 if ($is_member) {
echo "<img src="$img = "$g4[path]/data/file/$bo_table/".urlencode($list[$i][file][0][file]);
if (!file_exists($img) || !$list[$i][file][0][file])
} else {       
$img = "$latest_skin_path/img/noimage.gif";

-------------------------------------------------------

에러뜨네요.. 우와 같이하니..제가 프로그램 지식이 없는 디자이너인지라.ㅡ.ㅡ;

어디가 문제인가요?
아래 소스예요..
--------------------------------------------------------------------------------
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

$cols  = 5; //  이미지 가로갯수 //  이미지 세로 갯수는 메인에서 지정(총 이미지 수)
$image_h  = 15; // 이미지 상하 간격

$col_width = (int)(99 / $cols);
?>
<style type="text/css">
<!--
.data  { font-family:돋움; font-size:8pt; color:#999999; }
-->
</style>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr><? for ($i=0; $i<count($list); $i++) { if ($i>0 && $i%$cols==0) { echo "</tr><tr><td colspan='$cols' height='$image_h'></td></tr><tr>"; } ?>
    <td width="<?=$col_width?>%" align="center" valign='top'>
      <table cellpadding=0 cellspacing=0 border=0 width="100%">
        <tr>
          <td colspan='2' align='center'>
            <table align="center" cellpadding="0" cellspacing="0" border="0">
              <tr bgcolor="#FFFFFF">
                <td colspan=4></td>
              </tr>
              <tr>
                <td align="center" valign='top'>
                  <table border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td></td>
                      <td valign="top">
                        <?
$ex1_filed = explode("|", $list[$i][wr_1]);
$ext1_01  = explode(" ", $ex1_filed[1]);
$ext1_02  = explode(" ", $ex1_filed[2]);

$ext3_08  = explode(" ", $ex3_filed[8]);

    $title = get_text($list[$i][wr_subject]);
    $content = cut_str(get_text($list[$i][wr_content]), 75);
    $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";
$backimg = "$latest_skin_path/img/injaebox_bg.gif";
    $href = "$g4[bbs_path]/board.php?bo_table=$bo_table";

if (!$member['mb_id']) {  
$ext1_00 = substr($ex1_filed[0],0,2);
for($m=1;$m<ceil(strlen($ex1_filed[0])/2);$m++){
$ext1_00 .= "*";
}
} else {
$ext1_00  = $ex1_filed[0];
}

if($ext1_01[0]=="남자") {
$ext1_01[0] = "男";
} else if($ext1_01[0] == "여자") {
$ext1_01[0] = "女";
}



echo "<table width='161' height='78' border='0' cellspacing='0' cellpadding='2' background='{$backimg}'><tr><td height='3'></td></tr><tr><td width='60' align='center' valign='top'><a href='{$list[$i]['href']}'><img src='{$img}' width='50' height='65' border='0' title='$title'></a></td>";
echo "<td valign=top><table width='100%' border='0' cellspacing='0' cellpadding='4'><tr><td width=215>";
echo "<a href='{$list[$i]['href']}'><b><font color='#5F1B9E'>{$ext1_00}</font></b> / {$ext1_01[0]} ({$ext1_02[0]})  </a>";
echo "</td></tr><tr><td height='1' bgcolor='#f0f0f0'></td></tr><tr><td>";
echo "<a href='{$list[$i]['href']}'>{$ext3_08[0]}/&nbsp;<font color='#ff6600'>{$list[$i][ca_name]}</font></a>{$list[$i]['wr_10']}";
echo "</td></tr><tr><td height='1' bgcolor='#f0f0f0'></td></tr><tr><td>";


echo "</td></tr></table></td>";
echo "</tr></table>";
?>
 
<? if (count($list) == 0) { echo "게시물이 없습니다."; } ?>
                      </td>
                      <td></td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
</td>
<? } ?>
  </tr>
</table>

----------------------------------------------------
그리고, 48시간님! 너무 죄송하지만,.ㅡ.ㅡ;;
하나 더 부탁해도 될까요? 활용팁 봐도 제대로된것 같은데 안먹히는 이유를 모르겠네요..
게시판의 필드 필수입력으로 만들고 싶은데 아래와 같이 되어있으면 제대로된 것 아닌가 싶네요.
--------------------------------------------------------------
 <input class=ed maxlength=20 size=15 name=wr_name itemname="닉네임" required value="<?=$name?>">
----------------------------------------------------------------
required 이 명령어 넣으면 되는걸로 되어있는데 왜 안될까요?

위 2가지만 해결되면 되거든요..에휴..

넘 죄송스럽지만 부탁드립니다.
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

$cols  = 5; //  이미지 가로갯수 //  이미지 세로 갯수는 메인에서 지정(총 이미지 수)
$image_h  = 15; // 이미지 상하 간격

$col_width = (int)(99 / $cols);
?>
<style type="text/css">
<!--
.data  { font-family:돋움; font-size:8pt; color:#999999; }
-->
</style>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr><? for ($i=0; $i<count($list); $i++) { if ($i>0 && $i%$cols==0) { echo "</tr><tr><td colspan='$cols' height='$image_h'></td></tr><tr>"; } ?>
    <td width="<?=$col_width?>%" align="center" valign='top'>
      <table cellpadding=0 cellspacing=0 border=0 width="100%">
        <tr>
          <td colspan='2' align='center'>
            <table align="center" cellpadding="0" cellspacing="0" border="0">
              <tr bgcolor="#FFFFFF">
                <td colspan=4></td>
              </tr>
              <tr>
                <td align="center" valign='top'>
                  <table border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td></td>
                      <td valign="top">
                        <?
$ex1_filed = explode("|", $list[$i][wr_1]);
$ext1_01  = explode(" ", $ex1_filed[1]);
$ext1_02  = explode(" ", $ex1_filed[2]);

$ext3_08  = explode(" ", $ex3_filed[8]);

    $title = get_text($list[$i][wr_subject]);
    $content = cut_str(get_text($list[$i][wr_content]), 75);


// 이지지 출력
 if ($is_member) {
    $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";
 }
else {
    $img = "$latest_skin_path/img/noimage.gif";
}
//

    $backimg = "$latest_skin_path/img/injaebox_bg.gif";
    $href = "$g4[bbs_path]/board.php?bo_table=$bo_table";

if (!$member['mb_id']) { 
$ext1_00 = substr($ex1_filed[0],0,2);
for($m=1;$m<ceil(strlen($ex1_filed[0])/2);$m++){
$ext1_00 .= "*";
}
} else {
$ext1_00  = $ex1_filed[0];
}

if($ext1_01[0]=="남자") {
$ext1_01[0] = "男";
} else if($ext1_01[0] == "여자") {
$ext1_01[0] = "女";
}



echo "<table width='161' height='78' border='0' cellspacing='0' cellpadding='2' background='{$backimg}'><tr><td height='3'></td></tr><tr><td width='60' align='center' valign='top'><a href='{$list[$i]['href']}'><img src='{$img}' width='50' height='65' border='0' title='$title'></a></td>";
echo "<td valign=top><table width='100%' border='0' cellspacing='0' cellpadding='4'><tr><td width=215>";
echo "<a href='{$list[$i]['href']}'><b><font color='#5F1B9E'>{$ext1_00}</font></b> / {$ext1_01[0]} ({$ext1_02[0]})  </a>";
echo "</td></tr><tr><td height='1' bgcolor='#f0f0f0'></td></tr><tr><td>";
echo "<a href='{$list[$i]['href']}'>{$ext3_08[0]}/&nbsp;<font color='#ff6600'>{$list[$i][ca_name]}</font></a>{$list[$i]['wr_10']}";
echo "</td></tr><tr><td height='1' bgcolor='#f0f0f0'></td></tr><tr><td>";


echo "</td></tr></table></td>";
echo "</tr></table>";
?>
 
<? if (count($list) == 0) { echo "게시물이 없습니다."; } ?>
                      </td>
                      <td></td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
</td>
<? } ?>
  </tr>
</table>
해당 스킨 아래쪽 스크립트를 확인해 보세요...
예전 스킨이면 최신것과 비교해서 수정하셔야 할겁니다.

    // 별명 검사
    if ((f.w.value == "") ||
        (f.w.value == "u" && f.mb_nick.defaultValue != f.mb_nick.value)) {

        reg_mb_nick_check();

        if ($F('mb_nick_enabled')!='000') {
            alert('별명을 입력하지 않았거나 입력에 오류가 있습니다.');
            $('reg_mb_nick').activate();
            return false;
        }
    }
전체 66,554 |RSS
그누4 질문답변 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1402호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT