How does dedecms add thumbnails to a channel page?

Source: Internet
Author: User

When a column list uses thumbnails to represent production, it is not just text. Without this function, it will be very troublesome. There are many materials on the Internet for this purpose, however, I have tried a lot of problems. I have studied it myself and basically passed the test. The typeimg field needs to be added.
SQL Execution in the background:

1 alter table '80php _ arctype 'add'typeimg 'char (100) not null default '';

Files involved:
Dede/catalog_add.php
Dede/catalog_edit.php
Dede/templets/catalog_add.htm
Dede/templets/catalog_edit.htm

Open Dede/catalog_add.php
Find $ querytemplate = "insert into '80php _ arctype'
Set

2 (Reid, topid, sortrank, typename, typedir,

Replace

3 (Reid, topid, sortrank, typename, typedir, typeimg,

Set

4 ('~ Reid ~ ','~ Topid ~ ','~ Rank ~ ','~ Typename ~ ','~ Typedir ~ ',

Replace

5 ('~ Reid ~ ','~ Topid ~ ','~ Rank ~ ','~ Typename ~ ','~ Typedir ~ ','~ Typeimg ~ ',

Open Dede/catalog_edit.php
Search

6 $ upquery = "Update '80php _ arctype 'Set

Add a new line under it
'Typeimg '=' $ typeimg ', (14 ohang Mei You Tianjia)

Open Dede/templets/catalog_add.htm
Search

7 <tr>

8 <TD Height = "26"> list naming rules: </TD>

9 <TD>

10 <input name = "namerule2" type = "text" id = "namerule2" value = "{typedir}/list_1_tid1__1_page0000.html" class = "pubinputs" style = "width: 250px "/>

11 </TD>

12 </tr>

Add the following content below
<Tr>
<TD Height = "65" style = "padding-left: 10px;"> topic image: </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 =" selectimage ('form1. typeimg ', '');"/>
</TD>
</Tr>
Add the following content to the file head:
<Script language = 'javascript 'src = "JS/Main. js"> </SCRIPT>


Open Dede/templets/catalog_edit.htm
Add:
<Tr>
<TD Height = "65" style = "padding-left: 10px;"> topic image: </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 ', '');"/>
</TD>
</Tr>
Note: The following statement calls the added path.
<? PHP echo $ myrow ['typeimg ']?>

Add the following content to the file head:
<Script language = 'javascript 'src = "JS/Main. js"> </SCRIPT>

I tried using: {Dede: field. typeimg/} in the template, but no data can be called.

Modify channel. Lib. php

After all $ SQL = "select ID, typename, typedir, isdefault, ispart, defaultname, namerule2, moresite, siteurl, sitepath, and content

Add, typeimg

Similarly, you can add a subtopic title.

How does dedecms add thumbnails to a channel page?

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.