부탁드립니다. 골치거리가 생겨버렸어욤...
본문
문제가 되는 페이지 : http://www.pointtile.co.kr/bbs/search.php
해당 search.skin.php 소스는 아래와 같구요...
-------------------------------------------------------------------------------------------------------
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$table_width = 1000;
include_once("$g4[path]/lib/search0.lib.php");
include_once("$g4[path]/lib/search7.lib.php");
?>
<script type="text/javascript" language="JavaScript" src="<?="$g4[path]/js/suggest.js"?>"></script>
<table width="<?=$table_width?>" height="75" cellspacing="0" cellpadding="0" border="0" align="center">
<tr>
<td width="<?=$table_width?>" height="75">
<table width="95%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="24"><img src="<?=$search_skin_path?>/img/searchbg_01.gif"></td>
<td background="<?=$search_skin_path?>/img/searchbg_02.gif">
<table width=95% cellpadding=2 cellspacing=0 height="50">
<form name=fsearch method=get action="javascript:fsearch_submit(document.fsearch);" autocomplete="off">
<input type="hidden" name="srows" value="<?=$srows?>">
<tr>
<td height="25" colspan="3"><?=$group_select?>
<script language="JavaScript">document.getElementById("gr_id").value = "<?=$gr_id?>";</script>
<select name=sfl class=select>
<option value="wr_subject||wr_content">제목+내용</option>
<option value="wr_subject">제목</option>
<option value="wr_content">내용</option>
<option value="mb_id">회원아이디</option>
<option value="wr_name">이름</option>
</select>
<input type=text name=stx maxlength=20 required itemname="검색어" value='<?=$text_stx?>'>
<input name="image" type=image src="<?=$search_skin_path?>/img/search_btn.gif" align="absmiddle" width="60" height="25" border=0>
<script language="javascript">
document.fsearch.sfl.value = "<?=$sfl?>";
function fsearch_submit(f){
/*
// 검색에 많은 부하가 걸리는 경우 이 주석을 제거하세요.
var cnt = 0;
for (var i=0; i<f.stx.value.length; i++)
{
if (f.stx.value.charAt(i) == ' ')
cnt++;
}
if (cnt > 1)
{
alert("빠른 검색을 위하여 검색어에 공백은 한개만 입력할 수 있습니다.");
f.stx.select();
f.stx.focus();
return;
}
*/
f.action = "";
f.submit();
}
</script>
</td>
</tr>
<tr>
<td width="200"> 연산자 <input type="radio" name="sop" value="or" <?=($sop == "or") ? "checked" : "";?>>OR <input type="radio" name="sop" value="and" <?=($sop == "and") ? "checked" : "";?>>AND </td>
<td width="120" align="right"> 실시간 인기 검색어 : </td>
<td width="160" onMouseOver="MM_showHideLayers('my_view1','','show')"><?=search0();?>
<DIV id='my_view1' style="position:relative; left: 0px; top: -20px; width:100%px; visibility: hidden;" onMouseOut="MM_showHideLayers('my_view1','','hide')" onMouseOver="MM_showHideLayers('my_view1','','show')" >
<DIV id="my_view2" style="position:absolute; left:0px; top:0px; width:100%px; z-index:1;">
<?=search7();?>
</div></div>
</td>
</tr>
</form>
</table>
</td>
<td width="23"><img src="<?=$search_skin_path?>/img/searchbg_03.gif"></td>
</tr>
</table>
<!------------검색폼부분끝-------------->
<p>
<table align=center width="100%" cellpadding=0 cellspacing=0 border="0" align="center">
<tr>
<td width="20"></td>
<td valign="top" width="924">
<table align=center width="100%" cellpadding=2 cellspacing=0 border="0" align="center">
<tr>
<td style='word-break:break-all;' class=search valign="top">
<?
if ($stx)
{
echo "<b>검색된 리스트</b> (<b>{$board_count}</b>개의 리스트, <b>".number_format($total_count)."</b>개의 게시글, <b>".number_format($page)."/".number_format($total_page)."</b> 페이지)";
if ($board_count)
{
echo "<ul><ul style='line-height:130%;'>";
if ($onetable)
echo "<img src='$search_skin_path/img/icon_folder2.gif' border='0' align='absmiddle'> <a href='?$search_query&gr_id=$gr_id'>전체게시판 검색</a>";
//echo "<img src='$search_skin_path/img/icon_folder2.gif' border='0' align='absmiddle'> ";
echo $str_board_list;
echo "</ul></ul>";
}
else
{
echo "<ul style='line-height:130%;'><li><b>검색된 자료가 하나도 없습니다.</b></ul>";
}
}
?>
<?
$k=0;
for ($idx=$table_index, $k=0; $idx<count($search_table) && $k<$rows; $idx++)
{
echo "<img src='$search_skin_path/img/icon_folder2.gif' border='0' align='absmiddle'> <b><a href='./board.php?bo_table={$search_table[$idx]}&{$search_query}'><u>{$bo_subject[$idx]}</u></a>에서의 검색결과</b>";
$comment_href = "";
for ($i=0; $i<count($list[$idx]) && $k<$rows; $i++, $k++)
{
$content = cut_str(trim(strip_tags($list[$idx][$i][wr_content])),300,"…");
$content = search_font($stx, $content);
echo "<ul><ul style='line-height:130%;'> <img src='$search_skin_path/img/icon_list.gif' border='0' align='absmiddle'>";
if ($list[$idx][$i][wr_is_comment])
{
echo "<font color=999999>[코멘트]</font> ";
$comment_href = "#c_".$list[$idx][$i][wr_id];
}
echo "<a href='{$list[$idx][$i][href]}{$comment_href}'><u>";
echo $list[$idx][$i][subject];
echo "</u></a> [<a href='{$list[$idx][$i][href]}{$comment_href}' target=_blank>새창</a>]<br>";
echo $content;
echo "<br><font color=#999999>{$list[$idx][$i][wr_datetime]}</font> ";
echo $list[$idx][$i][name];
echo "</ul></ul>";
}
}
?>
<p><?=$write_pages?>
</td>
<td width="20"></td>
<td width="180" valign="top">
<table width="180" cellpadding="0" cellspacing="0" border="0" align="center" valign="top">
<tr><td width="180" align="right"></td></tr>
<tr><td height="20"></td></tr>
<tr><td width="180" align="right"></td></tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<script language="JavaScript" type="text/JavaScript">
document.fsearch.stx.obj =
sug_set_properties(document.fsearch.stx, '<?=$search_skin_path?>/suggest_search.php', true, false, true);
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_showHideLayers() { //v6.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
obj.visibility=v; }
}
</script>
-------------------------------------------------------------------------------------------------------
문제는 폭 문제인것 같은데... 지가 해결할 능력이 없네요...
참고로 검색창 전체 길이는 675~680 이 적당한데요... $table_width = 680; 으로 고치면 페이지가 깨져버립니다.
도와주셨으면 좋겠습니다. 감사합니다.
해당 search.skin.php 소스는 아래와 같구요...
-------------------------------------------------------------------------------------------------------
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$table_width = 1000;
include_once("$g4[path]/lib/search0.lib.php");
include_once("$g4[path]/lib/search7.lib.php");
?>
<script type="text/javascript" language="JavaScript" src="<?="$g4[path]/js/suggest.js"?>"></script>
<table width="<?=$table_width?>" height="75" cellspacing="0" cellpadding="0" border="0" align="center">
<tr>
<td width="<?=$table_width?>" height="75">
<table width="95%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="24"><img src="<?=$search_skin_path?>/img/searchbg_01.gif"></td>
<td background="<?=$search_skin_path?>/img/searchbg_02.gif">
<table width=95% cellpadding=2 cellspacing=0 height="50">
<form name=fsearch method=get action="javascript:fsearch_submit(document.fsearch);" autocomplete="off">
<input type="hidden" name="srows" value="<?=$srows?>">
<tr>
<td height="25" colspan="3"><?=$group_select?>
<script language="JavaScript">document.getElementById("gr_id").value = "<?=$gr_id?>";</script>
<select name=sfl class=select>
<option value="wr_subject||wr_content">제목+내용</option>
<option value="wr_subject">제목</option>
<option value="wr_content">내용</option>
<option value="mb_id">회원아이디</option>
<option value="wr_name">이름</option>
</select>
<input type=text name=stx maxlength=20 required itemname="검색어" value='<?=$text_stx?>'>
<input name="image" type=image src="<?=$search_skin_path?>/img/search_btn.gif" align="absmiddle" width="60" height="25" border=0>
<script language="javascript">
document.fsearch.sfl.value = "<?=$sfl?>";
function fsearch_submit(f){
/*
// 검색에 많은 부하가 걸리는 경우 이 주석을 제거하세요.
var cnt = 0;
for (var i=0; i<f.stx.value.length; i++)
{
if (f.stx.value.charAt(i) == ' ')
cnt++;
}
if (cnt > 1)
{
alert("빠른 검색을 위하여 검색어에 공백은 한개만 입력할 수 있습니다.");
f.stx.select();
f.stx.focus();
return;
}
*/
f.action = "";
f.submit();
}
</script>
</td>
</tr>
<tr>
<td width="200"> 연산자 <input type="radio" name="sop" value="or" <?=($sop == "or") ? "checked" : "";?>>OR <input type="radio" name="sop" value="and" <?=($sop == "and") ? "checked" : "";?>>AND </td>
<td width="120" align="right"> 실시간 인기 검색어 : </td>
<td width="160" onMouseOver="MM_showHideLayers('my_view1','','show')"><?=search0();?>
<DIV id='my_view1' style="position:relative; left: 0px; top: -20px; width:100%px; visibility: hidden;" onMouseOut="MM_showHideLayers('my_view1','','hide')" onMouseOver="MM_showHideLayers('my_view1','','show')" >
<DIV id="my_view2" style="position:absolute; left:0px; top:0px; width:100%px; z-index:1;">
<?=search7();?>
</div></div>
</td>
</tr>
</form>
</table>
</td>
<td width="23"><img src="<?=$search_skin_path?>/img/searchbg_03.gif"></td>
</tr>
</table>
<!------------검색폼부분끝-------------->
<p>
<table align=center width="100%" cellpadding=0 cellspacing=0 border="0" align="center">
<tr>
<td width="20"></td>
<td valign="top" width="924">
<table align=center width="100%" cellpadding=2 cellspacing=0 border="0" align="center">
<tr>
<td style='word-break:break-all;' class=search valign="top">
<?
if ($stx)
{
echo "<b>검색된 리스트</b> (<b>{$board_count}</b>개의 리스트, <b>".number_format($total_count)."</b>개의 게시글, <b>".number_format($page)."/".number_format($total_page)."</b> 페이지)";
if ($board_count)
{
echo "<ul><ul style='line-height:130%;'>";
if ($onetable)
echo "<img src='$search_skin_path/img/icon_folder2.gif' border='0' align='absmiddle'> <a href='?$search_query&gr_id=$gr_id'>전체게시판 검색</a>";
//echo "<img src='$search_skin_path/img/icon_folder2.gif' border='0' align='absmiddle'> ";
echo $str_board_list;
echo "</ul></ul>";
}
else
{
echo "<ul style='line-height:130%;'><li><b>검색된 자료가 하나도 없습니다.</b></ul>";
}
}
?>
<?
$k=0;
for ($idx=$table_index, $k=0; $idx<count($search_table) && $k<$rows; $idx++)
{
echo "<img src='$search_skin_path/img/icon_folder2.gif' border='0' align='absmiddle'> <b><a href='./board.php?bo_table={$search_table[$idx]}&{$search_query}'><u>{$bo_subject[$idx]}</u></a>에서의 검색결과</b>";
$comment_href = "";
for ($i=0; $i<count($list[$idx]) && $k<$rows; $i++, $k++)
{
$content = cut_str(trim(strip_tags($list[$idx][$i][wr_content])),300,"…");
$content = search_font($stx, $content);
echo "<ul><ul style='line-height:130%;'> <img src='$search_skin_path/img/icon_list.gif' border='0' align='absmiddle'>";
if ($list[$idx][$i][wr_is_comment])
{
echo "<font color=999999>[코멘트]</font> ";
$comment_href = "#c_".$list[$idx][$i][wr_id];
}
echo "<a href='{$list[$idx][$i][href]}{$comment_href}'><u>";
echo $list[$idx][$i][subject];
echo "</u></a> [<a href='{$list[$idx][$i][href]}{$comment_href}' target=_blank>새창</a>]<br>";
echo $content;
echo "<br><font color=#999999>{$list[$idx][$i][wr_datetime]}</font> ";
echo $list[$idx][$i][name];
echo "</ul></ul>";
}
}
?>
<p><?=$write_pages?>
</td>
<td width="20"></td>
<td width="180" valign="top">
<table width="180" cellpadding="0" cellspacing="0" border="0" align="center" valign="top">
<tr><td width="180" align="right"></td></tr>
<tr><td height="20"></td></tr>
<tr><td width="180" align="right"></td></tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<script language="JavaScript" type="text/JavaScript">
document.fsearch.stx.obj =
sug_set_properties(document.fsearch.stx, '<?=$search_skin_path?>/suggest_search.php', true, false, true);
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_showHideLayers() { //v6.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
obj.visibility=v; }
}
</script>
-------------------------------------------------------------------------------------------------------
문제는 폭 문제인것 같은데... 지가 해결할 능력이 없네요...
참고로 검색창 전체 길이는 675~680 이 적당한데요... $table_width = 680; 으로 고치면 페이지가 깨져버립니다.
도와주셨으면 좋겠습니다. 감사합니다.
추천0
귀여운현호님의 댓글
귀여운현호쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 작성일왼쪽부분을 빼주세요^^
그런 적당히 검색창이 들어가져서 깔끔해 질거에요