스크롤 최근게시물에서 내용이 보이지 않는 이유.. 정보
스크롤 최근게시물에서 내용이 보이지 않는 이유..본문
아무리 해도 다른건 다 잘 나오는데 내용만 안나옵니다.
고수님분들의 조언 부탁드릴꼐요..ㅠ.ㅠ 가르침 바랍니다..
<?
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($td_mod,$tr_mod) = explode(",", $options);
$img_width=92; //이미지 가로
$img_height=71; //이미지세로
$margin_right = 5; // 이미지 우측 여백
$margin_bottom = 10; // 이미지 아래쪽 여백
$height = $img_height+$margin_bottom;
$line_mod=1;
$box_height = (int)$line_mod * (int)$height;
?>
<table width=100% cellpadding=0 cellspacing=0 border=0>
<? /*
<tr>
<td><img src='<?=$latest_skin_path?>/img/latest_t01.gif'></td>
<td background='<?=$latest_skin_path?>/img/bg_latest.gif'> <strong><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><?=$board[bo_subject]?></a></strong></td>
<td background='<?=$latest_skin_path?>/img/bg_latest.gif'><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><img src='<?=$latest_skin_path?>/img/more.gif' border=0></a></td>
<td><img src='<?=$latest_skin_path?>/img/latest_t02.gif'></td>
</tr>
*/?>
<tr><td style='padding-left:0px; padding-right:0px; padding-top:5px; padding-bottom:5px;'>
<? if (count($list) == 0) { ?>
<tr><td align=center height=50>게시물이 없습니다.</td></tr>
<? } else { ?>
<script type="text/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++) {
$http = explode("://", $list[$i][wr_link1]);
$link_01 = $list[$i][href];
$img = "<img src=\"$latest_skin_path/img/noimage.gif\" border=0 heigth=\"$img_height\" width=\"$img_width\" title=\"이미지 없음\">";
$wrcontent = nl2br(cut_str($list[$i][wr_content],130,".. "));
$file = $list[$i][file][0][path] ."/". $list[$i][file][0][file];
if($file){
$img = "<img src=\"$file\" style=\"border:1px solid #efefef;margin-right:".$margin_right."px;\" border=0 height=\"$img_height\" width=\"$img_width\" alt=\"{$list[$i][subject]}\">";
}
$k = (int)($i / $td_mod);
$roll_text[$k] .= "<div style=\"height:{$height}px; padding-top:0px;\">";
$roll_text[$k] .= "<table width=\"417\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td width=\"15\"></td><td width=\"392\" valign=\"top\"><table width=\"392\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td width=\"92\" align=\"center\">";
$roll_text[$k] .= "<a href=\"{$link_01}\">";
// $roll_text[$k] .= "<a href=\"{$link_01}\" target=_blank>";
$roll_text[$k] .= $img;
$roll_text[$k] .= "</a>";
/////////////////////////////// 이 부분입니다. ////////////////////////////
$roll_text[$k] .= "</td><td width=\"10\"></td><td width=\"290\" style=\"word-break:break-all;line-height:140%;\"><a href=\"{$link_01}\"><b>{$list[$i][subject]}</b></a><br />$wrcontent</td></tr></table></td><td width=\"10\"></td></tr></table>";
//////////////////////////////// 이 부분입니다. //////////////////////////////////
$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*$tr_mod?>px; overflow:hidden;" onMouseover="bMouseOver_<?=$uni?>=0" onMouseout="bMouseOver_<?=$uni?>=1" id="latest_scroll_<?=$uni?>">
<script type='text/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>
<? } ?>
</td></tr>
</table>
고수님분들의 조언 부탁드릴꼐요..ㅠ.ㅠ 가르침 바랍니다..
<?
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($td_mod,$tr_mod) = explode(",", $options);
$img_width=92; //이미지 가로
$img_height=71; //이미지세로
$margin_right = 5; // 이미지 우측 여백
$margin_bottom = 10; // 이미지 아래쪽 여백
$height = $img_height+$margin_bottom;
$line_mod=1;
$box_height = (int)$line_mod * (int)$height;
?>
<table width=100% cellpadding=0 cellspacing=0 border=0>
<? /*
<tr>
<td><img src='<?=$latest_skin_path?>/img/latest_t01.gif'></td>
<td background='<?=$latest_skin_path?>/img/bg_latest.gif'> <strong><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><?=$board[bo_subject]?></a></strong></td>
<td background='<?=$latest_skin_path?>/img/bg_latest.gif'><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><img src='<?=$latest_skin_path?>/img/more.gif' border=0></a></td>
<td><img src='<?=$latest_skin_path?>/img/latest_t02.gif'></td>
</tr>
*/?>
<tr><td style='padding-left:0px; padding-right:0px; padding-top:5px; padding-bottom:5px;'>
<? if (count($list) == 0) { ?>
<tr><td align=center height=50>게시물이 없습니다.</td></tr>
<? } else { ?>
<script type="text/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++) {
$http = explode("://", $list[$i][wr_link1]);
$link_01 = $list[$i][href];
$img = "<img src=\"$latest_skin_path/img/noimage.gif\" border=0 heigth=\"$img_height\" width=\"$img_width\" title=\"이미지 없음\">";
$wrcontent = nl2br(cut_str($list[$i][wr_content],130,".. "));
$file = $list[$i][file][0][path] ."/". $list[$i][file][0][file];
if($file){
$img = "<img src=\"$file\" style=\"border:1px solid #efefef;margin-right:".$margin_right."px;\" border=0 height=\"$img_height\" width=\"$img_width\" alt=\"{$list[$i][subject]}\">";
}
$k = (int)($i / $td_mod);
$roll_text[$k] .= "<div style=\"height:{$height}px; padding-top:0px;\">";
$roll_text[$k] .= "<table width=\"417\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td width=\"15\"></td><td width=\"392\" valign=\"top\"><table width=\"392\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td width=\"92\" align=\"center\">";
$roll_text[$k] .= "<a href=\"{$link_01}\">";
// $roll_text[$k] .= "<a href=\"{$link_01}\" target=_blank>";
$roll_text[$k] .= $img;
$roll_text[$k] .= "</a>";
/////////////////////////////// 이 부분입니다. ////////////////////////////
$roll_text[$k] .= "</td><td width=\"10\"></td><td width=\"290\" style=\"word-break:break-all;line-height:140%;\"><a href=\"{$link_01}\"><b>{$list[$i][subject]}</b></a><br />$wrcontent</td></tr></table></td><td width=\"10\"></td></tr></table>";
//////////////////////////////// 이 부분입니다. //////////////////////////////////
$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*$tr_mod?>px; overflow:hidden;" onMouseover="bMouseOver_<?=$uni?>=0" onMouseout="bMouseOver_<?=$uni?>=1" id="latest_scroll_<?=$uni?>">
<script type='text/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>
<? } ?>
</td></tr>
</table>
댓글 전체

어떤스킨인지 URL주소를 적어주시면 더 자세히 알수 있는데...
제가 적용해 보니깐 최근게시물이 에러가 발생하네요.
그리고 내용부분이면 {$list[$i][wr_content]} 이렇게 고쳐보세요.
제가 적용해 보니깐 최근게시물이 에러가 발생하네요.
그리고 내용부분이면 {$list[$i][wr_content]} 이렇게 고쳐보세요.