加入收藏 | 设为首页 | 会员中心 | 我要投稿 平顶山站长网 (https://www.0375zz.cn/)- 分布式云、数据处理、媒体处理、图像分析、基础存储!
当前位置: 首页 > 教程 > 正文

织梦DEDECMS搜索结果页按频道模型显示不同模板的方法

发布时间:2022-09-01 12:34:29 所属栏目:教程 来源:互联网
导读:.formsearch.action={dede:field name=phpurl/}/search_images.php 06 else 07 document.formsearch.action={dede:field name=phpurl/}/search.php 08 } 09 -- 10 /script2.更改搜索代码 01 form name=formsearch action= *****ubmit=check(); 02 div class=
  .formsearch.action="{dede:field name='phpurl'/}/search_images.php"
  06
    else
  07
    document.formsearch.action="{dede:field name='phpurl'/}/search.php"
  08
   }
  09
  -->
  10
  </script>2.更改搜索代码
  01
  <form  name="formsearch" action="" *****ubmit="check();">
  02
          <div class="form">
  03
             <input type="hidden" name="kwtype" value="0" />
  04
             <input name="q" type="text" class="search-keyword" id="search-keyword"
  05
   
  06
   value="{dede:global name='keyword' function='RemoveXSS(@me)'/}" />
  07
         <select name="channeltype" id="channeltype" >
  08
      <option value='1' selected='1'>新闻</option>
  09
          <option value='3'>软件</option>
  10
             </select>
  11
            <button type="submit" class="search-submit">搜索</button>
  12
          </div>
  13
     </form>
  其中重点就是
 
  1
  <select name="channeltype" id="channeltype" >
  2
      <option value='1' selected='1'>新闻</option>
  3
      <option value='3'>软件</option>
  4
  </select>这里设置的按游戏模型搜索  1是文章模型 3是软件模型
  3.复制serach.php 更名为 search_images.php
  4.打开 search_images.php
  require_once(DEDEINC."/arc.searchview.class.php");
 
  更改为
 
  require_once(DEDEINC."/arc.searchimg.class.php");
 
  5.复制 arc.searchview.class.php 更名为 arc.searchimg.class.php
  6.打开 arc.searchimg.class.php
  修改
  $tempfile = $GLOBALS['cfg_basedir'].$GLOBALS['cfg_templets_dir']."/".$GLOBALS['cfg_df_style']."/search.htm";
 
  为
  $tempfile = $GLOBALS['cfg_basedir'].$GLOBALS['cfg_templets_dir']."/".$GLOBALS['cfg_df_style']."/search_images.htm";
 
  核心的修改已经结束了,剩下的就是在search_images.htm这个模板里自由发挥了。同理也可以实现按栏目type搜索显示不同风格的结果页得。
 

(编辑:平顶山站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    热点阅读