Home > Backend Development > PHP Tutorial > Dede3.1 paging text collection and filtering rules detailed (graphic tutorial) continued 4_PHP tutorial

Dede3.1 paging text collection and filtering rules detailed (graphic tutorial) continued 4_PHP tutorial

WBOY
Release: 2016-07-21 15:55:35
Original
774 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 novices like me, this thing of "regularity" is like a book from heaven. I found several regularity-related software and still felt that I couldn't get started, so I had to follow the same pattern, copy 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:

Dede3.1 paging text collection and filtering rules detailed (graphic tutorial) continued 4_PHP tutorial
Paging is successful, but there are many waste codes and must be changed!
Looking at the redundant code features, it seems that the filtering range is not enough, and a lot of content behind it needs to be filtered out. Well, move the filtering area further back, directly to the red part (in fact, when I change the filtering rules, I have changed it several times, so I will do it here once, so as not to waste my friends’ time):

Dede3.1 paging text collection and filtering rules detailed (graphic tutorial) continued 4_PHP tutorial
Write a complete paging filtering rule:
Copy the code The code is as follows:

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

Collect again and see the results:

Dede3.1 paging text collection and filtering rules detailed (graphic tutorial) continued 4_PHP tutorial

Okay Yes, 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 Literature and Art Department
Write a completed site rule:
Copy 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 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='Published 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]' comment='article content'
isunit=' 1' isdown='1'}

{dede:match}
🎜>                                                                                                                              🎜>                                                                                        ;
                                                                                     select>{/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: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}


www.bkjia.comtruehttp://www.bkjia.com/PHPjc/318214.htmlTechArticle至此,分页内容匹配进行完毕。 文章内容匹配、分页内容匹配都进行完后,最后就只有“过滤”了,包括分页区域过滤和文章内容过滤。据...
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