This article mainly introduces the implementation code of adding topic images in the dedecms background, which is very good and has reference value, for more information about how to add a topic image in the dedecms background, see this article.
Dedecms Template: www.php1.cn/xiazai/code/dedecms
You need to display the icon when calling the topic at the front end:
Step 1: "system-> SQL command tool", insert SQL statements
The code is as follows:
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).
The code is as follows:
$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).
The code is as follows:
$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:
The code is as follows: