Ik68.cn一切皆有可能!
[中国博客网]如何为自己的BLOG建立BLOG内部搜索功能

具体代码如下:

以下内容为程序代码:

<script language=javascript>
function subsearch()
{
with(document.searchbar)
{key.value=key1.value+" site:"+key2.value};
}
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<form name="searchbar" method="post" action="/search/redirect.asp" onsubmit="subsearch()"> <tr>
   <td> 
    <div align="center">
     <input type="text" name="key1">
     <br>
     <input type="hidden" name="tp" value="alllog">
     <input type="hidden" name="key">
     <input type="text" name="key2" size="12" value="你的用户名ID">
     <input type="submit" name="Submit" value="搜索">
    </div>
   </td>
 </tr></form>
</table>


将代码中的"你的用户名ID"部分改为你自己的ID,然后进入摸板编辑里覆盖<#search#>就可以了,如果摸板里找不到<#search#>,那么找到合适的位置放入这段代码就OK,如果你嫌表单太难看,可以在后面加入这段代码:

以下内容为程序代码:

<style type="text/css">
<!--
input { font-family: "Georgia", "Times New Roman", "Times", "serif"; font-size: 9pt; border: 1px #CCCCCC solid}
-->
</style>


这样,你的BLOG就支持准全文检索了,当然如果你设置了日志的关键字将更容易的被浏览者搜索到了。

相关主题相关主题
中国博客网加入Flash博客特效技巧
中国博客网加入Flash日历技巧