search
Homephp教程php手册dede 单表模型动态浏览设置 arclistsg arc.sglistview.class.php

比如,分类信息,内容页默认都是生成静态的,如果有需要设为动态访问的,可以参考如下方法:

  arclistsg 标签,单表独立模型的文档列表调用标记

  方法一:


  在arclist标签使用中,其对应主表dede_archives中有一个字段ismake字段,其作用大家应该知道,值为-1时动态,我们的方法就是模仿这个。

  单表模型的创建,默认是不没有ismake字段,因为我们手工创建一个ismake字段,设其传值为-1。

  注:创建模型时,可以添加一个ismake字段。如果没有,则可以在对应表中直接添加,并在dede_channeltype表中的listfields中加上ismake字段,此举为添加查询字段。如果最后一步都完了,发现不起作用,可以查询listfields是否有ismake

  修改源码:

    第一,arclistsg 源码中,大约在264行,找到$row['arcurl']这个,GetFileUrl()【这个函数在        helpers/channelunit.helper.php中】,就是获取url地址用的,其中有一个ismake参数,有兴趣可以看看这个函数。

我们的目的就是将GetFileUrl()参数中的 1[$row['title']后面的1] 改为$row['ismake']

      注:如果只需要arclistsg标签显示动态,则到此步就可以了

    第二,修改arc.sglistview.class.php,大约760行,将$row['ismake'] = 1;注释掉,下其下面的几行,有$row['arcurl'] = GetFileUrl()有与第一步中的代码,改成第一步中一样的即可

 

  到此,基本上可以实现动态浏览,不过在新增或修改时还是会生成html文件,将对应发布程序或修改程序将生成html的代码注释就可以了。

 

  方法二:

    其实和方法一是一个道理,如果不想建立ismake字段,将对应的地方法修改为-1就可以了,不过这样做兼容性不怎么好,建议方法一

 

        

 

 

Statement
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 Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)