dedecms increase columns (columns picture) upload thumbnails

When we find a DEDECMS system function is not available, the column is a thumbnail can not be added. For their own convenience station site is collecting this method to add the function.

dedecms website management system, the default article contains thumbnail option, you can directly upload entry.

However, the actual use, we found that as a column, it is necessary to thumbnail is also essential, so this article details how to quickly increase the thumbnail column.

1. "System -> SQL command tool", insert sql statement:

   In the first database arctype table increase in a typeimg field

alter table dede_arctype add typeimg varchar(100)

Open dede / catalog_add.php probably in line 65, in

   $ queryTemplate = "INSERT INTO` dede_arctype` (reid, topid, sortrank, typename, followed by typeimg, namely
   $ queryTemplate = "INSERT INTO` dede_arctype` (reid, topid, sortrank, typename, typeimg,

   the VALUES ( '~ Reid ~ ',' ~ topid ~ ' ,' ~ rank ~ ',' ~ typename ~ ',' ~ typedir ~ ', followed by' ~ typeimg ~ ', namely
   VALUES (' ~ reid ~ ', ' ~ topid ~ ',' ~ rank ~ ',  ' ~ typename ~ ',' ~ typedir ~ ',' ~ typeimg ~ ',

About 228 lines,

   $ in_query = "INSERT INTO` dede_arctype` (reid, topid, sortrank, typename, typedir, followed by typeimg, namely
   $ in_query = "INSERT INTO` dede_arctype` (reid, topid, sortrank, typename, typedir, typeimg,

   the VALUES ( '$ reid', '$ topid', '$ sortrank', '$ typename', '$ typedir', followed by '$ typeimg', namely
   VALUES ( '$ reid', ' $ topid', '$ sortrank ',' $ typename ', ' $ typedir ',' $ typeimg ',

Line 43 open catalog_edit.php probably typedir = '$ typedir', together with the following typeimg = '$ typeimg', 

$upquery = "UPDATE `#@__arctype` SET
     issend='$issend',
     sortrank='$sortrank',
     typename='$typename',
     typedir='$typedir',
     typeimg='$typeimg',
     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',
     `smalltypes`='$smalltypes'
     $uptopsql
    WHERE id='$id' ";


Probably in line 137 typedir = '$ typedir', together with the following typename = '$ typename',

$upquery = "UPDATE `#@__arctype` SET
     issend='$issend',
     sortrank='$sortrank',
     typedir='$typedir',
     typename='$typename',
        isdefault='$isdefault',
     defaultname='$defaultname',
     ispart='$ispart',
     corank='$corank' $uptopsql
    WHERE id='$id' ";

Open include / arc.archiver.class.php in about 77 lines


    $ query = "SELECT arc. * , tp.reid, tp.typedir, followed by tp.typeimg, that is,
    $ query =" SELECT arc. * , tp.reid, tp.typedir, tp.typeimg,

So far, the amendments part of the program is completed. Next, modify the template section. Open
dede / templets / catalog_add.htm probably in the back row 499 plus

   

<script type="text/javascript" src="js/main.js"></script>

 

          <tr>
            <td height="65" style="padding-left:10px;">栏目图片:</td>
            <td>
                <input name="typeimg" type="text" style="width:250px" id="typeimg" class="alltxt" value="<?php echo $myrow['typeimg']?>" />
                <input type="button" name="set9" value="浏览... "class="coolbg np" style="width:60px" onClick="SelectImage('form1.typeimg')" />(栏目模板里用{dede:field.typeimg /}调用)
            </td>
          </tr>  

Open
dede / templets / catalog_edit.htm probably in the back row 406 plus

<script type="text/javascript" src="js/main.js"></script>

 

          <tr>
            <td height="65" style="padding-left:10px;">栏目图片:</td>
            <td>
                <input name="typeimg" type="text" style="width:250px" id="typeimg" class="alltxt" value="<?php echo $myrow['typeimg']?>" />
                <input type="button" name="set9" value="浏览... "class="coolbg np" style="width:60px" onClick="SelectImage('form1.typeimg')" />(栏目模板里用{dede:field.typeimg /}调用)
            </td>
          </tr>  

After saving, column template with {dede: field.seotitle /} calls can be.

Call the 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)

if($type=='top')
    {
        $sql = "SELECT id,typename,typedir,typeimg,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath
          From `#@__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,typeimg,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath
          From `#@__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,typeimg,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath
            FROM `#@__arctype` WHERE reid='$reid' And ishidden<>1 order by sortrank asc limit 0, $line ";
    }

transfer:

{dede:channel type='son' row='10' typeid="2"}
                  <div class="w-prd-list-cell">
                    <div class="w-prd-list-cell-in">
                      <div class="w-prd-con">
                        <div class="w-prd-imgbox" title="[field:title /]"> <a target="_self" href="[field:typelink/]" class="img-count w-prd-img">
                            <div class="aspectRatio" style="padding-bottom:100%"></div>
                            <div class="img-count-in"><img alt="[field:typename /]" src="[field:typeimg/]" /></div>
                          </a> </div>
                        <div class="w-prd-infobox" style="text-align:center">
                          <h2 class="w-prd-name" title="[field:typename /]">
                            <a target="_self" href="[field:typelink/]">[field:typename/]</a>
                          </h2>
                        </div>
                      </div>
                    </div>
                  </div>
                  {/dede:channel}

 

Published 96 original articles · won praise 18 · views 50000 +

Guess you like

Origin blog.csdn.net/weixin_42694072/article/details/90174582