최근게시물 앞부분의 그룹게시판 지우는방법? > 그누4 질문답변

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.

최근게시물 앞부분의 그룹게시판 지우는방법? 정보

최근게시물 앞부분의 그룹게시판 지우는방법?

본문

 
 
이 주소의 최근게시물 쓸려고 합니다.
 
위에 그림처럼..
 
게시그룹 앞에 이름{청보산악회...} 이랑, 뒤에 {년도, 날짜} 지울려고 하는데요?
 
두개의 파일중에서 어디서 지워야 하나요?
latest.skin.php
new_scroll_latest.lib.php
 
 
 
latest.skin.php
 
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
// 위로 스크롤되는 최신글
// 사용법 :
// 스킨, 게시판아이디, 출력라인, 글자수, "몇개라인,라인높이"
// latest($skin_dir="", $bo_table, $rows=10, $subject_len=40, $options="")
// $rows(출력라인)는 $line_mod의 2의 배수 이상으로 설정하셔야 합니다.
// 유니크 값 (최신글은 한페이지에 여러개 둘 수 있으므로... 자바스크립트에서 함수, 변수 충돌을 방지)
$uni = md5(uniqid(rand(), true));
list($line_mod, $height) = explode(",", $options);
$box_height = (int)$line_mod * (int)$height;
?>
<table width=350 cellpadding=0 cellspacing=0 border=0>
<tr>
<td>
<div style="background: #FFFFFF">
<table width=400 cellpadding=0 cellspacing=0 border=0>
<colgroup width=14>
<colgroup>
<colgroup width=37>
<colgroup width=14>
<tr><td>
<table width=400 cellpadding=0 cellspacing=0>
   <tr>
<td width=400 align=center><a href="./bbs/new.php"><img src="<?=$latest_skin_path?>/img/bg.gif" align=absmiddle border=0></a></td>
<td height=40 align=center>
   <table border="0" cellpadding="0" cellspacing="0">
                  <tr>  
                   <td width=400 height=25></td>
                   </tr>
                 </table></td>
    <td align='right'></td></tr>
   <tr><td colspan=3 align=center><table id=new_all width=98% cellpadding=0 cellspacing=0 bgcolor=#EAEAD0><tr><td style='padding:4px;'>
                <nobr style=display:block; overflow:hidden; width:350;>

