Home>Article>Backend Development> phpcms v9 comes with collection module function experience
What is the function of the collection module that comes with Phpcms v9, one of the mainstream CMS systems? Phpcms v9 has three built-in content models: articles, pictures, and downloads by default. Let’s take a look at the most common article collection first. Don’t miss it if you are interested. Haha, I hope it can help you
The latest version of Phpcms website management system is Phpcms v9. As one of the mainstream CMS systems in China, it has been applied to tens of thousands of websites. So let’s take a look at the functions of its own collection module.
Article collection
Phpcms v9 has three built-in content models: articles, pictures, and downloads by default. Let’s look at the most common article collection first. Take the collection of Sina Internet channels and domestic rolling news columns as an example http://roll.tech.sina.com.cn/internet_chinalist/index_1.shtml
1. Enter the background, content - content release management - Collection management - add collection points. (Different from previous versions of Phpcms, collection management is in the module menu)
2. URL rules. Fill in the collection project name casually, and the collection page encoding defaults to GBK. When collecting a specific page, you can view its web page source code.
Website collection, there is no big feature, fill it in by checking the URL rules of the page you want to collect. Analyzing the target page shows that it is a sequence of URLs, and the URLs of the content to be obtained are between the two tags and . There are no other interfering links, so there is no need to define characters that must and must not be included in the URL. If the target website is configured with Base, it must also be configured.
The URL collection configuration is completed, but if the target website list page uses js to implement the upper and lower pages, or the depth of the URL to be obtained exceeds 2 levels, it will be difficult to achieve it with this built-in collection. .
3. Content rules. phpcms uses "[content]" as a wildcard, then sets the starting and ending characters, and then filters unwanted codes to collect content. The title tag of the analysis target page is relatively regular and can be set directly as shown in the figure.
The filtering format is "Content to be filtered [|] Replacement value". If it is deleted, leave the replacement value blank. The filtering rules support regular expressions. The system comes with several common tag filtering rules. It is a bit difficult for novices to filter more flexibly, so novices need to be familiar with regular expressions first.
Author rules, source rules, and time rules are obtained according to the rules. The editor tried the fixed value and found that it cannot be achieved, that is, setting a certain tag as a fixed value. For example, setting the "source" to http://www.sina.com.cn, but the source tag of the collection result is empty.
Content rules, fill in the start and end tags, the target page we tested is relatively clean, so we only need to filter out the hyperlinks and some useless tags inside.
Content pagination rules. If the content page has pagination, it must be filled in. There are no pagination in the articles here. The editor will introduce this tag in the following picture collection.
4. Customize rules. In addition to the default tags of the system, you can also customize various tags. The rules are the same, but there is one thing to note: the English name of the rule must be filled in, otherwise it will automatically The definition label cannot be saved.
5. Advanced configuration. This time you can set download pictures, picture watermarks, content paging and import order. Note that if you need a watermark, remember to modify the watermark image of your website. The watermark storage path is: statics/images/water
6. After the rules are set, submit and return to collection. To manage the homepage, you can first test to see if each label is accurate.
7. Publish content. If they are all accurate, click Collect URL first. The article address will be automatically collected and duplicate URLs will be filtered. Then a message that the collection of URLs is completed will pop up. Click "Collect article content"
The collection will automatically proceed and the collection progress will be displayed.
After the collection is completed, you will automatically return to the collection management homepage, click Content Publish, enter the list of collected articles, check the articles to be published, or directly click Import All at the bottom .
Enter the publishing plan selection interface, create a new publishing plan, and select a publishing column. This test selected the column "domestic" of the article module, which can be set on the new plan page. Automatically extract abstracts, automatically extract thumbnails, import article status, tags and database correspondence. Among them, there is only one "Publish" status for imported articles. If the webmaster needs the status to be pending review, he must first modify the workflow of the corresponding column to be first-level review.
In the corresponding relationship between tags and databases, match the collection tags with database fields one-to-one. If there is a custom tag that cannot find the corresponding field, you need to modify the model to add fields, and then Displaying it by modifying the template has relatively high technical requirements and is not suitable for novices. In addition, the system comes with several processing functions, which are also quite practical.
The publishing plan is set up, and the article you just selected will automatically start to be imported. There is no need to create a plan for the next import, just select the already built plan.
Article collection and publication completed. Take a look at the effect:
Backend content management page
Content page
Let’s take a look Look at picture collection
Picture collection
phpcms v9 comes with a picture model. It also has a grouping mode for picture processing, which is convenient for some webmasters to build picture websites or set up picture displays. Way. Let’s experience using the built-in collection program to collect pictures. Take the collection of pictures from the http://www.4493.com/mingxingxiezhen/ page as an example:
Website acquisition rules and content acquisition rules are all the same as the article The collection is the same, but the most important point is that the picture collection of phpcms v9 cannot only collect the image address, but should collect the entiretag so that it can be processed into a group picture. For example, in this example: the content tag is set to
The collected content should be like this
There is also a paging Question, the paging of the target site is as shown in the figure:
The web page code is:
So just add the content Select the list all mode for paging rules, then fill in the starting and ending characters of the paging tag, and the system will automatically collect the paging content.
After setting the rules, collect the URL, collect the content, and publish the content. Please pay attention when publishing the plan. After several attempts, the editor found that in order to implement the group picture mode, both the content field and the group picture field must use the "process as group picture" function. But in this way, it is impossible to obtain the content image as a thumbnail, so it is best to customize a thumbnail label and directly obtain the address of a content image as a thumbnail.
Publish after setting. See the collection effect:
Column page
##Content pageSummary:After careful experience, the collection function that comes with phpcms v9 is relatively comprehensive and can meet the basic collection of articles and pictures. However, it is not flexible enough and is obviously insufficient for some high-demand webmasters. Moreover, the threshold is high, and the official description and help files of the collection module are very limited, which is not conducive for novices to get started.
The above is the detailed content of phpcms v9 comes with collection module function experience. For more information, please follow other related articles on the PHP Chinese website!