제목을클릭해도 새창이안뜨는데 원인을 못찾겠습니다..ㅠ.ㅠ

제목을클릭해도 새창이안뜨는데 원인을 못찾겠습니다..ㅠ.ㅠ

QA

제목을클릭해도 새창이안뜨는데 원인을 못찾겠습니다..ㅠ.ㅠ

본문

제목을클릭해도 새창이안뜨는데 원인을 못찾겠습니다.

list.skin.php에서 아래와같이작성이됬는데......새창만뜨고 내용을 못가져오는거같습니다.


<?php if ($is_checkbox) { ?>
                    <a href="<?php echo $list[$i]['href'] ?>">
                        <?php echo $list[$i]['icon_reply'] ?>
                        <?php
                            if (isset($list[$i]['icon_secret'])) echo rtrim($list[$i]['icon_secret']);
                         ?>
                        <?php echo $list[$i]['subject'] ?>
                       
                    </a>
                 <?php }else{ ?>    
                    <a href="<?php echo $board_skin_url ?>/view_user.php?bo_table=<?php echo $bo_table;?>&wr_id=<?php echo $list[$i]['wr_id'];?>" class="mun_view"  >
                        <?php echo $list[$i]['icon_reply'] ?>
                        <?php
                            if (isset($list[$i]['icon_secret'])) echo rtrim($list[$i]['icon_secret']);
                         ?>
                        <?php echo $list[$i]['subject'] ?>
                       
                    </a>
                 <?php } ?> 

불러오는 함수는


<!-- 페이지 -->
<?php echo $write_pages;  ?>
 
<script>
var mun_view=function(href){
    var mun_view=window.open(href,'mun_view','left=350,top=50,width=750,height=750,scrollbars=1,resizable=yes');
    mun_view.focus();
}
 
$(function(){
    $(".mun_view").click(function(){
        mun_view(this.href);
        return false;
    });
 
});
</script>
 

이렇습니다..........

3021520807_1579720741.5403.png

3021520807_1579720755.6371.png

이 질문에 댓글 쓰기 :

답변 3

리스트 페이지는 이상이 없습니다.

view 페이지를 별도로 만드신것 같은데

해당 view_user.php 내용도 봐야합니다.

 

우선 해당 view 페이지 내에 커먼 파일이 로드되어야하며

내용을 읽기 위해선 grobal $view; 도 로드되어야겠죠.

그 외에 회원에 따라 분기를 두시려면 $view 와 함께 $member 도 불러와야하구요.

 

그리고 그누보드 내 인클루드 방식이 아니라

다이렉트로 바로 열려면 

if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가

이것도 확인해봐야 합니다.

 

위 코드가 있으면 별도 URL 로 해당 부분을 로드할 수 없습니다.

 

 


<?php
include_once('../../../common.php');
include_once('../../../head.sub.php');

 
$sql_search = "";
// 검색이면
if ($sca || $stx || $stx === '0') {
    // where 문을 얻음
    $sql_search = get_sql_search($sca, $sfl, $stx, $sop);
    
    $search_href = './board.php?bo_table='.$bo_table.'&page='.$page.$qstr;
    $list_href = './board.php?bo_table='.$bo_table;
} else {
    $search_href = '';
    $list_href = './board.php?bo_table='.$bo_table.'&page='.$page;
}

 
    if ($sql_search)
        $sql_search = " and " . $sql_search;
 
    // 윗글을 얻음
    $sql = " select wr_id, wr_subject, wr_datetime from {$write_table} where wr_is_comment = 0 and wr_num = '{$write['wr_num']}' and wr_reply < '{$write['wr_reply']}' {$sql_search} order by wr_num desc, wr_reply desc limit 1 ";
    $prev = sql_fetch($sql);
 
    // 위의 쿼리문으로 값을 얻지 못했다면
    if (!$prev['wr_id'])     {
        $sql = " select wr_id, wr_subject, wr_datetime from {$write_table} where wr_is_comment = 0 and wr_num < '{$write['wr_num']}' {$sql_search} order by wr_num desc, wr_reply desc limit 1 ";
        $prev = sql_fetch($sql);
    }
 
    // 아래글을 얻음
    $sql = " select wr_id, wr_subject, wr_datetime from {$write_table} where wr_is_comment = 0 and wr_num = '{$write['wr_num']}' and wr_reply > '{$write['wr_reply']}' {$sql_search} order by wr_num, wr_reply limit 1 ";
    $next = sql_fetch($sql);
    // 위의 쿼리문으로 값을 얻지 못했다면
    if (!$next['wr_id']) {
        $sql = " select wr_id, wr_subject, wr_datetime from {$write_table} where wr_is_comment = 0 and wr_num > '{$write['wr_num']}' {$sql_search} order by wr_num, wr_reply limit 1 ";
        $next = sql_fetch($sql);
    }

 
