Code for adding a column image in the dedecms background

Source: Internet
Author: User
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:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.