search
HomeCMS TutorialDEDECMSWhat is the DEDE sub-column code?

What is the DEDE sub-column code?

DEDE What is the sub-column code?

DEDE sub-column enhancement code

Recommended learning: 梦Weavercms

What is the DEDE sub-column code?

Modify line 178 of the file /include/taglib/arclist.lib.php

The code is as follows:

if($CrossID=='') 
//$orwheres[] = ' typeid in ('.GetSonIds($typeid).')'; 
$orwheres[] = ' typeid in ('.GetSonIds($typeid).') or typeid2 in ('.GetSonIds($typeid).')'; 
else 
//$orwheres[] = ' typeid in ('.GetSonIds($typeid).','.$CrossID.')'; 
$orwheres[] = ' typeid in ('.GetSonIds($typeid).','.$CrossID.') or typeid2 in ('.GetSonIds($typeid).','.$CrossID.')';

content_list.php file line 162

The code is as follows:

if($cid != 0) 
{ 
$whereSql .= ' And arc.typeid in ('.GetSonIds($cid).')'; 
}

Modify to

The code is as follows:

if($cid != 0) 
{ 
$whereSql .= " And (arc.typeid in(".GetSonIds($cid).") or arc.typeid2 in (".GetSonIds($cid)."))"; 
}

Display the name of the sub-column on the column

1. \dede\content_list.php Modify the code

//The original is: $query = "Select arc.id, arc.typeid, arc.senddate, arc.flag, arc.ismake,

Changed to: $query = "Select arc.id,arc.typeid,arc.typeid2,arc.senddate,arc.flag,arc.ismake,

2.\dede\templets\content_list.html

Find: {dede :field.flag function='IsCommendArchives(@me)'/}

Add below: {dede:field.typeid2 function="Typeid2Archives(@me)"/}

3. \ dede\inc\inc_list_functions.php

Add code:

Note that 5.3 is the following code

//Determine whether the sub-column has "0" selected or not

The code is as follows:

function Typeid2Archives($typeid2) 
{ 
if($typeid2>0) 
{ 
global $tid,$dsql; 
$dsql->SetQuery("Select id,ispart,typename From dede_arctype where ispart='0' and id=$typeid2"); 
$dsql->Execute(); 
//单单写这个,不用while也可以 $row = $dsql->GetObject(); 
while($row = $dsql->GetObject()) 
{ 
return "[副:<font color=&#39;red&#39;>$row->typename</font>]"; 
} 
} 
else 
{ 
return ""; 
} 
}

dede5.5 is the following code

//Judge whether "0" is selected in the sub-column or not

The code is as follows:

function Typeid2Archives($typeid2) 
{ 
if(sizeof($typeid2)>0) 
{ 
global $dsql; 
$s=split(",",$typeid2); 
for($i=0;$i<sizeof($s); $i++) 
{ 
$dsql->SetQuery("Select id,ispart,typename From dede_arctype where ispart=&#39;0&#39; and id=$s[$i]"); 
$dsql->Execute(); 
while($row = $dsql->GetObject()) 
{ 
$str.= "[副:<font color=&#39;red&#39;>$row->typename</font>]"; 
} 
} 
return $str; 
} 
else 
{ 
return ""; 
} 
}

The above is the detailed content of What is the DEDE sub-column code?. For more information, please follow other related articles on the PHP Chinese website!

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

Video Face Swap

Video Face Swap

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

Hot Tools

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

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.

Atom editor mac version download

Atom editor mac version download

The most popular open source editor