121 lines
4.9 KiB
PHP
121 lines
4.9 KiB
PHP
<?php
|
|
if (!defined('_GNUBOARD_'))
|
|
exit;
|
|
add_stylesheet('<link rel="stylesheet" href="' . $board_skin_url . '/style.css">', 0);
|
|
include_once G5_LIB_PATH . '/thumbnail.lib.php';
|
|
if ($board['bo_table_width'] == 0)
|
|
$width = "100%";
|
|
|
|
$cate = array();
|
|
$lists = array();
|
|
?>
|
|
<div class="board-skin-basic theme-box" style="max-width:<?= $width ?>;">
|
|
<?php if ($board['bo_content_head']) { ?>
|
|
<div class="content_head">
|
|
<?= stripslashes($board['bo_content_head']); ?>
|
|
</div>
|
|
<?php } ?>
|
|
<?php
|
|
if ($is_category) {
|
|
$cate = explode('|', $board['bo_category_list']);
|
|
}
|
|
|
|
for ($h = 0; $h <= count($cate); $h++) {
|
|
if (count($cate) > 0 && $h == count($cate))
|
|
continue;
|
|
|
|
$list_item = sql_query("SELECT * FROM {$write_table} WHERE wr_reply='' AND wr_is_comment=0 ORDER BY wr_10*1, wr_id");
|
|
for ($k = 0; $row = sql_fetch_array($list_item); $k++) {
|
|
$lists[$k] = get_list($row, $board, $board_skin_url);
|
|
}
|
|
?>
|
|
<div class="bo_list">
|
|
<?php if ($is_category) { ?>
|
|
<h2><?= $cate[$h] ?></h2>
|
|
<?php } ?>
|
|
<ul class="list_box">
|
|
<?php if (count($lists) > 0) { ?>
|
|
<?php
|
|
for ($i = 0; $i < count($lists); $i++) {
|
|
if ($is_category) {
|
|
if (($lists[$i]['ca_name'] != $cate[$h]) || ($sca && $lists[$i]['ca_name'] != $sca))
|
|
continue;
|
|
}
|
|
|
|
// 수정, 삭제 링크
|
|
$update_href = "";
|
|
$delete_href = "";
|
|
|
|
// 로그인중이고 자신의 글이라면 또는 관리자라면 패스워드를 묻지 않고 바로 수정, 삭제 가능
|
|
if (($member['mb_id'] && ($member['mb_id'] == $lists[$i]['mb_id'])) || $is_admin) {
|
|
$update_href = "./write.php?w=u&bo_table=$bo_table&wr_id={$lists[$i]['wr_id']}&page=$page" . $qstr;
|
|
$delete_href = "javascript:del('./delete.php?bo_table=$bo_table&wr_id={$lists[$i]['wr_id']}&page=$page" . urldecode($qstr) . "');";
|
|
if ($is_admin) {
|
|
$delete_href = "javascript:del('./delete.php?bo_table=$bo_table&wr_id={$lists[$i]['wr_id']}&token=$token&page=$page" . urldecode($qstr) . "');";
|
|
}
|
|
} else if (!$lists[$i]['mb_id']) { // 회원이 쓴 글이 아니라면
|
|
$update_href = "./password.php?w=u&bo_table=$bo_table&wr_id={$lists[$i]['wr_id']}&page=$page" . $qstr;
|
|
$delete_href = "./password.php?w=d&bo_table=$bo_table&wr_id={$lists[$i]['wr_id']}&page=$page" . $qstr;
|
|
}
|
|
|
|
$_link = $lists[$i]['wr_link2'] ? $lists[$i]['wr_link2'] : "javascript:void(0);";
|
|
$_secret = strstr($lists[$i]['wr_option'], 'secret') ? " secret" : "";
|
|
$_extraattr = "style=\"cursor:default;\" onclick=\"return false;\" ";
|
|
?>
|
|
<li class="bo-list">
|
|
<a href="<?= $_link ?>" target="_blank" class="link-banner<?= $_secret ?>" <?= !$lists[$i]['wr_link2'] ? $_extraattr : "" ?>>
|
|
<?php if ($lists[$i]['wr_link1']) { ?>
|
|
<img src="<?= $lists[$i]['wr_link1'] ?>" alt="<?= $lists[$i]['wr_1'] ?>">
|
|
<?php } else { ?>
|
|
<strong><?= $lists[$i]['wr_1'] ?></strong>
|
|
<?php } ?>
|
|
</a>
|
|
<p class="link-desc">
|
|
<?php if ($lists[$i]['wr_1'] && $lists[$i]['wr_link1']) {
|
|
?>
|
|
<a href="<?= $link ?>" target="_blank" <?= !$lists[$i]['wr_link2'] ? $_extraattr : "" ?>class="name">
|
|
<strong>
|
|
<?= $lists[$i]['wr_1'] ?>
|
|
</strong>
|
|
</a>
|
|
<?php } ?>
|
|
<?php if ($update_href || $delete_href) { ?>
|
|
<span class="options">
|
|
<?php if ($update_href) { ?><a href="<?= $update_href ?>">*</a><?php } ?>
|
|
<?php if ($delete_href) { ?><a href="<?= $delete_href ?>">-</a><?php } ?>
|
|
</span>
|
|
<?php } ?>
|
|
</p>
|
|
</li>
|
|
<?php } ?>
|
|
<?php } ?>
|
|
</ul>
|
|
</div>
|
|
<?php } ?>
|
|
<?php if ($board['bo_content_tail']) { ?>
|
|
<div class="content_head">
|
|
<?= stripslashes($board['bo_content_tail']); ?>
|
|
</div>
|
|
<?php } ?>
|
|
<?php if ($list_href || $is_checkbox || $write_href) { ?>
|
|
<div class="bo_fx txt-right" style="padding: 20px 0;">
|
|
<?php if ($list_href || $write_href) { ?>
|
|
<?php if ($list_href) { ?><a href="<?php echo $list_href ?>" class="ui-btn">목록</a>
|
|
<?php } ?>
|
|
<?php if ($write_href) { ?>
|
|
<a href="<?php echo $write_href ?>" class="ui-btn point">링크 추가</a>
|
|
<?php } ?>
|
|
<?php } ?>
|
|
<?php if ($admin_href) { ?>
|
|
<a href="<?= $board_skin_url ?>/set_order.php?bo_table=<?= $bo_table ?>&write_table=<?= $write_table ?>"
|
|
class="ui-btn">링크
|
|
관리
|
|
</a>
|
|
<a href="<?= $admin_href ?>" class="ui-btn admin">
|
|
관리자
|
|
</a>
|
|
<?php } ?>
|
|
</div>
|
|
<?php } ?>
|
|
</div>
|
|
<!-- } 게시판 목록 끝 -->
|