// 이전글 링크
$prev_href = '';
if (isset($prev['wr_id']) && $prev['wr_id']) {
    $prev_wr_subject = get_text(cut_str($prev['wr_subject'], 255));
    $prev_href = $board_skin_url.'/view_user.php?bo_table='.$bo_table.'&wr_id='.$prev['wr_id'].$qstr;
    $prev_wr_date = $prev['wr_datetime'];
}
 
// 다음글 링크
$next_href = '';
if (isset($next['wr_id']) && $next['wr_id']) {
    $next_wr_subject = get_text(cut_str($next['wr_subject'], 255));
    $next_href = $board_skin_url.'/view_user.php?bo_table='.$bo_table.'&wr_id='.$next['wr_id'].$qstr;
    $next_wr_date = $next['wr_datetime'];
}

 
    $scrap_href = '/bbs/scrap_popin.php?bo_table='.$bo_table.'&wr_id='.$wr_id;
 
    
 
include_once(G5_LIB_PATH.'/thumbnail.lib.php');
 
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
?>
<link rel="stylesheet" href="./style.css">
 
<script src="<?php echo G5_JS_URL; ?>/viewimageresize.js"></script>
 
<!-- 게시물 읽기 시작 { -->
 
<article id="bo_v" style="width:<?php echo $width; ?>">
    <header>
        <h2 id="bo_v_title">
            <?php if ($write['ca_name']) { ?>
            <span class="bo_v_cate"><?php echo $write['ca_name']; // 분류 출력 끝 ?></span> 
            <?php } ?>
            <span class="bo_v_tit">
            <?php
            echo cut_str(get_text($write['wr_subject']), 70); // 글제목 출력
            ?></span>
        </h2>
    </header>
 
        <style>
            #bo_v{padding:20px;margin-top:0px;}
            .mun{height:30px;}
            .answer_area{margin-top:30px;height:30px;}
            .answer_area:after {display:block;visibility:hidden;clear:both;content:""}
            .ans{float:left;border:1px solid #ccc;height:30px;line-height:30px;margin-left:-1px;padding:0px 10px;text-align:center;}
            .ans2{color:#fff;background:orange;cursor:pointer;}
            .ans3{color:#fff;background:#329632;cursor:pointer;}
            #bo_v_atc{margin-top:20px;}
            #bo_v_con{margin-top:10px;border:1px solid #ccc;padding:10px;display:none;}
            .wr_con{width:100%;border:1px solid #ccc;padding:10px;background:#eee;margin-bottom:20px;}

 
            .btn_area{clear:both;width:100%;padding-top:30px;}
            .btn_area .left{float:left;width:33.333%;}
            .btn_area .left .bt1{display:inline-block;width:70px;height:30px;line-height:30px;text-align:center;background: #f0ad4e;color:#fff;}
            .btn_area .right{float:right;width:66.666%;text-align:right;}
            .btn_area .right .bt2{display:inline-block;width:70px;height:30px;line-height:30px;text-align:center;background: #5bc0de;color:#fff;}
            .btn_area .right .bt3{display:inline-block;width:70px;height:30px;line-height:30px;text-align:center;background: #5cb85c;color:#fff;}
 
            @media (max-width: 500px) {
 
            .ans{width:20%;}
            .ans0{display:none;}
            .ans2{width:50%;}
            .ans3{width:50%;}
 
            }
 
        </style>
 
    <section id="bo_v_atc">
        <h2 id="bo_v_atc_title">본문</h2>
 
        <?php
        if ($write["wr_con"]){
        ?>
            <p class="wr_con"  style=""><?php echo nl2br($write["wr_con"])?></p>
        <?php } ?>
 
        <?php 
        for ($i=1;$i<6;$i++){
            if ($i==1) $no="①";
            else if ($i==2) $no="②";
            else if ($i==3) $no="③";
            else if ($i==4) $no="④";
            else if ($i==5) $no="⑤";
 
            if ($write["wr_".$i]){
        ?>
            <p class="mun"><?php echo $no;?> <?php echo $write["wr_".$i];?></p>
        <?php
            }
        }?>
        

 
        <div class="answer_area">
        <p class="ans ans0">정답체크</p>
        <?php 
        for ($i=1;$i<6;$i++){
            if ($i==1) $no="①";
            else if ($i==2) $no="②";
            else if ($i==3) $no="③";
            else if ($i==4) $no="④";
            else if ($i==5) $no="⑤";
 
            if ($write["wr_".$i]){
        ?>
            <p class="ans <?php if ($write["wr_10"]==$i) echo " dap";?>"><input type="radio" name="answer_ok" value="<?php echo $i;?>"><?php echo $i;?>번</p>
        <?php
            }
        }?>
        <p class="ans ans2">정답확인</p>
        <p class="ans ans3">해설보기</p>
        </div>

 
    <script>
 
$(function(){
    $(".ans2").click(function(){
        <?php if (!$member["mb_id"]){?>
            alert("회원로그인 후 보실 수 있습니다.");
            window.self.close();
        <?php } else {?>
            $(".dap").css("color","red");
        <?php } ?>

 
    });
 
    $(".ans3").click(function(){
        <?php if (!$member["mb_id"]){?>
            alert("회원로그인 후 보실 수 있습니다.");
            window.self.close();
        <?php } else {?>
            $("#bo_v_con").show();
        <?php } ?>

 
    });

 
});
</script>   
    
 
        <!-- 본문 내용 시작 { -->
        <div id="bo_v_con"><?php echo nl2br($write['wr_content']); ?></div>
        <?php //echo $write['rich_content']; //  과 같은 코드를 사용할 경우 ?>
        <!-- } 본문 내용 끝 -->
 
        <?php if ($is_signature) { ?><p><?php echo $signature ?></p><?php } ?>

 
       
    </section>

 
   
    <div class="btn_area">
        <div class="left">
            <a href="<?php echo $scrap_href;  ?>" target="_blank"  onclick="win_scrap(this.href); return false;" class="bt1">스크랩</a>
        </div>
        <div class="right">
        <?php if ($prev_href) { ?><a href="<?php echo $prev_href ?>" class="bt2">이전글</a><?php } ?>
        <?php if ($next_href) { ?><a href="<?php echo $next_href ?>" class="bt3">다음글</a><?php } ?>
        
        </div>
    </div>
  

 
</article>
<!-- } 게시판 읽기 끝 -->

 
<script>
<?php if ($board['bo_download_point'] < 0) { ?>
$(function() {
    $("a.view_file_download").click(function() {
        if(!g5_is_member) {
            alert("다운로드 권한이 없습니다.\n회원이시라면 로그인 후 이용해 보십시오.");
            return false;
        }
 
        var msg = "파일을 다운로드 하시면 포인트가 차감(<?php echo number_format($board['bo_download_point']) ?>점)됩니다.\n\n포인트는 게시물당 한번만 차감되며 다음에 다시 다운로드 하셔도 중복하여 차감하지 않습니다.\n\n그래도 다운로드 하시겠습니까?";
 
        if(confirm(msg)) {
            var href = $(this).attr("href")+"&js=on";
            $(this).attr("href", href);
 
            return true;
        } else {
            return false;
        }
    });
});
<?php } ?>
 
function board_move(href)
{
    window.open(href, "boardmove", "left=50, top=50, width=500, height=550, scrollbars=1");
}
</script>
 
<script>
$(function() {
    $("a.view_image").click(function() {
        window.open(this.href, "large_image", "location=yes,links=no,toolbar=no,top=10,left=10,width=10,height=10,resizable=yes,scrollbars=no,status=no");
        return false;
    });
 
    // 추천, 비추천
    $("#good_button, #nogood_button").click(function() {
        var $tx;
        if(this.id == "good_button")
            $tx = $("#bo_v_act_good");
        else
            $tx = $("#bo_v_act_nogood");
 
        excute_good(this.href, $(this), $tx);
        return false;
    });
 
    // 이미지 리사이즈
    $("#bo_v_atc").viewimageresize();
 
    //sns공유
    $(".btn_share").click(function(){
        $("#bo_v_sns").fadeIn();
   
    });
 
    $(document).mouseup(function (e) {
        var container = $("#bo_v_sns");
        if (!container.is(e.target) && container.has(e.target).length === 0){
        container.css("display","none");
        }   
    });
});
 
function excute_good(href, $el, $tx)
{
    $.post(
        href,
        { js: "on" },
        function(data) {
            if(data.error) {
                alert(data.error);
                return false;
            }
 
            if(data.count) {
                $el.find("strong").text(number_format(String(data.count)));
                if($tx.attr("id").search("nogood") > -1) {
                    $tx.text("이 글을 비추천하셨습니다.");
                    $tx.fadeIn(200).delay(2500).fadeOut(200);
                } else {
                    $tx.text("이 글을 추천하셨습니다.");
                    $tx.fadeIn(200).delay(2500).fadeOut(200);
                }
            }
        }, "json"
    );
}
</script>
<!-- } 게시글 읽기 끝 -->

view_user.php 1행 다음에 아래코드를 넣어보세요

무슨 에러인지 나올 것입니다

 

error_reporting(E_ALL & ~E_NOTICE);
ini_set("display_errors", 1);

답변을 작성하시기 전에 로그인 해주세요.
전체 61
QA 내용 검색

회원로그인

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