Dedecms Add column Picture function

Source: Internet
Author: User

DEDECMS application, often need to display the column in the column picture, but Dedecms itself does not have the function of the column picture, this has to say is a regret. The following Canton Station network small series to introduce how to change the program so that dedecms support column pictures.


Add a TypeName field to the Database Arctype table First


Below dede/for your system background directory, if you changed the background directory, please change the dede/to your system's background directory.

Open dede/catalog_add.php probably in line 65th, in
$queryTemplate = "INSERT into ' #@__arctype ' (Reid,topid,sortrank,typename, followed by Typeimg, which is
$queryTemplate = "INSERT into ' #@__arctype ' (reid,topid,sortrank,typename,typeimg,

VALUES (' ~reid~ ', ' ~topid~ ', ' ~rank~ ', ' ~typename~ ', ' ~typedir~ ', followed by ' ~typeimg~ ', which is
VALUES (' ~reid~ ', ' ~topid~ ', ' ~rank~ ', ' ~typename~ ', ' ~typedir~ ', ' ~typeimg~ ',

About the No. 228 line,
$in _query = "INSERT into ' #@__arctype ' (Reid,topid,sortrank,typename,typedir, followed by Typeimg, which is
$in _query = "INSERT into ' #@__arctype ' (reid,topid,sortrank,typename,typedir,typeimg,

VALUES (' $reid ', ' $topid ', ' $sortrank ', ' $typename ', ' $typedir ', followed by ' $typeimg ', which is
VALUES (' $reid ', ' $topid ', ' $sortrank ', ' $typename ', ' $typedir ', ' $typeimg ',

Open catalog_edit.php probably in 43 lines typedir= ' $typedir ', with typeimg= ' $typeimg ' below,
Probably in line 137 typeimg= ' $typeimg ', with Typename= ' $typename ' below,

Open include/arc.archiver.class.php, probably in line 77.
$query = "Select Arc.*,tp.reid,tp.typedir, followed by Tp.typeimg, which is
$query = "Select Arc.*,tp.reid,tp.typedir,tp.typeimg,

At this point, the procedure part of the revision of the comments completed. Next, modify the template section. Open it
Dede/templets/catalog_add.htm is probably after 499 lines plus

<tr>
&LT;TD height= "style=" padding-left:10px; > Column Picture:</td>
<td>
<input name= "typeimg" type= "text" style= "width:250px" id= "typeimg" class= "Alltxt" "value=" "/>"
<input type= "button" Name= "Set9" value= "Browse ... "Class=" COOLBG np "style=" width:60px "onclick=" selecttemplets (' form1.typeimg&activepath=%2ftemplets%2ftypeimg &img=yes '); "/>&nbsp;150pxx90px (in column template with {dede:field.typeimg/} call)
</td>
</tr>

Open it
Dede/templets/catalog_edit.htm is probably after 406 lines plus

<tr>
&LT;TD height= "style=" padding-left:10px; > Column Picture:</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= "Browse ... "Class=" COOLBG np "style=" width:60px "onclick=" selecttemplets (' form1.typeimg&activepath=%2ftemplets%2ftypeimg &img=yes '); "/>&nbsp;150pxx90px (in column template with {dede:field.typeimg/} call)
</td>
</tr>

fill in JS <script type= "Text/javascript" src= "Js/main.js" ></script>


<tr>
<TD height= "style=" padding-left:10px; > Column Picture:</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= "Browse ... "Class=" COOLBG np "style=" width:60px "onclick=" selectimage (' form1.typeimg ') "/> (Use {dede:field.typeimg/} in the column template)
</td>
</tr>

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




Http://www.020-zx.com/article89.html



How to add a picture to the Dedecms column

http://hi.baidu.com/%D3%C5%B4%CF%CD%F8%C2%E7%B9%A4%D7%F7%CA%D2/blog/item/2aca1c3a20426cdd9e3d6216.html

First step:Open dede: System SQL command line tool select the Single-line command (support for simple queries), and then execute the following statement:
ALTER TABLE ' dede_arctype ' ADD ' arcpic ' VARCHAR NULL


Step Two:Open include taglib channel.lib.php file, find the 80th row field arcpic add; The red font is the added field;

if ($type = = ' top ')
{
$sql = "Select

Id,typename,arcpic,typelitpic,typedir,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,arcpic,typelitpic,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath
From ' #@__arctype ' WHERE reid= ' $typeid ' and ishidden<>1 the ORDER by Sortrank ASC limit 0, $line ";
}
else if ($type = = ' self ')
{
if ($reid ==0) return ";
$sql = "Select

Id,typename,arcpic,typelitpic,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath
From ' #@__arctype ' WHERE reid= ' $reid ' and ishidden<>1 the ORDER by Sortrank ASC limit 0, $line ";
}

Third, the first call:

{dede:channel typeid= ' 3 ' row= ' 6 '}
<li><a href= "[field:typelink/]" target= "_blank" >
Alt= "[field:typename/]" width= "135" height= "/>[field:typename/]</a></li>"
{/dede:channel}

List page call: {dede:field.arcpic/}

Please download the background template file and cover it under the root directory; Download file


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.