Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to set the dynamic browsing of dedecms single table model

Shulou Source: shulou.com Published: 2022-06-02 03:31:48 09月15日 Update

This article mainly introduces how to set up the dynamic browsing of dedecms single-table model, which can be used for reference by friends who need it. I hope you will learn a lot after reading this article. Next, let the editor take you to learn about it.

How to set the dynamic browsing of dedecms single table model?

Arclistsg tag, document list invocation tag for single table independent model

Method 1:

In the use of the arclist tag, there is a field ismake field in the main table dede_archives. We should know that the value of-1 is dynamic, and our method is to imitate this.

For the creation of a single table model, there is no ismake field by default, because we manually create an ismake field and set it to pass a value of-1.

Note: when you create a model, you can add an ismake field. If not, you can add it directly to the corresponding table and add the ismake field to the listfields in the dede_ channel type table to add the query field. If the last step is over and it doesn't work, you can query whether listfields has ismake.

Modify the source code:

First, in the arclistsg source code, about 264 lines, find $row ['arcurl'] this, GetFileUrl () [this function is in helpers/channelunit.helper.php], which is used to obtain the url address, in which there is an ismake parameter. If you are interested, you can take a look at this function.

Our goal is to change 1 [$row [1] after 'title'] in the GetFileUrl () parameter to $row [' ismake'].

Note: if you only need the arclistsg tag to display the dynamic, then this step is fine.

Second, modify arc.sglistview.class.php, about 760 lines, and comment out $row ['ismake'] = 1; comment out the following lines, $row [' arcurl'] = GetFileUrl () has the same code as in the first step, and change it to the same as in the first step.

At this point, you can basically achieve dynamic browsing, but when you add or modify, you will still generate a html file, which will correspond to the code comments that the release program or modification program will generate html.

Method 2:

In fact, it is the same as method 1. If you do not want to establish the ismake field, just change the corresponding local method to-1, but the compatibility is not very good.

Thank you for reading this article carefully. I hope the editor will share the dedecms single table model and how to set up the content dynamically. At the same time, I also hope you will support us, pay attention to the industry information channel, and find out if you encounter problems. Detailed solutions are waiting for you to learn!

Tags: Fields dynamics models methods browsing that is tags articles code functions functions parameters comments source code programs queries generation one-to-one not much value Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology macOS Apple Docker Shulou Tech Info