Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize the Sub-column in DEDE

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces how to achieve the sub-column of DEDE, which is very detailed and has a certain reference value. Friends who are interested must read it!

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 162lines

The code is as follows:

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

Modify to

The code is as follows:

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

Show 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

Modify 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)'/}

The following adds: {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 a choice of "0" no choice

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 (); / / write this alone, $row = $dsql- > GetObject () without while; while ($row = $dsql- > GetObject ()) {return "[pair: $row- > typename]";} else {return ";}}

Dede5.5 is the following code

/ / determine whether the sub-column has a choice of "0" no choice

The code is as follows:

Function Typeid2Archives ($typeid2) {if (sizeof ($typeid2) > 0) {global $dsql; $s=split (",", $typeid2); for ($Select id,ispart,typename From dede_arctype where ispart='0' and id=$s [$I] "); $dsql- > Execute (); while ($row = $dsql- > GetObject ()) {$str.=" [vice: $row- > typename] ";} return $str;} else {return" }} above is how DEDE realizes all the contents of the sub-column. Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report