当前位置:Gxlcms > PHP教程 > phpcmsv9模板制作教程(三)

phpcmsv9模板制作教程(三)

时间:2021-07-01 10:21:17 帮助过:16人阅读

今天继续讲主体部分

  1. {template "content","header"}

调用根目录下phpcms/template/content/header文件

<!--main-->这个是模版注释!建议一定要养成写代码加注释的习惯

这个是div标签,不知道什么是div可以的去网上找些教程学习下,这个都不了解就没必要继续看了

  1. <!--这里是pc标签{pc:content 参数名="参数值" 参数名="参数值" 参数名="参数值"}-->
  2. {pc:content action="position" posid="2" order="listorder DESC" num="4"}
  3. <!--显示PC标签中的数据-->
  4. {loop $data $r}
  5. {str_cut($r[title],36)}
  6. {if $n==1}{/if}{str_cut($r[description],112)}
  7. {/loop}
  8. {/pc}
  9. <!--结束标签-->
  10. <!--这里还是pc标签-->
  11. {pc:content action="position" posid="1" order="listorder DESC" thumb="1" num="5"}
  12. {loop $data $r}
  13. {/loop}
  14. {/pc}
  15. 推广
  16. {pc:block pos="index_block_1"}
  17. {/pc}
  18. 图片新闻
  19. {pc:content action="position" posid="12" thumb="1" order="id DESC" num="10"}
  20. {loop $data $r}
  21. {str_cut($r[title],20)}
  22. {/loop}
  23. {/pc}
  24. {loop subcat(0,0,0,$siteid) $r}
  25. {php $num++}
  26. {$r[catname]}更多>>
  27. {pc:content action="lists" catid="$r[catid]" num="1" thumb="1" order="id DESC" return="info"}
  28. {loop $info $v}
  29. {str_cut($v['title'],28)}
  30. {str_cut($v['description'],100)}
  31. {/loop}
  32. {/pc}
  33. {pc:content action="lists" catid="$r[catid]" num="5" order="id DESC" return="info"}
  34. {loop $info $v}
  35. ·{str_cut($v['title'],40)}
  36. {/loop}
  37. {/pc}
  38. {if $num%2==0}
  39. {/if}
  40. {/loop}
  41. 公告
  42. {pc:announce action="lists" siteid="$siteid" num="2"}
  43. {loop $data $r}
  44. {$r['title']}
  45. {/loop}
  46. {/pc}
  47. 专题更多>>
  48. {pc:special action="lists" siteid="$siteid" elite="1" listorder="3" num="2"}
  49. {loop $data $r}
  50. {if $n!=1}
  51. {/if}
  52. {str_cut($r[title],'18')}
  53. {str_cut($r['description'],50)}
  54. {/loop}
  55. {/pc}
  56. 热点 | 评论 | 关注排行
  57. {pc:content action="hits" catid="35" num="10" order="views DESC"}
  58. {loop $data $r}
  59. {$r[title]}
  60. {/loop}
  61. {/pc}
  62. {pc:comment action="bang" num="10" cache="3600"}
  63. {loop $data $r}
  64. {$r[title]}
  65. {/loop}
  66. {/pc}
  67. {pc:content action="hits" catid="35" num="10" order="views DESC"}
  68. {loop $data $r}
  69. {$r[title]}
  70. {/loop}
  71. {/pc}
  72. 调查问卷更多>>
  73. 更多>>友情链接申请链接
  74. {pc:link action="type_list" siteid="$siteid" linktype="1" order="listorder DESC" num="8" return="pic_link"}
  75. {loop $pic_link $v}
  76. {/loop}
  77. {/pc}
  78. {pc:link action="type_list" siteid="$siteid" order="listorder DESC" num="10" return="dat"}
  79. {loop $dat $v}
  80. {if $type==0}
  81. {$v[name]} |
  82. {else}
  83. {/if}
  84. {/loop}
  85. {/pc}
  86. $(function(){
  87. new slide("#main-slide","cur",310,260,1);//焦点图
  88. new SwapTab(".SwapTab","span",".tab-content","ul","fb");//排行TAB
  89. })
  90. {template "content","footer"}

以上就是phpcms v9模板制作教程(三)的内容,更多相关内容请关注PHP中文网(www.gxlcms.com)!

人气教程排行