dede5.7 template dede31 paging text collection filtering rules detailed graphic tutorial continued four

WBOY
Release: 2016-07-29 08:36:51
Original
1296 people have browsed it

At this point, the paging content matching is completed.
After article content matching and paging content matching are completed, there is only "filtering" in the end, including paging area filtering and article content filtering. According to my own feeling, the above two rules are easy to write. As long as you find the "uniqueness" code in all links, you can get it done. However, there are endless mysteries in the filtering rules that I can't explain... Haha, it feels like That's it. Especially for a novice like me, the word "regularity" is like a book from heaven. I searched for several regularity-related software and still found it impossible to start, so I had to follow the same pattern, imitate the cat and the tiger, and fumble around.
Okay, enough gossip. If you are tired, just listen to "Hotel California" and relax here: Hotel California_Eagles 94 Live.
Have you figured out how to write the filtering rules at a glance? Anyway, I couldn’t figure it out. I can’t help it. A novice is a novice. Ignore it, then write a rule according to the original example of paging filtering rules and try it to see the result:

Copy the code The code is as follows:


{dede:trim}(.*) Page{/dede:trim}


Collect it:
 dede31分页文字采集过滤规则详说图文教程续四
Paging is successful, but there are many waste codes and need to be changed!
Look at the redundant code features, it seems to be The filtering scope is not enough, and a lot of subsequent content needs to be filtered out. Well, move the filtering area further back, directly to the red part (in fact, when I changed the filtering rules, I changed it several times, so I’ll just do it here once, so as not to waste my friends’ time):
 dede31分页文字采集过滤规则详说图文教程续四
Write a complete paging filtering rule:

Copy the code The code is as follows:


{dede:trim}(.*){/dede:trim}


Collect it again and see the results:
 dede31分页文字采集过滤规则详说图文教程续四
Okay, paging is successful, no redundant code. At this point, all the main code parts are completed.
The results are here:
With pagination: Materials for rectification and analysis of the style of party members and cadres
Without pagination: Work plan of the Ministry of Literature and Art
Write a completed site rule:

Copy the code The code is as follows:


{!-- Basic node information --}
{dede:item name='Tianshui_Work Plan_1 Page'
imgurl='/upimg' imgdir='../upimg' language='gb2312' typeid= '1' macthtype='string'}
{/dede:item}
{!-- Collection list acquisition rules --}
{dede:list source='var' sourcetype='list'
varstart='' varend= ''}
{dede:url value='http://www.tiansou.net/Html/Y_CYFW/R_Gzzj/F_Gzjh/index.html'}{/dede:url}
{dede:need}Gzjh/2007- {/dede:need}
{dede:cannot}Gzjh/2007-1{/dede:cannot}
{dede:linkarea}[var:area]{/dede:linkarea}
{/dede:list}
{! -- Web page content acquisition rules --}
{dede:art}
{dede:sppage sptype='full'}Home page Previous page [var: paging area] Page{/dede:sppage}
{dede:note field='dede_archives.title' value='[var:content]' comment='article title'
isunit='' isdown=''}
{dede:match }[var:content]--Tianshui search{/dede:match}
{dede:function}{/dede:function}
{/dede:note}
{dede:note field ='dede_archives.sortrank' value='[var:content]' comment='sort level'
isunit='' isdown=''}
{dede:match}{/dede:match}
{dede:function}@ me = time();{/dede:function}
{/dede:note}
{dede:note field='dede_archives.writer' value='[var:content]' comment='article author'
isunit=' ' isdown=''}
{dede:match}{/dede:match}
{dede:function}{/dede:function}
{/dede:note}
{dede:note field='dede_archives.litpic' value ='[var:content]' comment='thumbnail'
isunit='' isdown=''}
{dede:match}{/dede:match}
{dede:function}@me = @litpic;{/ dede:function}
{/dede:note}
{dede:note field='dede_archives.pubdate' value='[var:content]' comment='release time'
isunit='' isdown=''}
{ dede:match}{/dede:match}
{dede:function}if(@me!="") @me = GetMkTime(@me);
else @me = time();{/dede:function}
{/dede:note}
{dede:note field='dede_archives.senddate' value='[var:content]' comment='entry time'
isunit='' isdown=''}
{dede:match}{ /dede:match}
{dede:function}@me = time();{/dede:function}
{/dede:note}
{dede:note field='dede_addonarticle.body' value='[var:content | TD>
                                                                             
                                                                                                 TR>{/dede:match}
{dede:trim}(.*){/ dede:trim}
{dede:trim}
{/dede:trim}
{dede:trim}]*)>{/dede:trim}
{dede:trim}< embed([^>]*)>([^>]*){/dede:trim}
 {dede:trim}]*)>{ /dede:trim}
{dede:trim}{/dede:trim}
{dede:trim}]*)>([^>]*)< ;/object>{/dede:trim}
{dede:trim}]*)>{/dede:trim}
    {dede:trim}{/dede:trim}
    {dede:trim}]*)>([^>]*){/dede:trim}
    {dede:trim}]*)>{/dede:trim}
    {dede:trim}{/dede:trim}
    {dede:trim}]*)>([^>]*){/dede:trim}
    {dede:trim}]*)>{/dede:trim}
    {dede:trim}{/dede:trim}
    {dede:trim}]*)>([^>]*){/dede:trim}
    {dede:trim}]*)>{/dede:trim}
    {dede:trim}{/dede:trim}
    {dede:trim}]*)>([^<]*){/dede:trim}
    {dede:trim}]*)>{/dede:trim}
    {dede:trim}{/dede:trim}
    {dede:trim}]*)>{/dede:trim}
    {dede:trim}]*)>([^<]*){/dede:trim}
    {dede:trim}]*)>{/dede:trim}
    {dede:trim}{/dede:trim}
    {dede:trim}]*)>([^>]*){/dede:trim}
    {dede:trim}]*)>{/dede:trim}
    {dede:trim}{/dede:trim}
    {dede:trim}]*)>([^>]*){/dede:trim}
    {dede:trim}]*)>{/dede:trim}
    {dede:trim}{/dede:trim}
    {dede:trim}]*)>([^>]*){/dede:trim}
    {dede:trim}{/dede:trim}
    {dede:trim}{/dede:trim}
    {dede:trim}]*)>([^>]*){/dede:trim}
    {dede:trim}]*)>{/dede:trim}
    {dede:trim}{/dede:trim}
    {dede:trim} {/dede:trim}
    {dede:function}{/dede:function}
  {/dede:note}
  {dede:note field='dede_archives.source' value='[var:内容]' comment='文章来源' 
  isunit='' isdown=''}
    {dede:match}{/dede:match}
    {dede:function}@me ='互联网'{/dede:function}
  {/dede:note}
{/dede:art}

以上就介绍了dede5.7模板 dede31分页文字采集过滤规则详说图文教程续四,包括了dede5.7模板方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template