update
This commit is contained in:
parent
c9b65efbf3
commit
90dd3e7113
4 changed files with 131 additions and 123 deletions
104
list.skin.php
104
list.skin.php
|
|
@ -19,11 +19,12 @@ $lists = array();
|
||||||
if ($is_category) {
|
if ($is_category) {
|
||||||
$cate = explode('|', $board['bo_category_list']);
|
$cate = explode('|', $board['bo_category_list']);
|
||||||
}
|
}
|
||||||
|
|
||||||
for ($h = 0; $h <= count($cate); $h++) {
|
for ($h = 0; $h <= count($cate); $h++) {
|
||||||
if (count($cate) > 0 && $h == count($cate))
|
if (count($cate) > 0 && $h == count($cate))
|
||||||
continue;
|
continue;
|
||||||
$list_item = sql_query("select * from {$write_table} where wr_reply='' and wr_is_comment=0 order by wr_10*1, wr_id");
|
|
||||||
|
|
||||||
|
$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++) {
|
for ($k = 0; $row = sql_fetch_array($list_item); $k++) {
|
||||||
$lists[$k] = get_list($row, $board, $board_skin_url);
|
$lists[$k] = get_list($row, $board, $board_skin_url);
|
||||||
}
|
}
|
||||||
|
|
@ -33,57 +34,61 @@ $lists = array();
|
||||||
<h2><?= $cate[$h] ?></h2>
|
<h2><?= $cate[$h] ?></h2>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<ul class="list_box">
|
<ul class="list_box">
|
||||||
|
<?php if (count($lists) > 0) { ?>
|
||||||
<?php
|
<?php
|
||||||
if (count($lists) > 0) {
|
for ($i = 0; $i < count($lists); $i++) {
|
||||||
for ($i = 0; $i < count($lists); $i++) {
|
if ($is_category) {
|
||||||
// 수정, 삭제 링크
|
if (($lists[$i]['ca_name'] != $cate[$h]) || ($sca && $lists[$i]['ca_name'] != $sca))
|
||||||
$update_href = $delete_href = "";
|
continue;
|
||||||
// 로그인중이고 자신의 글이라면 또는 관리자라면 패스워드를 묻지 않고 바로 수정, 삭제 가능
|
}
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($is_category) {
|
// 수정, 삭제 링크
|
||||||
if (($lists[$i]['ca_name'] != $cate[$h]) || ($sca && $lists[$i]['ca_name'] != $sca))
|
$update_href = "";
|
||||||
continue;
|
$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) . "');";
|
||||||
}
|
}
|
||||||
$_link = $lists[$i]['wr_link2'] ? $lists[$i]['wr_link2'] : "javascript:void(0);";
|
} else if (!$lists[$i]['mb_id']) { // 회원이 쓴 글이 아니라면
|
||||||
$_secret = strstr($lists[$i]['wr_option'], 'secret') ? " secret" : "";
|
$update_href = "./password.php?w=u&bo_table=$bo_table&wr_id={$lists[$i]['wr_id']}&page=$page" . $qstr;
|
||||||
$_extraattr = "style=\"cursor:default;\" onclick=\"return false;\" ";
|
$delete_href = "./password.php?w=d&bo_table=$bo_table&wr_id={$lists[$i]['wr_id']}&page=$page" . $qstr;
|
||||||
?>
|
}
|
||||||
<li class="bo-list">
|
|
||||||
<a href="<?= $_link ?>" target="_blank" class="link-banner<?= $_secret ?>" <?= !$lists[$i]['wr_link2'] ? $_extraattr : "" ?>>
|
$_link = $lists[$i]['wr_link2'] ? $lists[$i]['wr_link2'] : "javascript:void(0);";
|
||||||
<?php if ($lists[$i]['wr_link1']) { ?>
|
$_secret = strstr($lists[$i]['wr_option'], 'secret') ? " secret" : "";
|
||||||
<img src="<?= $lists[$i]['wr_link1'] ?>" alt="<?= $lists[$i]['wr_1'] ?>">
|
$_extraattr = "style=\"cursor:default;\" onclick=\"return false;\" ";
|
||||||
<?php } else { ?>
|
?>
|
||||||
<strong><?= $lists[$i]['wr_1'] ?></strong>
|
<li class="bo-list">
|
||||||
<?php } ?>
|
<a href="<?= $_link ?>" target="_blank" class="link-banner<?= $_secret ?>" <?= !$lists[$i]['wr_link2'] ? $_extraattr : "" ?>>
|
||||||
</a>
|
<?php if ($lists[$i]['wr_link1']) { ?>
|
||||||
<p class="link-desc">
|
<img src="<?= $lists[$i]['wr_link1'] ?>" alt="<?= $lists[$i]['wr_1'] ?>">
|
||||||
<?php if ($lists[$i]['wr_1'] && $lists[$i]['wr_link1']) {
|
<?php } else { ?>
|
||||||
?>
|
<strong><?= $lists[$i]['wr_1'] ?></strong>
|
||||||
<a href="<?= $link ?>" target="_blank" <?= !$lists[$i]['wr_link2'] ? $_extraattr : "" ?>class="name">
|
<?php } ?>
|
||||||
<strong>
|
</a>
|
||||||
<?= $lists[$i]['wr_1'] ?>
|
<p class="link-desc">
|
||||||
</strong>
|
<?php if ($lists[$i]['wr_1'] && $lists[$i]['wr_link1']) {
|
||||||
</a>
|
?>
|
||||||
<?php } ?>
|
<a href="<?= $link ?>" target="_blank" <?= !$lists[$i]['wr_link2'] ? $_extraattr : "" ?>class="name">
|
||||||
<?php if ($update_href || $delete_href) { ?>
|
<strong>
|
||||||
<span class="options">
|
<?= $lists[$i]['wr_1'] ?>
|
||||||
<?php if ($update_href) { ?><a href="<?= $update_href ?>">*</a><?php } ?>
|
</strong>
|
||||||
<?php if ($delete_href) { ?><a href="<?= $delete_href ?>">-</a><?php } ?>
|
</a>
|
||||||
</span>
|
<?php } ?>
|
||||||
<?php } ?>
|
<?php if ($update_href || $delete_href) { ?>
|
||||||
</p>
|
<span class="options">
|
||||||
</li><?php }
|
<?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>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
@ -113,5 +118,4 @@ $lists = array();
|
||||||
</div>
|
</div>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- } 게시판 목록 끝 -->
|
<!-- } 게시판 목록 끝 -->
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@
|
||||||
|
|
||||||
### 주요 수정 사항
|
### 주요 수정 사항
|
||||||
- short open tag 제거
|
- short open tag 제거
|
||||||
|
- list.skin.php 수정
|
||||||
|
|
||||||
모든 아보카도 버전에 호환됩니다.
|
모든 아보카도 버전에 호환됩니다.
|
||||||
|
|
||||||
|
|
|
||||||
125
set_order.php
125
set_order.php
|
|
@ -1,73 +1,74 @@
|
||||||
<?php
|
<?php
|
||||||
include_once "./_common.php";
|
include_once "./_common.php";
|
||||||
include_once G5_PATH . "/head.sub.php";
|
include_once G5_PATH . "/head.sub.php";
|
||||||
|
|
||||||
add_stylesheet('<link rel="stylesheet" href="' . $board_skin_url . '/style.css">', 0);
|
add_stylesheet('<link rel="stylesheet" href="' . $board_skin_url . '/style.css">', 0);
|
||||||
if ($board['bo_write_level'] <= $member['mb_level']) {
|
|
||||||
?>
|
if ($board['bo_write_level'] <= $member['mb_level']) { ?>
|
||||||
<form action="<?= $board_skin_url ?>/set_order_update.php" name="orders" method="post" autocomplete="off">
|
<form action="<?= $board_skin_url ?>/set_order_update.php" name="orders" method="post" autocomplete="off">
|
||||||
<input type="hidden" name="bo_table" value="<?= $bo_table ?>">
|
<input type="hidden" name="bo_table" value="<?= $bo_table ?>">
|
||||||
<input type="hidden" name="write_table" value="<?= $write_table ?>">
|
<input type="hidden" name="write_table" value="<?= $write_table ?>">
|
||||||
<div style="max-width:1000px;margin:10px auto;">
|
<div style="max-width:1000px;margin:10px auto;">
|
||||||
<table class="theme-form">
|
<table class="theme-form">
|
||||||
<colgroup>
|
<colgroup>
|
||||||
|
<?php if ($board['bo_use_category'] && $board['bo_category_list']) { ?>
|
||||||
|
<col style="width:100px;">
|
||||||
|
<?php } ?>
|
||||||
|
<col style="width:150px;">
|
||||||
|
<col>
|
||||||
|
<col>
|
||||||
|
<col style="width:80px;">
|
||||||
|
</colgroup>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
<?php if ($board['bo_use_category'] && $board['bo_category_list']) { ?>
|
<?php if ($board['bo_use_category'] && $board['bo_category_list']) { ?>
|
||||||
<col style="width:100px;">
|
<th>카테고리</th>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<col style="width:150px;">
|
<th>제목</th>
|
||||||
<col>
|
<th>배너</th>
|
||||||
<col>
|
<th>링크</th>
|
||||||
<col style="width:80px;">
|
<th>순서</th>
|
||||||
</colgroup>
|
</tr>
|
||||||
<tbody>
|
<?php
|
||||||
|
$order = sql_query("SELECT * FROM {$write_table} ORDER BY wr_10*1, wr_id");
|
||||||
|
for ($i = 0; $row = sql_fetch_array($order); $i++) { ?>
|
||||||
<tr>
|
<tr>
|
||||||
<?php if ($board['bo_use_category'] && $board['bo_category_list']) { ?>
|
<?php if ($board['bo_use_category'] && $board['bo_category_list']) { ?>
|
||||||
<th>카테고리</th>
|
<td>
|
||||||
<?php } ?>
|
<select name="category[<?= $row['wr_id'] ?>]">
|
||||||
<th>제목</th>
|
<option value="">카테고리</option>
|
||||||
<th>배너</th>
|
<?php
|
||||||
<th>링크</th>
|
$cate = explode('|', $board['bo_category_list']);
|
||||||
<th>순서</th>
|
for ($h = 0; $h < count($cate); $h++) { ?>
|
||||||
|
<option value="<?= $cate[$h] ?>" <?= $row['ca_name'] == $cate[$h] ? "selected" : ""; ?>>
|
||||||
|
<?= $cate[$h] ?>
|
||||||
|
</option>
|
||||||
|
<?php } ?>
|
||||||
|
</select>
|
||||||
|
<?php } ?>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" name="subject[<?= $row['wr_id'] ?>]" value="<?= $row['wr_1'] ?>" style="width:100%;">
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" name="banner[<?= $row['wr_id'] ?>]" value="<?= $row['wr_link1'] ?>" style="width:100%;">
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" name="link[<?= $row['wr_id'] ?>]" value="<?= $row['wr_link2'] ?>" style="width:100%;">
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" name="order[<?= $row['wr_id'] ?>]" value="<?= $row['wr_10'] ?>" size="4">
|
||||||
|
<input type="hidden" name="idx[]" value="<?= $row['wr_id'] ?>">
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php } ?>
|
||||||
$order = sql_query("select * from {$write_table} order by wr_10*1, wr_id");
|
</tbody>
|
||||||
for ($i = 0; $row = sql_fetch_array($order); $i++) { ?>
|
</table>
|
||||||
<tr>
|
<br>
|
||||||
<?php if ($board['bo_use_category'] && $board['bo_category_list']) { ?>
|
<div style="float:right;">
|
||||||
<td>
|
<button type="submit" class="ui-btn point">확인</button>
|
||||||
<select name="category[<?= $row['wr_id'] ?>]">
|
<a href="<?= G5_BBS_URL ?>/board.php?bo_table=<?= $bo_table ?>" class="ui-btn">목록으로</a>
|
||||||
<option value="">카테고리</option>
|
|
||||||
<?php
|
|
||||||
$cate = explode('|', $board['bo_category_list']);
|
|
||||||
for ($h = 0; $h < count($cate); $h++) { ?>
|
|
||||||
<option value="<?= $cate[$h] ?>" <?= $row['ca_name'] == $cate[$h] ? "selected" : ""; ?>>
|
|
||||||
<?= $cate[$h] ?>
|
|
||||||
</option>
|
|
||||||
<?php } ?>
|
|
||||||
</select>
|
|
||||||
<?php } ?>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<input type="text" name="subject[<?= $row['wr_id'] ?>]" value="<?= $row['wr_1'] ?>" style="width:100%;">
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<input type="text" name="banner[<?= $row['wr_id'] ?>]" value="<?= $row['wr_link1'] ?>" style="width:100%;">
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<input type="text" name="link[<?= $row['wr_id'] ?>]" value="<?= $row['wr_link2'] ?>" style="width:100%;">
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<input type="text" name="order[<?= $row['wr_id'] ?>]" value="<?= $row['wr_10'] ?>" size="4">
|
|
||||||
<input type="hidden" name="idx[]" value="<?= $row['wr_id'] ?>">
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<?php } ?>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
<br>
|
|
||||||
<div style="float:right;">
|
|
||||||
<button type="submit" class="ui-btn point">확인</button>
|
|
||||||
<a href="<?= G5_BBS_URL ?>/board.php?bo_table=<?= $bo_table ?>" class="ui-btn">목록으로</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</div>
|
||||||
|
</form>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,19 @@
|
||||||
<?php
|
<?php
|
||||||
include_once "./_common.php";
|
include_once "./_common.php";
|
||||||
|
|
||||||
for ($i = 0; $i < count($idx); $i++) {
|
if (is_array($idx)) {
|
||||||
$k = $idx[$i];
|
for ($i = 0; $i < count($idx); $i++) {
|
||||||
sql_query("update {$write_table}
|
$k = $idx[$i];
|
||||||
set wr_10 = '{$order[$k]}',
|
sql_query("UPDATE {$write_table}
|
||||||
wr_1 = '{$subject[$k]}',
|
SET wr_10 = '{$order[$k]}',
|
||||||
wr_link1='{$banner[$k]}',
|
wr_1 = '{$subject[$k]}',
|
||||||
wr_link2='{$link[$k]}'
|
wr_link1='{$banner[$k]}',
|
||||||
where wr_id='{$k}'
|
wr_link2='{$link[$k]}'
|
||||||
");
|
WHERE wr_id='{$k}'
|
||||||
if ($board['bo_use_category'] && $board['bo_category_list'] && $category[$k] != '') {
|
");
|
||||||
sql_query("update {$write_table} set ca_name='{$category[$k]}' where wr_id='{$k}'");
|
if ($board['bo_use_category'] && $board['bo_category_list'] && $category[$k] != '') {
|
||||||
|
sql_query("update {$write_table} set ca_name='{$category[$k]}' where wr_id='{$k}'");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue