别人写的PHP的CMS都是用很短的语句控制文章怎么实现
别人写的PHP的CMS都是用很短的语句控制文章如何实现
我用过dedecms 他里面的功能是这样的。比如我要调用某个项目里面的 最新更新的10个文章我就可以这样。
{dede:imt xx xx xx } 然后这样就调用出来了。他没有直接查询mysql吗?如何才能坐到这样 给个思路呢?
------解决方案--------------------
标签名称:arclist
标记简介:织梦常用标记,也称为自由列表标记,其中imglist、imginfolist、specart、coolart、autolist都是由该标记所定义的不同属性延伸出来的别名标记。
功能说明:获取指定文档列表
适用范围:全局使用
基本语法:
{dede:arclist flag='h' typeid='' row='' col='' titlelen='' infolen='' imgwidth='' imgheight='' listtype='' orderby='' keyword='' limit='0,1'}
[field:title/]
{/dede:arclist}
typeid='' 栏目ID,在列表模板和档案模板中一般不需要指定,在首页模板中允许用","分开表示多个栏目;
orderby='sortrank' 文档排序方式
§ orderby='hot' 或 orderby='click' 表示按点击数排列
§ orderby='sortrank' 或 orderby='pubdate' 按出版时间排列
§ orderby='near'
§ orderby=='lastpost' 按最后评论时间
§ orderby=='scores' 按得分排序
§ orderby='id' 按文章ID排序
§ orderby='rand' 随机获得指定条件的文档列表
idlist ='' 提取特定文档(文档ID) 调用指定id文档 例子idlist ='4,45,78,237'
limit='起始ID,记录数' (起始ID从0开始)表示限定的记录范围(如:limit='1,2' 表示从ID为1的记录开始,取2条记录)
keyword='' 含有指定关键字的文档列表,多个关键字用","分
orderway='desc' 值为 desc 或 asc ,指定排序方式是降序还是顺向排序,默认为降序
使用实例
调用推荐文章
{dede:arclist flag="c" channelid='' row='10' titlelen='60' orderby=''}
{/dede:arclist}
row='10' 调用10条, titlelen='60'标题长度为30汉字 flag="c" 推荐文章 orderby='' 默认为按发布时间排序
flag = 'c' 自定义属性值:头条[h] 推荐[c] 图片[p] 幻灯[f] 滚动[s] 跳转[j] 图文[a] 加粗
调用最新文章按发布时间排序
{dede:arclist channelid='' row='10' titlelen='60'}
{/dede:arclist} row='10' 调用10条, titlelen='60'标题长度为30汉字
按ID排序降序排列,从大到小
{dede:arclist channelid='' row='10' titlelen='60' orderby='id' }
{/dede:arclist} row='10' 调用10条, titlelen='60'标题长度为30汉字 orderby='id' 按ID,降序排列
按ID排序顺序排列,从小到大
{dede:arclist channelid='' row='10' titlelen='60' orderby='id' orderway='asc' }
{/dede:arclist} row='10' 调用10条, titlelen='60'标题长度为30汉字 orderby='id' 按ID,orderway='desc' 值为 desc 或 asc ,指定排序方式是降序还是顺向排序,默认为降序
调用含有缩图的文档
{dede:arclist flag="p" row='10' titlelen='60'}
![[field:fulltitle /]](/static/imghw/default1.png)
[field:title /]
{/dede:arclist} flag = 'p' 自定义属性值:头条[h] 推荐[c] 图片[p] 幻灯[f] 滚动[s] 跳转[j] 图文[a] 加粗
日期的各种格式
08 [field:pubdate function=strftime('%d',@me)/]
08 日 [field:pubdate function=strftime('%d日',@me)/]
06-08 [field:pubdate function=strftime('%m-%d',@me)/]
06月08日 [field:pubdate function=strftime('%m月%d日',@me)/]
09-06-08 [field:pubdate function=strftime('%y-%m-%d',@me)/]
2009-06-08 [field:pubdate function=strftime('%Y-%m-%d',@me)/]
09年06月08日 [field:pubdate function=strftime('%y年%m月%d日',@me)/]
2009年06月08日 [field:pubdate function=strftime('%Y年%m月%d日',@me)/]
2009-06-08 13:28 [field:pubdate function=strftime('%Y-%m-%d %H:%M',@me)/]

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











PHP and Python each have their own advantages, and choose according to project requirements. 1.PHP is suitable for web development, especially for rapid development and maintenance of websites. 2. Python is suitable for data science, machine learning and artificial intelligence, with concise syntax and suitable for beginners.

In PHP, password_hash and password_verify functions should be used to implement secure password hashing, and MD5 or SHA1 should not be used. 1) password_hash generates a hash containing salt values to enhance security. 2) Password_verify verify password and ensure security by comparing hash values. 3) MD5 and SHA1 are vulnerable and lack salt values, and are not suitable for modern password security.

PHP is widely used in e-commerce, content management systems and API development. 1) E-commerce: used for shopping cart function and payment processing. 2) Content management system: used for dynamic content generation and user management. 3) API development: used for RESTful API development and API security. Through performance optimization and best practices, the efficiency and maintainability of PHP applications are improved.

PHP is a scripting language widely used on the server side, especially suitable for web development. 1.PHP can embed HTML, process HTTP requests and responses, and supports a variety of databases. 2.PHP is used to generate dynamic web content, process form data, access databases, etc., with strong community support and open source resources. 3. PHP is an interpreted language, and the execution process includes lexical analysis, grammatical analysis, compilation and execution. 4.PHP can be combined with MySQL for advanced applications such as user registration systems. 5. When debugging PHP, you can use functions such as error_reporting() and var_dump(). 6. Optimize PHP code to use caching mechanisms, optimize database queries and use built-in functions. 7

PHP is still dynamic and still occupies an important position in the field of modern programming. 1) PHP's simplicity and powerful community support make it widely used in web development; 2) Its flexibility and stability make it outstanding in handling web forms, database operations and file processing; 3) PHP is constantly evolving and optimizing, suitable for beginners and experienced developers.

PHP type prompts to improve code quality and readability. 1) Scalar type tips: Since PHP7.0, basic data types are allowed to be specified in function parameters, such as int, float, etc. 2) Return type prompt: Ensure the consistency of the function return value type. 3) Union type prompt: Since PHP8.0, multiple types are allowed to be specified in function parameters or return values. 4) Nullable type prompt: Allows to include null values and handle functions that may return null values.

PHP and Python have their own advantages and disadvantages, and the choice depends on project needs and personal preferences. 1.PHP is suitable for rapid development and maintenance of large-scale web applications. 2. Python dominates the field of data science and machine learning.

PHP is suitable for web development, especially in rapid development and processing dynamic content, but is not good at data science and enterprise-level applications. Compared with Python, PHP has more advantages in web development, but is not as good as Python in the field of data science; compared with Java, PHP performs worse in enterprise-level applications, but is more flexible in web development; compared with JavaScript, PHP is more concise in back-end development, but is not as good as JavaScript in front-end development.
