리스트정렬 질문 드림니다.
본문
리스트에서 재생목록옆에 최신순정렬 버튼 넣코 리스트 최근업데이트 순서로 정렬하고싶은데요
여유되시는분들 가르쳐주세요?
어디부근을 수정해야 하나요,,
아래 자료를 사용하엿습니다.
링크하고 뷰 코드 입니다.
https://sir.kr/g5_skin/15119?sfl=wr_subject%7C%7Cwr_content&stx=%EB%93%9C%EB%9D%BC%EB%A7%88
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
include_once(G5_LIB_PATH.'/thumbnail.lib.php');
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0);
if ($admin_href) {
if($config[cf_10]=="g5_video_list"){}else{
// Name of the file
$filename = "$board_skin_url/g5_video_list.sql";
// Connect to MySQL server
//mysql_connect($mysql_host, $mysql_username, $mysql_password) or die('Error connecting to MySQL server: ' . mysql_error());
// Select database
//mysql_select_db($mysql_database) or die('Error selecting MySQL database: ' . mysql_error());
// Temporary variable, used to store current query
$templine = '';
// Read in entire file
$lines = file($filename);
// Loop through each line
foreach ($lines as $line)
{
// Skip it if it's a comment
if (substr($line, 0, 2) == '--' || $line == '')
continue;
// Add this line to the current segment
$templine .= $line;
// If it has a semicolon at the end, it's the end of the query
if (substr(trim($line), -1, 1) == ';')
{
// Perform the query
sql_query($templine) or print('Error performing query \'<strong>' . $templine . '\': ' . sql_error() . '<br /><br />');
// Reset temp variable to empty
$templine = '';
}
}
$sql = " update g5_config
set cf_10_subj = '영상기능',
cf_10 = 'g5_video_list'";
$sql_query=sql_query($sql);
echo "<script>document.location.href='/bbs/board.php?bo_table=$_GET[bo_table]&wr_id=$_GET[wr_id]'</script>";
}
///////////등록/////////
$bo_table =$_POST[bo_table];
$wr_id =$_POST[wr_id];
$wr_subject =$_POST[wr_subject];
$id =$_POST[id];
$wr_link1 =$_POST[wr_link1];
$wr_link2 =$_POST[wr_link2];
$wr_link3 =$_POST[wr_link3];
$wr_datetime =date('Y-m-j h:i:s');
if($_POST[type]=="new"){
$sql = " insert into g5_video_list
set bo_table = '$bo_table',
wr_id = '$wr_id',
wr_subject = '$wr_subject',
wr_link1 = '$wr_link1',
wr_link2 = '$wr_link2',
wr_datetime = '$wr_datetime'";
$sql_query=sql_query($sql);
echo "<script>alert('등록되였습니다..');window.location='/bbs/board.php?bo_table=$bo_table&wr_id=$wr_id'</script>";
///////////위치등록끝/////////
}else if($_POST[type]=="update"){
///////////위치수정/////////
$sql = " update g5_video_list
set bo_table = '$bo_table',
wr_id = '$wr_id',
wr_subject = '$wr_subject',
wr_link1 = '$wr_link1',
wr_link2 = '$wr_link2'
where id = '$id' ";
$sql_query=sql_query($sql);
echo "<script>alert('수정되였습니다.');window.location='/bbs/board.php?bo_table=$bo_table&wr_id=$wr_id'</script>";
}
}
?>
<style>
@font-face { /* 나눔고딕 Regular */
font-family: 'Nanum Gothic';
font-style: normal;
font-weight: 400;
src: url(//fonts.gstatic.com/ea/nanumgothic/v5/NanumGothic-Regular.eot);
src: url(//fonts.gstatic.com/ea/nanumgothic/v5/NanumGothic-Regular.eot?#iefix) format('embedded-opentype'),
url(//fonts.gstatic.com/ea/nanumgothic/v5/NanumGothic-Regular.woff2) format('woff2'),
url(//fonts.gstatic.com/ea/nanumgothic/v5/NanumGothic-Regular.woff) format('woff'),
url(//fonts.gstatic.com/ea/nanumgothic/v5/NanumGothic-Regular.ttf) format('truetype');
}
@font-face { /* 나눔고딕 Bold */
font-family: 'Nanum Gothic';
font-style: normal;
font-weight: 700;
src: url(//fonts.gstatic.com/ea/nanumgothic/v5/NanumGothic-Bold.eot);
src: url(//fonts.gstatic.com/ea/nanumgothic/v5/NanumGothic-Bold.eot?#iefix) format('embedded-opentype'),
url(//fonts.gstatic.com/ea/nanumgothic/v5/NanumGothic-Bold.woff2) format('woff2'),
url(//fonts.gstatic.com/ea/nanumgothic/v5/NanumGothic-Bold.woff) format('woff'),
url(//fonts.gstatic.com/ea/nanumgothic/v5/NanumGothic-Bold.ttf) format('truetype');
}
@font-face { /* 나눔고딕 ExtraBold */
font-family: 'Nanum Gothic';
font-style: normal;
font-weight: 800;
src: url(//fonts.gstatic.com/ea/nanumgothic/v5/NanumGothic-ExtraBold.eot);
src: url(//fonts.gstatic.com/ea/nanumgothic/v5/NanumGothic-ExtraBold.eot?#iefix) format('embedded-opentype'),
url(//fonts.gstatic.com/ea/nanumgothic/v5/NanumGothic-ExtraBold.woff2) format('woff2'),
url(//fonts.gstatic.com/ea/nanumgothic/v5/NanumGothic-ExtraBold.woff) format('woff'),
url(//fonts.gstatic.com/ea/nanumgothic/v5/NanumGothic-ExtraBold.ttf) format('truetype');
}
html, body {
font-family: 'Nanum Gothic', sans-serif;
white-space: normal;
}
select {margin:0; font-family: 'Nanum Gothic', sans-serif; border: 1px solid #ccc; width: 140px; height: 38px; padding: 5px; 10px; }
.title{border-bottom:solid 2px #202020; font-size: 13px; font-family: 'Nanum Gothic', sans-serif; font-weight: 800; color: #000; padding-bottom:9px; padding-top: 33px;}
.list_content{border-bottom:solid 1px #e6e6e6; font-family: 'Nanum Gothic', sans-serif; height:58px;}
.td_1{ font-family: 'Nanum Gothic', sans-serif; width: 104px; height:50px; border-top: solid 1px #e9e9e9; border-right: solid 1px #e9e9e9; background-color: #fafafa; color: #000000; padding-left: 12px; font-size: 13px; font-weight: 800;}
.td_2{ font-family: 'Nanum Gothic', sans-serif; width: 261px; height:50px; border-top: solid 1px #e9e9e9; padding-left: 10px;}
.td_3{ font-family: 'Nanum Gothic', sans-serif; width: 104px; height:50px; border-top: solid 1px #e9e9e9; border-right: solid 1px #e9e9e9; background-color: #fafafa; color: #000000; padding-left: 12px; font-size: 13px; font-weight: 800; border-bottom: solid 1px #e9e9e9;}
.td_4{ font-family: 'Nanum Gothic', sans-serif; width: 261px; height:50px; border-top: solid 1px #e9e9e9; border-bottom: solid 1px #e9e9e9; padding-left: 10px;}
.input1{border: solid 0px; background-color:#e9e9e9; width: 540px; height: 38px;}
.input2{border: solid 0px; background-color:#e9e9e9; height: 38px;}
</style>
<script src="<?php echo G5_JS_URL; ?>/viewimageresize.js"></script>
<!-- 게시물 읽기 시작 { -->
<div id="bo_v_table"><?php echo $board['bo_subject']; ?></div>
<article id="bo_v" style="width:<?php echo $width; ?>">
<header>
<h1 id="bo_v_title">
<?php
if ($category_name) echo $view['ca_name'].' / '; // 분류 출력 끝
echo cut_str(get_text($view['wr_subject']), 70); // 글제목 출력
?>
</h1>
</header>
<section id="bo_v_info">
<h2>페이지 정보</h2>
작성자 <strong><?php echo $view['name'] ?><?php if ($is_ip_view) { echo " ($ip)"; } ?></strong>
<span class="sound_only">작성일</span><strong><?php echo date("y-m-d H:i", strtotime($view['wr_datetime'])) ?></strong>
조회<strong><?php echo number_format($view['wr_hit']) ?>회</strong>
댓글<strong><?php echo number_format($view['wr_comment']) ?>건</strong>
</section>
<!-- 게시물 상단 버튼 시작 { -->
<div id="bo_v_top">
<?php
ob_start();
?>
<?php if ($prev_href || $next_href) { ?>
<ul class="bo_v_nb">
<?php if ($prev_href) { ?><li><a href="<?php echo $prev_href ?>" class="btn_b01">이전글</a></li><?php } ?>
<?php if ($next_href) { ?><li><a href="<?php echo $next_href ?>" class="btn_b01">다음글</a></li><?php } ?>
</ul>
<?php } ?>
<ul class="bo_v_com">
<?php if ($update_href) { ?><li><a href="<?php echo $update_href ?>" class="btn_b01">수정</a></li><?php } ?>
<?php if ($delete_href) { ?><li><a href="<?php echo $delete_href ?>" class="btn_b01" onclick="del(this.href); return false;">삭제</a></li><?php } ?>
<?php if ($copy_href) { ?><li><a href="<?php echo $copy_href ?>" class="btn_admin" onclick="board_move(this.href); return false;">복사</a></li><?php } ?>
<?php if ($move_href) { ?><li><a href="<?php echo $move_href ?>" class="btn_admin" onclick="board_move(this.href); return false;">이동</a></li><?php } ?>
<?php if ($search_href) { ?><li><a href="<?php echo $search_href ?>" class="btn_b01">검색</a></li><?php } ?>
<li><a href="<?php echo $list_href ?>" class="btn_b01">목록</a></li>
<?php if ($reply_href) { ?><li><a href="<?php echo $reply_href ?>" class="btn_b01">답변</a></li><?php } ?>
<?php if ($write_href) { ?><li><a href="<?php echo $write_href ?>" class="btn_b02">글쓰기</a></li><?php } ?>
</ul>
<?php
$link_buttons = ob_get_contents();
ob_end_flush();
?>
</div>
<!-- } 게시물 상단 버튼 끝 -->
<? if ($admin_href) { ?>
<? if($_GET[w]==""){?>
<a href="/bbs/board.php?bo_table=<?=$_GET[bo_table]?>&wr_id=<?=$_GET[wr_id]?>&w=w"><button style="padding: 10px; background-color: #f50c0c; color: #fff; border: solid 0px;">회수등록하기</button></a>
<? } ?>
<div style="height: 20px;"></div>
<? if($_GET[w]=="w" || $_GET[w]=="u"){?>
<form method="post" action="" onSubmit="return InputCheck(this)" enctype="multipart/form-data">
<? if($_GET[w]=="w"){?>
<input type="hidden" name="type" value="new">
<input type="hidden" name="bo_table" value="<?=$_GET[bo_table]?>">
<input type="hidden" name="wr_id" value="<?=$_GET[wr_id]?>">
<? }else if($_GET[w]=="u"){ ?>
<?
$user_query = sql_query("select * from g5_video_list where id = '$_GET[id]' limit 1");
$video = sql_fetch_array($user_query);
?>
<input type="hidden" name="type" value="update">
<input type="hidden" name="id" value="<?=$_GET[id]?>">
<input type="hidden" name="bo_table" value="<?=$_GET[bo_table]?>">
<input type="hidden" name="wr_id" value="<?=$_GET[wr_id]?>">
<? } ?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="td_1">회수입력</td>
<td class="td_2"><input type="text" name="wr_subject" style="padding-left:10px; padding-right: 10px;" value="<?=$video[wr_subject]?>" class="input1" placeholder="例:2017/07/11 (제1회)"></td>
</tr>
<tr>
<td class="td_1">영상링크1</td>
<td class="td_2"><input type="text" name="wr_link1" style="padding-left:10px; padding-right: 10px;" value="<?=$video[wr_link1]?>" class="input1" placeholder="例:http://www.dailymotion.com/embed/video/x5stqq3"></td>
</tr>
<tr>
<td class="td_1">영상링크2</td>
<td class="td_2"><input type="text" name="wr_link2" style="padding-left:10px; padding-right: 10px;" value="<?=$video[wr_link2]?>" class="input1" placeholder="例:https://www.youtube.com/embed/PMrFkTwf7jo"></td>
</tr>
</tbody>
</table>
<div style="margin: auto; width: 100px; padding-top: 10px; padding-bottom: 15px;">
<? if($_GET[w]=="w"){?>
<input type="submit" value="등록하기" id="btn_submit" accesskey="s" style="padding: 10px; background-color: #f50c0c; color: #fff; border: solid 0px;">
<? }else{ ?>
<input type="submit" value="수정하기" id="btn_submit" accesskey="s" style="padding: 10px; background-color: #f50c0c; color: #fff; border: solid 0px;">
<? } ?>
</div>
</form>
<? } ?>
<? } ?>
<table width="100%" border="0" cellspacing="0" cellpadding="0" style="max-width: 980px; margin: auto;">
<tbody>
<tr>
<td height="490" valign="top" background="http://image.tupian114.com/20140522/10001986.png" style="background-color: #FFFFFF;">
<?
$view_query = sql_query("select * from g5_video_list where id = '$_GET[list]' limit 1");
$vplyer = sql_fetch_array($view_query);
if($_GET[plyer]=="1"){ $vcontent=$vplyer[wr_link1];
}else if($_GET[plyer]=="2"){ $vcontent=$vplyer[wr_link2];
}else if($_GET[plyer]=="3"){ $vcontent=$vplyer[wr_link3];}
?>
<iframe width="100%" height="490" src="<?=$vcontent?>" frameborder="0" allowfullscreen></iframe>
</td>
<td width="180" height="490" valign="top" style="background-color: #252525;">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="73" height="40" align="center" style="color: #ffffff;">재생목록</td>
<td style="background-color: #1b1b1b;"> </td>
</tr>
<tr>
<td colspan="2" style="padding: 7px;">
<div style="height:450px; overflow:auto;">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tbody>
<?
$video_list = sql_query("select * from g5_video_list where bo_table ='$_GET[bo_table]' and wr_id ='$_GET[wr_id]' ORDER BY wr_datetime DESC ");
for ($i; $list=sql_fetch_array($video_list); $i++) {
?>
<tr>
<td height="25" style=" color: #999999;"><?=$list[wr_subject]?></td>
<td><? if($list[wr_link2]){?><a href="/bbs/board.php?bo_table=<?=$_GET[bo_table]?>&wr_id=<?=$_GET[wr_id]?>&list=<?=$list[id]?>&plyer=2"><button style="padding:1px; border: background-color: #d20d0d0; color: #000000;">HD2</button></a><? } ?></td>
<td><? if($list[wr_link1]){?><a href="/bbs/board.php?bo_table=<?=$_GET[bo_table]?>&wr_id=<?=$_GET[wr_id]?>&list=<?=$list[id]?>&plyer=1"><button style="padding:1px; border: background-color: #d20d0d0; color: #000000;">HD1</button></a><? } ?></td>
<? if ($admin_href) { ?>
<td><a href="/bbs/board.php?bo_table=<?=$_GET[bo_table]?>&wr_id=<?=$_GET[wr_id]?>&w=u&id=<?=$list[id]?>"><button style="padding:2px; border: solid 0px; background-color: #757575; color: #ffffff;">수정</button></a></td>
<? } ?>
</tr>
<? } ?>
</tbody>
</table>
</div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<section id="bo_v_atc">
<h2 id="bo_v_atc_title">본문</h2>
<br>
<br>
<br>
<?php if ($is_signature) { ?><p><?php echo $signature ?></p><?php } ?>
<!-- 스크랩 추천 비추천 시작 { -->
<?php if ($scrap_href || $good_href || $nogood_href) { ?>
<div id="bo_v_act">
<?php if ($scrap_href) { ?><a href="<?php echo $scrap_href; ?>" target="_blank" class="btn_b01" onclick="win_scrap(this.href); return false;">스크랩</a><?php } ?>
<?php if ($good_href) { ?>
<span class="bo_v_act_gng">
<a href="<?php echo $good_href.'&'.$qstr ?>" id="good_button" class="btn_b01">추천 <strong><?php echo number_format($view['wr_good']) ?></strong></a>
<b id="bo_v_act_good"></b>
</span>
<?php } ?>
<?php if ($nogood_href) { ?>
<span class="bo_v_act_gng">
<a href="<?php echo $nogood_href.'&'.$qstr ?>" id="nogood_button" class="btn_b01">비추천 <strong><?php echo number_format($view['wr_nogood']) ?></strong></a>
<b id="bo_v_act_nogood"></b>
</span>
<?php } ?>
</div>
<?php } else {
if($board['bo_use_good'] || $board['bo_use_nogood']) {
?>
<div id="bo_v_act">
<?php if($board['bo_use_good']) { ?><span>추천 <strong><?php echo number_format($view['wr_good']) ?></strong></span><?php } ?>
<?php if($board['bo_use_nogood']) { ?><span>비추천 <strong><?php echo number_format($view['wr_nogood']) ?></strong></span><?php } ?>
</div>
<?php
}
}
?>
<!-- } 스크랩 추천 비추천 끝 -->
</section>
<?php
include_once(G5_SNS_PATH."/view.sns.skin.php");
?>
<?php
// 코멘트 입출력
include_once(G5_BBS_PATH.'/view_comment.php');
?>
<!-- 링크 버튼 시작 { -->
<div id="bo_v_bot">
<?php echo $link_buttons ?>
</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();
});
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>
<!-- } 게시글 읽기 끝 -->
답변을 작성하시기 전에 로그인 해주세요.