그누보드 관리자페이지에서 게시판 글쓰기 페이지로 링크..

그누보드 관리자페이지에서 게시판 글쓰기 페이지로 링크..

QA

그누보드 관리자페이지에서 게시판 글쓰기 페이지로 링크..

본문


<tr class="<?php echo $bg; ?>">
        <td>
           <?php echo $row['gr_id'] ?>
        </td>
        <td>
            <a href="<?php echo get_pretty_url($row['bo_table']) ?>" target='_blank'><?php echo get_text($row['bo_subject']) ?></a>
        </td>
        <td>
            //글쓰기 페이지로 넘어가는 링크!
        </td>
    </tr>

 

관리자 메인에 각 게시판 바로가기 영역을 추가하는 중입니다.

다른건 다 괜찮은데 해당 게시판의 '글쓰기'페이지로 넘어가는 링크를 불러오려면 

get_pretty_url($row['bo_table'] 에서 bo_table을 어떻게 고쳐야할까요>..?

이 질문에 댓글 쓰기 :

답변 2


// 쓰기 링크
$write_href = '';
if ($member['mb_level'] >= $row['bo_write_level']) {
    $write_href = short_url_clean(G5_BBS_URL.'/write.php?bo_table='.$row['bo_table']);
}

이런식으로 쓰시면되겠네요

<a href="<?php echo $write_href ?>" target='_blank'>글쓰기</a>

어떤식으로 관리자메인에 각 게시판들이 뿌려지는지 알수있으면 어떻게 해야할지 알것같네요

 

$row['bo_table']은 게시판 ID입니다 각 게시판가져올때 bo_table 사용한값을 그대로 넣으면 될듯합니다.


<?php
$sub_menu = '100000';
include_once('./_common.php');

@include_once('./safe_check.php');
if(function_exists('social_log_file_delete')){
    social_log_file_delete(86400);      //소셜로그인 디버그 파일 24시간 지난것은 삭제
}

$g5['title'] = '관리자메인';
include_once ('./admin.head.php');

$new_write_rows = 5;

auth_check($auth[$sub_menu], 'r');

$sql_common = " from {$g5['board_table']} a ";
$sql_search = " where (1) ";

if ($is_admin != "super") {
    $sql_common .= " , {$g5['group_table']} b ";
    $sql_search .= " and (a.gr_id = b.gr_id and b.gr_admin = '{$member['mb_id']}') ";
}

if ($stx) {
    $sql_search .= " and ( ";
    switch ($sfl) {
        case "bo_table" :
            $sql_search .= " ($sfl like '$stx%') ";
            break;
        case "a.gr_id" :
            $sql_search .= " ($sfl = '$stx') ";
            break;
        default :
            $sql_search .= " ($sfl like '%$stx%') ";
            break;
    }
    $sql_search .= " ) ";
}


if (!$sst) {
    $sst  = "a.gr_id, a.bo_table";
    $sod = "asc";
}
$sql_order = " order by $sst $sod ";

$sql = " select count(*) as cnt {$sql_common} {$sql_search} {$sql_order} ";
$row = sql_fetch($sql);
$total_count = $row['cnt'];

$rows = $config['cf_page_rows'];
$total_page  = ceil($total_count / $rows);  // 전체 페이지 계산
if ($page < 1) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
$from_record = ($page - 1) * $rows; // 시작 열을 구함

$sql = " select * {$sql_common} {$sql_search} {$sql_order} limit {$from_record}, {$rows} ";
$result = sql_query($sql);

$listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'" class="ov_listall">전체목록</a>';

$g5['title'] = '게시판관리';
include_once('./admin.head.php');

$colspan = 15;


?>

<div class="wrapper clearfix">


<!--게시판 바로가기 링크-->
<section class="board_link" style=" float: left; width: 48%; margin-right: 4%;">
<h2>게시판 바로가기</h2>
<form name="fboardlist" id="fboardlist" action="./board_list_update.php" onsubmit="return fboardlist_submit(this);" method="post">
<input type="hidden" name="sst" value="<?php echo $sst ?>">
<input type="hidden" name="sod" value="<?php echo $sod ?>">
<input type="hidden" name="sfl" value="<?php echo $sfl ?>">
<input type="hidden" name="stx" value="<?php echo $stx ?>">
<input type="hidden" name="page" value="<?php echo $page ?>">
<input type="hidden" name="token" value="<?php echo $token ?>">

<div class="tbl_head01 tbl_wrap">
    <table>
    <caption><?php echo $g5['title']; ?> 목록</caption>
    <thead>
    <tr>
        <th scope="col" style="width: 20%;">게시판 그룹명</th>
        <th scope="col">게시판 제목</th>
        <th scope="col">글쓰기</th>
    </tr>
    </thead>
    <tbody>
    <?php
    for ($i=0; $row=sql_fetch_array($result); $i++) {
        $one_update = '<a href="./board_form.php?w=u&amp;bo_table='.$row['bo_table'].'&amp;'.$qstr.'" class="btn btn_03">수정</a>';
        $one_copy = '<a href="./board_copy.php?bo_table='.$row['bo_table'].'" class="board_copy btn btn_02" target="win_board_copy">복사</a>';

        $bg = 'bg'.($i%2);
    ?>

    <tr class="<?php echo $bg; ?>">
        <td>
           <?php echo $row['gr_id'] ?>
        </td>
        <td>
            <a href="<?php echo get_pretty_url($row['bo_table']) ?>" target='_blank'><?php echo get_text($row['bo_subject']) ?></a>
        </td>
        <td>
            
        </td>
    </tr>
    <?php
    }
    if ($i == 0)
        echo '<tr><td colspan="'.$colspan.'" class="empty_table">자료가 없습니다.</td></tr>';
    ?>
    </tbody>
    </table>
</div>

</form>
</section>



답변주셔서 감사드립니다!
아직 직접 짜는 수준은 못되서 게시판 리스트페이지에 있는 코드를 그대로 긁어서 붙여넣었거든요..
<?php echo get_pretty_url($row['bo_table']) ?>
요기서 어떻게 코드를 추가해야 글쓰기페이지를 의미하는지 궁금해서요.. !

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

회원로그인

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