新闻中心

phpbb3怎么在网站内添加google搜索

作者 / 无忧主机 时间 2014-05-30 16:58:04

对于使用phpbb的用户大部分都是喜欢国外环境的用户,对于国内的百度搜索并不习惯,phpbb本身的搜索功能也没有google的功能强大,如果能把phpbb和谷歌搜索整合该多好啊,无忧主机小编参考了以前网站整合百度搜索的经验和phpbb官网的材料终于完成了这篇整合教程,下面无忧主机小编就非常荣幸的给大家讲解phpbb整合google搜索的全部过程。 1、用谷歌搜索驱动现有的站长搜索 通过ftp工具连接您的php虚拟主机 打开styles/prosilver/template/overall_header.html <form action="{U_SEARCH}" method="get" id="search"> <fieldset> <input name="keywords" id="keywords" type="text" maxlength="128" title="{L_SEARCH_KEYWORDS}" class="inputbox search" value="<!-- IF SEARCH_WORDS-->{SEARCH_WORDS}<!-- ELSE -->{L_SEARCH_MINI}<!-- ENDIF -->" onclick="if(this.value=='{LA_SEARCH_MINI}')this.value='';" onblur="if(this.value=='')this.value='{LA_SEARCH_MINI}';" /> <input class="button2" value="{L_SEARCH}" type="submit" /><br /> <a href="{U_SEARCH}" title="{L_SEARCH_ADV_EXPLAIN}">{L_SEARCH_ADV}</a> {S_SEARCH_HIDDEN_FIELDS} </fieldset> </form> 把这些代码替换成: <form method="get" action="http://www.google.com/search" target="google_window"> <input type="text" style="color: #000000" name="q" size="30"maxlength="255" value=" 试试google搜索..." onfocus="if(this.value==' 试试google搜索...')this.value=''" onblur="if(this.value=='')this.value=' 试试google搜索...'"/> <input type="submit" style="color: #000000" name="sa" value="Search"></input> <input type="hidden" name="sitesearch" value="www.linuxsir.tk" checked="checked"><br /> </form> 2、整合谷歌到高级搜索 打开styles/prosilver/template/search_body.html 找到: <h2 class="solo">{L_SEARCH}</h2> 在上面这段代码后面添加 <div class="panel bg3"> <div class="inner"> <span class="corners-top"><span></span></span> <h3>Google Search query</h3> <fieldset> <dl> <dt><label for="q">Google Site Search:</label><br><span>To search a phrase, surround in double quotes ""<br/> To exclude terms, lead with -<br/> For exact terms, lead with +<br/>For wildcards use * </span></dt> <dd> <form method="get" action="http://www.google.com/search"> <input type="text" name="q" size="40" maxlength="255" value="" class="inputbox"/><br/> <input type="radio" name="sitesearch" value="bbs.linuxsir.tk" checked="checked" /> 仅论坛 <br/> <input type="radio" name="sitesearch" value="www.linuxsir.tk" /> 整个网络<br/> <input type="submit" value="Google Search" /> </form> </dd> </dl> </fieldset> </div> <span class="corners-bottom"><span></span></span> </div> 添加好就可以看到新的搜索功能了,当然上传的时候要注意编码格式的问题。 相关文章推荐阅读: PHPBB如何找回网站后台管理员密码 PHPBB论坛系统安装中文语言包的完整教程 如何在PHPBB论坛首页调用最新帖子和最新回复

本文地址:https://www.51php.com/phpbb/14231.html

1
1
1
1
1
1
1

客户服务热线

0791-8623-3537

在线客服