<? if (count($list) == 0) { ?>
    <tr><td colspan=4 align=center height=50>게시물이 없습니다.</td></tr>
<? } else { ?>
    <script language="javascript">
    var roll_height_<?=$uni?> = <?=$box_height?>;
    var total_area_<?=$uni?> = 0;
    var wait_flag_<?=$uni?> = true;
    var bMouseOver_<?=$uni?> = 1;
    var roll_speed_<?=$uni?> = 1;
    var waitingtime_<?=$uni?> = 3000;
    var s_tmp_<?=$uni?> = 0;
    var s_amount_<?=$uni?> = <?=(int)$height?>;
    var roll_text_<?=$uni?> = new Array();
    var startPanel_<?=$uni?> = 0;
    var n_panel_<?=$uni?> = 0;
    var i_<?=$uni?> = 0;
    function start_roll_<?=$uni?>()
    {
        i_<?=$uni?> = 0;
        for (i_<?=$uni?> in roll_text_<?=$uni?>)
            n_panel_<?=$uni?>++;
        n_panel_<?=$uni?> = n_panel_<?=$uni?> -1 ;
        startPanel_<?=$uni?> = Math.round(Math.random()*n_panel_<?=$uni?>);
        if(startPanel_<?=$uni?> == 0) {
            i_<?=$uni?> = 0;
            for (i_<?=$uni?> in roll_text_<?=$uni?>)
                insert_area_<?=$uni?>(total_area_<?=$uni?>, total_area_<?=$uni?>++);
        } else if(startPanel_<?=$uni?> == n_panel_<?=$uni?>) {
            insert_area_<?=$uni?>(startPanel_<?=$uni?>, total_area_<?=$uni?>);
            total_area_<?=$uni?>++;
            for (i_<?=$uni?>=0; i_<?=$uni?><startPanel_<?=$uni?>; i_<?=$uni?>++) {
                insert_area_<?=$uni?>(i_<?=$uni?>, total_area_<?=$uni?>);
                total_area_<?=$uni?>++;
            }
        } else if((startPanel_<?=$uni?> > 0) || (startPanel_<?=$uni?> < n_panel_<?=$uni?>)) {
            insert_area_<?=$uni?>(startPanel_<?=$uni?>, total_area_<?=$uni?>);
            total_area_<?=$uni?>++;
            for (i_<?=$uni?>=startPanel_<?=$uni?>+1; i_<?=$uni?><=n_panel_<?=$uni?>; i_<?=$uni?>++) {
                insert_area_<?=$uni?>(i_<?=$uni?>, total_area_<?=$uni?>);
                total_area_<?=$uni?>++;
            }
            for (i_<?=$uni?>=0; i_<?=$uni?><startPanel_<?=$uni?>; i_<?=$uni?>++) {
                insert_area_<?=$uni?>(i_<?=$uni?>, total_area_<?=$uni?>);
                total_area_<?=$uni?>++;
            }
        }
     
        if ( navigator.appName == "Microsoft Internet Explorer" ) {
            if ( navigator.appVersion.indexOf ( "MSIE 4" ) > -1 )
            return ;
        }
        window.setTimeout("rolling_<?=$uni?>()",waitingtime_<?=$uni?>);
    }
    function rolling_<?=$uni?>()
    {
        if (bMouseOver_<?=$uni?> && wait_flag_<?=$uni?>) {
            for (i_<?=$uni?>=0;i_<?=$uni?><total_area_<?=$uni?>;i_<?=$uni?>++) {
                tmp_<?=$uni?> = document.getElementById('scroll_area_<?=$uni?>'+i_<?=$uni?>).style;
                tmp_<?=$uni?>.top = parseInt(tmp_<?=$uni?>.top)-roll_speed_<?=$uni?>;
               
                if (parseInt(tmp_<?=$uni?>.top) <= -roll_height_<?=$uni?>) {
                    tmp_<?=$uni?>.top = roll_height_<?=$uni?>*(total_area_<?=$uni?>-1);
                }
               
                if (s_tmp_<?=$uni?>++ > (s_amount_<?=$uni?>-1)*roll_text_<?=$uni?>.length) {
                    wait_flag_<?=$uni?>=false;
                    window.setTimeout("wait_flag_<?=$uni?>=true;s_tmp_<?=$uni?>=0;",waitingtime_<?=$uni?>);
                }
            }
        }
        window.setTimeout("rolling_<?=$uni?>()", 1);
    }
    function insert_area_<?=$uni?>(idx_<?=$uni?>, n_<?=$uni?>)
    {
        document.write('<div style="left: 0px; width: 100%; position: absolute; top: '+(roll_height_<?=$uni?>*n_<?=$uni?>)+'px" id="scroll_area_<?=$uni?>'+n_<?=$uni?>+'">\n'+roll_text_<?=$uni?>[idx_<?=$uni?>]+'\n</div>\n');
    }
    <?
    unset($roll_text);
    for ($i=0; $i<count($list); $i++) {
        $href = "<a href='./?doc=$cart_dir/item.php&it_id=$row[it_id]' class=item>";
        $k = (int)($i / $line_mod);
        $roll_text[$k] .= "<div style=\"height:{$height}px; padding-top:5px;\">";
        $roll_text[$k] .= "<a href=\"{$list[$i][href]}\">";
        $roll_text[$k] .= "<img src=\"{$latest_skin_path}/img/latest_icon.gif\" align=absmiddle border=0>  ";
        $roll_text[$k] .= "<font color=#FF9900>";
        $roll_text[$k] .= "[";
        $roll_text[$k] .= $list[$i][gr_subject];
        $roll_text[$k] .= "/";
        $roll_text[$k] .= $list[$i][bo_subject];
        $roll_text[$k] .= "] ";
        $roll_text[$k] .= "</font>";
        $roll_text[$k] .= $list[$i][wr_subject];
        if ($list[$i][comment_cnt])
            $roll_text[$k] .= " {$list[$i][comment_cnt]}";
        $roll_text[$k] .= "  ";
        $roll_text[$k] .= "<font color=#009900>";
        $roll_text[$k] .= substr($list[$i][wr_datetime],0,10);
        $roll_text[$k] .= "</font>";
        $roll_text[$k] .= "</a>";
        $roll_text[$k] .= "</div>";
    }
    for ($i=0; $i<=$k; $i++) {
        echo "roll_text_{$uni}[$i] = '{$roll_text[$i]}';\n";
    }
    ?>
    </script>
          <div style="left: 0px; width: 100%; position: relative; top: 0px; height: <?=$box_height?>px; overflow:hidden;" onMouseover="bMouseOver_<?=$uni?>=0" onMouseout="bMouseOver_<?=$uni?>=1" id="latest_scroll_<?=$uni?>">
            <script language='javascript'>
    var no_script_flag_<?=$uni?> = false ;
    if ( navigator.appName == "Microsoft Internet Explorer" ) {
        if ( navigator.appVersion.indexOf ( "MSIE 4" ) > -1 ) {
            document.write ( roll_text_<?=$uni?>[0] ) ;
            no_script_flag_<?=$uni?> = true ;
        }
    }
    if ( no_script_flag_<?=$uni?> == false )
        start_roll_<?=$uni?>();
    </script>
          </div>         
<? } ?>
                </nobr></td></tr></table></td></tr>
   <tr><td colspan=3 height=10></td></tr>
   </table></td>
  </tr></table>
