If we have a list of columns with thumbnails to indicate, and not just text, if not this feature will be very troublesome, online there are many of this information, but have tried to have a lot of problems, their own research, testing basic through. New Add Field typeimg
Background execution sql:
ALTER TABLE ' Cn_arctype ' Add ' typeimg ' char (+) not NULL default ';
Related files:
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 ' cn_arctype '
Will
(Reid,topid,sortrank,typename,typedir,
Replaced by
(Reid,topid,sortrank,typename,typedir,typeimg,
Will
(' ~reid~ ', ' ~topid~ ', ' ~rank~ ', ' ~typename~ ', ' ~typedir~ ',
Replaced by
(' ~reid~ ', ' ~topid~ ', ' ~rank~ ', ' ~typename~ ', ' ~typedir~ ', ' ~typeimg~ ',
Open dede/catalog_edit.php
Find
$upquery = "Update ' Cn_arctype ' Set
Add a new line below it
' typeimg ' = ' $typeimg ',
Open dede/templets/catalog_add.htm
Find
<tr> <td height= "+" > list naming rules:</td> <td> <input name= "Namerule2" type= "text" Id= "Namerule2" value= "{typedir}/list_{tid}_{page}.html" class= "pubinputs" style= "width:250px"/> </td> </tr>
Add the following below it:
<tr> <td height= "" "style=" padding-left:10px; " > Pictures:</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 >
and add the following content to the head of the file
<script language= ' javascript ' src= ' js/main.js ' ></script>
Open dede/templets/catalog_edit.htm
In the previous position, add:
<tr> <td height= "" "style=" padding-left:10px; " > Pictures:</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 sentence will call out the path that has been added.
<?php echo $myrow [' typeimg ']?>
and add the following content to the head of the file
<script language= ' javascript ' src= ' js/main.js ' ></script>
I tried it in the template: {dede:field.typeimg/} is not the data, so I changed to SQL call.
The original is this:
{dede:channel type= ' top ' row= ' <li><a href= ' [field:typeurl/] ' [field:rel/]>[field:typeimg/]</a></li> {/dede:channel }
In this add [field:typeimg] is not adjustable, I personally think the column thumbnail is through the loop out, and the loop does not come out is not very meaningful, so changed to the following:
{dede:sql sql= "select Typename,typedir,typeimg from Dede_arctype"} <li><a href= "[field:typedir/]" >[field:typeimg/]</a></li> {/dede:sql}
This will be smoothly paged out, of course, if you want to call the sub-ID, just add the corresponding conditional ID call on it.
{dede:channelartlist typeid= ' 13,14 ' row = ' Ten '} <dt class= "Clearfix" ><span><a href= ' {dede:field name= ' typeurl '/} ' >{dede:field name= ' TypeName '/}< /a></span></dt><dd><ul class= "Clearfix" > {dede:channel type= ' son ' noself= ' yes '} <li><a href= ' [field:typelink/] ' >[field:typename/]</a></li> {/dede:channel}</ul ></dd>
The method of adding pictures to the column of "Turn" weaving dream