스킨에 있는 [완전굿잡] 배너관리 및 유지보수 관련 질문입니다. 정보
그누보드 스킨에 있는 [완전굿잡] 배너관리 및 유지보수 관련 질문입니다.관련링크
본문
스킨자료실에 있는 [완전굿잡] 배너관리 및 유지보수 최신글을
head.php에서 왼쪽 상단에 항상 랜덤으로 배너가 뜨게 해놓았습니다.
그누 외부통합검색에서 등록된 배너 제목을 검색해버리면 랜덤배너에 검색된 제목과 글내용이 출력됩니다. 요상시리 등록된 배너게시물 본문내용에 일치하는 내용이 있으면 화면 중앙에 검색내용이 제대로 나오는데 제목과 일치 되면 랜덤배너자리에 쭈루룩 나와 버립니다.
관리자에서 검색사용을 안함으로 해놓으면 본문검색은 안되지만 제목으로 검색하면 위와 같은 현상이 발생됩니다.
관련소스를 올립니다.
랜덤배너 latest.skin.php // 기존배너를 제가좀 손을 보았거든요 짜집기라 ..^^
<?
$mod = 4; // 한행당 몇개씩?
?>
<table>
<tr>
<? for ($i=0; $i<count($list); $i++) { ?>
<?if ($i>0 && $i%$mod==0) { echo "</tr><tr>"; } ?>
<td width=60 height=25>
<a href='<?="./?doc=$cfg[bbs_dir]/gblink.php&bo_table=$bo_table&wr_id={$list[$i][wr_id]}&index=1"?>' target='_blink'><img src='<?=$list[$i][file_image2]?>' width=60 height=25 border=0 alt='<?=$list[$i][subject]?> <?=$list[$i][content]?>'></a>
</td>
<? } ?>
<? // td(열)의 나머지 갯수를 구한후 빈 td(열)을 출력한다.
$nam = ($i%$mod);
for ($k=$nam; $k<$mod && $nam; $k++) {
echo "<td> </td>";
}?>
<? if (count($list) == 0) { echo "<div align=center><img src='$latest_skin/bener.gif'></div>"; } ?>
</tr>
</table>
//랜덤 배너용 최신글 추출
function r_latest($skin_dir='', $bo_table, $rows=10, $len=40)
{
global $latest_skin, $cfg;
$tmp_latest_skin = $latest_skin;
// 스킨디렉토리값이 넘어왔다면
if ($skin_dir) {
$latest_skin = "./$cfg[bbs_dir]/skin/latest/$skin_dir";
}
$sql = " select * from $cfg[table_board] where bo_table = '$bo_table' ";
$bo = sql_fetch($sql);
$bo_subject = $bo[bo_subject];
$sql = " select * from {$cfg[write_table_prefix]}{$bo_table} where wr_comment = 0 order by rand() limit 0, $rows ";
$result = sql_query($sql);
for ($i=0; $row = mysql_fetch_array($result); $i++) {
$list[$i] = $row;
$list[$i][href] = "./?doc=$cfg[bbs_dir]/gnuboard.php&bo_table=$bo_table&wr_id=$row[wr_id]";
// 코멘트 카운트
$list[$i][commentcnt] = "";
if ($row[wr_commentcnt] > 0) {
$list[$i][commentcnt] = "($row[wr_commentcnt])";
}
$list[$i][name] = gblayer($row[mb_id], cut_str($row[wr_name],10), $row[wr_email], $row[wr_homepage]);
$list[$i][subject] = conv_subject($row[wr_subject], $len,"…");
$list[$i][content] = ($row[wr_content]);
$list[$i][date] = substr($row[wr_datetime],2,8);
$list[$i][icon_new] = "";
if ($row[wr_datetime] >= date("Y-m-d H:i:s", time() - $bo[bo_new] * 3600)) {
$list[$i][icon_new] = "<img src='$latest_skin/icon_new.gif' align=absmiddle> ";
}
for ($k=1; $k<=$cfg[file_count]; $k++) {
if (@preg_match($cfg[image_extension], $row["wr_file".$k])) {
$list[$i]["file_image".$k] = "./data/file/$bo_table/" . $row["wr_file".$k];
}
}
for ($k=1; $k<=$cfg[link_count]; $k++) {
if ($row["wr_link".$k]) {
$link[$i]["link".$k] = set_http(get_text(cut_str($row["wr_link".$k], 255)));
$link[$i]["link_href".$k] = "./?doc=$cfg[bbs_dir]/gblink.php&$qstr&wr_id=$row[wr_id]&index=$k";
}
}
}
mysql_free_result($result);
include "$latest_skin/latest.skin.php";
$latest_skin = $tmp_latest_skin;
}
head.php에서 왼쪽 상단에 항상 랜덤으로 배너가 뜨게 해놓았습니다.
그누 외부통합검색에서 등록된 배너 제목을 검색해버리면 랜덤배너에 검색된 제목과 글내용이 출력됩니다. 요상시리 등록된 배너게시물 본문내용에 일치하는 내용이 있으면 화면 중앙에 검색내용이 제대로 나오는데 제목과 일치 되면 랜덤배너자리에 쭈루룩 나와 버립니다.
관리자에서 검색사용을 안함으로 해놓으면 본문검색은 안되지만 제목으로 검색하면 위와 같은 현상이 발생됩니다.
관련소스를 올립니다.
랜덤배너 latest.skin.php // 기존배너를 제가좀 손을 보았거든요 짜집기라 ..^^
<?
$mod = 4; // 한행당 몇개씩?
?>
<table>
<tr>
<? for ($i=0; $i<count($list); $i++) { ?>
<?if ($i>0 && $i%$mod==0) { echo "</tr><tr>"; } ?>
<td width=60 height=25>
<a href='<?="./?doc=$cfg[bbs_dir]/gblink.php&bo_table=$bo_table&wr_id={$list[$i][wr_id]}&index=1"?>' target='_blink'><img src='<?=$list[$i][file_image2]?>' width=60 height=25 border=0 alt='<?=$list[$i][subject]?> <?=$list[$i][content]?>'></a>
</td>
<? } ?>
<? // td(열)의 나머지 갯수를 구한후 빈 td(열)을 출력한다.
$nam = ($i%$mod);
for ($k=$nam; $k<$mod && $nam; $k++) {
echo "<td> </td>";
}?>
<? if (count($list) == 0) { echo "<div align=center><img src='$latest_skin/bener.gif'></div>"; } ?>
</tr>
</table>
//랜덤 배너용 최신글 추출
function r_latest($skin_dir='', $bo_table, $rows=10, $len=40)
{
global $latest_skin, $cfg;
$tmp_latest_skin = $latest_skin;
// 스킨디렉토리값이 넘어왔다면
if ($skin_dir) {
$latest_skin = "./$cfg[bbs_dir]/skin/latest/$skin_dir";
}
$sql = " select * from $cfg[table_board] where bo_table = '$bo_table' ";
$bo = sql_fetch($sql);
$bo_subject = $bo[bo_subject];
$sql = " select * from {$cfg[write_table_prefix]}{$bo_table} where wr_comment = 0 order by rand() limit 0, $rows ";
$result = sql_query($sql);
for ($i=0; $row = mysql_fetch_array($result); $i++) {
$list[$i] = $row;
$list[$i][href] = "./?doc=$cfg[bbs_dir]/gnuboard.php&bo_table=$bo_table&wr_id=$row[wr_id]";
// 코멘트 카운트
$list[$i][commentcnt] = "";
if ($row[wr_commentcnt] > 0) {
$list[$i][commentcnt] = "($row[wr_commentcnt])";
}
$list[$i][name] = gblayer($row[mb_id], cut_str($row[wr_name],10), $row[wr_email], $row[wr_homepage]);
$list[$i][subject] = conv_subject($row[wr_subject], $len,"…");
$list[$i][content] = ($row[wr_content]);
$list[$i][date] = substr($row[wr_datetime],2,8);
$list[$i][icon_new] = "";
if ($row[wr_datetime] >= date("Y-m-d H:i:s", time() - $bo[bo_new] * 3600)) {
$list[$i][icon_new] = "<img src='$latest_skin/icon_new.gif' align=absmiddle> ";
}
for ($k=1; $k<=$cfg[file_count]; $k++) {
if (@preg_match($cfg[image_extension], $row["wr_file".$k])) {
$list[$i]["file_image".$k] = "./data/file/$bo_table/" . $row["wr_file".$k];
}
}
for ($k=1; $k<=$cfg[link_count]; $k++) {
if ($row["wr_link".$k]) {
$link[$i]["link".$k] = set_http(get_text(cut_str($row["wr_link".$k], 255)));
$link[$i]["link_href".$k] = "./?doc=$cfg[bbs_dir]/gblink.php&$qstr&wr_id=$row[wr_id]&index=$k";
}
}
}
mysql_free_result($result);
include "$latest_skin/latest.skin.php";
$latest_skin = $tmp_latest_skin;
}
댓글 전체