Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[疑问] 求教关于首页模板调用

[复制链接]
三牛 发表于 2010-4-20 23:02:51 | 显示全部楼层 |阅读模式
本帖最后由 三牛 于 2010-4-21 08:31 编辑

请教各位朋友,我打算在首页把热点内容去掉,在幻灯片和最新资讯下面加一个 图文资讯 的模板。用来展示产品。

麻烦各位给指点下,谢谢大家。 我的网站:http://www.028tm.com/

首页


图文资讯





首页模板代码
  1. <?exit?>
  2. <!--{template header}-->
  3. <!--{eval $ads = getad('system', 'indexad', '1'); }-->
  4. <!--{if !empty($ads['pageheadad']) }-->
  5. <div class="ad_header">$ads[pageheadad]</div>
  6. <!--{/if}-->
  7. </div><!--header end-->

  8. <div id="nav">
  9. <div class="main_nav">
  10. <ul>
  11. <li class="current"><a href="{S_URL}/">首页</a></li>
  12. <!--{loop $channels['menus'] $key $value}-->
  13. <li><a href="$value[url]">$value[name]</a></li>
  14. <!--{/loop}-->
  15. </ul>
  16. </div>

  17. <div class="order_nav">
  18. <!--{loop $channels['menus'] $key $value}-->
  19. <!--{if $key == 'news' || $value['upnameid']=='news'}-->
  20. <!--{block name="category" parameter="type/$key/isroot/1/order/c.displayorder/limit/0,12/cachetime/80800/cachename/category"}-->
  21. <ul><li>
  22. <em><a href="$value[url]">$value['name']</a>: </em>
  23. <!--{eval $dot = '|'}-->
  24. <!--{eval $total = count($_SBLOCK['category'])}-->
  25. <!--{eval $i = 1;}-->
  26. <!--{loop $_SBLOCK['category'] $value}-->
  27. <a href="$value[url]">$value[name]</a><!--{if $total != $i}--> $dot <!--{/if}-->
  28. <!--{eval $i++;}-->
  29. <!--{/loop}-->
  30. </li></ul>
  31. <!--{elseif $key == 'bbs'}-->
  32. <!--{if $forumarr}-->
  33. <ul><li>
  34. <em><a href="$value[url]">$value['name']</a>: </em>
  35. <!--{eval $dot = '|'}-->
  36. <!--{eval $total = count($forumarr)}-->
  37. <!--{eval $i = 1;}-->
  38. <!--{loop $forumarr $value}-->
  39. <a href="$value[url]">$value[name]</a><!--{if $total != $i}--> $dot <!--{/if}-->
  40. <!--{eval $i++;}-->
  41. <!--{/loop}-->
  42. </li></ul>
  43. <!--{/if}-->
  44. <!--{elseif $value['type'] == 'model'}-->
  45. <!--{eval @include S_ROOT.'./cache/model/model_'.$value['nameid'].'.cache.php';}-->
  46. <!--{if !empty($cacheinfo['categories'])}-->
  47. <ul><li>
  48. <em><a href="$value[url]">$value['name']</a>: </em>
  49. <!--{eval $dot = '|'}-->
  50. <!--{eval $total = count($cacheinfo['categories'])}-->
  51. <!--{eval $i = 1;}-->
  52. <!--{loop $cacheinfo['categories'] $key $value}-->
  53. <a href="$siteurl/m.php?name=$cacheinfo[models][modelname]&mo_catid=$key" title="$value">$value</a><!--{if $total != $i}--> $dot <!--{/if}-->
  54. <!--{eval $i++;}-->
  55. <!--{/loop}-->
  56. </li></ul>
  57. <!--{/if}-->
  58. <!--{/if}-->
  59. <!--{/loop}-->
  60. </div>

  61. </div><!--nav end-->

  62. <div class="column">
  63. <div class="col1">
  64. <div class="col3">
  65. <!--{block name="spacenews" parameter="haveattach/2/order/i.dateline DESC/limit/0,4/cachetime/83400/subjectlen/40/subjectdot/0/cachename/hotnewspic"}-->
  66. <div id="focus_turn">
  67. <!--{if !empty($_SBLOCK['hotnewspic'])}-->
  68. <ul id="focus_pic">
  69. <!--{eval $j = 0}-->
  70. <!--{loop $_SBLOCK['hotnewspic'] $pkey $pvalue}-->
  71. <!--{eval $pcurrent = ($j == 0 ? 'current' : 'normal');}-->
  72. <li class="$pcurrent"><a href="$pvalue[url]"><img src="$pvalue['a_filepath']" alt="" /></a></li>
  73. <!--{eval $j++}-->
  74. <!--{/loop}-->
  75. </ul>
  76. <ul id="focus_tx">
  77. <!--{eval $i = 0}-->
  78. <!--{loop $_SBLOCK['hotnewspic'] $key $value}-->
  79. <!--{eval $current = ($i == 0 ? 'current' : 'normal');}-->
  80. <li class="$current"><a href="$value[url]" title="$value[subjectall]">$value[subject]</a></li>
  81. <!--{eval $i++}-->
  82. <!--{/loop}-->
  83. </ul>
  84. <div id="focus_opacity"></div>
  85. <!--{/if}-->
  86. </div><!--focus_turn end-->

  87. <!--{block name="spacenews" parameter="order/i.viewnum DESC/limit/0,17/cachetime/86900/subjectlen/40/subjectdot/0/showdetail/1/messagelen/100/messagedot/1/cachename/hotnews"}-->
  88. <!--{if !empty($_SBLOCK['hotnews'])}-->
  89. <!--{eval $hotnews = @array_slice($_SBLOCK['hotnews'], 0, 5)}-->
  90. <!--{/if}-->
  91. <div id="new_news">
  92. <h3>热点内容</h3>
  93. <ul>
  94. <!--{loop $hotnews $value}-->
  95. <li><span class="box_r">#date('m-d',$value['dateline'])#</span><a href="$value[url]" title="$value[subjectall]">$value[subject]</a></li>
  96. <!--{/loop}-->
  97. </ul>
  98. </div>
  99. </div><!--col3 end-->

  100. <!--最新资讯-->
  101. <!--{block name="spacenews" parameter="order/i.dateline DESC/limit/0,3/cachetime/85400/subjectlen/46/subjectdot/0/showdetail/1/messagelen/150/messagedot/1/cachename/newnews1"}-->
  102. <div class="col4" id="hot_news">
  103. <h3>最新资讯</h3>
  104. <!--{loop $_SBLOCK['newnews1'] $value}-->
  105. <div class="hot_news_list">
  106. <h4><a href="$value[url]" title="$value[subjectall]">$value[subject]</a></h4>
  107. <p>$value[message]</p>
  108. </div>
  109. <!--{/loop}-->
  110. </div><!--col4 end-->
  111. </div><!--col1 end-->
  112. <div class="col2">
  113. <div id="user_login">
  114. <script src="{S_URL}/batch.panel.php?open=1&rand={eval echo rand(1, 999999)}" type="text/javascript" language="javascript"></script>
  115. </div><!--user_login end-->

  116. <!--{block name="announcement" parameter="order/displayorder DESC,starttime DESC/limit/0,3/cachetime/96400/subjectlen/34/subjectdot/0/cachename/announce"}-->
  117. <div class="super_notice">
  118. <h3>公告:</h3>
  119. <ul>
  120. <!--{if empty($_SBLOCK['announce'])}-->
  121. <li>暂时没有公告</li>
  122. <!--{else}-->
  123. <!--{loop $_SBLOCK['announce'] $value}-->
  124. <li><a href="$value[url]" title="$value[subjectall]">$value[subject]</a></li>
  125. <!--{/loop}-->
  126. <!--{/if}-->
  127. </ul>
  128. </div><!--公告end-->

  129. <div class="top_right"><a href="http://www.028tm.com/?action-category-catid-12" target="_blank"><img src="http://www.028tm.com/ad/TM_250-225.JPG" width="250px" height="225px" alt="点击查看-天麻的吃法" /></a></div>

  130. </div><!--column end-->

  131. <!--{if !empty($ads['pagecenterad'])}-->
  132. <div class="ad_pagebody">$ads[pagecenterad]</div>
  133. <!--{/if}-->


  134. <!--{loop $channels['menus'] $key $value}-->
  135. <!--{if $value['upnameid']=='news'}-->
  136. <div class="column">
  137. <div class="col1">
  138. <div class="global_module">
  139. <div class="global_module1_caption"><h3>$value[name]</h3><a class="more" href="#action/$key#">更多>></a></div>
  140. <ul class="global_tx_list1">
  141. <!--{block name="spacenews" parameter="type/$key/order/i.dateline DESC/limit/0,12/cachetime/86900/subjectlen/40/subjectdot/0/showdetail/1/messagelen/100/messagedot/1/cachename/hotnews"}-->
  142. <!--{loop $_SBLOCK['hotnews'] $value}-->
  143. <li><span class="box_r">#date('m-d',$value['dateline'])#</span><a href="$value[url]" title="$value[subjectall]">$value[subject]</a></li>
  144. <!--{/loop}-->
  145. </ul>
  146. </div>
  147. </div><!--col1 end-->

  148. <!--{block name="spacenews" parameter="type/$key/digest/1,2,3/order/i.viewnum DESC,i.dateline DESC/limit/0,6/cachetime/89877/subjectlen/34/subjectdot/0/cachename/hotnews2"}-->
  149. <div class="col2">
  150. <div class="global_module bg_fff">
  151. <div class="global_module2_caption"><h3>本月精华</h3></div>
  152. <ul class="global_tx_list2">
  153. <!--{loop $_SBLOCK['hotnews2'] $value}-->
  154. <li><a href="$value[url]" title="$value[subjectall]">$value[subject]</a></li>
  155. <!--{/loop}-->
  156. </ul>
  157. </div>
  158. </div><!--col2 end-->
  159. </div><!--column end-->
  160. <!--{/if}-->
  161. <!--{/loop}-->

  162. <!--{if !empty($channels['menus']['uchimage'])}-->
  163. <div class="column">
  164. <!--{block name="uchphoto" parameter="updatetime/604800/order/updatetime DESC/limit/0,6/cachetime/86585/subjectlen/12/cachename/uchphoto"}-->
  165. <div class="col1">
  166. <div class="global_module">
  167. <div class="global_module1_caption"><h3>相册</h3><a class="more" href="#action/uchimage#">更多>></a></div>
  168. <ul class="global_piclist">
  169. <!--{loop $_SBLOCK['uchphoto'] $key $value}-->
  170. <li><div><a href="$value[url]"><img alt="" src="$value['pic']"/></a></div><span><a href="$value[url]">$value[albumname]</a></span></li>
  171. <!--{/loop}-->
  172. </ul>
  173. </div>
  174. </div><!--col1 end-->

  175. <!--{block name="uchphoto" parameter="dateline/604800/order/picnum DESC,updatetime DESC/limit/0,2/cachetime/89477/subjectlen/14/subjectdot/0/cachename/uchphototop"}-->
  176. <div class="col2">
  177. <div class="global_module bg_fff">
  178. <div class="global_module2_caption"><h3>精彩推荐</h3></div>
  179. <ul class="global_piclist">
  180. <!--{loop $_SBLOCK['uchphototop'] $key $value}-->
  181. <li><div><a href="$value[url]"><img alt="" src="$value['pic']"/></a></div><span><a href="$value[url]">$value[albumname]</a></span></li>
  182. <!--{/loop}-->
  183. </ul>
  184. </div>
  185. </div><!--col2 end-->
  186. </div><!--column end-->
  187. <!--{/if}-->

  188. <!--{if !empty($channels['menus']['bbs'])}-->
  189. <div class="column">
  190. <div class="col1">
  191. <!--{block name="bbsthread" parameter="order/t.dateline DESC/subjectlen/36/subjectdot/0/limit/0,12/cachetime/5630/cachename/newthread"}-->
  192. <div class="global_module">
  193. <div class="global_module1_caption"><h3>论坛</h3><a class="more" href="#action/bbs#">更多>></a></div>
  194. <ul class="global_tx_list1">
  195. <!--{loop $_SBLOCK['newthread'] $value}-->
  196. <li><span class="box_r"><a href="{S_URL}/space.php?uid=$value[authorid]">$value[author]</a></span><a href="$value[url]" title="$value[subjectall]">$value[subject]</a></li>
  197. <!--{/loop}-->
  198. </ul>
  199. </div>
  200. </div><!--col1 end-->

  201. <!--{block name="bbsforum" parameter="type/forum/allowblog/1/order/posts DESC/limit/0,6/cachetime/14672/cachename/hotforums"}-->
  202. <div class="col2">
  203. <div class="global_module bg_fff">
  204. <div class="global_module2_caption"><h3>版块帖子数排行</h3></div>
  205. <ul class="global_tx_list2">
  206. <!--{loop $_SBLOCK['hotforums'] $value}-->
  207. <li><span class="box_r">$value[posts]</span><a href="$value[url]">$value[name]</a></li>
  208. <!--{/loop}-->
  209. </ul>
  210. </div>
  211. </div><!--col2 end-->
  212. </div><!--column end-->
  213. <!--{/if}-->

  214. <!--{if !empty($channels['menus']['uchblog'])}-->
  215. <!--{block name="uchblog" parameter="order/dateline DESC/subjectlen/36/subjectdot/0/limit/0,12/cachetime/18400/cachename/hotblog"}-->
  216. <div class="column">
  217. <div class="col1">
  218. <div class="global_module">
  219. <div class="global_module1_caption"><h3>日志</h3><a class="more" href="#action/uchblog#">更多>></a></div>
  220. <ul class="global_tx_list1">
  221. <!--{loop $_SBLOCK['hotblog'] $value}-->
  222. <li><span class="box_r"><a href="{S_URL}/space.php?uid=$value[uid]">$value[username]</a></span><a href="$value[url]" title="$value[subjectall]">$value[subject]</a></li>
  223. <!--{/loop}-->
  224. </ul>
  225. </div>
  226. </div><!--col1 end-->

  227. <!--{block name="uchspace" parameter="order/updatetime DESC/limit/0,8/cachetime/86430/cachename/uchspace"}-->
  228. <div class="col2">
  229. <div class="global_module bg_fff">
  230. <div class="global_module2_caption"><h3>最近更新</h3></div>
  231. <ul class="global_avatar_list new_avatar">
  232. <!--{loop $_SBLOCK['uchspace'] $value}-->
  233. <li><a href="{S_URL}/space.php?uid=$value[uid]"><img src="{UC_API}/avatar.php?uid=$value[uid]&size=small" alt="$value[username]" /></a><span><a href="{S_URL}/space.php?uid=$value[uid]">$value[username]</a></span></li>
  234. <!--{/loop}-->
  235. </ul>
  236. </div>
  237. </div><!--col2 end-->
  238. </div><!--column end-->
  239. <!--{/if}-->

  240. <!--{if !empty($ads['pagefootad'])}-->
  241. <div class="ad_pagebody">$ads[pagefootad]</div>
  242. <!--{/if}-->

  243. <!--{if !empty($_SCONFIG['showindex'])}-->
  244. <!--{block name="friendlink" parameter="order/displayorder/limit/0,$_SCONFIG['showindex']/cachetime/11600/namelen/32/cachename/friendlink/tpl/data"}-->
  245. <div id="links">
  246. <h3>友情链接</h3>
  247. <!--{eval $imglink=$txtlink="";}-->
  248. <!--{loop $_SBLOCK['friendlink'] $value}-->
  249. <!--{if $value[logo]}-->
  250. <!--{eval $imglink .= "<a href="".$value[url]."" target="_blank" title="".$value[description].""><img src="".$value[logo]."" alt="".$value[description]."" border="0" /></a>\n";}-->
  251. <!--{else}-->
  252. <!--{eval $txtlink .= "<li><a href="".$value[url]."" title="".$value[description]."" target="_blank">".$value[name]."</a></li>\n";}-->
  253. <!--{/if}-->
  254. <!--{/loop}-->
  255. <!--{if !empty($imglink)}-->
  256. <div class="links_img">
  257. $imglink
  258. </div>
  259. <!--{/if}-->
  260. <!--{if !empty($txtlink)}-->
  261. <div class="links_tx">
  262. <ul class="s_clear">
  263. $txtlink
  264. </ul>
  265. </div>
  266. <!--{/if}-->
  267. </div>
  268. <!--{/if}-->
  269. <!--{if !empty($ads['pagemovead']) || !empty($ads['pageoutad'])}-->
  270. <!--{if !empty($ads['pagemovead'])}-->
  271. <div id="coupleBannerAdv" style="z-index: 10; position: absolute; width:100px;left:10px;top:10px;display:none">
  272. <div style="position: absolute; left: 6px; top: 6px;">
  273. $ads[pagemovead]
  274. <br />
  275. <img src="{S_URL}/images/base/advclose.gif" onMouseOver="this.style.cursor='hand'" onClick="closeBanner('coupleBannerAdv');">
  276. </div>
  277. <div style="position: absolute; right: 6px; top: 6px;">
  278. $ads[pagemovead]
  279. <br />
  280. <img src="{S_URL}/images/base/advclose.gif" onMouseOver="this.style.cursor='hand'" onClick="closeBanner('coupleBannerAdv');">
  281. </div>
  282. </div>
  283. <!--{/if}-->
  284. <!--{if !empty($ads['pageoutad'])}-->
  285. <div id="floatAdv" style="z-index: 10; position: absolute; width:100px;left:10px;top:10px;display:none">
  286. <div id="floatFloor" style="position: absolute; right: 6px; bottom:-700px">
  287. $ads[pageoutad]
  288. </div>
  289. </div>
  290. <!--{/if}-->
  291. <script type="text/javascript" src="{S_URL}/include/js/floatadv.js"></script>
  292. <script type="text/javascript">
  293. <!--{if !empty($ads['pageoutad'])}-->
  294. var lengthobj = getWindowSize();
  295. lsfloatdiv('floatAdv', 0, 0, 'floatFloor' , -lengthobj.winHeight).floatIt();
  296. <!--{/if}-->
  297. <!--{if !empty($ads['pagemovead'])}-->
  298. lsfloatdiv('coupleBannerAdv', 0, 0, '', 0).floatIt();
  299. <!--{/if}-->
  300. </script>
  301. <!--{/if}-->

  302. <!--{if !empty($ads['pageoutindex'])}-->
  303. $ads[pageoutindex]
  304. <!--{/if}-->

  305. <!--{template footer}-->
复制代码

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
jm611 发表于 2010-4-21 09:39:27 | 显示全部楼层
好长的代码,看不懂。。
回复

使用道具 举报

hellokai 发表于 2010-4-21 11:39:50 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

zp.cn 发表于 2010-4-21 13:07:10 | 显示全部楼层
增加一个模块就是了
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-11-17 07:52 , Processed in 0.025660 second(s), 3 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表