In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-22 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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.