채택완료

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

2014-06-09 (월) 18:16:02 4,107
<?
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개 / 댓글 1개

채택된 답변
+20 포인트
    $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]}";

이 코드를 보면 
기본으로 위에 코드를 실행하고 관리자 일때 아래코드인데 두개의 코드가 동일한 경로를 가르키니
관리자나 일반 유저나 동일한 곳으로 이동하겠네요

답변에 대한 댓글 1개

오호~ 그러네요... 적용해볼께요

답변을 작성하려면 로그인이 필요합니다.