Home Backend Development PHP Tutorial dede5.7 template dede31 paging text collection filtering rules detailed graphic tutorial continued four

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

Jul 29, 2016 am 08:36 AM

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教程有兴趣的朋友有所帮助。

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Explain JSON Web Tokens (JWT) and their use case in PHP APIs. Explain JSON Web Tokens (JWT) and their use case in PHP APIs. Apr 05, 2025 am 12:04 AM

JWT is an open standard based on JSON, used to securely transmit information between parties, mainly for identity authentication and information exchange. 1. JWT consists of three parts: Header, Payload and Signature. 2. The working principle of JWT includes three steps: generating JWT, verifying JWT and parsing Payload. 3. When using JWT for authentication in PHP, JWT can be generated and verified, and user role and permission information can be included in advanced usage. 4. Common errors include signature verification failure, token expiration, and payload oversized. Debugging skills include using debugging tools and logging. 5. Performance optimization and best practices include using appropriate signature algorithms, setting validity periods reasonably,

Describe the SOLID principles and how they apply to PHP development. Describe the SOLID principles and how they apply to PHP development. Apr 03, 2025 am 12:04 AM

The application of SOLID principle in PHP development includes: 1. Single responsibility principle (SRP): Each class is responsible for only one function. 2. Open and close principle (OCP): Changes are achieved through extension rather than modification. 3. Lisch's Substitution Principle (LSP): Subclasses can replace base classes without affecting program accuracy. 4. Interface isolation principle (ISP): Use fine-grained interfaces to avoid dependencies and unused methods. 5. Dependency inversion principle (DIP): High and low-level modules rely on abstraction and are implemented through dependency injection.

How to automatically set permissions of unixsocket after system restart? How to automatically set permissions of unixsocket after system restart? Mar 31, 2025 pm 11:54 PM

How to automatically set the permissions of unixsocket after the system restarts. Every time the system restarts, we need to execute the following command to modify the permissions of unixsocket: sudo...

Explain the concept of late static binding in PHP. Explain the concept of late static binding in PHP. Mar 21, 2025 pm 01:33 PM

Article discusses late static binding (LSB) in PHP, introduced in PHP 5.3, allowing runtime resolution of static method calls for more flexible inheritance.Main issue: LSB vs. traditional polymorphism; LSB's practical applications and potential perfo

How to send a POST request containing JSON data using PHP's cURL library? How to send a POST request containing JSON data using PHP's cURL library? Apr 01, 2025 pm 03:12 PM

Sending JSON data using PHP's cURL library In PHP development, it is often necessary to interact with external APIs. One of the common ways is to use cURL library to send POST�...

Framework Security Features: Protecting against vulnerabilities. Framework Security Features: Protecting against vulnerabilities. Mar 28, 2025 pm 05:11 PM

Article discusses essential security features in frameworks to protect against vulnerabilities, including input validation, authentication, and regular updates.

How to debug CLI mode in PHPStorm? How to debug CLI mode in PHPStorm? Apr 01, 2025 pm 02:57 PM

How to debug CLI mode in PHPStorm? When developing with PHPStorm, sometimes we need to debug PHP in command line interface (CLI) mode...

See all articles