Dedecms background columns add images and dedecms Columns

Source: Internet
Author: User

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}

 

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.