dedeHow to sort by ID?
dede sorting problem: How to sort by the ID you wrote and change the function. It can be easily implemented. There is a specific example below. You can refer to the following
Recommended learning: 梦Weavercms
Change the function and implement the sorting method according to your own writing Sort by ID just fine.
Method:
1. Open include/taglib/channelartlist.lib.php, find about 78 lines, and modify the
code as follows:
$dsql->SetQuery("SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath FROM `dede_arctype` WHERE $tpsql ORDER BY sortrank ASC LIMIT $totalnum");
For:
The code is as follows:
$dsql->SetQuery("SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath FROM `dede_arctype` WHERE $tpsql ORDER BY substring_index('$typeid',id,1) LIMIT $totalnum");
2. Front desk call tag:
The code is as follows:
{dede:channelartlist typeid='1,2,3,4,5,6'} {dede:type} <li><a href='[field:typeurl/]' [field:rel/]>[field:typename/]</a></li> {/dede:type} {/dede:channelartlist}
Sort according to the ID of the column, what do you want? Just change the order of IDs,
The above is the detailed content of How dede sorts by ID. For more information, please follow other related articles on the PHP Chinese website!

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

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 Chinese version
Chinese version, very easy to use

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

Zend Studio 13.0.1
Powerful PHP integrated development environment

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.

Atom editor mac version download
The most popular open source editor