skin.board.link/list.skin.php

122 lines
4.9 KiB
PHP
Raw Permalink Normal View History

2024-10-22 17:57:41 +09:00
<?php
2024-10-22 17:40:53 +09:00
if (!defined('_GNUBOARD_'))
2024-10-22 17:57:41 +09:00
exit;
2024-10-22 17:40:53 +09:00
add_stylesheet('<link rel="stylesheet" href="' . $board_skin_url . '/style.css">', 0);
2024-10-22 17:57:41 +09:00
include_once G5_LIB_PATH . '/thumbnail.lib.php';
2024-10-22 17:40:53 +09:00
if ($board['bo_table_width'] == 0)
$width = "100%";
2024-10-22 14:27:23 +09:00
2024-10-22 17:40:53 +09:00
$cate = array();
$lists = array();
2024-10-22 14:27:23 +09:00
?>
2024-10-22 17:40:53 +09:00
<div class="board-skin-basic theme-box" style="max-width:<?= $width ?>;">
2024-10-22 17:57:41 +09:00
<?php if ($board['bo_content_head']) { ?>
2024-10-22 17:40:53 +09:00
<div class="content_head">
<?= stripslashes($board['bo_content_head']); ?>
</div>
2024-10-22 17:57:41 +09:00
<?php } ?>
<?php
2024-10-22 17:40:53 +09:00
if ($is_category) {
$cate = explode('|', $board['bo_category_list']);
}
2024-10-23 00:08:19 +09:00
2024-10-22 17:40:53 +09:00
for ($h = 0; $h <= count($cate); $h++) {
if (count($cate) > 0 && $h == count($cate))
continue;
2024-10-23 00:08:19 +09:00
$list_item = sql_query("SELECT * FROM {$write_table} WHERE wr_reply='' AND wr_is_comment=0 ORDER BY wr_10*1, wr_id");
2024-10-22 17:40:53 +09:00
for ($k = 0; $row = sql_fetch_array($list_item); $k++) {
$lists[$k] = get_list($row, $board, $board_skin_url);
}
?>
<div class="bo_list">
2024-10-22 17:57:41 +09:00
<?php if ($is_category) { ?>
<h2><?= $cate[$h] ?></h2>
<?php } ?>
2024-10-22 17:40:53 +09:00
<ul class="list_box">
2024-10-23 00:08:19 +09:00
<?php if (count($lists) > 0) { ?>
2024-10-22 17:57:41 +09:00
<?php
2024-10-23 00:08:19 +09:00
for ($i = 0; $i < count($lists); $i++) {
if ($is_category) {
if (($lists[$i]['ca_name'] != $cate[$h]) || ($sca && $lists[$i]['ca_name'] != $sca))
continue;
}
2024-10-22 14:27:23 +09:00
2024-10-23 00:08:19 +09:00
// 수정, 삭제 링크
$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) . "');";
2024-10-22 17:40:53 +09:00
}
2024-10-23 00:08:19 +09:00
} 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 } ?>
2024-10-22 17:57:41 +09:00
</ul>
</div>
<?php } ?>
<?php if ($board['bo_content_tail']) { ?>
2024-10-22 17:40:53 +09:00
<div class="content_head">
<?= stripslashes($board['bo_content_tail']); ?>
</div>
2024-10-22 17:57:41 +09:00
<?php } ?>
<?php if ($list_href || $is_checkbox || $write_href) { ?>
2024-10-22 17:40:53 +09:00
<div class="bo_fx txt-right" style="padding: 20px 0;">
2024-10-22 17:57:41 +09:00
<?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 } ?>
2024-10-22 17:40:53 +09:00
</div>
2024-10-22 17:57:41 +09:00
<?php } ?>
</div>
2024-10-22 14:27:23 +09:00
<!-- } 게시판 목록 -->