dede搜索一些如何使用心得

决定转身就不要频频回头,酷的人才会被记得久一些。早安!没什么可懊恼的,能被拆散的,其实都不是属于你的,继续下一个吧。早安!
1站内搜索增加个仅搜索当前频道功能 其实自己有搜索框加一个栏目选择的项就行了,系统不必要自动去生成 高级搜索里可选的条件,你全都可以用 Quote: <select name="channeltype" id="channeltype" style="width:100"> <option value="0" selected>--不限--</option> <option value='4'>Flash</option> <option value='3'>软件</option> <option value='2'>图片集</option> <option value='1'>普通文章</option> </select> 如果不想用户选择,你直接加 <input type='hidden' name='channeltype' value="{dede:field name='channeltype'/}"> 这样也行 2 最新5.1随便搜索一串数字出错 提示信息如下: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') limit 500' at line 1 - Execute Query False! Select aid from dede_full_search where arcrank > -1 and () limit 500 因搜索未过滤html标签,导致用户可以在搜索出注入html代码,该补丁修改该问题和utf-8版tag标签找不 到以及部分用户尾部丢0的问题 覆盖补丁后请在后台 内容维护搜索关键词管理 处删除不正常的关键词。 解决方法:官方已经出补丁了 下载补丁包下载地址(GBK/UTF8请按版本选择里面的文件) http://www.dedecms.com/upimg/soft/2008/patch20080407.zip 非5.1版请修改 plus/search.php文件 把Copy code$keyword = ereg_replace("[\|\&;\r\n\t%\*\?\(\)\$;,'%-]"," ",trim($keyword)); 替换为Copy code$keyword = ereg_replace("[\|\&;\r\n\t%\*\?\(\)\$;,'%<>]"," ",trim($keyword)); 3 文章关键字自动对应搜索的办法 {dede:field name='keywords' runphp='yes' } if(!empty(@me)){ $kws = explode(' ',@me); @me = ""; foreach($kws as $k){ @me .= "<a rel="nofollow noopener noreferrer" href='/cms/plus/search.php?keyword=".urlencode($k)."' >$k</a> "; } @me= str_replace('+', ' ',trim(@me)); } {/dede:field} 列表页中的关键字自动连接对应办法,// 关键字: [field:keywords runphp='yes'] if(!empty(@me)){ $kws = explode(' ',@me); @me = ""; foreach($kws as $k){ @me .= "<a rel="nofollow noopener noreferrer" href='/cms/plus/search.php?keyword=".urlencode($k)."' >$k</a> "; } @me= str_replace('+', ' ',trim(@me)); } [/field:keywords] 4 在文章列表页和搜索结果页调用来源 1 ,改 include 目录下的 inc_arclist_view.php 查找 $query = "Select arc.ID,arc.title,arc.iscommend,arc.color, arc.typeid,arc.ismake,arc.money,arc.description,arc.shorttitle, arc.memberid,arc.writer,arc.postnum,arc.lastpost, arc.pubdate,arc.senddate,arc.arcrank,arc.click,arc.litpic, tp.typedir,tp.typename,tp.isdefault,tp.defaultname, tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl $addField 在 arc.writer, 后面加上 arc.source, (感谢cms2009分享) 2,改inc_arcsearch_view.php 查找:arctype.siteurl 添加,archives.source 5 调用当天搜索关键字,并过滤色情关键字0 Copy code {dede:loop table='dede_search_keywords' sort='lasttime' row='40' if='TO_DAYS(NOW())=TO_DAYS (FROM_UNIXTIME(lasttime)) and keyword regexp "性|黄色|成人|色" =0'} <a class="tag" rel="nofollow noopener noreferrer" href="/plus/search.php?keyword=[field:keyword/]">[field:keyword/]</a> {/dede:loop} 过滤的关键字可以自已加 这个应该明白是什么吧 sort='lasttime' sort='count' TO_DAYS 改成其它MYSQL时间函数还可调用一周内的关键字等,请自行修改! 【好代码教程】实时更新的【热门关键字】!http://bbs.dedecms.com/read.php?tid=15818 6 大大提高搜索准确度的方法 原来的模板的 请将 <form action="{dede:field name='phpurl'/}/search.php" name="formsearch"> <input type="hidden" name="kwtype" value="0"> 改成 <form action="{dede:field name='phpurl'/}/search.php" name="formsearch"> <input type="hidden" name="kwtype" value="1"> 即0改成1 采用“仅搜索标题”的搜索方式, <option value="title" selected>搜索标题</option> 可将这个设为默认,或者干脆删除下面的智能模 糊,那个太不准。 <option value="titlekeyword">智能搜索</option> ----------------------------------- 高级搜索中,可以将模板中的“与”改成默认 <input type="radio" name="kwtype" value="1" checked="checked"/> 与 <input name="kwtype" type="radio" value="0" /> 或 “与”应该就是value="1"的意思,下面的同样采用“仅搜索标题”的方式 总的说来就是“与”(value="1")+“仅搜索标题”=准确 7 如何设置让搜索条可以搜一个汉字 需要修改2个地方 /plus/search.php if($keyword==""||strlen($keyword)<1){ ShowMsg("关键字不能小于1个字节!","-1"); exit(); } /include/inc_arcsearch_view.php codeif(strlen($k)<2) continue;

到此这篇关于dede搜索一些如何使用心得就介绍到这了。路只能走一步是一步,因为明天难以预测,过去已成定局,除了把握好当下,其实别无它。更多相关dede搜索一些如何使用心得内容请查看相关栏目,小编编辑不易,再次感谢大家的支持!

您可能有感兴趣的文章
织梦autoindex,itemindex 的如何使用心得

最模板网站浅谈织梦dedecms如何使用心得

织梦dedecms5.7如何使用心得之TAGS优化

autoindex,itemindex 的如何使用心得

DEDE如何使用心得!务必请看!