SOS 입니다...ㅠㅠ

매출이 오르면 내리는 수수료! 지금 수수료센터에서 전자결제(PG)수수료 비교견적 신청해 보세요!
SOS 입니다...ㅠㅠ

QA

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>






제목 없음.jpg
낮에도 물어 보았는데요..... 제 힘으로는 처리를 못해서 다시 한번 문의드립니다...ㅠ.ㅠ

위쪽 코드는 최신 글 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

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]);?>


select * from where wr_is_comment = 0 and mb_id='admin' order by wr_num limit 0, 3

1064 : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where wr_is_comment = 0 and mb_id='admin' order by wr_num limit 0, 3' at line 1

error file : /bbs/board.php

설명대로 하였는데요. 이런 에러가 뜨네요..ㅠㅠ

답변을 작성하시기 전에 로그인 해주세요.
전체 7
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT