갤러리를 관리자만 클릭할수 있나요?

갤러리를 관리자만 클릭할수 있나요?

QA

갤러리를 관리자만 클릭할수 있나요?

본문

<?
for ($i=0; $i<count($list); $i++)
{
    $title = "자세히보기";
    $content = cut_str(get_text($list[$i][wr_content]), 80);
 $subject = cut_str(get_text($list[$i][subject]), 30, '...');  //제목길이
 $img_width  = '110';  // 이미지 가로크기
 $img_height = '140';  // 이미지 세로크기
    $img = "$g4[path]/data/file/$bo_table/".urlencode($list[$i][file][0][file]);
    if (!file_exists($img) || !$list[$i][file][0][file])
        $img = "$board_skin_path/img/noimage.jpg";
    $href = "$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}";
    $view_href = "$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}";
    if ($is_admin)
        $view_href = "$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}";
    $checkbox = "";
    if ($is_checkbox)
        $checkbox = "<input type=checkbox name=chk_wr_id[] value='{$list[$i][wr_id]}'>";
 $comment_cnt = "";
        if ($list[$i][comment_cnt])
           $comment_cnt = " <a href=\"{$list[$i][comment_href]}\"><span style='font-size:10px;'><font face='Tahoma' color='#EE5A00'>{$list[$i][comment_cnt]}</span></a>";
    $tr = "";
    if ($i && $i%$board[bo_gallery_cols]==0)
        $tr = "</tr><tr>";
    echo "$tr";
    echo <<<HEREDOC
    <td width="{$td_width}%" valign="top" align="center">
        <table border="0" cellpadding="0" cellspacing="0">
        <tr>
            <td style='word-break:break-all; padding-bottom:4px;'><a href="{$href}"><img src="{$img}" width='{$img_width}' border="0" title="$title" style="border:0px solid #ccc"></a>
          </td>   

이 질문에 댓글 쓰기 :

답변 1

    $view_href = "$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}"; 
    if ($is_admin) 
        $view_href = "$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}";

이 코드를 보면 
기본으로 위에 코드를 실행하고 관리자 일때 아래코드인데 두개의 코드가 동일한 경로를 가르키니
관리자나 일반 유저나 동일한 곳으로 이동하겠네요
답변을 작성하시기 전에 로그인 해주세요.
전체 129,672 | RSS
QA 내용 검색

회원로그인

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