Dedecms background columns add images and dedecms Columns
You need to display the icon when calling the topic at the front end:
Step 1: "system-> SQL command tool", insert SQL statements
alter table dede_arctype add imgtype varchar(100)
Step 2: Go to the background management file directory (default: dede directory) and find row 228 under "catelog_add.php, replace the following with the default one ("typeimg" is added to the SQL statement).
$in_query = "INSERT INTO `dede_arctype`(reid,topid,sortrank,typename,typedir,isdefault,defaultname,issend,channeltype, tempindex,templist,temparticle,modname,namerule,namerule2, ispart,corank,description,keywords,seotitle,moresite,siteurl,sitepath,ishidden,`cross`,`crossid`,`content`,`smalltypes`,`typeimg`) VALUES('$reid','$topid','$sortrank','$typename','$typedir','$isdefault','$defaultname','$issend','$channeltype', '$tempindex','$templist','$temparticle','default','$namerule','$namerule2', '$ispart','$corank','$description','$keywords','$seotitle','$moresite','$siteurl','$sitepath','$ishidden','$cross','$crossid','$content','$smalltypes','$typeimg')";
Step 3: Find the 36 rows under "catelog_edit.php" and replace the following with the default one ("typeimg" is added to the SQL statement).
$upquery = "UPDATE `dede_arctype` SET issend='$issend', sortrank='$sortrank', typename='$typename', typedir='$typedir', isdefault='$isdefault', defaultname='$defaultname', issend='$issend', ishidden='$ishidden', channeltype='$channeltype', tempindex='$tempindex', templist='$templist', temparticle='$temparticle', namerule='$namerule', namerule2='$namerule2', ispart='$ispart', corank='$corank', description='$description', keywords='$keywords', seotitle='$seotitle', moresite='$moresite', `cross`='$cross', `content`='$content', `crossid`='$crossid', `typeimg`='$typeimg', `smalltypes`='$smalltypes' $uptopsql WHERE id='$id' ";
Step 4: Go to the background management file directory (default: dede directory)/“catalog_add.htm and catalog_edit.htm files under templets/, and add the following code:
<script language='javascript' src="js/main.js"></script>
Add the following code to the desired location:
<Tr> <td colspan = "2"> <table width = "100%" border = "0" cellspacing = "0" cellpadding = "0" style = "margin-bottom: 3px; "> <tbody> <tr> <td width =" 90 "class =" bline "height =" 24 "> & nbsp; imgmm: </td> <td class = "bline"> <input type = "text" name = "typeimg" id = "imgmm" style = "width: 300px "class =" text "/> <input name =" imgmm_bt "type =" button "class =" inputbut "value =" Browse... "onclick =" SelectImage ('form1. imgmm ', 'Big ') "/> </td> </tr> </tbody> </table> <input type =" hidden "name =" dede_addonfields "value =" imgmm, img "/> </td> </tr>
Step 5: Call the channel label of the topic, so you need to change it to/include/taglib/channel. lib. PHP file, find 78 lines, replace the following code with the default (add typeimg field query)
if($type=='top') { $sql = "SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath,typeimg From `dede_arctype` WHERE reid=0 And ishidden<>1 order by sortrank asc limit 0, $line "; } else if($type=='son') { if($typeid==0) return ''; $sql = "SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath,content,typeimg From `dede_arctype` WHERE reid='$typeid' And ishidden<>1 order by sortrank asc limit 0, $line "; } else if($type=='self') { if($reid==0) return ''; $sql = "SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath,typeimg FROM `dede_arctype` WHERE reid='$reid' And ishidden<>1 order by sortrank asc limit 0, $line "; }
The last step is to call it at the front-end.
{dede:channel type='self' typeid='15' row='8' currentstyle="<li><a href='~typelink~' class='thisclass'>~typename~</a> </li>"} <li><a href='[field:typelink/]'>[field:typename/]</a> </li> {/dede:channel}