SOS 입니다...ㅠㅠ
본문
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<style>
a { color: #141478; text-decoration: none; }
a:hover { color: #0099ff; }
#page {
width: 100%;
margin: 0 auto;
background-color: #FFF;
margin-bottom: 0px;
}
.highlight {
font-size: 10px;
color: #0099ff;
}
.bar {
background-color: #111;
color: #f0f0f0;
box-shadow: 0px 0px 2px #333;
line-height: 25px;
padding: 0px 20px;
}
.bar a {
color: #DDD;
}
.bar a:hover {
color: #FFFFFF;
}
.ticker {
width: 100%;
height: 12px;
overflow: hidden;
border: 1px solid #DDD;
margin: 0;
padding: 0;
list-style: none;
border-radius: 5px;
box-shadow: 0px 0px 5px #DDD;
}
#ticker_02 {
height: 70px;
}
.ticker li {
height: 12px;
border-bottom: 1px dotted #DDD;
padding: 5px;
margin: 0px 5px;
}
.subject {
height: 12px;
font-family:dotum;
font-size:12px;
color:#333;
font-weight:bold;
}
</style>
<div id="page">
<ul id="ticker_02" class="ticker">
<? for ($i=0; $i<count($list); $i++) { ?>
<li><?
echo $list[$i]['icon_reply'] . " ";
echo "<a href='{$list[$i]['href']}'>";
if ($list[$i]['is_notice'])
echo "<font style='font-family:돋움; font-size:9pt; color:#2C88B9;'><strong>{$list[$i]['subject']}</strong></font>";
else
echo "<font style='font-family:돋움; font-size:9pt; color:#6A6A6A;'>{$list[$i]['subject']}</font>";
echo "</a>";
if ($list[$i]['comment_cnt'])
echo " <a href=\"{$list[$i]['comment_href']}\"><span style='font-family:돋움; font-size:8pt; color:#9A9A9A;'>{$list[$i]['comment_cnt']}</span></a>";
// if ($list[$i]['link']['count']) { echo "[{$list[$i]['link']['count']}]"; }
// if ($list[$i]['file']['count']) { echo "<{$list[$i]['file']['count']}>"; }
echo " " . $list[$i]['icon_new'];
echo " " . $list[$i]['icon_file'];
echo " " . $list[$i]['icon_link'];
echo " " . $list[$i]['icon_hot'];
echo " " . $list[$i]['icon_secret'];
?></li>
<? } ?>
</ul>
</div>
<script>
function tick(){
$('#ticker_01 li:first').slideUp( function () { $(this).appendTo($('#ticker_01')).slideDown(); });
}
setInterval(function(){ tick () }, 5000);
function tick2(){
$('#ticker_02 li:first').slideUp( function () { $(this).appendTo($('#ticker_02')).slideDown(); });
}
setInterval(function(){ tick2 () }, 3000);
function tick3(){
$('#ticker_03 li:first').animate({'opacity':0}, 200, function () { $(this).appendTo($('#ticker_03')).css('opacity', 1); });
}
setInterval(function(){ tick3 () }, 4000);
</script>
낮에도 물어 보았는데요..... 제 힘으로는 처리를 못해서 다시 한번 문의드립니다...ㅠ.ㅠ
위쪽 코드는 최신 글 PHP 입니다.
최신글을 첨부한 그림 처럼 구현 할려고 하는데요.
최신글 스킨의 경우 A라는 게시판의 전체 글이 표현되어 지고 있는데요.
여기에서 전체글이 아니라 현재 글쓴 사람의 글만 표현 하고 싶은데요.
어떻게 코드를 수정해야 할지 모르겠어요.
아래분이 말해 주신 라이브러리 파일도 같이 올려드려요...ㅠㅠ
<?
if (!defined('_GNUBOARD_')) exit;
// 최신글 추출
function latest($skin_dir="", $bo_table, $rows=10, $subject_len=40, $options="")
{
global $g4;
if ($skin_dir)
$latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
else
$latest_skin_path = "$g4[path]/skin/latest/basic";
$list = array();
$sql = " select * from $g4[board_table] where bo_table = '$bo_table'";
$board = sql_fetch($sql);
$tmp_write_table = $g4['write_prefix'] . $bo_table; // 게시판 테이블 전체이름
//$sql = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_id desc limit 0, $rows ";
// 위의 코드 보다 속도가 빠름
$sql = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_num limit 0, $rows ";
//explain($sql);
$result = sql_query($sql);
for ($i=0; $row = sql_fetch_array($result); $i++)
$list[$i] = get_list($row, $board, $latest_skin_path, $subject_len);
ob_start();
include "$latest_skin_path/latest.skin.php";
$content = ob_get_contents();
ob_end_clean();
return $content;
}
?>
답변 2
/bbs/board.php<--라이브러리 화일을 수정했는데 왜 이 화일에서 에러가 났을까요?
수정한 내용을 그대로 올려보세요
1. latest()함수는 기본을 사용하는 곳도 있을테니 전체를 복사해서 아래 처럼 하나더 만듭니다
2. function latest2($skin_dir="", $bo_table, $rows=10, $subject_len=40, $options=""){
~
~
수정
$sql = " select * from $tmp_write_table where wr_is_comment = 0 and mb_id='$options' order by wr_num limit 0, $rows ";
3. 아이디를 넣어서 원하는 위치에 불러옵니다
<? echo latest2(스킨, 테이블, 게시물수, 제목길이, $view[mb_id]);?>
답변을 작성하시기 전에 로그인 해주세요.