1. <tfoot id='znv33pgw'></tfoot>
      <bdo id='955t63kg'></bdo><ul id='djmx75ew'></ul>

    <small id='6veubshy'></small><noframes id='98ejoir4'>

    <legend id='w6udm7kz'><style id='cdo25lbo'><dir id='7916ifbo'><q id='j3kgvera'></q></dir></style></legend>

    1. <i id='woeqwumz'><tr id='sp4zj9b7'><dt id='8qcrav0n'><q id='wqtb2smw'><span id='0fuuen7c'><b id='2yw7xe6r'><form id='alghqvzj'><ins id='8jj12zw2'></ins><ul id='5yh3kzui'></ul><sub id='zkww9hg2'></sub></form><legend id='9l1d8dfo'></legend><bdo id='os3kgdf7'><pre id='3a1yc6lv'><center id='eqojmk8d'></center></pre></bdo></b><th id='gdlme75s'></th></span></q></dt></tr></i><div id='n436u7gw'><tfoot id='o8srmi6h'></tfoot><dl id='dukk8kd4'><fieldset id='x9picv4o'></fieldset></dl></div>

      精准传达 • 价值共享

      洞悉互联网前沿资讯,探寻网站营销规律

      DEDECMS织梦栏目和内容页调用相关文章

      作者: 庚午网络 | 2020-12-13 12:30 |点击:

      关键词

      <legend id='6def9iri'><style id='6kxydapz'><dir id='w6tr4ivf'><q id='9yuoi8pw'></q></dir></style></legend>
      • <bdo id='2kepsnjx'></bdo><ul id='zvzn430d'></ul>
          <tbody id='ln4z1wxu'></tbody>

        1. <i id='1x6nfbul'><tr id='b1rls0m1'><dt id='4t8jvajr'><q id='piey3qs1'><span id='lobfx5re'><b id='x3ndgo3j'><form id='2onobpdc'><ins id='ysp4ycv6'></ins><ul id='q7xqnoft'></ul><sub id='78rucild'></sub></form><legend id='8t9jnjzf'></legend><bdo id='nfrchpw0'><pre id='bqgwhluu'><center id='ldi5t7xm'></center></pre></bdo></b><th id='xnt1cfry'></th></span></q></dt></tr></i><div id='83c35two'><tfoot id='ylipdaf4'></tfoot><dl id='3c2cakbh'><fieldset id='7tsqzrrf'></fieldset></dl></div>
              <tfoot id='com2iipv'></tfoot>

              <small id='blgqbk96'></small><noframes id='81dpfadj'>

              1. 摘要:调用相关文章,有时候发现网站的内容根本不是相关的  我们可以用织梦的sql来查询调用

                调用相关文章,如果是内容页调用则不包含当前这一篇文章

                实现方法

                把下面代码放到模板你想显示的位置

                如果想要更改样式  更改$result .= "<li><a href="{$row['arcurl']}"><img src="{$row['litpic']}">{$row['title']}</a></li>"; 即可

                注意使用单引号

                默认调用的是10篇 修改的地方是在
                desc limit 0, 10 将10改成自己想要的条数

                {dede:field.keywords runphp=yes}
                global $dsql,$id,$aid;
                $aid = isset($id) ? $id : $aid;
                $keyword = '';
                if(!empty(@me))
                {
                    $keywords = explode(',' , trim(@me));
                    $keyword = '';
                    $n = 1;
                    foreach($keywords as $k)
                    {
                        if($n > 3)  break;
                        
                        if(trim($k)=='') continue;
                        else $k = addslashes($k);
                        
                        $keyword .= ($keyword=='' ? " CONCAT(arc.keywords,' ',arc.title) LIKE '%$k%' " : " OR CONCAT(arc.keywords,' ',arc.title) LIKE '%$k%' ");
                        $n++;
                    }
                }
                if($keyword != '')
                {
                    $sql = "SELECT arc.*,tp.typedir,tp.typename,tp.corank,tp.isdefault,tp.defaultname,tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath FROM `dede_archives` arc LEFT JOIN `dede_arctype` tp ON arc.typeid=tp.id where arc.arcrank>-1 AND ($keyword) AND arc.id<>'$aid' ORDER BY arc.id desc limit 0, 10";
                }
                
                $dsql->SetQuery($sql);
                $dsql->Execute('t');
                $result = '';
                while($row = $dsql->GetArray('t'))
                {
                	$arcrow = GetOneArchive($row['id']);
                	$row['arcurl'] = $arcrow['arcurl'];
                	$row['pubdate'] = MyDate('Y-m-d',$row['pubdate']);
                	$row['litpic'] = $row['litpic'] = $row['litpic']=='' ? '/images/defaultpic.gif' : $row['litpic'];
                	$result .= "<li><a href="{$row['arcurl']}"><img src="{$row['litpic']}">{$row['title']}</a></li>";
                }
                @me = $result;
                {/dede:field.keywords}

                二度创作,如有侵权请联系删除。如没特殊注明,文章均为庚午网络原创,转载请注明https://www.hngengwu.com/gengwuwenku/576.html

                1. <legend id='9lic9n9z'><style id='u6pakxs8'><dir id='rdsaig1c'><q id='titk5hl8'></q></dir></style></legend>
                2. <tfoot id='3etnikev'></tfoot>
                    <bdo id='r5c5vzc8'></bdo><ul id='pnq032uv'></ul>

                  <small id='3aps4ogv'></small><noframes id='3t6e5e7n'>

                  <i id='1khczc7e'><tr id='apwbgwz7'><dt id='w4wgf3s4'><q id='pad4ys7t'><span id='cbbkmty4'><b id='5hfyrkt8'><form id='da0ctiiq'><ins id='ck6w6ulh'></ins><ul id='059o0gi1'></ul><sub id='th7jix32'></sub></form><legend id='fqefgdrm'></legend><bdo id='p1zvq3ta'><pre id='q6s81aca'><center id='enviz3no'></center></pre></bdo></b><th id='er05zqao'></th></span></q></dt></tr></i><div id='eme5whmi'><tfoot id='27sibvpa'></tfoot><dl id='bh32dwpv'><fieldset id='3y44faov'></fieldset></dl></div>

                  1. 多一份策划方案,总有益处。

                    请直接添加技术总监微信联系咨询

                    网站设计 品牌营销

                    多一份参考,总有益处

                    联系庚午网络,获得专属《策划方案》及报价

                    咨询相关问题或预约面谈,可以通过以下方式与我们联系

                    业务热线:18574395938 / 大客户专线:18574395938