</div>
</td>
</tr>
</table>
///////////////////////////////////////////////////////////////////////////////////////////////////
 
new_scroll_latest.lib.php
 
 
<?
function latest_scroll($skin_dir="",$rows, $subject_len,$options="")
{
    global $config;
    global $g4;
    if ($skin_dir)
        $latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
    else
        $latest_skin_path = "$g4[path]/skin/latest/$config[cf_latest_skin]";
    $list = array();

    $sql = " select a.*, b.bo_subject, c.gr_subject, c.gr_id
        from $g4[board_new_table] a, $g4[board_table] b,  $g4[group_table] c
        where a.bo_table = b.bo_table and b.gr_id = c.gr_id and b.bo_use_search = '1' and  a.wr_id = a.wr_parent
        order by a.bn_id desc limit 0,$rows";

    $result = sql_query($sql);
    for ($i=0; $row = sql_fetch_array($result); $i++)
    {
        $tmp_write_table = $g4[write_prefix].$row[bo_table];
        $row2 = sql_fetch(" select * from $tmp_write_table where wr_id = '$row[wr_id]' ");
        $list[$i] = $row2;
        $list[$i][bo_table] = $row[bo_table];
        $list[$i][bo_subject] = $row[bo_subject];
        $list[$i][gr_subject] = $row[gr_subject];
        $list[$i][href] = "$g4[bbs_path]/board.php?bo_table=$row[bo_table]&wr_id=$row2[wr_id]";
        $list[$i][wr_subject] = cut_str($row2[wr_subject], $subject_len, "…");
        $list[$i][comment_cnt] = "";
        if ($row2[wr_comment])
           $list[$i][comment_cnt] = "($row2[wr_comment])";
     }
        ob_start();
        include "$latest_skin_path/latest.skin.php";
        $content = ob_get_contents();
        ob_end_clean();
    return $content;
}
?>

댓글 전체

$roll_text[$k] .= "<font color=#FF9900>";
        $roll_text[$k] .= "[";
        $roll_text[$k] .= $list[$i][gr_subject];
        $roll_text[$k] .= "/";
        $roll_text[$k] .= $list[$i][bo_subject];
        $roll_text[$k] .= "] ";
        $roll_text[$k] .= "</font>";
        $roll_text[$k] .= $list[$i][wr_subject];
        if ($list[$i][comment_cnt])
            $roll_text[$k] .= " {$list[$i][comment_cnt]}";
        $roll_text[$k] .= "&nbsp;&nbsp;";
        $roll_text[$k] .= "<font color=#009900>";
        $roll_text[$k] .= substr($list[$i][wr_datetime],0,10);
        $roll_text[$k] .= "</font>";
        $roll_text[$k] .= "</a>";
        $roll_text[$k] .= "</div>";

대신에


$roll_text[$k] .= "<font color=#FF9900>";
        $roll_text[$k] .= "</font>";
        $roll_text[$k] .= $list[$i][wr_subject];
        if ($list[$i][comment_cnt])
            $roll_text[$k] .= " {$list[$i][comment_cnt]}";
        $roll_text[$k] .= "</a>";
        $roll_text[$k] .= "</div>";

이정도 넣으시면 될듯...
전체 66,554 |RSS
그누4 질문답변 내용 검색

회원로그인

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