`
piperzero
  • 浏览: 3456610 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
文章分类
社区版块
存档分类
最新评论

织梦(dedecms)仿站教程第十六讲—首页其它部分及站内调查

 
阅读更多
接上一讲,继续我们的仿站之路。
打开index.htm文档,接着看代码,接下来是论坛新帖,这里我们不讨论论坛的调用,我们改为调用一个特定的栏目,所以要参考织梦仿站系列教程第十三讲——特定栏目调用 。
接下来是热门信息,我们细讲一下,找到如下代码:
<DIV class=right_a>
<UL>
<LI class=mall_hover>
<DIV class=mall_img><A href="http://www.quanji.cn/news/1/5719.html" target=_blank><IMG src="{dede:global.cfg_templets_skin/}/images/small3cdbd2277083179ced6ceb7d43b2a9b01304902616.jpg"></A> </DIV>
<DIV class=mall_name><A title=帕奎奥12回合点数完胜莫斯利(附视频) href="http://www.quanji.cn/news/1/5719.html" target=_blank>帕奎奥12回合点数完胜莫斯利</A></DIV>
<DIV class=mall_name><A title=“幽灵”帕弗里克10回合点胜洛佩兹(附视频) href="http://www.quanji.cn/news/1/5717.html" target=_blank>“幽灵”帕弗里克10回合点胜</A></DIV>
<DIV class=mall_name><A title=帕奎奥VS莫斯利赛后新闻发布会 href="http://www.quanji.cn/news/1/5721.html" target=_blank>帕奎奥VS莫斯利赛后新闻发布</A></DIV>
<LI><A title="萨利多8回合TKO洛佩兹 夺得WBO冠军头衔(附视频)" href="http://www.quanji.cn/news/1/5667.html" target=_blank>萨利多8回合TKO洛佩兹 夺得WBO冠军头衔(附视频)</A>
<LI><A title=帕奎奥VS莫斯利洛杉矶新闻发布会 href="http://www.quanji.cn/news/1/5123.html" target=_blank>帕奎奥VS莫斯利洛杉矶新闻发布会</A>
<LI><A title=霍利菲尔德11回合TKO尼尔森 href="http://www.quanji.cn/news/1/5713.html" target=_blank>霍利菲尔德11回合TKO尼尔森</A>
<LI><A title=库托VS马约加纽约新闻会爆口水战 href="http://www.quanji.cn/news/1/4988.html" target=_blank>库托VS马约加纽约新闻会爆口水战</A>
<LI><A title=乔治.阿瑟爆冷12回合KO小瓦兹奎兹(附视频) href="http://www.quanji.cn/news/1/5718.html" target=_blank>乔治.阿瑟爆冷12回合KO小瓦兹奎兹(附视频)</A>
<LI><A title="泰森为第五频道拍大片 演绎“美女与野兽”" href="http://www.quanji.cn/news/1/4956.html" target=_blank>泰森为第五频道拍大片 演绎“美女与野兽”</A>
<LI><A title=帕奎奥VS莫斯利赛前最后新闻发布会 href="http://www.quanji.cn/news/1/5701.html" target=_blank>帕奎奥VS莫斯利赛前最后新闻发布会</A>
<LI><A title=9月17日:小梅威瑟复出挑战奥提兹 href="http://www.quanji.cn/news/1/5706.html" target=_blank>9月17日:小梅威瑟复出挑战奥提兹</A>
<LI><A title=梅威瑟VS奥提兹纽约召开新闻发布会 href="http://www.quanji.cn/news/1/6004.html" target=_blank>梅威瑟VS奥提兹纽约召开新闻发布会</A>
<LI><A title="[组图]帕奎奥 VS 莫斯利精彩瞬间" href="http://www.quanji.cn/news/1/5720.html" target=_blank>[组图]帕奎奥 VS 莫斯利精彩瞬间</A>
<LI><A title=达臣延5回合点数完胜佩雷兹(附视频) href="http://www.quanji.cn/news/1/5683.html" target=_blank>达臣延5回合点数完胜佩雷兹(附视频)</A>
<LI><A title="帕奎奥完胜莫斯利 次中量级最新排名" href="http://www.quanji.cn/news/1/5722.html" target=_blank>帕奎奥完胜莫斯利 次中量级最新排名</A>
</LI>
</UL>
</DIV>
看拳击在线首页的热门信息,分为三部分,一个图片内容,三个蓝色字体的内容,九篇普通格式内容。我们就照这三部分来做代码:
  1. <DIV class=right_a>
  2. <UL>
  3. <LI class=mall_hover>
  4. {dede:arclist row='1' sort='hot' type='image.'}
  5. <DIV class=mall_img><A href="[field:arcurl/]" target=_blank><IMG src="[field:litpic/]"></A> </DIV>
  6. {/dede:arclist}
  7. {dede:arclist sort='hot' titlelen='26' limit='0,3'}
  8. <DIV class=mall_name><A title=[field:title/] href="[field:arcurl/]" target=_blank>[field:title/]</A></DIV>
  9. {/dede:arclist}
  10. {dede:arclist sort='hot' titlelen='50' limit='3,9'}
  11. <LI><A title="[field:title/]" href="[field:arcurl/]" target=_blank>[field:title/]</A>
  12. {/dede:arclist}
  13. </LI>
  14. </UL>
  15. </DIV>
代码解释:
第4行到第6行:row='1' 调用一篇内容,sort='hot' 按点击数排列,type='.image.' 调用有缩略图的内容。
第7行到第9行:limit='0,3' 表示从ID为0的记录开始,取3条记录。
第10行到第12行:limit='3,9' 表示从ID为3的记录开始,取9条记录。
接下来是图片海报,可以参考织梦仿站系列教程第十四讲——特定栏目图片调用 。
再往下是站内调查,拳击在线的代码是调用一个JS文件,我们进入织梦后台-》模块-》投票模块,默认有一个调查:你是从哪儿得知本站的? 点击后面获取代码,有三种调用格式,我们选择最后一种格式,这种格式便于控制样式。把代码复制一下,覆盖掉下面的代码:
<SCRIPT src="{dede:global.cfg_templets_skin/}/images/vote2.js"></SCRIPT>
替换后的代码:
<table width='100%' border='0' cellspacing='1' cellpadding='1' id='voteitem'>
<form name='voteform' method='post' action='/111/plus/vote.php' target='_blank'>
<input type='hidden' name='dopost' value='send' />
<input type='hidden' name='aid' value='1' />
<input type='hidden' name='ismore' value='0' />
<tr align='center'>
<td height='30' id='votetitle' style='border-bottom:1px dashed #999999;color:#3F7652' ><strong>你是从哪儿得知本站的?</strong></td>
</tr>
<tr><td height=30 bgcolor=#FFFFFF style='color:#666666'><input type='radio' name='voteitem' value='1' />朋友介绍</td></tr> <tr><td height=30 bgcolor=#FFFFFF style='color:#666666'><input type='radio' name='voteitem' value='2' />门户网站的搜索引擎</td>
</tr>
<tr>
<td height=30 bgcolor=#FFFFFF style='color:#666666'><input type='radio' name='voteitem' value='3' />Google或百度搜索</td>
</tr>
<tr>
<td height=30 bgcolor=#FFFFFF style='color:#666666'><input type='radio' name='voteitem' value='4' />别的网站上的链接</td>
</tr>
<tr>
<td height=30 bgcolor=#FFFFFF style='color:#666666'><input type='radio' name='voteitem' value='5' />其它途径</td>
</tr>
<tr>
<td height='30'> <input type='submit' class='btn-1' name='vbt1' value='投票' /> <input type='button' class='btn-1' name='vbt2' value='查看结果' onClick=window.open('/111/plus/vote.php?dopost=view&aid=1'); /></td>
</tr>
</form>
</table>
好了,首页除通用底部外,都完成了,我们查看下前台,欣赏一下我们的成果吧!
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics