1. First, the classification table columns to dede_arctype
the table to increase the thumbnail field typeimg
with phpMyAdmin or other database management tools, add the fields directly in the data table, or run the following SQL statement:
1 alter table `dede_arctype` add `typeimg` char(100) NOT NULL default '';
2. Modify the page, add the corresponding fields in the form, related to the page:
dede/catalog_add.php
dede/catalog_edit.php
dede/templets/catalog_add.htm
dede/templets/catalog_edit.htm
2.1 Open dede / templets / catalog_add.htm, Find
1 <tr> 2 <td class='bline' height="26" style="padding-left:10px;"><font color='red'>栏目名称:</font></td> 3 <td class='bline'><input name="typename" type="text" id="typename" size="30" class="iptxt" /></td> 4 </tr>
Thereunder add the following code:
1 <tr> 2 <td class='bline' height="26" style="padding-left:10px;"><font color='red'>栏目图片:</font></td> 3 <td class='bline'> 4 <input name="typeimg" type="text" style="width:250px" id="typeimg" class="alltxt" value="" /> 5 <input type="button" name="set9" value="浏览... "class="coolbg np" style="width:60px" onClick="SelectImage('form1.typeimg','');" /> 6 </td> 7 </tr>
Below and between the lead-js:
1 <script language="javascript" src="js/main.js"></script>
2.2 Open dede / catalog_add.php page, save the uploaded picture content column, look for
1 $queryTemplate = "INSERT INTO
in
1 (reid,topid,sortrank,typename
Add back field, to find ,typeimg
1 ('~reid~','~topid~','~rank~','~typename~',
Behind it to add field, and then find ,'~typeimg~'
1 $in_query = "INSERT INTO
in
1 (reid,topid,sortrank,typename
Also added later fields, and ,typeimg
1 ('$reid','$topid','$sortrank','$typename'
Add back field. ,'$typeimg'
2.3 Open dede / templets / catalog_edit.htm page, find
1 <tr> 2 <td class='bline' height="26" style="padding-left:10px;"><font color='red'>栏目名称:</font></td> 3 <td class='bline'><input name="typename" type="text" id="typename" size="30" value="<?php echo $myrow['typename']?>" class="iptxt" /></td> 4 </tr>
Below it add:
1 <tr> 2 <td class='bline' height="26" style="padding-left:10px;"><font color='red'>栏目图片:</font></td> 3 <td class='bline'> 4 <input name="typeimg" type="text" style="width:250px" id="typeimg" class="alltxt" value="<?php echo $myrow['typeimg']?>" /> 5 <input type="button" name="set9" value="浏览... "class="coolbg np" style="width:60px" onClick="SelectImage('form1.typeimg','');" /> 6 </td> 7 </tr>
And the introduction of the following js files between
1 <script language='javascript' src="js/main.js"></script>
2.4 Open dede / catalog_edit.php, look for the following code (queries to multiple records, select the first)
1 $upquery = "UPDATE `#@__arctype` SET
in
1 typename='$typename',
Added back
typeimg='$typeimg',
Then save.
3. Call column through side channel label called, so you want to change, enter /include/taglib/channel.lib.php file, find the line 78, the following code to replace the default (Add typeimg field inquiry)
1 if($type=='top') 2 { 3 $sql = "SELECT id,typename,typeimg,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath,typeimg 4 From `dede_arctype` WHERE reid=0 And ishidden<>1 order by sortrank asc limit 0, $line "; 5 } 6 else if($type=='son') 7 { 8 if($typeid==0) return ''; 9 $sql = "SELECT id,typename,typeimg,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath,content,typeimg 10 From `dede_arctype` WHERE reid='$typeid' And ishidden<>1 order by sortrank asc limit 0, $line "; 11 } 12 else if($type=='self') 13 { 14 if($reid==0) return ''; 15 $sql = "SELECT id,typename,typeimg,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath,typeimg 16 FROM `dede_arctype` WHERE reid='$reid' And ishidden<>1 order by sortrank asc limit 0, $line "; 17 }
4. Call on edge type column label called, so you want to change, enter /include/taglib/type.lib.php file, find the line 42, the following code to replace the default (Add typeimg field inquiry)
1 $row = $dsql->GetOne("SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath 2 FROM `#@__arctype` WHERE id='$typeid' ");
5. Call
{dede:channel typeid="1"}
<li> <img src='[field:typeimg/]' /></li>
{/dede:channel}
{dede:type typeid="1"}
<li><img src='[field:typeimg/]' /></li>
{/dede:type}
Reprinted from: https://blog.csdn.net/jklgfgdsr/article/details/80596880
Increasing the type label