织梦DeDeCms列表分页和内容页分页错位解决办法,探秘河北首家人类精子库
分类:高并发

解决办法:
列表页分页代码:

文章页分页代码在这里
/include/arc.archives.class.php
列表页分页
/include/arc.listview.class.php

【轮子狂魔】手把手教你用JS给博客动态增加目录,狂魔js

.g-btn, .galleryList-btn, .mask_btn span, .pop_iv_bg, .contextDiv span{ background:url() no-repeat 0 0; display:inline-block }.gallery { width:640px; overflow:hidden; margin:0 auto 20px; position:relative; text-align:center; font-size:14px }#galleryPicWrap { width:100%; position:relative; z-index:1; text-align:center; overflow:hidden; background:#fff url() center center no-repeat; height:395px }#galleryPic { background:#000; filter:Alpha(opacity = 0); opacity:0}.galleryInfo { position:relative; bottom:0; text-align:left; z-index:1; width:640px; visibility:hidden }#galleryTxtWrap { line-height:25px; font-size:14px; color:#fff; width:100%; text-align:left; position:absolute;bottom:0; z-index:3;background:url() repeat 0 0; _background:none; _filter: progid:DXImageTransform.Microsoft.gradient( GradientType = 0, startColorstr = '#AA000000', endColorstr = '#AA000000');}#galleryTxt{ padding:5px 40px 0 11px; font-size:14px; line-height:21px; }#galleryTxt p { padding:0; font-size:14px; height:30px; }.galleryInfo-btn { position:absolute; right:5px; bottom:0; height:25px; width:70px; line-height:25px; z-index:2 }.galleryInfo-btn div { font-size:12px; color:#999; position:absolute; right:0; cursor:pointer }.galleryInfo-btn b { position:absolute; width:0; height:0; top:9px; margin-left:3px; border-width:4px; border-style:solid; font-size:0; line-height:0; border-color:#999 transparent transparent; _width:7px; _height:4px; _border:none; _background:url() no-repeat }.gallery-btn-close { width:40px; }.gallery-btn-open { background:#3E3E3E; color:#fff; cursor:pointer; padding:0 5px; display:none }.contextDiv { cursor:pointer; width:50%;height:100%;position:absolute; top:0; z-index:2; background:url() no-repeat}.contextDiv span { width:24px; height:43px; position:absolute; top:50%; margin-top:-22px; visibility:hidden}.contextDiv:hover { zoom:1}.contextDiv:hover span { visibility:visible;}#preArrow span { background-position:0 -50px; left:16px }#nextArrow span { background-position:-30px -50px; right:16px }#preArrow { left:0 }#nextArrow { right:0 }#lastCon { position:absolute; background: #fff; height:400px; top:0; left:0; width:100%; z-index:6; display:none }.gallery-AD { margin:0 auto; width:550px; position:absolute; left:38px; _left:20px; top:0; z-index:11}.gallery-AD .l_qq_com { left:0 !important; top:0 !important}.galleryBottom { border-top:1px solid #e0e0e0; border-bottom:1px solid #e0e0e0; position:relative; z-index:9 }.galleryList { height:68px; border-top:1px solid #fff; border-bottom:1px solid #fff; background-color:#f2f2f2; padding:5px 0 }.galleryList ul { position:absolute; left:0; top:5px }.galleryList li { width:80px; height:60px; overflow:hidden; float:left; margin:0 3px 0 1px; display:inline; text-align:center; border:3px solid #f2f2f2; padding:1px; background:#f2f2f2 }.galleryList li.hover{ border:3px solid #2d96e9; background:#fff }.galleryList li a { display:block; width:80px;height:60px; overflow:hidden }.galleryList li img { height:60px } .galleryList-btn { position:absolute; top:30px; width:22px; z-index:3; height:22px; filter:Alpha(opacity = 60); opacity:0.6; -moz-transition: opacity 0.5s ease; -webkit-transition: opacity 0.5s ease; -o-transition: opacity 0.5s ease; transition: opacity 0.5s ease }.galleryList-btn:hover { opacity:1; filter:Alpha(opacity = 100); color:#379BE9 }.galleryList-btn-l { left:5px; background-position:0 -23px }.galleryList-btn-r { right:3px; background-position:-30px -23px }.galleryTool { position:absolute; top:10px; left:50%; z-index:2; margin-left:-84px; width:166px; height:30px; border-width:1px 0; border-color:#c5b9b6; border-style:solid; visibility:hidden }#Mask_Pic_wrap .galleryTool { visibility : visible; top:15px }.galleryTool-wrap { border-width:0 1px; border-color:#c5b9b6; border-style:solid; float:left; position:relative; margin:0 -1px; width:100%; overflow:visible;background:rgba(0, 0, 0, 0.2); height:30px; filter: progid:DXImageTransform.Microsoft.gradient( GradientType = 0, startColorstr = '#30000000', endColorstr = '#30000000') /9}.galleryTool-num { float:left; width:60px; padding:0 5px; text-align:right; color:#fff; line-height:30px }.galleryTool-num em { margin:0 2px;color:#fff}.galleryTool-btn { float:left; width:80px; padding:6px 0 0 10px }.galleryTool-btn .g-btn { margin-right:8px }.g-btn { filter:Alpha(opacity = 70); opacity:0.7 }.g-btn:hover { filter:Alpha(opacity = 100); opacity:1 }.g-btn-left { width:10px; height:20px; background-position:0 0 }.g-btn-right { width:10px; height:20px; background-position:-16px 0 }.g-btn-play { width:20px; height:20px; background:url() no-repeat; _background:url() no-repeat 0 0 }.g-btn-pause { width:20px; height:20px; background:url() no-repeat 3px 1px }/* 模拟右键 */#cmenu { border:1px solid #5EB4D8;background-color:#F6F9FD;padding:2px;}#cmenu ul,#cmenu li { list-style:none; margin:0px; padding:0px; text-align:center; font-size:12px; cursor:pointer }#cmenu .item { list-style:none; margin:0px; padding:0px; height:23px; line-height:23px; display:block; padding:0px }#cmenu .itemOver { background-color:#68B5EA; color:#fff; cursor:default }/* 末页推荐――内容 */.endMain { width:564px; margin:0 auto; text-align: left; line-height: 18px }.endMain .title { padding-bottom:8px; text-align: left; } .endMain h2 { font-size:14px; line-height:26px; color:#44a2ea; font-family: "微软雅黑", 'Microsoft YaHei', 'STHeiti' }.endMain ul { width: 600px }.endMain li { float:left; width:126px; height:126px; font-size:12px; margin-right: 15px }.endMain li img { background:url() right top no-repeat; padding-right:6px; width:120px }.endMain li a { color:#000 }.endMain li .lastImg { display:block; height:75px;width:126px; overflow:hidden; margin-bottom:5px }/* 末页推荐――按钮 */.endBtn { border-top:1px dotted #dbdbdb; padding-top: 20px; text-align:center }.endBtn a { width:112px; height:34px; margin: 0 20px; font-family: "Microsoft YaHei"; line-height:34px; font-size:14px; display:inline-block; background:url() no-repeat 0 0 }.endBtn a:hover { text-decoration: none }.endBtn .btnReplay { background-position:0 -254px; padding-left:40px; width:82px; color:#575757; text-align: left;}.endBtn .btnReplay:hover { background-position:0 -295px; color:#575757 }.endBtn .btnEnter { background-position:-189px -304px; text-align:center; color:#fff }.endBtn .btnEnter:hover { background-position:-189px -345px; color:#fff }/* Floating layer */#MyMaskWrap { position: absolute; width:100%; height:100%; z-index: 1000; top: 0; left: 0; background: #000; overflow: hidden; font-size:14px }#MyMaskCon { position: absolute; width:100%; height:100%; z-index: 1001; left: 0; top: 0; overflow: hidden; font-family:"simSun" }#MyMaskCon a { outline:0 }/*.pop_iv_bg { position:absolute; right:-35px; top:0; width:32px; height:32px; overflow:hidden; cursor:pointer; background:url(); line-height:99em; z-index:9;_background-image: none; _filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="", sizingMethod="scale") }.pop_iv_bg:hover { background:url(: none; _filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="", sizingMethod="scale")}*/.pop_iv_bg { position:absolute; right:20px; top:20px; width:54px; height:54px; overflow:hidden; cursor:pointer; background-position:0 -294px; line-height:99em; z-index:9;_background-image: none; _filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="", sizingMethod="scale") }.pop_iv_bg:hover { background:url() no-repeat 0 0}#Mask_Pic_wrap { margin:0 auto; position:absolute; z-index:3; background:url() center center no-repeat }#Mask_Picture { border:9px solid #fff; overflow:hidden }#Mask_Pic_wrap a { overflow:hidden }#Mask_Pic_wrap .mask_cur{ position:absolute; width:50%; height:100%; margin-top:-39px; top:0; background:#fff; filter:Alpha(opacity = 0); opacity:0 }#Mask_Pic_wrap .mask_cur_prev { left:0; cursor: url(""), auto }#Mask_Pic_wrap .mask_cur_next { right:0; cursor: url(""), auto }#Mask_Pic_wrap .mask_zoom{ position:absolute; bottom:39px; right:8px; width:31px; height:31px; background:url(); _background-image: none; _filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="", sizingMethod="scale") }#Mask_Pic_wrap .mask_zoom:hover{ background:url(: none; _filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="", sizingMethod="scale")}.Mask_Info { color:#fff; width: 800px;font-size:14px; position:absolute; left:50%; margin-left:-400px }.Mask_Info p { text-indent:2em; line-height:25px; font-size:14px }.txtC, .txtC p { text-align:center }.Mask_hd { height:37px; line-height:37px}.Mask_hd h3 { font-size:18px; color:#484848; float:left }.mask_btn { width:50%; height:100%; overflow:visible; position:absolute; z-index:2; outline:none }.mask_btn:hover { background:none }.mask_btn span{ height:93px; position:relative; width:47px; position:absolute; top:50%; margin:-47px 0 0 0; cursor:pointer }.mask_btn_prev { text-align:left; left:0} .mask_btn_prev span{ left:5%; background-position:0 -98px; _background-image: none; _filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="", sizingMethod="scale") }.mask_btn_prev:hover span{ _background-image: none; _filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="", sizingMethod="scale") }.mask_btn_next { text-align:right; right:0 }.mask_btn_next span{ right:5%; background-position:0 -196px; _background-image: none; _filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="", sizingMethod="scale") }#Mask_Loading { position: absolute; z-index: 1 }.mask_btn_next:hover span{ _background-image: none; _filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="", sizingMethod="scale") }#Mask_Loading { position: absolute; z-index: 1 }#Mask_Error { position: absolute; z-index: 2 }#Mask_PerHint {position: absolute; z-index: 3; width: 62px; height: 28px; text-align: center; font: bold 13px/28px Tahoma; color: #fff; background:url(); cursor: default}#Mask_Hint {position: absolute; z-index: 3; height: 25px; bottom:53px; width:100%; color: #fff; font: 12px/25px Tahoma, "simSun"; text-align: center}#Mask_Bottom {position: absolute; z-index: 4; width:100%; bottom:0; left:0; overflow:hidden; height:29px }#Mask_Count { width:100%; text-align:center; z-index:3; height:27px; border-bottom:2px solid #232323; color:#fff; font-size:12px}#Mask_Count span { display:inline-block; background:url() no-repeat; width:82px; height:29px }#Mask_Count em { margin:0 5px; font-family:Tahoma; text-shadow:1px 1px 1px #494949 }.num_Cur { font-size:18px; color:#0a96d0 }#Mask_Items { height:77px; background-color:#000; overflow:hidden; padding:11px 0 0; position:relative }#Mask_List { overflow:hidden; margin:0 auto; position:relative; height:77px }#Mask_List ul { position:absolute; top:0; left:0 }#Mask_Items li {float: left; width: 80px; height:60px; display:inline; margin:0 2px 0; cursor: pointer; border:3px solid #000; padding:1px; background:#000; opacity:0.6 }#Mask_Items li.hover { border:3px solid #0a96d0; padding:1px; background:#fff } #Mask_Items li:hover { opacity:1 }#Mask_Items li a { display:block; width: 80px; height:60px; overflow:hidden; text-align:center }#Mask_Items img { height: 60px }.Mask_Items_btn { position:absolute; top:24px; width:26px; height:41px }.Mask_Items_btnL { left:13px; background:url() no-repeat;_background-image: none; _filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="", sizingMethod="scale") }.Mask_Items_btnL:hover { left:13px; background:url() no-repeat;_background-image: none; _filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="", sizingMethod="scale") }.Mask_Items_btnR { right:13px; background:url() no-repeat;_background-image: none; _filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="", sizingMethod="scale") }.Mask_Items_btnR:hover { right:13px; background:url() no-repeat;_background-image: none; _filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="", sizingMethod="scale") }.mask-last-photo { width:530px; height:320px; background:#fff; position:absolute; left:24px; top:14px; z-index:999 }.mask-last-photo .hd { border-bottom:1px solid #e6e6e6 }.m-picList { padding-left:183px; position:relative; height:115px; text-align:center }.m-picList-pic { position:absolute; left:0; top:0 }.m-picList-pic a { width:155px; height:100px; display:block; text-align:center; overflow:hidden }.m-picList-pic a img { height:100px }.m-picList-title { font-size:14px; font-weight:bold; text-align:left }.m-picList-title a { color:#093c8b }.m-picList-btn { margin-top:24px }.m-picList-btn a { display:inline-block; line-height:28px; margin-right:6px; padding-right:20px; background:url() no-repeat right top;}.m-picList-btn a span { float:left;height:28px;padding-right:20px;background:url() no-repeat left top;}.m-picList-btn a em { float:left; height:28px;}.m-picList-btn .btn-replayPic em {width:13px;background:url() no-repeat -34px -32px;padding-right:5px;}.m-picList-btn .btn-MIcblog em {width:16px;background:url() no-repeat -211px -32px;padding-right:5px;}.mask-last-photo .bd h3 { color:#093c8b; padding:4px 0 6px }.maskComend li { float:left; width:142px; height:148px; border:1px solid #ececec; text-align:center; background:#f3f6fd; padding:8px 9px 0; margin-right:10px }.maskComend li .img { width:142px; height:92px; overflow:hidden; display:block; margin-bottom:10px }.maskComend li img { height:92px }.Mask-share-box { background:#fff; height:30px; text-align:right; padding:0 30px 0 9px; position:relative }#t_weibo { background:url() no-repeat 0 0; width:14px; height:17px; position:absolute; right:10px; top:2px }|xGv00|67976bddc81434f421839aeb86200f50 |xGv00|60a70311526586fe908876bac0652304|xGv00|fd586c288592bf707d9eb04d9e28f2a8|xGv00|7a4fb90d20e9b7823d382aa34e55d1ba0/0隐藏查看图注 大家都在看再看一次进入图片中心 查看原图 |xGv00|02e3590efebf394caca0778042c15b3b|xGv00|16433e7e4c898ec36e7a7aa092cc072e|xGv00|8025d4bc02f77126ddde97eb1aca5b50#sidebar{ float: right; width:343px; position: relative; height:556px; border-left:1px solid #4b4b4b; background:#383838; }.nowPlay { color:#fff; font-size:14px; padding:9px 16px 6px; font-weight: bold; background:#2F2F2F; }#Cnt-Main-Article-QQ .nowPlay p { margin-bottom: 0; color:#fff; margin:0;padding:0;}#video_box{ float: left; width: 640px; height:518px; overflow:hidden;} .video_list{ float: right; width: 342px;position:absolute; left: 0; top: 43px; }.video_list_con{ height:511px;overflow:hidden; background:#383838;}.video_list ul { background:#383838; *zoom:1; }.video_list li{ height: 102px; }.list_box{ padding: 10px 10px 18px 17px; height: 47px;}.list_box p{ color: #d3d3d3; font-size: 14px; margin-top: 4px;}.bt{ line-height: 24px;}.bt span{ float: left; color: #8a8a8a;}.bt em{ float: right;font-family:simsun}.live{ display: block;float: none;background: url(images/live.png) no-repeat right;padding-right: 37px;}.list_box_over{ padding: 11px 13px 13px 17px; }.v_img{ float: left; position: relative; margin-right: 10px; display: inline; }.v_img p{ position: absolute; bottom: 0px; left: 0px;background-color: rgba;width: 98px;}.v_img p span{ background: url(images/v_Icon.png) no-repeat 0px 2px; text-align: center; margin-left: 8px; padding-left: 15px; color: #cfb28c;}.v_intr span{ color:#fff; font-size:12px; }#Cnt-Main-Article-QQ .v_intr p{ color: #666666; margin-top: 4px; line-height: 22px; font-size:12px; margin-bottom:0;}#scr{ width: 8px; background-color:#4b4b4b; position: absolute; height: 470px; right:0;top:0; }#scr span { display:block; width:8px; height:40px; background:#818181;position: absolute; }.listvideoNLayout { height:511px; overflow-x: hidden; overflow-y: auto; scrollbar-arrow-color: #61605d; scrollbar-face-color: #818181;scrollbar-darkshadow-color: #1e1d1b;scrollbar-highlight-color: #818181;scrollbar-3dlight-color: #1e1d1b;scrollbar-shadow-color: #818181;scrollbar-track-color: #4b4b4b; }.listvideoNLayout::-webkit-scrollbar{width:8px}.listvideoNLayout::-webkit-scrollbar-button{display:none}.listvideoNLayout::-webkit-scrollbar-button:vertical:end:increment{display:block;height:8px;background-color:#383838}.listvideoNLayout::-webkit-scrollbar-track{height:200px;background-color:#383838;border-radius:3px}.listvideoNLayout::-webkit-scrollbar-track-piece:vertical:start{width:4px;background:#4B4B4B}.listvideoNLayout::-webkit-scrollbar-track-piece:vertical:end{width:4px;background:#4B4B4B}.listvideoNLayout::-webkit-scrollbar-thumb:vertical{background:#818181;cursor:pointer}#video_btn:hover { background-color:#fb9004; }.video_btn { position:absolute; left:641px; height:558px; width:15px; border-right:1px solid #262626; background-color:#383838; background-image: url(); background-repeat:no-repeat; background-position:center; }.nowLive { background:#1c1c1c; } .nowLive .v_intr span { color:#FF7900; font-size:12px; }.video_btn:hover { background-image: url(); background-repeat:no-repeat; }.video_btn_right { background-image:url( { background-image: url(); background-repeat:no-repeat;}.list_box_over_cur { background:#272727; }#sidebar { position:absolute; left:656px; }.relativeVideo { position:absolute; float: left; margin-bottom:35px}#ch { height:106px; }#Cnt-Main-Article-QQ { z-index:1; }.reltit h3 { float:left; width:auto; padding-right: 48px; }.reltit .v_close { position:static; padding-left:0; }#icon_v_close { position:static; float:left; margin-top: 9px; *margin-top: 7px; width: 19px; } .relativeVideo, .relInfo, .relVideo { z-index: 1; }#mod_player { float:left; position:static; }.convideo { float:left; width:640px; }.tjvideo { float:left; width:640px; border-top:1px solid #303030;font-size: 14px; padding-left:10px; }.tjvideo span { float:left; color:#FC8D00; font-weight:bold; line-height:38px; }#invideocon .tjvideo ul { float:right; width:360px; font-size:14px; line-height:38px; margin-bottom:0; } #invideocon .tjvideo ul a,#invideocon .tjvideo ul a:visited,#invideocon .tjvideo ul a:link,#invideocon .tjvideo ul a:active { color:#fff; border:none; }#invideocon .tjvideo ul a:hover { color:#FC8D00; }#showHotBox { float:left; width:439px; }.relVideo { height:588px }.relVideoF { height:627px }.relVideoF .video_btn { height:597px }.relVideoF .listvideoNLayout { height:553px }/* 关注 */#followVideo{width:640px;height:78px; border-top:1px solid #303030; margin:1px 0 0; background:#000; position:relative;top:518px;}#followVideoCover{ width:93px;height:53px; float:left; display:inline; margin:12px 13px 0;border:0}#Cnt-Main-Article-QQ .followVideoInfo{ position:absolute; width:521px;height:53px; font:14px/27px simsun;color:#989898; top:14px; left:120px;margin:0}#Cnt-Main-Article-QQ .followVideoInfo em{display:block; color:#fff; font-weight:bold; font-size:16px; font-style:normal; width:20em; overflow:hidden}#Cnt-Main-Article-QQ .followVideoInfo em a{color:#fff;text-decoration:none}#Cnt-Main-Article-QQ .followVideoInfo em a:hover{color:#fff;text-decoration:underline}#Cnt-Main-Article-QQ .followVideoInfo span{ display:inline-block; float:left;margin:0 20px 0 0}#Cnt-Main-Article-QQ #followVideo a.followVideoBtn{ height:20px; overflow:hidden; font:14px/20px 微软雅黑; color:#ed6f00; margin:3px 0 0;cursor:pointer;display: inline-block;text-decoration:none;border:0}#Cnt-Main-Article-QQ #followVideo a.followVideoBtn:hover{color:#ff950c;text-decoration:none}#Cnt-Main-Article-QQ .followVideoInfo .followVideoBtn span{padding-left:24px;background:url() 0 -6px no-repeat; float:none}#Cnt-Main-Article-QQ .followVideoInfo .followVideoBtn:hover span{ background-position:0 -36px}#Cnt-Main-Article-QQ .followVideoInfo .followVideoBtn span.followVideoBtnEd{ background-position:0 -66px}#Cnt-Main-Article-QQ .followVideoInfo .followVideoBtn:hover span.followVideoBtnEd{ background-position:0 -96px}#Cnt-Main-Article-QQ .followVideoInfo span a{color:#ff9003;text-decoration: underline;}#Cnt-Main-Article-QQ .followVideoInfo span a:hover{color:#ff9003;text-decoration: none;}#Cnt-Main-Article-QQ .video_openNew{ position:absolute;top:10px;right:30px;color:#666;font-size:12px; width:100px; height:22px;}.video_openNew label{cursor:pointer}.video_openNew label:hover{color:#fff}.video_openNew input{float:right; position:relative;margin-top:6px;*margin-top:3px}#Cnt-Main-Article-QQ .video_openNew strong{ float:right; margin:0 0 0 2px;line-height:22px;+line-height:25px;height:22px}#Cnt-Main-Article-QQ .followWrap .followVideoInfo a { border-bottom: none }#Cnt-Main-Article-QQ a#select_video{ font:12px/23px simsun; padding:0 9px; color:#fff; position:absolute; bottom:12px;right:10px;cursor:pointer;text-decoration:none;border-radius:2px}#Cnt-Main-Article-QQ .tjvideo a#select_video{bottom:6px;right:20px}#Cnt-Main-Article-QQ a#select_video:hover{text-decoration:none}#Cnt-Main-Article-QQ a.select_videoOff{background:#ed6f00}#Cnt-Main-Article-QQ a.select_videoOff:hover{background:#ff960e}#Cnt-Main-Article-QQ a.select_videoOn{ background:#519600}#Cnt-Main-Article-QQ a.select_videoOn:hover{ background:#6aa700}/* /关注 */|xGv00|93218fd27bd8aba655eba8524dbe1573全程探秘河北省首家人类精子库时长:5'59''播放:0来源:腾讯视频全程探秘河北省首家人类精子库收起推荐视频:自动播放 正在播放 |xGv00|191a05a156fc0d7868329017bcbc3f46

调用样式添加:

很多入门的站长会碰到这样的问题,织梦的通病,下面秀站网总结了一下织梦的列表页和文章页分页问题,希望可以帮助到大家。
主要修改两个文件一个是include/arc.listview.class,一个是修改CSS样式表。

动态显示目录的作用

不用每次写博客的时候繁琐的人工整理目录,又可以动态浮动在右下角,方便快速跳到感兴趣的位置同时也可以快速的对文章内容有一个大概的了解。

 

.dede_pages{
text-align:right;
}
.dede_pages ul{
float:right;
padding:12px 0px 12px 16px;
}
.dede_pages ul li{
float:left;
font-family:Tahoma;
line-height:17px;
margin-right:6px;
border:1px solid #E9E9E9;
}
.dede_pages ul li a{
float:left;
padding:2px 4px 2px;
color:#555;
display:block;
}
.dede_pages ul li a:hover{
color:#690;
text-decoration:none;
padding:2px 4px 2px;
}
.dede_pages ul li.thisclass,
.dede_pages ul li.thisclass a,.pagebox ul li.thisclass a:hover{
background-color:#F8F8F8;
padding:2px 4px 2px;
font-weight:bold;
}
.dede_pages .pageinfo{
line-height:21px;
padding:12px 10px 12px 16px;
color:#999;
}
.dede_pages .pageinfo strong{
color:#555;
font-weight:normal;
margin:0px 2px;
}

第一,在CSS样式表里面添加如下代码:

实现原理

首先根据个人喜好,我习惯了用 h1 来做分类。所以本篇内容也主要是针对h1来提取目录。

如何提取出来h1呢?

图片 1

先来看这张图,以猎豹浏览器为例:

首先在博客内容第一行点击鼠标右键,然后选择检查。这时会弹出右边的框,直接定位到我的h1标签,就这么简单的找到了它的父级 cnblogs_post_body 。

然后使用 jquery 选择器 来获取到这些h1,对jquery选择器不熟的直接跳这个链接温习一下:

$('#cnblogs_post_body h1')

就这么简单的一个括号就完成了对 h1 的提取。

在遍历所有的h1,取出内容之前,我们需要一个目录的容器。

$('#cnblogs_post_body').append('<div id="blog_catalog" class="blog_catalog"><ul><li><a id="blog_catalog_close" class="blog_catalog_close">>折叠目录</a></li></ul></div>');

这句简单解释就是在博客内容最末尾插入了一个 div,里面包含ul和一个默认的li 用于折叠目录。

接下来就要提取h1的内容了,但在这个过程中我们还要做一件事,就是自动给h1增加一个id,作为一个标准的懒人,我肯定连h1的id都不想写的,自动生成神马的最好了。

var id = 1;
$('#cnblogs_post_body h1').each(function(){
    $(this).attr('id','blog_catalog_id_'+id);
    $('#blog_catalog ul').append('<li><a href="#blog_catalog_id_'+id+'">'+$(this).text()+'</a></li>');
    id++;
});

有了折叠,当然少不了展开。

$('#cnblogs_post_body').append('<div id="blog_catalog_open" class="blog_catalog_open">展开目录</div>');

最后一步,让展开目录和折叠目录联动起来

$('#blog_catalog_open').click(function(){
$('#blog_catalog').show();
$('#blog_catalog_open').hide();
});

$('#blog_catalog_close').click(function(){
$('#blog_catalog').hide();
$('#blog_catalog_open').show();
});

整个制作过程其实并不复杂,还有一些css样式应用上就完工了。

 

/*列表分页*/

不管原理,我想直接用

 怎么自定义皮肤我就不多说了,一抓一大把。下面直接给你们代码。

css:

图片 2.blog_catalog { display: none; width: auto; height: auto; float: right; position: fixed; right: 180px; bottom: 200px; z-index: 9999; background-color: #fff; font-size: 12px; margin: 10px 0 0 0; padding: 5px; text-align: center; border: 3px solid #55895b; border-radius: 5px; -webkit-box-shadow: 0px 1px 3px 0px rgba(0,0,0,.73), 0px 0px 18px 0px rgba(0,0,0,.13); -moz-box-shadow: 0px 1px 3px 0px rgba(0,0,0,.73), 0px 0px 18px 0px rgba(0,0,0,.13); box-shadow: 0px 1px 3px 0px rgba(0,0,0,.73), 0px 0px 18px 0px rgba(0,0,0,.13); } .blog_catalog > li > a { background-color: #616975; background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(114, 122, 134)),to(rgb(80, 88, 100))); background-image: -webkit-linear-gradient(top, rgb(114, 122, 134), rgb(80, 88, 100)); background-image: -moz-linear-gradient(top, rgb(114, 122, 134), rgb(80, 88, 100)); background-image: -o-linear-gradient(top, rgb(114, 122, 134), rgb(80, 88, 100)); background-image: -ms-linear-gradient(top, rgb(114, 122, 134), rgb(80, 88, 100)); background-image: linear-gradient(top, rgb(114, 122, 134), rgb(80, 88, 100)); filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr='#727a86', EndColorStr='#505864'); -webkit-box-shadow: inset 0px 1px 0px 0px #878e98; -moz-box-shadow: inset 0px 1px 0px 0px #878e98; box-shadow: inset 0px 1px 0px 0px #878e98; width: 100%; height: 2.75em; line-height: 2.75em; text-indent: 2.75em; display: block; position: relative; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-weight: 600; color: #fff; text-shadow: 0px 1px 0px rgba(0,0,0,.5); } .blog_catalog ul li a { background: #fff; border-bottom: 1px solid #efeff0; width: 100%; height: 2.75em; line-height: 2.75em; display: block; position: relative; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 0.923em; font-weight: 400; color: #878d95; } .blog_catalog ul li a:hover { cursor: pointer; } .blog_catalog > li > a:hover, .blog_catalog > li > a.active, .blog_catalog > li:target > a; /*add this*/ { background-color: #35afe3; background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(69, 199, 235)),to(rgb(38, 152, 219))); background-image: -webkit-linear-gradient(top, rgb(69, 199, 235), rgb(38, 152, 219)); background-image: -moz-linear-gradient(top, rgb(69, 199, 235), rgb(38, 152, 219)); background-image: -o-linear-gradient(top, rgb(69, 199, 235), rgb(38, 152, 219)); background-image: -ms-linear-gradient(top, rgb(69, 199, 235), rgb(38, 152, 219)); background-image: linear-gradient(top, rgb(69, 199, 235), rgb(38, 152, 219)); filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr='#45c7eb', EndColorStr='#2698db'); border-bottom: 1px solid #103c56; -webkit-box-shadow: inset 0px 1px 0px 0px #6ad2ef; -moz-box-shadow: inset 0px 1px 0px 0px #6ad2ef; box-shadow: inset 0px 1px 0px 0px #6ad2ef; } .blog_catalog > li > a.active { border-bottom: 1px solid #1a638f; } .blog_catalog > li > a:before { content: ''; background-image: url(../images/sprite.png); background-repeat: no-repeat; font-size: 36px; height: 1em; width: 1em; position: absolute; left: 0; top: 50%; margin: -.5em 0 0 0; } .item1 > a:before { background-position: 0 0; } .item2 > a:before { background-position: -38px 0; } .item3 > a:before { background-position: 0 -38px; } .item4 > a:before { background-position: -38px -38px; } .item5 > a:before { background-position: -76px 0; } .blog_catalog > li > a span { font-size: 0.857em; display: inline-block; position: absolute; right: 1em; top: 50%; background: #48515c; line-height: 1em; height: 1em; padding: .4em .6em; margin: -.8em 0 0 0; color: #fff; text-indent: 0; text-align: center; -webkit-border-radius: .769em; -moz-border-radius: .769em; border-radius: .769em; -webkit-box-shadow: inset 0px 1px 3px 0px rgba(0, 0, 0, .26), 0px 1px 0px 0px rgba(255, 255, 255, .15); -moz-box-shadow: inset 0px 1px 3px 0px rgba(0, 0, 0, .26), 0px 1px 0px 0px rgba(255, 255, 255, .15); box-shadow: inset 0px 1px 3px 0px rgba(0, 0, 0, .26), 0px 1px 0px 0px rgba(255, 255, 255, .15); text-shadow: 0px 1px 0px rgba(0,0,0,.5); font-weight: 500; } .blog_catalog > li > a:hover span, .blog_catalog > li a.active span, .blog_catalog > li:target > a span /*add this*/ { background: #2173a1; } .blog_catalog > li > ul li a:before { font-size: 8px; color: #bcbcbf; position: absolute; width: 1em; height: 1em; top: 0; left: -2.7em; } .blog_catalog > li > ul li:hover a, .blog_catalog > li > ul li:hover a span, .blog_catalog > li > ul li:hover a:before { color: #32373D; } .blog_catalog ul > li > a span { font-size: 0.857em; display: inline-block; position: absolute; right: 1em; top: 50%; / background: #fff; border: 1px solid #d0d0d3; line-height: 1em; height: 1em; padding: .4em .7em; margin: -.9em 0 0 0; color: #878d95; text-indent: 0; text-align: center; -webkit-border-radius: .769em; -moz-border-radius: 769em; border-radius: 769em; text-shadow: 0px 0px 0px rgba(255,255,255,.01)); } /*additional*/ .blog_catalog > li > ul { height: 0; overflow: hidden; opacity: 0; filter: alpha(opacity=0); /* IE6-IE8 */ -webkit-transition: opacity 0.9s ease-in-out; -moz-transition: opacity 0.9s ease-in-out; -o-transition: opacity 0.9s ease-in-out; -ms-transition: opacity 0.9s ease-in-out; transition: opacity 0.9s ease-in-out; } .blog_catalog > li:target > ul { height: auto; /*using auto nullifies the height transitions, but it makes things flexible which is more important*/ border-bottom: 1px solid #51555a; opacity: 1; filter: alpha(opacity=100); /* IE6-IE8 */ } #cnblogs_post_body ul li { list-style-type: none; margin-left: -30px; } .blog_catalog_open { width: auto; height: auto; float: right; position: fixed; right: 180px; bottom: 200px; z-index: 9999; background-color: #fff; font-size: 12px; width: 125px; margin: 10px 0 0 0; padding: 5px; text-align: center; border: 3px solid #55895b; border-radius: 5px; -webkit-box-shadow: 0px 1px 3px 0px rgba(0,0,0,.73), 0px 0px 18px 0px rgba(0,0,0,.13); -moz-box-shadow: 0px 1px 3px 0px rgba(0,0,0,.73), 0px 0px 18px 0px rgba(0,0,0,.13); box-shadow: 0px 1px 3px 0px rgba(0,0,0,.73), 0px 0px 18px 0px rgba(0,0,0,.13); cursor: pointer; } View Code

js:

图片 3$('#cnblogs_post_body').append('<div id="blog_catalog_open" class="blog_catalog_open">展开目录</div>'); $('#cnblogs_post_body').append('<div id="blog_catalog" class="blog_catalog"><ul><li><a id="blog_catalog_close" class="blog_catalog_close">>折叠目录</a></li></ul></div>'); var id = 1; $('#cnblogs_post_body h1').each(function(){ $(this).attr('id','blog_catalog_id_'+id); $('#blog_catalog ul').append('<li><a href="#blog_catalog_id_'+id+'">'+$(this).text()+'</a></li>'); id++; }); $('#blog_catalog_open').click(function(){ $('#blog_catalog').show(); $('#blog_catalog_open').hide(); }); $('#blog_catalog_close').click(function(){ $('#blog_catalog').hide(); $('#blog_catalog_open').show(); }); View Code

 

.page_list {padding:3px; margin: 3px; text-align:center}

如何使用

<h1>你可以随意设置你的标题</h1>

没错,就是这么简单,其他什么都不需要。

.page_list a{padding:2px 5px; margin:2px; border:#eee 1px solid; color:#036cb4; text-decoration:none}

我不只要用目录,我还要完整皮肤

先声明,我这套皮肤是从别人那扒下来的一个雏形然后自己再改了不少地方。但是从哪里弄来的,忘了。。。很尴尬。

具体设置皮肤的也是一抓一大把就不多说了,上干货。

1.博客皮肤 选择 Custom

2.页面定制css代码

图片 4@charset "utf-8"; /* CSS Document */ /* By rhinoc.cnblogs.com*/ /*第一部分*/ #EntryTag { margin-top: 20px; font-size: 9pt; color: gray; } .topicListFooter { text-align: right; margin-right: 10px; margin-top: 10px; } #divRefreshComments { text-align: right; margin-right: 10px; margin-bottom: 5px; font-size: 9pt; } /*全局样式*/ { margin: 0; padding: 0; } html { height: 100%; } body { background-image: url(); background-repeat: repeat; font-family: 'Lucida Console',Georgia,'Microsoft YaHei',Microsoft YaHei; 5B8B4F53, sans-serif; font: 'Lucida Console',Georgia,'Microsoft YaHei',Microsoft YaHei; font-size: 11.5px; min-height: 101%; } table { border-collapse: collapse; border-spacing: 0; } fieldset, img { border: 0; } ul { word-break: break-all; } li { list-style: none; } h1, h2, h3, h4, h5, h6 { font-size: 100%; font-weight: normal; } a { outline: none; color: #21759b; } address, cite, dfn, em, var { font-style: normal; } code, kbd, pre, samp, tt { font-family: "Courier New", Courier,Microsoft Yahei, monospace; } .clear { clear: both; } /*第三部分*/ /*home和头部*/ #home { margin: 0 auto; width: 65%; min-width: 1000px; background-color: #fff; padding: 30px; margin-top: 50px; margin-bottom: 50px; box-shadow: 0px 1px 10px #999; -moz-box-shadow: 0px 1px 10px #999; -web-kit-shadow: 0px 1px 10px #999; } #header { padding-bottom: 5px; margin-top: 20px; } #blogTitle { height: 50px; clear: both; font-family: Georgia,Serif; } #InkBlogLogo { display: none; } /*博客名称*/ #blogTitle h1 { font-size: 28px; font-weight: bold; line-height: 0.2em; margin-top: 20px; } #blogTitle h1 a { color: #515151; } #blogTitle h1 a:hover { color: #21759b; } #blogTitle h2 { font-weight: normal; font-size: 14.5px; line-height: 0.3em; color: #515151; float: left; margin-left: 2em; margin-bottom: 2em; } #blogLogo { float: right; } /*导航栏*/ #navigator { text-decoration: none; font-size: 14px; font-family: 'Lucida Console',Georgia,'FZYaoTi',Microsoft YaHei; 5B8B4F53, sans-serif; font: 'Lucida Console',Georgia,'FZYaoTi',Microsoft YaHei; border-bottom: 1px solid #515151; border-top: 1px solid #515151; height: 80px; clear: both; margin-top: 20px; } #navList { width: 1200px; min-height: 30px; float: left; } #navList .border { height: 28px; position: absolute; width: 5px; left: 0px; top: 0px; overflow: hidden; opacity: 0; background: #F90; -webkit-transition: 0.3s all ease; -moz-transition: 0.3s all ease; -ms-transition: 0.3s all ease; -o-transition: 0.3s all ease; -webkit-transition: .5s left ease; } #navList li { float: left; margin: 0px,40px,0px,0px; -webkit-transition: 0.3s all ease; -moz-transition: 0.3s all ease; -ms-transition: 0.3s all ease; -o-transition: 0.3s all ease; transition: 0.3s all ease; overflow: hidden; position: relative; } #navList li:hover { background: #000; box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4); } #navList li:hover .border { opacity: 1; left: 65px; } #navList li:hover a { color: #FFF; text-shadow: 1px 2px 4px #333; } #navList li:hover .menu { -webkit-animation-name: shake; -moz-animation-name: shake; } .menu { -webkit-animation: .5s .2s ease both; -moz-animation: 1s .2s ease both; } @-webkit-keyframes shake { 0%,100% { -webkit-transform: translateX(0); } 20%,60% { -webkit-transform: translateX(-10px); } 40%,80% { -webkit-transform: translateX(10px); } } @-moz-keyframes shake { 0%,100% { -moz-transform: translateX(0); } 20%,60% { -moz-transform: translateX(-10px); } 40%,80% { -moz-transform: translateX(10px); } } #navList a { text-decoration: none; display: block; width: 5em; height: 20px; float: left; text-align: center; font-weight: bold; padding-top: 8px; color: #515151; } .blogStats { float: right; font-style: italic; font-family: Georgia,'FZYaoTi',Microsoft YaHei; 5B8B4F53, sans-serif; color: #757575; margin-right: 1px; text-align: right; } /*主页文章列表*/ #main { width: 100%; text-align: left; margin-top: 10px; } #mainContent .forFlow { margin-left: 22em; float: none; width: auto; } #mainContent { min-height: 200px; padding: 0px 0px 10px 0; -o-text-overflow: ellipsis; text-overflow: ellipsis; overflow: hidden; word-break: break-all; float: left; margin-left: -22em; margin-top: 0; width: 100%; } /*日期*/ .day { text-decoration: none; background: #FFF; padding: 20px; margin-bottom: -1px; color: #515151; font-size: 21px; line-height: 1.5em; float: left; clear: right; } .day:hover { border: 1px solid #21759B; position: relative; z-index: 10; } .day:hover .postSeparator { border-top: 1px dashed #515151; } .dayTitle { text-decoration: none; } .dayTitle a { text-decoration: none; color: #515151; font-size: 13px; font-weight: bold; font-family: Georgia,Consolas,Microsoft YaHei, monospace; } /*文章标题*/ .postTitle { font-family: Georgia,'Consolas','FZYaoTi','STHeiti',Microsoft YaHei; 5B8B4F53, sans-serif; font: 'Lucida Console',Georgia,'Microsoft YaHei',Microsoft YaHei; margin-bottom: 10px; font-size: 20px; font-weight: bold; float: right; width: 100%; clear: both; } .postTitle a:link, .postTitle a:visited, .postTitle a:active { color: #21759b; font-weight: bold; transition: all 0.4s linear 0s; } .postTitle a:hover { text-decoration: none; margin-left: 30px; font-weight: bold; color: #45bcf9; } .postTitle2 { text-decoration: none; font-size: 20px; font-weight: bold; font-family: Georgia,'Consolas','FZYaoTi','STHeiti',Microsoft YaHei; 5B8B4F53, sans-serif; font: 'Lucida Console',Georgia,'Microsoft YaHei',Microsoft YaHei; padding-right: 64px; padding-left: 10px; border-left-style: solid; border-left-width: 3px; border-left-color: #515151; } .postCon { float: right; line-height: 1.5em; width: 100%; clear: both; padding: 10px 0; } .day .postTitle a { padding-left: 10px; } .postDesc { border-right: 3px solid #21759b; font-size: 12px; color: #21759b; float: right; width: 100%; clear: both; text-align: right; padding-left: 20px; padding-right: 5px; margin-top: 20px; line-height: 1.5; } .postDesc a:link, .postDesc a:visited, .postDesc a:active { color: #666; } .postDesc a:hover { color: #21759b; text-decoration: none; } .postSeparator { clear: both; height: 1px; width: 100%; clear: both; float: right; margin: 0 auto 15px auto; } /*侧边栏*/ #sideBar { margin-top: -15px; width: 240px; min-height: 200px; padding: 0px 0 0px 5px; float: right; -o-text-overflow: ellipsis; text-overflow: ellipsis; overflow: hidden; word-break: break-all; } #sideBar a { color: #757575; } #sideBar a:hover { color: #21759b; } .mySearch { background: #FFF; } .catListTitle { font-size: 16px; background-color: #169FE6; color: white; font-weight: normal; margin-bottom: 5px; } .catListEssay ul li { font-size: 12px; font-weight: normal; margin-left: -2.3em; } .liScore { font-family: Georgia,'Consolas','FZYaoTi','STHeiti',Microsoft YaHei; font-size: 12px; font-weight: normal; margin-left: -2.3em; } .liRank { font-family: Georgia,'Consolas','FZYaoTi','STHeiti',Microsoft YaHei; font-size: 12px; font-weight: normal; margin-left: -2.3em; } .catListTag { text-decoration: none; background: #FFF; margin-top: 10px; margin-bottom: 20px; } .catListTag ul { border-top: none; } .catListTag ul li { line-height: 44px; margin-left: -30px; color: #7e8c8d; } .catListPostArchive { background: #FFF; } .catListPostArchive ul { border-top: none; } .catListPostArchive ul li { line-height: 44px; color: #7e8c8d; margin-left: -30px; } .catListArticleCategory { width: 290px; padding-top: 20px; background: #FFF; margin-top: 20px; } .catListImageCategory { width: 290px; padding-top: 20px; background: #FFF; margin-top: 20px; } .catListComment { background: #FFF; margin-top: 20px; } #RecentCommentsBlock { padding: 10px; border: 1px solid #dedede; border-top: none; } .recent_comment_title { font-size: 15px; color: #7e8c8d; } .recent_comment_body, .recent_comment_author { border-bottom: 1px solid #E9E9E9; color: #9fa4a4; font-size: 13px; } .recent_comment_body { border-bottom: none; } .catListView { background: #FFF; margin-top: 20px; } #TopViewPostsBlock { padding: 10px; border: 1px solid #dedede; border-top: none; } .catListView ul li { border-bottom: 1px solid #E9E9E9; margin-left: -30px; margin-bottom: 5px; } .catListFeedback { background: #FFF; margin-top: 20px; } #TopFeedbackPostsBlock { padding: 10px; border-top: none; } .catListFeedback ul li { margin-left: -30px; } .catListLink { display: none; } .clearFix:after { clear: both; display: block; height: 0; line-height: 0; content: ""; visibility: hidden; } #myding { background: #99B16B; display: none; } #myadd:hover { opacity: 1; } #goto-top:hover { background: url() no-repeat 0 -36px; } /*日历控件样式*/ #blog-calendar { float: center; width: 238px; margin-top: 20px; padding-bottom: 5px; margin-bottom: 20px; box-shadow: 0 1px 1px #ccc; } #blog-calendar td { font-size: 12px; font-family: "Comic Sans MS"; } #blog-calendar th { font-size: 12px; } #calendar { width: 238px; padding-bottom: 5px; margin-bottom: 35px; box-shadow: 0 1px 1px #ccc; } #calendar .Cal { width: 100%; line-height: 1.5em; } #calendar td { font-family: "Comic Sans MS"; background: #FFFFFF; padding-top: 2px; } .Cal { border: none; color: #666; text-decoration: none; } #calendar table a:hover { color: white; text-decoration: none; } .CalTodayDay { background: #FFF !important; text-decoration: none; } .CalWeekendDay { padding-top: 4px; padding-bottom: 4px; text-decoration: none; } .CalOtherMonthDay { color: #ccc; padding-top: 4px; padding-bottom: 4px; text-decoration: none; } #calendar .CalNextPrev a:link, #calendar .CalNextPrev a:visited, #calendar .CalNextPrev a:active { font-weight: bold; padding-left: 10px; padding-right: 15px; text-decoration: none; } .CalDayHeader { background: #F8F8F8; font-weight: 100; color: #5E5F63; text-decoration: none; } .CalTitle { /**日历年月头部样式**/ background: #6293bb; width: 100%; height: 25px; text-align: center; font-size: 14px; font-weight: bold; padding: 5px 0; color: #FFF; text-decoration: none; } .CalTitle td { background: #F8F8F8 !important; border: 0px !important; color: #5E5F63; font-family: "Comic Sans MS"; text-decoration: none; } .catListTitle { font-size: 13px; padding: 10px 20px; background-color: #515151; color: white; font-weight: normal; } .catListComment { line-height: 1.5em; } .divRecentComment { text-indent: 2em; color: #494949; margin-bottom: 20px; } #sideBarMain ul { line-height: 1.5em; } #sideBarMain li { line-height: 1.8; } #widget_my_zzk { padding: 10px 0 0 15px; margin-bottom: 3px; } #widget_my_google { padding: 10px 0 15px 15px; margin: 0 !important; } .input_my_zzk { width: 122px; height: 35px; outline: none; line-height: 35px; font-size: 13px; padding: 0 5px; } input.btn_my_zzk { font-size: 13px; height: 37px; width: 70px; background: #515151; text-align: center; line-height: 37px; border: none; color: #FFF; font-family: "Microsoft Yahei", "Microsoft YaHei", Arial; } input.btn_my_zzk:hover { cursor: pointer; cursor: hand; } /*查看文章页面*/ #topics { width: 100%; min-height: 200px; padding: 0px 0px 10px 0; float: left; -o-text-overflow: ellipsis; text-overflow: ellipsis; overflow: hidden; word-break: break-all; } #topics .postTitle { border: 0px; font-size: 130%; font-weight: bold; float: left; line-height: 1.5em; width: 100%; padding-left: 5px; } #EntryTag { color: #666; } #EntryTag a { margin-left: 5px; height: 20px; line-height: 20px; color: #333333; padding: 3px 14px; border-radius: 10px; margin: 2px 5px 0; background: #e7e7e7; text-decoration: none; } #EntryTag a:link, #EntryTag a:visited, #EntryTag a:active { color: #666; } #EntryTag a:hover { color: #f5f5f5; background: #21759b; transition: all 0.4s linear 0s; } #BlogPostCategory { color: #666; } #BlogPostCategory a { margin-left: 5px; height: 20px; line-height: 20px; color: #333333; padding: 3px 14px; border-radius: 10px; margin: 2px 5px 0; background: #e7e7e7; text-decoration: none; } #BlogPostCategory a:link, #BlogPostCategory a:visited, #BlogPostCategory a:active { color: #666; } #BlogPostCategory a:hover { color: #f5f5f5; background: #21759b; } #topics .postDesc { padding-left: 0px; width: 100%; text-align: right; color: #666; margin-top: 5px; background: none; } .feedback_area_title { font: normal normal 16px/35px "Microsoft YaHei"; margin: 10px 0 30px; border-bottom: 2px solid #cccccc; } .louzhu { background: transparent url() no-repeat scroll right top; padding-right: 16px; } .feedbackListSubtitle { color: #A8A8A8; } .feedbackListSubtitle a:link, .feedbackListSubtitle a:visited, .feedbackListSubtitle a:active { color: #21759b; font-weight: bold; } .feedbackListSubtitle a:hover { color: #21759b; text-decoration: underline; } .feedbackListSubtitle b { color: #21759b; } .feedbackManage { width: 200px; text-align: right; float: right; } .feedbackCon { border-bottom: 1px solid #EEE; padding: 10px 20px 10px 5px; min-height: 35px; _height: 35px; margin-bottom: 1em; line-height: 1.5; } #divRefreshComments { text-align: right; margin-bottom: 10px; } .commenttb { padding: 8px; margin-bottom: 10px; width: 50%; color: #555; border: 1px solid #ddd; border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; width: 320px; } .commenttb:hover { color: #333; border-color: rgba(82, 168, 236, 0.8); outline: 0; -webkit-box-shadow: inset 1px 1px 1px rgba(0, 0, 0, 0.075), 0 0 4px rgba(82, 168, 236, 0.6); -moz-box-shadow: inset 1px 1px 1px rgba(0, 0, 0, 0.075), 0 0 4px rgba(82, 168, 236, 0.6); box-shadow: inset 1px 1px 1px rgba(0, 0, 0, 0.075), 0 0 4px rgba(82, 168, 236, 0.6); transition: all 0.4s linear 0s; } .commentTextBox { width: 410px !important; margin-top: 10px; margin-bottom: 10px; } .commentTextBox:hover { color: #333; border-color: rgba(82, 168, 236, 0.8); outline: 0; -webkit-box-shadow: inset 1px 1px 1px rgba(0, 0, 0, 0.075), 0 0 4px rgba(82, 168, 236, 0.6); -moz-box-shadow: inset 1px 1px 1px rgba(0, 0, 0, 0.075), 0 0 4px rgba(82, 168, 236, 0.6); box-shadow: inset 1px 1px 1px rgba(0, 0, 0, 0.075), 0 0 4px rgba(82, 168, 236, 0.6); transition: all 0.4s linear 0s; } #AjaxHolder_PostComment_btnSubmit { padding: 8px 20px; text-align: center; font-size: 14px; color: #fff; border: none; background: #21759b; border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; -webkit-transition: all 0.4s ease; -moz-transition: all 0.4s ease; -o-transition: all 0.4s ease; -ms-transition: all 0.4s ease; transition: all 0.4s ease; cursor: pointer; display: inline-block; vertical-align: middle; outline: none; text-decoration: none; } #AjaxHolder_PostComment_btnSubmit:hover { background: #333; } #AjaxHolder_PostComment_divCommnentArea tr { margin-top: 10px; margin-bottom: 10px; } /*评论框*/ .comment_vote { padding-right: 10px; } .comment_vote a { color: #999; } .comment_vote a:hover { color: #21759b; } #commentform_title { font: normal normal 16px/35px "Microsoft YaHei"; margin: 10px 0 30px; border-bottom: 2px solid #cccccc; background-image: none; padding: 0; } #comment_form_container .author { padding-left: 10px; color: #555; border: 1px solid #ddd; border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; width: 320px; height: 20px; background-image: none; } #comment_form_container p { font-size: 14px; margin-bottom: 20px; } .commentbox_title_left { font-size: 14px; } .commentbox_title_right { float: left; } #comment_form_container .comment_textarea { width: 95%; height: 200px; font-size: 13px; padding: 8px; margin-bottom: 10px; color: #555; border: 1px solid #ddd; border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; } #comment_form_container .comment_textarea:hover { border-color: rgba(82, 168, 236, 0.8); outline: 0; transition: all 0.4s linear 0s; } #comment_form_container .comment_textarea:focus { outline: 0; } .comment_btn { width: 100px; height: 38px; padding: 8px 20px; text-align: center; font-size: 14px; color: #fff; border: none; background: #21759b; border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; -webkit-transition: all 0.4s ease; -moz-transition: all 0.4s ease; -o-transition: all 0.4s ease; -ms-transition: all 0.4s ease; transition: all 0.4s ease; cursor: pointer; display: inline-block; vertical-align: middle; outline: none; text-decoration: none; } .comment_btn:hover { background: #333; } #comment_form_container { } /*列表页面*/ .entrylistTitle, .PostListTitle, .thumbTitle { margin-bottom: 25px; height: 38px; line-height: 38px; font-size: 16px; border-bottom: 2px solid #e6e6e6; } color: #21759b; .entrylistDescription { color: #666; text-align: right; padding-top: 5px; padding-bottom: 5px; padding-right: 10px; margin-bottom: 10px; } .entrylistItem { min-height: 20px; _height: 20px; margin-bottom: 30px; padding-bottom: 50px; padding-top: 10px; width: 100%; } .entrylistPosttitle { padding-left: 15px; margin-bottom: 10px; border-left: 3px solid #21759b; font-size: 20px; width: 100%; } .entrylistPosttitle a:link, .entrylistPosttitle a:visited, .entrylistPosttitle a:active { color: #21759b; transition: all 0.4s linear 0s; } .entrylistPosttitle a:hover { margin-left: 30px; color: #0f3647; text-decoration: none; } .entrylistPostSummary { margin-top: 5px; margin-bottom: 5px; } .entrylistItemPostDesc { margin-top: 12px; text-align: right; color: #757575; padding-left: 5px; } .entrylistItemPostDesc a:link, .entrylistItemPostDesc a:visited, .entrylistItemPostDesc a:active { color: #666; } .entrylistItemPostDesc a:hover { color: #21759b; } .entrylist .postSeparator { clear: both; width: 100%; font-size: 0; line-height: 0; margin: 0; padding: 0; height: 0; border: none; } .divRecentCommentAticle a { color: #000; } .pager { text-align: right; margin-right: 10px; } .pager a { box-shadow: 0 1px 3px #3671a5; border: 1px solid #3671a5; background: #3671a5; color: white; transition: all 0.4s linear 0s; } .pager a:hover { background: #000; } .PostList { border-bottom: 1px solid #ccc; clear: both; min-height: 1.5em; _height: 1.5em; padding-top: 10px; margin-bottom: 20px; padding-bottom: 20px; } .postTitl2 { float: left; padding-top: 10px; padding-bottom: 10px; font-size: 14px; } .postDesc2 { color: #666; float: right; } .postText2 { clear: both; color: #757575; } /*留言*/ .pfl_feedback_area_title { text-align: right; line-height: 1.5em; font-weight: bold; margin-bottom: 10px; } .pfl_feedbackItem { border: 1px dashed #ccc; padding: 10px; border-radius: 3px; margin-bottom: 20px; } .pfl_feedbacksubtitle { width: 100%; height: 1.5em; } .pfl_feedbackname { float: left; } .pfl_feedbackname a { color: #21759b; font-weight: bold; } .pfl_feedbackManage { float: right; } .pfl_feedbackCon { color: black; padding-top: 5px; padding-bottom: 5px; } .pfl_feedbackAnswer { color: #F40; text-indent: 2em; } .tdSentMessage { text-align: right; } .errorMessage { width: 300px; float: left; } #Profile1_panelAdd input[type=text], #Profile1_txtContent { padding: 8px; margin-bottom: 10px; color: #555; border: 1px solid #ddd; border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; } #Profile1_panelAdd input[type=text]:hover, #Profile1_txtContent:hover { color: #333; border-color: rgba(82, 168, 236, 0.8); outline: 0; -webkit-box-shadow: inset 1px 1px 1px rgba(0, 0, 0, 0.075), 0 0 4px rgba(82, 168, 236, 0.6); -moz-box-shadow: inset 1px 1px 1px rgba(0, 0, 0, 0.075), 0 0 4px rgba(82, 168, 236, 0.6); box-shadow: inset 1px 1px 1px rgba(0, 0, 0, 0.075), 0 0 4px rgba(82, 168, 236, 0.6); transition: all 0.4s linear 0s; } #Profile1_panelAdd input[type=text]:focus, #Profile1_txtContent:focus { outline: 0; border-color: rgba(82, 168, 236, 0.8); } #Profile1_panelAdd input[type=submit] { padding: 8px 20px; text-align: center; font-size: 14px; color: #fff; border: none; background: #21759b; border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; -webkit-transition: all 0.4s ease; -moz-transition: all 0.4s ease; -o-transition: all 0.4s ease; -ms-transition: all 0.4s ease; transition: all 0.4s ease; cursor: pointer; display: inline-block; vertical-align: middle; outline: none; text-decoration: none; } #Profile1_panelAdd input[type=submit]:hover { background: #333; } .feedbackListSubtitle { clear: both; color: #A8A8A8; padding: 8px 5px; } .feedbackItem { margin-top: 30px; } .divPhoto { border: 1px solid #ccc; padding: 2px; margin-right: 10px; } .thumbDescription { color: #757575; text-align: right; padding-top: 5px; padding-bottom: 5px; padding-right: 10px; margin-bottom: 30px; } #footer { color: #686868; text-align: center; min-height: 15px; _height: 15px; border-top: 1px solid #ededed; margin-top: 50px; padding-top: 10px; margin-bottom: 10px; } /*留言查看页面的个人信息*/ .personInfo { margin-bottom: 20px; } /*留言分页区域*/ .pages { text-align: right; } #RSignature { border-top: #45bcf9 1px dashed; border-right: #45bcf9 1px dashed; border-bottom: #45bcf9 1px dashed; border-left: #45bcf9 1px dashed; padding-top: 12px; padding-right: 12px; padding-bottom: 12px; padding-left: 140px; color: #FFFFFF; font-family: 微软雅黑; font-size: 14px; background: url() #45bcf9 no-repeat 1% 30%; } #RSignature a { color: white; } #RSignature div { line-height: 25px; } /*第四部分:文章内容常用标签格式*/ /*文章内部常用标签格式*/ .postBody { color: #000; line-height: 1.7; font-size: 14px; } .postBody p, .postCon p { text-indent: 2em; margin: 0 auto 1em auto; } .postBody h2 { font-size: 150%; margin: 15px auto 2px auto; font-weight: bold; } .postBody h3 { font-size: 120%; margin: 15px auto 2px auto; font-weight: bold; } .postBody h4 { background-color: #515151; color: white; text-shadow: 0 1px rgba(33, 117, 188, 0.5); font-family: Consolas, Microsoft YaHei, 'Andale Mono', monospace; direction: ltr; text-align: center; white-space: pre; word-spacing: normal; word-break: normal; line-height: 1.5; padding: 1em; margin: .5em 0; overflow: auto; border-radius: 0.5em; -moz-tab-size: 4; -o-tab-size: 4; tab-size: 4; -webkit-hyphens: none; -moz-hyphens: none; -ms-hyphens: none; hyphens: none; font-size: 16.5px; margin-top: 3em; } .postBody h5 { font-size: 100%; margin: 15px auto 2px auto; font-weight: bold; color: #333; } .postBody a:link, .postBody a:visited, .postBody a:active { text-decoration: underline; } .postCon a:link, .postCon a:visited, .postCon a:active { text-decoration: underline; } .postBody ul, .postCon ul { margin-left: 2em; } .postBody li, .postCon li { list-style-type: disc; } .postBody blockquote { background-repeat: no-repeat; quotes: "201C""201D""2018""2019"; } blockquote:before { color: #ccc; content: open-quote; font-size: 4em; line-height: .1em; vertical-align: -.4em; } blockquote p { display: inline; } .buryit { background: url() no-repeat; } .burynum { display: none; } #author_profile { display: none; } #green_channel { float: left; } #div_digg { float: right; } .myposts_title { font-weight: bold; text-align: center; } #sideBar { font-size: 12px; } #sideBar h3 { font-size: 14px; } .c_b_p_desc { font-size: 14px; line-height: 1.7; } /*页脚下一页*/ #nav_next_page { line-height: 50px; } #nav_next_page a { background-color: #515151; height: 40px; line-height: 40px; color: #fff; display: inline-block; padding: 0 25px; text-decoration: none; } /*隐藏多余信息*/ #ad_text_under_commentbox, #ad_under_post_holder { display: none; } /*顶一下*/ .diggnum { font-size: 28px; color: #6DA47D; font-family: 'Microsoft Yahei'; } #div_digg { position: fixed; right: 180px; bottom: 20px; z-index: 9999; background-color: #fff; font-size: 12px; width: 125px; margin: 10px 0 0 0; padding: 5px; text-align: center; border: 3px solid #55895b; border-radius: 5px; } .diggit { float: left; width: 128px; height: 128px; background: url('') no-repeat; background-position: 0 0; text-align: center; cursor: pointer; } .diggit:hover { background-position: -128px 0; } .postBody h1 { border-left: 5px solid #e84c3d; padding-left: 10px; background-color: #ECECEC; } .postBody h2 { padding-left: 20px; border-bottom: 1px dashed #f00; color: transparent; background-color: black; text-shadow: rgba(255,255,255,0.5) 0 5px 6px, rgba(255,255,255,0.2) 1px 3px 3px; -webkit-background-clip: text; } .blog_catalog { display: none; width: auto; height: auto; float: right; position: fixed; right: 180px; bottom: 200px; z-index: 9999; background-color: #fff; font-size: 12px; margin: 10px 0 0 0; padding: 5px; text-align: center; border: 3px solid #55895b; border-radius: 5px; -webkit-box-shadow: 0px 1px 3px 0px rgba(0,0,0,.73), 0px 0px 18px 0px rgba(0,0,0,.13); -moz-box-shadow: 0px 1px 3px 0px rgba(0,0,0,.73), 0px 0px 18px 0px rgba(0,0,0,.13); box-shadow: 0px 1px 3px 0px rgba(0,0,0,.73), 0px 0px 18px 0px rgba(0,0,0,.13); } .blog_catalog > li > a { background-color: #616975; background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(114, 122, 134)),to(rgb(80, 88, 100))); background-image: -webkit-linear-gradient(top, rgb(114, 122, 134), rgb(80, 88, 100)); background-image: -moz-linear-gradient(top, rgb(114, 122, 134), rgb(80, 88, 100)); background-image: -o-linear-gradient(top, rgb(114, 122, 134), rgb(80, 88, 100)); background-image: -ms-linear-gradient(top, rgb(114, 122, 134), rgb(80, 88, 100)); background-image: linear-gradient(top, rgb(114, 122, 134), rgb(80, 88, 100)); filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr='#727a86', EndColorStr='#505864'); -webkit-box-shadow: inset 0px 1px 0px 0px #878e98; -moz-box-shadow: inset 0px 1px 0px 0px #878e98; box-shadow: inset 0px 1px 0px 0px #878e98; width: 100%; height: 2.75em; line-height: 2.75em; text-indent: 2.75em; display: block; position: relative; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-weight: 600; color: #fff; text-shadow: 0px 1px 0px rgba(0,0,0,.5); } .blog_catalog ul li a { background: #fff; border-bottom: 1px solid #efeff0; width: 100%; height: 2.75em; line-height: 2.75em; display: block; position: relative; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 0.923em; font-weight: 400; color: #878d95; } .blog_catalog ul li a:hover { cursor: pointer; } .blog_catalog > li > a:hover, .blog_catalog > li > a.active, .blog_catalog > li:target > a; /*add this*/ { background-color: #35afe3; background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(69, 199, 235)),to(rgb(38, 152, 219))); background-image: -webkit-linear-gradient(top, rgb(69, 199, 235), rgb(38, 152, 219)); background-image: -moz-linear-gradient(top, rgb(69, 199, 235), rgb(38, 152, 219)); background-image: -o-linear-gradient(top, rgb(69, 199, 235), rgb(38, 152, 219)); background-image: -ms-linear-gradient(top, rgb(69, 199, 235), rgb(38, 152, 219)); background-image: linear-gradient(top, rgb(69, 199, 235), rgb(38, 152, 219)); filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr='#45c7eb', EndColorStr='#2698db'); border-bottom: 1px solid #103c56; -webkit-box-shadow: inset 0px 1px 0px 0px #6ad2ef; -moz-box-shadow: inset 0px 1px 0px 0px #6ad2ef; box-shadow: inset 0px 1px 0px 0px #6ad2ef; } .blog_catalog > li > a.active { border-bottom: 1px solid #1a638f; } .blog_catalog > li > a:before { content: ''; background-image: url(../images/sprite.png); background-repeat: no-repeat; font-size: 36px; height: 1em; width: 1em; position: absolute; left: 0; top: 50%; margin: -.5em 0 0 0; } .item1 > a:before { background-position: 0 0; } .item2 > a:before { background-position: -38px 0; } .item3 > a:before { background-position: 0 -38px; } .item4 > a:before { background-position: -38px -38px; } .item5 > a:before { background-position: -76px 0; } .blog_catalog > li > a span { font-size: 0.857em; display: inline-block; position: absolute; right: 1em; top: 50%; background: #48515c; line-height: 1em; height: 1em; padding: .4em .6em; margin: -.8em 0 0 0; color: #fff; text-indent: 0; text-align: center; -webkit-border-radius: .769em; -moz-border-radius: .769em; border-radius: .769em; -webkit-box-shadow: inset 0px 1px 3px 0px rgba(0, 0, 0, .26), 0px 1px 0px 0px rgba(255, 255, 255, .15); -moz-box-shadow: inset 0px 1px 3px 0px rgba(0, 0, 0, .26), 0px 1px 0px 0px rgba(255, 255, 255, .15); box-shadow: inset 0px 1px 3px 0px rgba(0, 0, 0, .26), 0px 1px 0px 0px rgba(255, 255, 255, .15); text-shadow: 0px 1px 0px rgba(0,0,0,.5); font-weight: 500; } .blog_catalog > li > a:hover span, .blog_catalog > li a.active span, .blog_catalog > li:target > a span /*add this*/ { background: #2173a1; } .blog_catalog > li > ul li a:before { font-size: 8px; color: #bcbcbf; position: absolute; width: 1em; height: 1em; top: 0; left: -2.7em; } .blog_catalog > li > ul li:hover a, .blog_catalog > li > ul li:hover a span, .blog_catalog > li > ul li:hover a:before { color: #32373D; } .blog_catalog ul > li > a span { font-size: 0.857em; display: inline-block; position: absolute; right: 1em; top: 50%; / background: #fff; border: 1px solid #d0d0d3; line-height: 1em; height: 1em; padding: .4em .7em; margin: -.9em 0 0 0; color: #878d95; text-indent: 0; text-align: center; -webkit-border-radius: .769em; -moz-border-radius: 769em; border-radius: 769em; text-shadow: 0px 0px 0px rgba(255,255,255,.01)); } /*additional*/ .blog_catalog > li > ul { height: 0; overflow: hidden; opacity: 0; filter: alpha(opacity=0); /* IE6-IE8 */ -webkit-transition: opacity 0.9s ease-in-out; -moz-transition: opacity 0.9s ease-in-out; -o-transition: opacity 0.9s ease-in-out; -ms-transition: opacity 0.9s ease-in-out; transition: opacity 0.9s ease-in-out; } .blog_catalog > li:target > ul { height: auto; /*using auto nullifies the height transitions, but it makes things flexible which is more important*/ border-bottom: 1px solid #51555a; opacity: 1; filter: alpha(opacity=100); /* IE6-IE8 */ } #cnblogs_post_body ul li { list-style-type: none; margin-left: -30px; } .blog_catalog_open { width: auto; height: auto; float: right; position: fixed; right: 180px; bottom: 200px; z-index: 9999; background-color: #fff; font-size: 12px; width: 125px; margin: 10px 0 0 0; padding: 5px; text-align: center; border: 3px solid #55895b; border-radius: 5px; -webkit-box-shadow: 0px 1px 3px 0px rgba(0,0,0,.73), 0px 0px 18px 0px rgba(0,0,0,.13); -moz-box-shadow: 0px 1px 3px 0px rgba(0,0,0,.73), 0px 0px 18px 0px rgba(0,0,0,.13); box-shadow: 0px 1px 3px 0px rgba(0,0,0,.73), 0px 0px 18px 0px rgba(0,0,0,.13); cursor: pointer; } View Code

3.页角html代码

图片 5<script> var digg = $('#mainContent');//the element I want to monitor digg.bind('DOMNodeInserted', function(e) { $('.buryit').remove(); }); $('#navList').children().each(function(){ $(this).prepend('<div class="border"></div>'); }); $('#cnblogs_post_body').append('<div id="blog_catalog_open" class="blog_catalog_open">展开目录</div>'); $('#cnblogs_post_body').append('<div id="blog_catalog" class="blog_catalog"><ul><li><a id="blog_catalog_close" class="blog_catalog_close">>折叠目录</a></li></ul></div>'); var id = 1; $('#cnblogs_post_body h1').each(function(){ $(this).attr('id','blog_catalog_id_'+id); $('#blog_catalog ul').append('<li><a href="#blog_catalog_id_'+id+'">'+$(this).text()+'</a></li>'); id++; }); $('#blog_catalog_open').click(function(){ $('#blog_catalog').show(); $('#blog_catalog_open').hide(); }); $('#blog_catalog_close').click(function(){ $('#blog_catalog').hide(); $('#blog_catalog_open').show(); }); </script> View Code

 

动态显示目录的作用 不用每次写博客的时候繁琐的人工整理目录,又可以动态浮...

.page_list a:hover {border:#999 1px solid; color:#666;}

.page_list a:active {border:#999 1px solid; color:#666;}

.page_list .thisclass {padding:2px 5px; border:#036cb4 1px solid; font-weight:bold; color:#fff !important; margin:2px}

.page_list .disabled {border: #eee 1px solid; padding:2px 5px; margin:2px; color:#ddd;}

/*文章页分页*/

.pagebreak{line-height:20px;float:left; padding:5px 5px 5px 200px; color:#333; font-size:12px; width:500px;}

.pagebreak li{float:left; margin:0 3px;}

.pagebreak li a{padding:2px 5px; border:#eee 1px solid; color:#036cb4; text-decoration:none}

.pagebreak li a:hover {border:#999 1px solid; color:#666;}

.pagebreak li a:active {border:#999 1px solid; color:#666;}

.pagebreak li.thisclass {background-color:#036cb4; font-weight:bold; color:#FFF;}

.pagebreak li.thisclass a{color:#FFF}

第二:模板文件的标签是:

列表分页的标签是:

{dede:pagelist listitem="info,index,end,pre,next,pageno" listsize="5"/}

 

文章页分页标签是:

{dede:pagebreak/} 

GBK

<?php

if(!defined('DEDEINC')) exit('Request Error!');
require_once(DEDEINC."/arc.partview.class.php");

@set_time_limit(0);
class ListView
{
    var $dsql;
    var $dtp;
    var $dtp2;
    var $TypeID;
    var $TypeLink;
    var $PageNo;
    var $TotalPage;
    var $TotalResult;
    var $PageSize;
    var $ChannelUnit;
    var $ListType;
    var $Fields;
    var $PartView;
    var $upPageType;
    var $addSql;
    var $IsError;
    var $CrossID;
    var $IsReplace;
    //php5构造函数
    function __construct($typeid,$uppage=1)
    {
        global $dsql;
        $this->TypeID = $typeid;
        $this->dsql = &$dsql;
        $this->CrossID = '';
        $this->IsReplace = false;
        $this->IsError = false;
        $this->dtp = new DedeTagParse();
        $this->dtp->refObj = $this;
        $this->dtp->SetNameSpace("dede","{","}");
        $this->dtp2 = new DedeTagParse();
        $this->dtp2->SetNameSpace("field","[","]");
        $this->TypeLink = new TypeLink($typeid);
        $this->upPageType = $uppage;
        if(!is_array($this->TypeLink->TypeInfos))
        {
            $this->IsError = true;
        }
        if(!$this->IsError)
        {
            $this->ChannelUnit = new ChannelUnit($this->TypeLink->TypeInfos['channeltype']);
            $this->Fields = $this->TypeLink->TypeInfos;
            $this->Fields['id'] = $typeid;
            $this->Fields['position'] = $this->TypeLink->GetPositionLink(true);
            $this->Fields['title'] = ereg_replace("[<>]"," / ",$this->TypeLink->GetPositionLink(false));

            //设置一些全局参数的值
            foreach($GLOBALS['PubFields'] as $k=>$v) $this->Fields[$k] = $v;
            $this->Fields['rsslink'] = $GLOBALS['cfg_cmsurl']."/data/rss/".$this->TypeID.".xml";

            //设置环境变量
            SetSysEnv($this->TypeID,$this->Fields['typename'],0,'','list');
            $this->Fields['typeid'] = $this->TypeID;

            //获得交叉栏目ID
            if($this->TypeLink->TypeInfos['cross']>0 && $this->TypeLink->TypeInfos['ispart']==0)
            {
                $selquery = '';
                if($this->TypeLink->TypeInfos['cross']==1)
                {
                    $selquery = "Select id,topid From `dede_arctype` where typename like '{$this->Fields['typename']}' And id<>'{$this->TypeID}' And topid<>'{$this->TypeID}'  ";
                }
                else
                {
                    $this->Fields['crossid'] = ereg_replace('[^0-9,]','',trim($this->Fields['crossid']));
                    if($this->Fields['crossid']!='')
                    {
                        $selquery = "Select id,topid From `dede_arctype` where id in({$this->Fields['crossid']}) And id<>{$this->TypeID} And topid<>{$this->TypeID}  ";
                    }
                }
                if($selquery!='')
                {
                    $this->dsql->SetQuery($selquery);
                    $this->dsql->Execute();
                    while($arr = $this->dsql->GetArray())
                    {
                        $this->CrossID .= ($this->CrossID=='' ? $arr['id'] : ','.$arr['id']);
                    }
                }
            }

        }//!error

    }

    //php4构造函数
    function ListView($typeid,$uppage=0){
        $this->__construct($typeid,$uppage);
    }
    //关闭相关资源
    function Close()
    {

    }

    //统计列表里的记录
    function CountRecord()
    {
        global $cfg_list_son,$cfg_need_typeid2;
        if(empty($cfg_need_typeid2)) $cfg_need_typeid2 = 'N';

        //统计数据库记录
        $this->TotalResult = -1;
        if(isset($GLOBALS['TotalResult'])) $this->TotalResult = $GLOBALS['TotalResult'];
        if(isset($GLOBALS['PageNo'])) $this->PageNo = $GLOBALS['PageNo'];
        else $this->PageNo = 1;
        $this->addSql  = " arc.arcrank > -1 ";

        if($cfg_list_son=='N')
        {
            if($cfg_need_typeid2=='N')
            {
                if($this->CrossID=='') $this->addSql .= " And (arc.typeid='".$this->TypeID."') ";
                else $this->addSql .= " And (arc.typeid in({$this->CrossID},{$this->TypeID})) ";
            }
            else
            {
                if($this->CrossID=='') $this->addSql .= " And ( (arc.typeid='".$this->TypeID."') OR typeid2='{$this->TypeID}' ) ";
                else $this->addSql .= " And ( arc.typeid in({$this->CrossID},{$this->TypeID}) OR typeid2='{$this->TypeID}' ) ";
            }
        }
        else
        {
            if($cfg_need_typeid2=='N')
            {
                if($this->CrossID=='') $this->addSql .= " And ( arc.typeid in (".GetSonIds($this->TypeID,$this->Fields['channeltype']).") ) ";
                else $this->addSql .= " And ( arc.typeid in (".GetSonIds($this->TypeID,$this->Fields['channeltype']).",{$this->CrossID}) ) ";
            }
            else
            {
                if($this->CrossID=='') $this->addSql .= " And ( arc.typeid in (".GetSonIds($this->TypeID,$this->Fields['channeltype']).") OR typeid2='{$this->TypeID}'  ) ";
                else $this->addSql .= " And ( arc.typeid in (".GetSonIds($this->TypeID,$this->Fields['channeltype']).",{$this->CrossID}) OR typeid2='{$this->TypeID}' ) ";
            }
        }

        if($this->TotalResult==-1)
        {
            $cquery = "Select count(*) as dd From `dede_arctiny` arc where ".$this->addSql;
            $row = $this->dsql->GetOne($cquery);
            if(is_array($row))
            {
                $this->TotalResult = $row['dd'];
            }
            else
            {
                $this->TotalResult = 0;
            }
        }

        //初始化列表模板,并统计页面总数
        $tempfile = $GLOBALS['cfg_basedir'].$GLOBALS['cfg_templets_dir']."/".$this->TypeLink->TypeInfos['templist'];
        $tempfile = str_replace("{tid}",$this->TypeID,$tempfile);
        $tempfile = str_replace("{cid}",$this->ChannelUnit->ChannelInfos['nid'],$tempfile);
        if(!file_exists($tempfile))
        {
            $tempfile = $GLOBALS['cfg_basedir'].$GLOBALS['cfg_templets_dir']."/".$GLOBALS['cfg_df_style']."/list_default.htm";
        }
        if(!file_exists($tempfile)||!is_file($tempfile))
        {
            echo "模板文件不存在,无法解析文档!";
            exit();
        }
        $this->dtp->LoadTemplate($tempfile);
        $ctag = $this->dtp->GetTag("page");
        if(!is_object($ctag))
        {
            $ctag = $this->dtp->GetTag("list");
        }
        if(!is_object($ctag))
        {
            $this->PageSize = 20;
        }
        else
        {
            if($ctag->GetAtt("pagesize")!="")
            {
                $this->PageSize = $ctag->GetAtt("pagesize");
            }
            else
            {
                $this->PageSize = 20;
            }
        }
        $this->TotalPage = ceil($this->TotalResult/$this->PageSize);
    }

    //列表创建HTML
    function MakeHtml($startpage=1,$makepagesize=0)
    {
        if(empty($startpage))
        {
            $startpage = 1;
        }

        //创建封面模板文件
        if($this->TypeLink->TypeInfos['isdefault']==-1)
        {
            echo '这个类目是动态类目!';
            return '../plus/list.php?tid='.$this->TypeLink->TypeInfos['id'];
        }

        //单独页面
        else if($this->TypeLink->TypeInfos['ispart']>0)
        {
            $reurl = $this->MakePartTemplets();
            return $reurl;
        }

        $this->CountRecord();
        //初步给固定值的标记赋值
        $this->ParseTempletsFirst();
        $totalpage = ceil($this->TotalResult/$this->PageSize);
        if($totalpage==0)
        {
            $totalpage = 1;
        }
        CreateDir(MfTypedir($this->Fields['typedir']));
        $murl = '';
        if($makepagesize > 0)
        {
            $endpage = $startpage+$makepagesize;
        }
        else
        {
            $endpage = ($totalpage+1);
        }
        if( $endpage >= $totalpage+1 )
        {
            $endpage = $totalpage+1;
        }
        if($endpage==1)
        {
            $endpage = 2;
        }
        for($this->PageNo=$startpage; $this->PageNo < $endpage; $this->PageNo++)
        {
            $this->ParseDMFields($this->PageNo,1);
            $makeFile = $this->GetMakeFileRule($this->Fields['id'],'list',$this->Fields['typedir'],'',$this->Fields['namerule2']);
            $makeFile = str_replace("{page}",$this->PageNo,$makeFile);
            $murl = $makeFile;
            if(!ereg("^/",$makeFile))
            {
                $makeFile = "/".$makeFile;
            }
            $makeFile = $this->GetTruePath().$makeFile;
            $makeFile = ereg_replace("/{1,}","/",$makeFile);
            $murl = $this->GetTrueUrl($murl);
            $this->dtp->SaveTo($makeFile);
        }
        if($startpage==1)
        {
            //如果列表启用封面文件,复制这个文件第一页
            if($this->TypeLink->TypeInfos['isdefault']==1
            && $this->TypeLink->TypeInfos['ispart']==0)
            {
                $onlyrule = $this->GetMakeFileRule($this->Fields['id'],"list",$this->Fields['typedir'],'',$this->Fields['namerule2']);
                $onlyrule = str_replace("{page}","1",$onlyrule);
                $list_1 = $this->GetTruePath().$onlyrule;
                $murl = MfTypedir($this->Fields['typedir']).'/'.$this->Fields['defaultname'];
                $indexname = $this->GetTruePath().$murl;
                copy($list_1,$indexname);
            }
        }
        return $murl;
    }

    //显示列表
    function Display()
    {
        if($this->TypeLink->TypeInfos['ispart']>0)
        {
            $this->DisplayPartTemplets();
            return ;
        }
        $this->CountRecord();
        if((empty($this->PageNo) || $this->PageNo==1)
        && $this->TypeLink->TypeInfos['ispart']==1)
        {
            $tmpdir = $GLOBALS['cfg_basedir'].$GLOBALS['cfg_templets_dir'];
            $tempfile = str_replace("{tid}",$this->TypeID,$this->Fields['tempindex']);
            $tempfile = str_replace("{cid}",$this->ChannelUnit->ChannelInfos['nid'],$tempfile);
            $tempfile = $tmpdir."/".$tempfile;
            if(!file_exists($tempfile))
            {
                $tempfile = $tmpdir."/".$GLOBALS['cfg_df_style']."/index_default.htm";
            }
            $this->dtp->LoadTemplate($tempfile);
        }
        $this->ParseTempletsFirst();
        $this->ParseDMFields($this->PageNo,0);
        $this->dtp->Display();
    }

    //创建单独模板页面
    function MakePartTemplets()
    {
        $this->PartView = new PartView($this->TypeID,false);
        $this->PartView->SetTypeLink($this->TypeLink);
        $nmfa = 0;
        $tmpdir = $GLOBALS['cfg_basedir'].$GLOBALS['cfg_templets_dir'];
        if($this->Fields['ispart']==1)
        {
            $tempfile = str_replace("{tid}",$this->TypeID,$this->Fields['tempindex']);
            $tempfile = str_replace("{cid}",$this->ChannelUnit->ChannelInfos['nid'],$tempfile);
            $tempfile = $tmpdir."/".$tempfile;
            if(!file_exists($tempfile))
            {
                $tempfile = $tmpdir."/".$GLOBALS['cfg_df_style']."/index_default.htm";
            }
            $this->PartView->SetTemplet($tempfile);
        }
        else if($this->Fields['ispart']==2)
        {
            //跳转网址
            return $this->Fields['typedir'];
        }
        CreateDir(MfTypedir($this->Fields['typedir']));
        $makeUrl = $this->GetMakeFileRule($this->Fields['id'],"index",MfTypedir($this->Fields['typedir']),$this->Fields['defaultname'],$this->Fields['namerule2']);
        $makeUrl = ereg_replace("/{1,}","/",$makeUrl);
        $makeFile = $this->GetTruePath().$makeUrl;
        if($nmfa==0)
        {
            $this->PartView->SaveToHtml($makeFile);
        }
        else
        {
            if(!file_exists($makeFile))
            {
                $this->PartView->SaveToHtml($makeFile);
            }
        }
        return $this->GetTrueUrl($makeUrl);
    }

    //显示单独模板页面
    function DisplayPartTemplets()
    {
        $this->PartView = new PartView($this->TypeID,false);
        $this->PartView->SetTypeLink($this->TypeLink);
        $nmfa = 0;
        $tmpdir = $GLOBALS['cfg_basedir'].$GLOBALS['cfg_templets_dir'];
        if($this->Fields['ispart']==1)
        {
            //封面模板
            $tempfile = str_replace("{tid}",$this->TypeID,$this->Fields['tempindex']);
            $tempfile = str_replace("{cid}",$this->ChannelUnit->ChannelInfos['nid'],$tempfile);
            $tempfile = $tmpdir."/".$tempfile;
            if(!file_exists($tempfile))
            {
                $tempfile = $tmpdir."/".$GLOBALS['cfg_df_style']."/index_default.htm";
            }
            $this->PartView->SetTemplet($tempfile);
        }
        else if($this->Fields['ispart']==2)
        {
            //跳转网址
            $gotourl = $this->Fields['typedir'];
            header("Location:$gotourl");
            exit();
        }
        CreateDir(MfTypedir($this->Fields['typedir']));
        $makeUrl = $this->GetMakeFileRule($this->Fields['id'],"index",MfTypedir($this->Fields['typedir']),$this->Fields['defaultname'],$this->Fields['namerule2']);
        $makeFile = $this->GetTruePath().$makeUrl;
        if($nmfa==0)
        {
            $this->PartView->Display();
        }
        else
        {
            if(!file_exists($makeFile))
            {
                $this->PartView->Display();
            }
            else
            {
                include($makeFile);
            }
        }
    }

    //获得站点的真实根路径
    function GetTruePath()
    {
        $truepath = $GLOBALS["cfg_basedir"];
        return $truepath;
    }

    //获得真实连接路径
    function GetTrueUrl($nurl)
    {
        if($this->Fields['moresite']==1)
        {
            if($this->Fields['sitepath']!='')
            {
                $nurl = ereg_replace("^".$this->Fields['sitepath'],'',$nurl);
            }
            $nurl = $this->Fields['siteurl'].$nurl;
        }
        return $nurl;
    }

    //解析模板,对固定的标记进行初始给值
    function ParseTempletsFirst()
    {
        if(isset($this->TypeLink->TypeInfos['reid']))
        {
            $GLOBALS['envs']['reid'] = $this->TypeLink->TypeInfos['reid'];
        }
        $GLOBALS['envs']['typeid'] = $this->TypeID;
        $GLOBALS['envs']['topid'] = GetTopid($this->Fields['typeid']);
        $GLOBALS['envs']['cross'] = 1;
        MakeOneTag($this->dtp,$this);
    }

    //解析模板,对内容里的变动进行赋值
    function ParseDMFields($PageNo,$ismake=1)
    {
        //替换第二页后的内容
        if(($PageNo>1 || strlen($this->Fields['content'])<10 ) && !$this->IsReplace)
        {
            $this->dtp->SourceString = str_replace('[cmsreplace]','display:none',$this->dtp->SourceString);
            $this->IsReplace = true;
        }
        foreach($this->dtp->CTags as $tagid=>$ctag)
        {
            if($ctag->GetName()=="list")
            {
                $limitstart = ($this->PageNo-1) * $this->PageSize;
                $row = $this->PageSize;
                if(trim($ctag->GetInnerText())=="")
                {
                    $InnerText = GetSysTemplets("list_fulllist.htm");
                }
                else
                {
                    $InnerText = trim($ctag->GetInnerText());
                }
                $this->dtp->Assign($tagid,
                $this->GetArcList(
                $limitstart,
                $row,
                $ctag->GetAtt("col"),
                $ctag->GetAtt("titlelen"),
                $ctag->GetAtt("infolen"),
                $ctag->GetAtt("imgwidth"),
                $ctag->GetAtt("imgheight"),
                $ctag->GetAtt("listtype"),
                $ctag->GetAtt("orderby"),
                $InnerText,
                $ctag->GetAtt("tablewidth"),
                $ismake,
                $ctag->GetAtt("orderway")
                )
                );
            }
            else if($ctag->GetName()=="pagelist")
            {
                $list_len = trim($ctag->GetAtt("listsize"));
                $ctag->GetAtt("listitem")=="" ? $listitem="index,pre,pageno,next,end,option" : $listitem=$ctag->GetAtt("listitem");
                if($list_len=="")
                {
                    $list_len = 3;
                }
                if($ismake==0)
                {
                    $this->dtp->Assign($tagid,$this->GetPageListDM($list_len,$listitem));
                }
                else
                {
                    $this->dtp->Assign($tagid,$this->GetPageListST($list_len,$listitem));
                }
            }
            else if($PageNo!=1 && $ctag->GetName()=='field' && $ctag->GetAtt('display')!='')
            {
                $this->dtp->Assign($tagid,'');
            }
        }
    }

    //获得要创建的文件名称规则
    function GetMakeFileRule($typeid,$wname,$typedir,$defaultname,$namerule2)
    {
        $typedir = MfTypedir($typedir);
        if($wname=='index')
        {
            return $typedir.'/'.$defaultname;
        }
        else
        {
            $namerule2 = str_replace('{tid}',$typeid,$namerule2);
            $namerule2 = str_replace('{typedir}',$typedir,$namerule2);
            return $namerule2;
        }
    }

    //获得一个单列的文档列表
    function GetArcList($limitstart=0,$row=10,$col=1,$titlelen=30,$infolen=250,
    $imgwidth=120,$imgheight=90,$listtype="all",$orderby="default",$innertext="",$tablewidth="100",$ismake=1,$orderWay='desc')
    {
        global $cfg_list_son;

        $typeid=$this->TypeID;

        if($row=='') $row = 10;
        if($limitstart=='') $limitstart = 0;
        if($titlelen=='') $titlelen = 100;
        if($infolen=='') $infolen = 250;
        if($imgwidth=='') $imgwidth = 120;
        if($imgheight=='') $imgheight = 120;
        if($listtype=='') $listtype = 'all';
        if($orderWay=='') $orderWay = 'desc';

        if($orderby=='') {
            $orderby='default';
        }
        else {
            $orderby=strtolower($orderby);
        }

        $tablewidth = str_replace('%','',$tablewidth);
        if($tablewidth=='') $tablewidth=100;
        if($col=='') $col=1;
        $colWidth = ceil(100/$col);
        $tablewidth = $tablewidth.'%';
        $colWidth = $colWidth.'%';

        $innertext = trim($innertext);
        if($innertext=='') {
            $innertext = GetSysTemplets('list_fulllist.htm');
        }

        //排序方式
        $ordersql = '';
        if($orderby=="senddate" || $orderby=="id") {
            $ordersql=" order by arc.id $orderWay";
        }
        else if($orderby=="hot" || $orderby=="click") {
            $ordersql = " order by arc.click $orderWay";
        }
        else if($orderby=="lastpost") {
            $ordersql = "  order by arc.lastpost $orderWay";
        }
        else {
            $ordersql=" order by arc.sortrank $orderWay";
        }

        //获得附加表的相关信息
        $addtable  = $this->ChannelUnit->ChannelInfos['addtable'];
        if($addtable!="")
        {
            $addJoin = " left join `$addtable` on arc.id = ".$addtable.'.aid ';
            $addField = '';
            $fields = explode(',',$this->ChannelUnit->ChannelInfos['listfields']);
            foreach($fields as $k=>$v)
            {
                $nfields[$v] = $k;
            }
            if(is_array($this->ChannelUnit->ChannelFields) && !empty($this->ChannelUnit->ChannelFields))
            {
                foreach($this->ChannelUnit->ChannelFields as $k=>$arr)
                {
                    if(isset($nfields[$k]))
                    {
                        if(!empty($arr['rename'])) {
                            $addField .= ','.$addtable.'.'.$k.' as '.$arr['rename'];
                        }
                        else {
                            $addField .= ','.$addtable.'.'.$k;
                        }
                    }
                }
            }
        }
        else
        {
            $addField = '';
            $addJoin = '';
        }

        //如果不用默认的sortrank或id排序,使用联合查询(数据量大时非常缓慢)
        if(ereg('hot|click|lastpost',$orderby))
        {
            $query = "Select arc.*,tp.typedir,tp.typename,tp.isdefault,tp.defaultname,
           tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath
           $addField
           from `dede_archives` arc
           left join `dede_arctype` tp on arc.typeid=tp.id
           $addJoin
           where {$this->addSql} $ordersql limit $limitstart,$row";
        }
        //普通情况先从arctiny表查出ID,然后按ID查询(速度非常快)
        else
        {
            $t1 = ExecTime();
            $ids = array();
            $query = "Select id From `dede_arctiny` arc where {$this->addSql} $ordersql limit $limitstart,$row ";
            $this->dsql->SetQuery($query);
            $this->dsql->Execute();
            while($arr=$this->dsql->GetArray())
            {
                $ids[] = $arr['id'];
            }
            $idstr = join(',',$ids);
            if($idstr=='')
            {
                return '';
            }
            else
            {
                $query = "Select arc.*,tp.typedir,tp.typename,tp.corank,tp.isdefault,tp.defaultname,
                       tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath
                       $addField
                       from `dede_archives` arc left join `dede_arctype` tp on arc.typeid=tp.id
                       $addJoin
                       where arc.id in($idstr) $ordersql ";
            }
            $t2 = ExecTime();
            //echo $t2-$t1;

        }
        $this->dsql->SetQuery($query);
        $this->dsql->Execute('al');
        $t2 = ExecTime();

        //echo $t2-$t1;
        $artlist = '';
        $this->dtp2->LoadSource($innertext);
        $GLOBALS['autoindex'] = 0;
        for($i=0;$i<$row;$i++)
        {
            if($col>1)
            {
                $artlist .= "<div>rn";
            }
            for($j=0;$j<$col;$j++)
            {
                if($row = $this->dsql->GetArray("al"))
                {
                    $GLOBALS['autoindex']++;
                    $ids[$row['id']] = $row['id'];

                    //处理一些特殊字段
                    $row['infos'] = cn_substr($row['description'],$infolen);
                    $row['id'] =  $row['id'];

                    if($row['corank'] > 0 && $row['arcrank']==0)
                    {
                        $row['arcrank'] = $row['corank'];
                    }
                    $row['filename'] = $row['arcurl'] = GetFileUrl($row['id'],$row['typeid'],$row['senddate'],$row['title'],$row['ismake'],
                    $row['arcrank'],$row['namerule'],$row['typedir'],$row['money'],$row['filename'],$row['moresite'],$row['siteurl'],$row['sitepath']);
                    $row['typeurl'] = GetTypeUrl($row['typeid'],MfTypedir($row['typedir']),$row['isdefault'],$row['defaultname'],
                    $row['ispart'],$row['namerule2'],$row['moresite'],$row['siteurl'],$row['sitepath']);
                    if($row['litpic'] == '-' || $row['litpic'] == '')
                    {
                        $row['litpic'] = $GLOBALS['cfg_cmspath'].'ultpic.gif';
                    }
                    if(!eregi("^http://",$row['litpic']) && $GLOBALS['cfg_multi_site'] == 'Y')
                    {
                        $row['litpic'] = $GLOBALS['cfg_mainsite'].$row['litpic'];
                    }
                    $row['picname'] = $row['litpic'];
                    $row['stime'] = GetDateMK($row['pubdate']);
                    $row['typelink'] = "<a href='".$row['typeurl']."'>".$row['typename']."</a>";
                    $row['image'] = "<img src='".$row['picname']."' border='0' width='$imgwidth' height='$imgheight' alt='".ereg_replace("['><]","",$row['title'])."'>";
                    $row['imglink'] = "<a href='".$row['filename']."'>".$row['image']."</a>";
                    $row['fulltitle'] = $row['title'];
                    $row['title'] = cn_substr($row['title'],$titlelen);
                    if($row['color']!='')
                    {
                        $row['title'] = "<font color='".$row['color']."'>".$row['title']."</font>";
                    }
                    if(ereg('c',$row['flag']))
                    {
                        $row['title'] = "<b>".$row['title']."</b>";
                    }
                    $row['textlink'] = "<a href='".$row['filename']."'>".$row['title']."</a>";
                    $row['plusurl'] = $row['phpurl'] = $GLOBALS['cfg_phpurl'];
                    $row['memberurl'] = $GLOBALS['cfg_memberurl'];
                    $row['templeturl'] = $GLOBALS['cfg_templeturl'];

                    //编译附加表里的数据
                    foreach($row as $k=>$v)
                    {
                        $row[strtolower($k)] = $v;
                    }
                    foreach($this->ChannelUnit->ChannelFields as $k=>$arr)
                    {
                        if(isset($row[$k]))
                        {
                            $row[$k] = $this->ChannelUnit->MakeField($k,$row[$k]);
                        }
                    }
                    if(is_array($this->dtp2->CTags))
                    {
                        foreach($this->dtp2->CTags as $k=>$ctag)
                        {
                            if($ctag->GetName()=='array')
                            {
                                //传递整个数组,在runphp模式中有特殊作用
                                $this->dtp2->Assign($k,$row);
                            }
                            else
                            {
                                if(isset($row[$ctag->GetName()]))
                                {
                                    $this->dtp2->Assign($k,$row[$ctag->GetName()]);
                                }
                                else
                                {
                                    $this->dtp2->Assign($k,'');
                                }
                            }
                        }
                    }
                    $artlist .= $this->dtp2->GetResult();
                }//if hasRow

            }//Loop Col

            if($col>1)
            {
                $i += $col - 1;
                $artlist .= "    </div>rn";
            }
        }//Loop Line

        $t3 = ExecTime();

        //echo ($t3-$t2);
        $this->dsql->FreeResult('al');
        return $artlist;
    }

    //获取静态的分页列表
    function GetPageListST($list_len,$listitem="index,end,pre,next,pageno")
    {
        $prepage="";
        $nextpage="";
        $prepagenum = $this->PageNo-1;
        $nextpagenum = $this->PageNo+1;
        if($list_len==""||ereg("[^0-9]",$list_len))
        {
            $list_len=3;
        }
        $totalpage = ceil($this->TotalResult/$this->PageSize);
        if($totalpage<=1 && $this->TotalResult>0)
        {

            return "共 <strong>1</strong>页<strong>".$this->TotalResult."</strong>条记录";
        }
        if($this->TotalResult == 0)
        {
            return "共 <strong>0</strong>页<strong>".$this->TotalResult."</strong>条记录";
        }
        $purl = $this->GetCurUrl();
        $maininfo = "共 <strong>{$totalpage}</strong>页<strong>".$this->TotalResult."</strong>条";
        $tnamerule = $this->GetMakeFileRule($this->Fields['id'],"list",$this->Fields['typedir'],$this->Fields['defaultname'],$this->Fields['namerule2']);
        $tnamerule = ereg_replace('^(.*)/','',$tnamerule);

        //获得上一页和主页的链接
        if($this->PageNo != 1)
        {
            $prepage.="<a href='".str_replace("{page}",$prepagenum,$tnamerule)."'>上一页</a>r";
            $indexpage="<a href='".str_replace("{page}",1,$tnamerule)."'>首页</a>r";
        }
        else
        {
            $indexpage="首页r";
        }

        //下一页,未页的链接
        if($this->PageNo!=$totalpage && $totalpage>1)
        {
            $nextpage.="<a href='".str_replace("{page}",$nextpagenum,$tnamerule)."'>下一页</a>rn";
            $endpage="<a href='".str_replace("{page}",$totalpage,$tnamerule)."'>末页</a>rn";
        }
        else
        {
            $endpage="末页";
        }

        //option链接
        $optionlist = "";
        /*
        $optionlen = strlen($totalpage);
        $optionlen = $optionlen*10+18;
        $optionlist = "<select name='sldd' style='width:{$optionlen}px' onchange='location.href=this.options[this.selectedIndex].value;'>rn";
        for($mjj=1;$mjj<=$totalpage;$mjj++)
        {
            if($mjj==$this->PageNo)
            {
                $optionlist .= "<option value='".str_replace("{page}",$mjj,$tnamerule)."' selected>$mjj</option>rn";
            }
            else
            {
                $optionlist .= "<option value='".str_replace("{page}",$mjj,$tnamerule)."'>$mjj</option>rn";
            }
        }
        $optionlist .= "</select>";
        */

        //获得数字链接
        $listdd="";
        $total_list = $list_len * 2 + 1;
        if($this->PageNo >= $total_list)
        {
            $j = $this->PageNo-$list_len;
            $total_list = $this->PageNo+$list_len;
            if($total_list>$totalpage)
            {
                $total_list=$totalpage;
            }
        }
        else
        {
            $j=1;
            if($total_list>$totalpage)
            {
                $total_list=$totalpage;
            }
        }
        for($j;$j<=$total_list;$j++)
        {
            if($j==$this->PageNo)
            {
                $listdd.= "$jrn";
            }
            else
            {
                $listdd.="<a href='".str_replace("{page}",$j,$tnamerule)."'>".$j."</a>rn";
            }
        }
        $plist = "";
        if(eregi('info',$listitem))
        {
            $plist .= $maininfo.' ';
        }
        if(eregi('index',$listitem))
        {
            $plist .= $indexpage.' ';
        }
        if(eregi('pre',$listitem))
        {
            $plist .= $prepage.' ';
        }
        if(eregi('pageno',$listitem))
        {
            $plist .= $listdd.' ';
        }
        if(eregi('next',$listitem))
        {
            $plist .= $nextpage.' ';
        }
        if(eregi('end',$listitem))
        {
            $plist .= $endpage.' ';
        }
        if(eregi('option',$listitem))
        {
            $plist .= $optionlist;
        }
        return $plist;
    }

    //获取动态的分页列表
    function GetPageListDM($list_len,$listitem="index,end,pre,next,pageno")
    {
        global $cfg_rewrite;
        $prepage="";
        $nextpage="";
        $prepagenum = $this->PageNo-1;
        $nextpagenum = $this->PageNo+1;
        if($list_len==""||ereg("[^0-9]",$list_len))
        {
            $list_len=3;
        }
        $totalpage = ceil($this->TotalResult/$this->PageSize);
        if($totalpage<=1 && $this->TotalResult>0)
        {
            return "共1页/".$this->TotalResult."条记录";
        }
        if($this->TotalResult == 0)
        {
            return "共0页/".$this->TotalResult."条记录";
        }

        $purl = $this->GetCurUrl();
        if($cfg_rewrite == 'Y')
        {
            $nowurls = ereg_replace("-",".php?",$purl);
            $nowurls = explode("?",$nowurls);
            $purl = $nowurls[0];
        }

        $geturl = "tid=".$this->TypeID."&TotalResult=".$this->TotalResult."&";
        $hidenform = "<input type='hidden' name='tid' value='".$this->TypeID."'>rn";
        $hidenform .= "<input type='hidden' name='TotalResult' value='".$this->TotalResult."'>rn";
        $purl .= "?".$geturl;

        //获得上一页和下一页的链接
        if($this->PageNo != 1)
        {
            $prepage.="<a href='".$purl."PageNo=$prepagenum'>上一页</a>rn";
            $indexpage="<a href='".$purl."PageNo=1'>首页</a>rn";
        }
        else
        {
            $indexpage="<a>首页</a>rn";
        }
        if($this->PageNo!=$totalpage && $totalpage>1)
        {
            $nextpage.="<a href='".$purl."PageNo=$nextpagenum'>下一页</a>rn";
            $endpage="<a href='".$purl."PageNo=$totalpage'>末页</a>rn";
        }
        else
        {
            $endpage="<a>末页</a>";
        }


        //获得数字链接
        $listdd="";
        $total_list = $list_len * 2 + 1;
        if($this->PageNo >= $total_list)
        {
            $j = $this->PageNo-$list_len;
            $total_list = $this->PageNo+$list_len;
            if($total_list>$totalpage)
            {
                $total_list=$totalpage;
            }
        }
        else
        {
            $j=1;
            if($total_list>$totalpage)
            {
                $total_list=$totalpage;
            }
        }
        for($j;$j<=$total_list;$j++)
        {
            if($j==$this->PageNo)
            {
                $listdd.= "<li class="thisclass"><a>$j</a>rn";
            }
            else
            {
                $listdd.="<a href='".$purl."PageNo=$j'>".$j."</a>rn";
            }
        }


        $plist = $indexpage.$prepage.$listdd.$nextpage.$endpage;
        if($cfg_rewrite == 'Y')
        {
            $plist = str_replace('.php?tid=', '-', $plist);
            $plist = str_replace('&TotalResult=', '-', $plist);
            $plist = preg_replace("/&PageNo=(d+)/i",'-\1.html',$plist);
        }
        return $plist;
    }

    //获得当前的页面文件的url
    function GetCurUrl()
    {
        if(!empty($_SERVER["REQUEST_URI"]))
        {
            $nowurl = $_SERVER["REQUEST_URI"];
            $nowurls = explode("?",$nowurl);
            $nowurl = $nowurls[0];
        }
        else
        {
            $nowurl = $_SERVER["PHP_SELF"];
        }
        return $nowurl;
    }
}//End Class
?>

UTF-8

<?php

if(!defined('DEDEINC')) exit('Request Error!');
require_once(DEDEINC."/arc.partview.class.php");

@set_time_limit(0);
class ListView
{
    var $dsql;
    var $dtp;
    var $dtp2;
    var $TypeID;
    var $TypeLink;
    var $PageNo;
    var $TotalPage;
    var $TotalResult;
    var $PageSize;
    var $ChannelUnit;
    var $ListType;
    var $Fields;
    var $PartView;
    var $upPageType;
    var $addSql;
    var $IsError;
    var $CrossID;
    var $IsReplace;
    //php5构造函数
    function __construct($typeid,$uppage=1)
    {
        global $dsql;
        $this->TypeID = $typeid;
        $this->dsql = &$dsql;
        $this->CrossID = '';
        $this->IsReplace = false;
        $this->IsError = false;
        $this->dtp = new DedeTagParse();
        $this->dtp->refObj = $this;
        $this->dtp->SetNameSpace("dede","{","}");
        $this->dtp2 = new DedeTagParse();
        $this->dtp2->SetNameSpace("field","[","]");
        $this->TypeLink = new TypeLink($typeid);
        $this->upPageType = $uppage;
        if(!is_array($this->TypeLink->TypeInfos))
        {
            $this->IsError = true;
        }
        if(!$this->IsError)
        {
            $this->ChannelUnit = new ChannelUnit($this->TypeLink->TypeInfos['channeltype']);
            $this->Fields = $this->TypeLink->TypeInfos;
            $this->Fields['id'] = $typeid;
            $this->Fields['position'] = $this->TypeLink->GetPositionLink(true);
            $this->Fields['title'] = ereg_replace("[<>]"," / ",$this->TypeLink->GetPositionLink(false));

            //设置一些全局参数的值
            foreach($GLOBALS['PubFields'] as $k=>$v) $this->Fields[$k] = $v;
            $this->Fields['rsslink'] = $GLOBALS['cfg_cmsurl']."/data/rss/".$this->TypeID.".xml";

            //设置环境变量
            SetSysEnv($this->TypeID,$this->Fields['typename'],0,'','list');
            $this->Fields['typeid'] = $this->TypeID;

            //获得交叉栏目ID
            if($this->TypeLink->TypeInfos['cross']>0 && $this->TypeLink->TypeInfos['ispart']==0)
            {
                $selquery = '';
                if($this->TypeLink->TypeInfos['cross']==1)
                {
                    $selquery = "Select id,topid From `dede_arctype` where typename like '{$this->Fields['typename']}' And id<>'{$this->TypeID}' And topid<>'{$this->TypeID}'  ";
                }
                else
                {
                    $this->Fields['crossid'] = ereg_replace('[^0-9,]','',trim($this->Fields['crossid']));
                    if($this->Fields['crossid']!='')
                    {
                        $selquery = "Select id,topid From `dede_arctype` where id in({$this->Fields['crossid']}) And id<>{$this->TypeID} And topid<>{$this->TypeID}  ";
                    }
                }
                if($selquery!='')
                {
                    $this->dsql->SetQuery($selquery);
                    $this->dsql->Execute();
                    while($arr = $this->dsql->GetArray())
                    {
                        $this->CrossID .= ($this->CrossID=='' ? $arr['id'] : ','.$arr['id']);
                    }
                }
            }

        }//!error

    }

    //php4构造函数
    function ListView($typeid,$uppage=0){
        $this->__construct($typeid,$uppage);
    }
    //关闭相关资源
    function Close()
    {

    }

    //统计列表里的记录
    function CountRecord()
    {
        global $cfg_list_son,$cfg_need_typeid2;
        if(empty($cfg_need_typeid2)) $cfg_need_typeid2 = 'N';

        //统计数据库记录
        $this->TotalResult = -1;
        if(isset($GLOBALS['TotalResult'])) $this->TotalResult = $GLOBALS['TotalResult'];
        if(isset($GLOBALS['PageNo'])) $this->PageNo = $GLOBALS['PageNo'];
        else $this->PageNo = 1;
        $this->addSql  = " arc.arcrank > -1 ";

        if($cfg_list_son=='N')
        {
            if($cfg_need_typeid2=='N')
            {
                if($this->CrossID=='') $this->addSql .= " And (arc.typeid='".$this->TypeID."') ";
                else $this->addSql .= " And (arc.typeid in({$this->CrossID},{$this->TypeID})) ";
            }
            else
            {
                if($this->CrossID=='') $this->addSql .= " And ( (arc.typeid='".$this->TypeID."') OR typeid2='{$this->TypeID}' ) ";
                else $this->addSql .= " And ( arc.typeid in({$this->CrossID},{$this->TypeID}) OR typeid2='{$this->TypeID}' ) ";
            }
        }
        else
        {
            if($cfg_need_typeid2=='N')
            {
                if($this->CrossID=='') $this->addSql .= " And ( arc.typeid in (".GetSonIds($this->TypeID,$this->Fields['channeltype']).") ) ";
                else $this->addSql .= " And ( arc.typeid in (".GetSonIds($this->TypeID,$this->Fields['channeltype']).",{$this->CrossID}) ) ";
            }
            else
            {
                if($this->CrossID=='') $this->addSql .= " And ( arc.typeid in (".GetSonIds($this->TypeID,$this->Fields['channeltype']).") OR typeid2='{$this->TypeID}'  ) ";
                else $this->addSql .= " And ( arc.typeid in (".GetSonIds($this->TypeID,$this->Fields['channeltype']).",{$this->CrossID}) OR typeid2='{$this->TypeID}' ) ";
            }
        }

        if($this->TotalResult==-1)
        {
            $cquery = "Select count(*) as dd From `dede_arctiny` arc where ".$this->addSql;
            $row = $this->dsql->GetOne($cquery);
            if(is_array($row))
            {
                $this->TotalResult = $row['dd'];
            }
            else
            {
                $this->TotalResult = 0;
            }
        }

        //初始化列表模板,并统计页面总数
        $tempfile = $GLOBALS['cfg_basedir'].$GLOBALS['cfg_templets_dir']."/".$this->TypeLink->TypeInfos['templist'];
        $tempfile = str_replace("{tid}",$this->TypeID,$tempfile);
        $tempfile = str_replace("{cid}",$this->ChannelUnit->ChannelInfos['nid'],$tempfile);
        if(!file_exists($tempfile))
        {
            $tempfile = $GLOBALS['cfg_basedir'].$GLOBALS['cfg_templets_dir']."/".$GLOBALS['cfg_df_style']."/list_default.htm";
        }
        if(!file_exists($tempfile)||!is_file($tempfile))
        {
            echo "模板文件不存在,无法解析文档!";
            exit();
        }
        $this->dtp->LoadTemplate($tempfile);
        $ctag = $this->dtp->GetTag("page");
        if(!is_object($ctag))
        {
            $ctag = $this->dtp->GetTag("list");
        }
        if(!is_object($ctag))
        {
            $this->PageSize = 20;
        }
        else
        {
            if($ctag->GetAtt("pagesize")!="")
            {
                $this->PageSize = $ctag->GetAtt("pagesize");
            }
            else
            {
                $this->PageSize = 20;
            }
        }
        $this->TotalPage = ceil($this->TotalResult/$this->PageSize);
    }

    //列表创建HTML
    function MakeHtml($startpage=1,$makepagesize=0)
    {
        if(empty($startpage))
        {
            $startpage = 1;
        }

        //创建封面模板文件
        if($this->TypeLink->TypeInfos['isdefault']==-1)
        {
            echo '这个类目是动态类目!';
            return '../plus/list.php?tid='.$this->TypeLink->TypeInfos['id'];
        }

        //单独页面
        else if($this->TypeLink->TypeInfos['ispart']>0)
        {
            $reurl = $this->MakePartTemplets();
            return $reurl;
        }

        $this->CountRecord();
        //初步给固定值的标记赋值
        $this->ParseTempletsFirst();
        $totalpage = ceil($this->TotalResult/$this->PageSize);
        if($totalpage==0)
        {
            $totalpage = 1;
        }
        CreateDir(MfTypedir($this->Fields['typedir']));
        $murl = '';
        if($makepagesize > 0)
        {
            $endpage = $startpage+$makepagesize;
        }
        else
        {
            $endpage = ($totalpage+1);
        }
        if( $endpage >= $totalpage+1 )
        {
            $endpage = $totalpage+1;
        }
        if($endpage==1)
        {
            $endpage = 2;
        }
        for($this->PageNo=$startpage; $this->PageNo < $endpage; $this->PageNo++)
        {
            $this->ParseDMFields($this->PageNo,1);
            $makeFile = $this->GetMakeFileRule($this->Fields['id'],'list',$this->Fields['typedir'],'',$this->Fields['namerule2']);
            $makeFile = str_replace("{page}",$this->PageNo,$makeFile);
            $murl = $makeFile;
            if(!ereg("^/",$makeFile))
            {
                $makeFile = "/".$makeFile;
            }
            $makeFile = $this->GetTruePath().$makeFile;
            $makeFile = ereg_replace("/{1,}","/",$makeFile);
            $murl = $this->GetTrueUrl($murl);
            $this->dtp->SaveTo($makeFile);
        }
        if($startpage==1)
        {
            //如果列表启用封面文件,复制这个文件第一页
            if($this->TypeLink->TypeInfos['isdefault']==1
            && $this->TypeLink->TypeInfos['ispart']==0)
            {
                $onlyrule = $this->GetMakeFileRule($this->Fields['id'],"list",$this->Fields['typedir'],'',$this->Fields['namerule2']);
                $onlyrule = str_replace("{page}","1",$onlyrule);
                $list_1 = $this->GetTruePath().$onlyrule;
                $murl = MfTypedir($this->Fields['typedir']).'/'.$this->Fields['defaultname'];
                $indexname = $this->GetTruePath().$murl;
                copy($list_1,$indexname);
            }
        }
        return $murl;
    }

    //显示列表
    function Display()
    {
        if($this->TypeLink->TypeInfos['ispart']>0)
        {
            $this->DisplayPartTemplets();
            return ;
        }
        $this->CountRecord();
        if((empty($this->PageNo) || $this->PageNo==1)
        && $this->TypeLink->TypeInfos['ispart']==1)
        {
            $tmpdir = $GLOBALS['cfg_basedir'].$GLOBALS['cfg_templets_dir'];
            $tempfile = str_replace("{tid}",$this->TypeID,$this->Fields['tempindex']);
            $tempfile = str_replace("{cid}",$this->ChannelUnit->ChannelInfos['nid'],$tempfile);
            $tempfile = $tmpdir."/".$tempfile;
            if(!file_exists($tempfile))
            {
                $tempfile = $tmpdir."/".$GLOBALS['cfg_df_style']."/index_default.htm";
            }
            $this->dtp->LoadTemplate($tempfile);
        }
        $this->ParseTempletsFirst();
        $this->ParseDMFields($this->PageNo,0);
        $this->dtp->Display();
    }

    //创建单独模板页面
    function MakePartTemplets()
    {
        $this->PartView = new PartView($this->TypeID,false);
        $this->PartView->SetTypeLink($this->TypeLink);
        $nmfa = 0;
        $tmpdir = $GLOBALS['cfg_basedir'].$GLOBALS['cfg_templets_dir'];
        if($this->Fields['ispart']==1)
        {
            $tempfile = str_replace("{tid}",$this->TypeID,$this->Fields['tempindex']);
            $tempfile = str_replace("{cid}",$this->ChannelUnit->ChannelInfos['nid'],$tempfile);
            $tempfile = $tmpdir."/".$tempfile;
            if(!file_exists($tempfile))
            {
                $tempfile = $tmpdir."/".$GLOBALS['cfg_df_style']."/index_default.htm";
            }
            $this->PartView->SetTemplet($tempfile);
        }
        else if($this->Fields['ispart']==2)
        {
            //跳转网址
            return $this->Fields['typedir'];
        }
        CreateDir(MfTypedir($this->Fields['typedir']));
        $makeUrl = $this->GetMakeFileRule($this->Fields['id'],"index",MfTypedir($this->Fields['typedir']),$this->Fields['defaultname'],$this->Fields['namerule2']);
        $makeUrl = ereg_replace("/{1,}","/",$makeUrl);
        $makeFile = $this->GetTruePath().$makeUrl;
        if($nmfa==0)
        {
            $this->PartView->SaveToHtml($makeFile);
        }
        else
        {
            if(!file_exists($makeFile))
            {
                $this->PartView->SaveToHtml($makeFile);
            }
        }
        return $this->GetTrueUrl($makeUrl);
    }

    //显示单独模板页面
    function DisplayPartTemplets()
    {
        $this->PartView = new PartView($this->TypeID,false);
        $this->PartView->SetTypeLink($this->TypeLink);
        $nmfa = 0;
        $tmpdir = $GLOBALS['cfg_basedir'].$GLOBALS['cfg_templets_dir'];
        if($this->Fields['ispart']==1)
        {
            //封面模板
            $tempfile = str_replace("{tid}",$this->TypeID,$this->Fields['tempindex']);
            $tempfile = str_replace("{cid}",$this->ChannelUnit->ChannelInfos['nid'],$tempfile);
            $tempfile = $tmpdir."/".$tempfile;
            if(!file_exists($tempfile))
            {
                $tempfile = $tmpdir."/".$GLOBALS['cfg_df_style']."/index_default.htm";
            }
            $this->PartView->SetTemplet($tempfile);
        }
        else if($this->Fields['ispart']==2)
        {
            //跳转网址
            $gotourl = $this->Fields['typedir'];
            header("Location:$gotourl");
            exit();
        }
        CreateDir(MfTypedir($this->Fields['typedir']));
        $makeUrl = $this->GetMakeFileRule($this->Fields['id'],"index",MfTypedir($this->Fields['typedir']),$this->Fields['defaultname'],$this->Fields['namerule2']);
        $makeFile = $this->GetTruePath().$makeUrl;
        if($nmfa==0)
        {
            $this->PartView->Display();
        }
        else
        {
            if(!file_exists($makeFile))
            {
                $this->PartView->Display();
            }
            else
            {
                include($makeFile);
            }
        }
    }

    //获得站点的真实根路径
    function GetTruePath()
    {
        $truepath = $GLOBALS["cfg_basedir"];
        return $truepath;
    }

    //获得真实连接路径
    function GetTrueUrl($nurl)
    {
        if($this->Fields['moresite']==1)
        {
            if($this->Fields['sitepath']!='')
            {
                $nurl = ereg_replace("^".$this->Fields['sitepath'],'',$nurl);
            }
            $nurl = $this->Fields['siteurl'].$nurl;
        }
        return $nurl;
    }

    //解析模板,对固定的标记进行初始给值
    function ParseTempletsFirst()
    {
        if(isset($this->TypeLink->TypeInfos['reid']))
        {
            $GLOBALS['envs']['reid'] = $this->TypeLink->TypeInfos['reid'];
        }
        $GLOBALS['envs']['typeid'] = $this->TypeID;
        $GLOBALS['envs']['topid'] = GetTopid($this->Fields['typeid']);
        $GLOBALS['envs']['cross'] = 1;
        MakeOneTag($this->dtp,$this);
    }

    //解析模板,对内容里的变动进行赋值
    function ParseDMFields($PageNo,$ismake=1)
    {
        //替换第二页后的内容
        if(($PageNo>1 || strlen($this->Fields['content'])<10 ) && !$this->IsReplace)
        {
            $this->dtp->SourceString = str_replace('[cmsreplace]','display:none',$this->dtp->SourceString);
            $this->IsReplace = true;
        }
        foreach($this->dtp->CTags as $tagid=>$ctag)
        {
            if($ctag->GetName()=="list")
            {
                $limitstart = ($this->PageNo-1) * $this->PageSize;
                $row = $this->PageSize;
                if(trim($ctag->GetInnerText())=="")
                {
                    $InnerText = GetSysTemplets("list_fulllist.htm");
                }
                else
                {
                    $InnerText = trim($ctag->GetInnerText());
                }
                $this->dtp->Assign($tagid,
                $this->GetArcList(
                $limitstart,
                $row,
                $ctag->GetAtt("col"),
                $ctag->GetAtt("titlelen"),
                $ctag->GetAtt("infolen"),
                $ctag->GetAtt("imgwidth"),
                $ctag->GetAtt("imgheight"),
                $ctag->GetAtt("listtype"),
                $ctag->GetAtt("orderby"),
                $InnerText,
                $ctag->GetAtt("tablewidth"),
                $ismake,
                $ctag->GetAtt("orderway")
                )
                );
            }
            else if($ctag->GetName()=="pagelist")
            {
                $list_len = trim($ctag->GetAtt("listsize"));
                $ctag->GetAtt("listitem")=="" ? $listitem="index,pre,pageno,next,end,option" : $listitem=$ctag->GetAtt("listitem");
                if($list_len=="")
                {
                    $list_len = 3;
                }
                if($ismake==0)
                {
                    $this->dtp->Assign($tagid,$this->GetPageListDM($list_len,$listitem));
                }
                else
                {
                    $this->dtp->Assign($tagid,$this->GetPageListST($list_len,$listitem));
                }
            }
            else if($PageNo!=1 && $ctag->GetName()=='field' && $ctag->GetAtt('display')!='')
            {
                $this->dtp->Assign($tagid,'');
            }
        }
    }

    //获得要创建的文件名称规则
    function GetMakeFileRule($typeid,$wname,$typedir,$defaultname,$namerule2)
    {
        $typedir = MfTypedir($typedir);
        if($wname=='index')
        {
            return $typedir.'/'.$defaultname;
        }
        else
        {
            $namerule2 = str_replace('{tid}',$typeid,$namerule2);
            $namerule2 = str_replace('{typedir}',$typedir,$namerule2);
            return $namerule2;
        }
    }

    //获得一个单列的文档列表
    function GetArcList($limitstart=0,$row=10,$col=1,$titlelen=30,$infolen=250,
    $imgwidth=120,$imgheight=90,$listtype="all",$orderby="default",$innertext="",$tablewidth="100",$ismake=1,$orderWay='desc')
    {
        global $cfg_list_son;

        $typeid=$this->TypeID;

        if($row=='') $row = 10;
        if($limitstart=='') $limitstart = 0;
        if($titlelen=='') $titlelen = 100;
        if($infolen=='') $infolen = 250;
        if($imgwidth=='') $imgwidth = 120;
        if($imgheight=='') $imgheight = 120;
        if($listtype=='') $listtype = 'all';
        if($orderWay=='') $orderWay = 'desc';

        if($orderby=='') {
            $orderby='default';
        }
        else {
            $orderby=strtolower($orderby);
        }

        $tablewidth = str_replace('%','',$tablewidth);
        if($tablewidth=='') $tablewidth=100;
        if($col=='') $col=1;
        $colWidth = ceil(100/$col);
        $tablewidth = $tablewidth.'%';
        $colWidth = $colWidth.'%';

        $innertext = trim($innertext);
        if($innertext=='') {
            $innertext = GetSysTemplets('list_fulllist.htm');
        }

        //排序方式
        $ordersql = '';
        if($orderby=="senddate" || $orderby=="id") {
            $ordersql=" order by arc.id $orderWay";
        }
        else if($orderby=="hot" || $orderby=="click") {
            $ordersql = " order by arc.click $orderWay";
        }
        else if($orderby=="lastpost") {
            $ordersql = "  order by arc.lastpost $orderWay";
        }
        else {
            $ordersql=" order by arc.sortrank $orderWay";
        }

        //获得附加表的相关信息
        $addtable  = $this->ChannelUnit->ChannelInfos['addtable'];
        if($addtable!="")
        {
            $addJoin = " left join `$addtable` on arc.id = ".$addtable.'.aid ';
            $addField = '';
            $fields = explode(',',$this->ChannelUnit->ChannelInfos['listfields']);
            foreach($fields as $k=>$v)
            {
                $nfields[$v] = $k;
            }
            if(is_array($this->ChannelUnit->ChannelFields) && !empty($this->ChannelUnit->ChannelFields))
            {
                foreach($this->ChannelUnit->ChannelFields as $k=>$arr)
                {
                    if(isset($nfields[$k]))
                    {
                        if(!empty($arr['rename'])) {
                            $addField .= ','.$addtable.'.'.$k.' as '.$arr['rename'];
                        }
                        else {
                            $addField .= ','.$addtable.'.'.$k;
                        }
                    }
                }
            }
        }
        else
        {
            $addField = '';
            $addJoin = '';
        }

        //如果不用默认的sortrank或id排序,使用联合查询(数据量大时非常缓慢)
        if(ereg('hot|click|lastpost',$orderby))
        {
            $query = "Select arc.*,tp.typedir,tp.typename,tp.isdefault,tp.defaultname,
           tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath
           $addField
           from `dede_archives` arc
           left join `dede_arctype` tp on arc.typeid=tp.id
           $addJoin
           where {$this->addSql} $ordersql limit $limitstart,$row";
        }
        //普通情况先从arctiny表查出ID,然后按ID查询(速度非常快)
        else
        {
            $t1 = ExecTime();
            $ids = array();
            $query = "Select id From `dede_arctiny` arc where {$this->addSql} $ordersql limit $limitstart,$row ";
            $this->dsql->SetQuery($query);
            $this->dsql->Execute();
            while($arr=$this->dsql->GetArray())
            {
                $ids[] = $arr['id'];
            }
            $idstr = join(',',$ids);
            if($idstr=='')
            {
                return '';
            }
            else
            {
                $query = "Select arc.*,tp.typedir,tp.typename,tp.corank,tp.isdefault,tp.defaultname,
                       tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath
                       $addField
                       from `dede_archives` arc left join `dede_arctype` tp on arc.typeid=tp.id
                       $addJoin
                       where arc.id in($idstr) $ordersql ";
            }
            $t2 = ExecTime();
            //echo $t2-$t1;

        }
        $this->dsql->SetQuery($query);
        $this->dsql->Execute('al');
        $t2 = ExecTime();

        //echo $t2-$t1;
        $artlist = '';
        $this->dtp2->LoadSource($innertext);
        $GLOBALS['autoindex'] = 0;
        for($i=0;$i<$row;$i++)
        {
            if($col>1)
            {
                $artlist .= "<div>rn";
            }
            for($j=0;$j<$col;$j++)
            {
                if($row = $this->dsql->GetArray("al"))
                {
                    $GLOBALS['autoindex']++;
                    $ids[$row['id']] = $row['id'];

                    //处理一些特殊字段
                    $row['infos'] = cn_substr($row['description'],$infolen);
                    $row['id'] =  $row['id'];

                    if($row['corank'] > 0 && $row['arcrank']==0)
                    {
                        $row['arcrank'] = $row['corank'];
                    }
                    $row['filename'] = $row['arcurl'] = GetFileUrl($row['id'],$row['typeid'],$row['senddate'],$row['title'],$row['ismake'],
                    $row['arcrank'],$row['namerule'],$row['typedir'],$row['money'],$row['filename'],$row['moresite'],$row['siteurl'],$row['sitepath']);
                    $row['typeurl'] = GetTypeUrl($row['typeid'],MfTypedir($row['typedir']),$row['isdefault'],$row['defaultname'],
                    $row['ispart'],$row['namerule2'],$row['moresite'],$row['siteurl'],$row['sitepath']);
                    if($row['litpic'] == '-' || $row['litpic'] == '')
                    {
                        $row['litpic'] = $GLOBALS['cfg_cmspath'].'ultpic.gif';
                    }
                    if(!eregi("^http://",$row['litpic']) && $GLOBALS['cfg_multi_site'] == 'Y')
                    {
                        $row['litpic'] = $GLOBALS['cfg_mainsite'].$row['litpic'];
                    }
                    $row['picname'] = $row['litpic'];
                    $row['stime'] = GetDateMK($row['pubdate']);
                    $row['typelink'] = "<a href='".$row['typeurl']."'>".$row['typename']."</a>";
                    $row['image'] = "<img src='".$row['picname']."' border='0' width='$imgwidth' height='$imgheight' alt='".ereg_replace("['><]","",$row['title'])."'>";
                    $row['imglink'] = "<a href='".$row['filename']."'>".$row['image']."</a>";
                    $row['fulltitle'] = $row['title'];
                    $row['title'] = cn_substr($row['title'],$titlelen);
                    if($row['color']!='')
                    {
                        $row['title'] = "<font color='".$row['color']."'>".$row['title']."</font>";
                    }
                    if(ereg('c',$row['flag']))
                    {
                        $row['title'] = "<b>".$row['title']."</b>";
                    }
                    $row['textlink'] = "<a href='".$row['filename']."'>".$row['title']."</a>";
                    $row['plusurl'] = $row['phpurl'] = $GLOBALS['cfg_phpurl'];
                    $row['memberurl'] = $GLOBALS['cfg_memberurl'];
                    $row['templeturl'] = $GLOBALS['cfg_templeturl'];

                    //编译附加表里的数据
                    foreach($row as $k=>$v)
                    {
                        $row[strtolower($k)] = $v;
                    }
                    foreach($this->ChannelUnit->ChannelFields as $k=>$arr)
                    {
                        if(isset($row[$k]))
                        {
                            $row[$k] = $this->ChannelUnit->MakeField($k,$row[$k]);
                        }
                    }
                    if(is_array($this->dtp2->CTags))
                    {
                        foreach($this->dtp2->CTags as $k=>$ctag)
                        {
                            if($ctag->GetName()=='array')
                            {
                                //传递整个数组,在runphp模式中有特殊作用
                                $this->dtp2->Assign($k,$row);
                            }
                            else
                            {
                                if(isset($row[$ctag->GetName()]))
                                {
                                    $this->dtp2->Assign($k,$row[$ctag->GetName()]);
                                }
                                else
                                {
                                    $this->dtp2->Assign($k,'');
                                }
                            }
                        }
                    }
                    $artlist .= $this->dtp2->GetResult();
                }//if hasRow

            }//Loop Col

            if($col>1)
            {
                $i += $col - 1;
                $artlist .= "    </div>rn";
            }
        }//Loop Line

        $t3 = ExecTime();

        //echo ($t3-$t2);
        $this->dsql->FreeResult('al');
        return $artlist;
    }

    //获取静态的分页列表
    function GetPageListST($list_len,$listitem="index,end,pre,next,pageno")
    {
        $prepage="";
        $nextpage="";
        $prepagenum = $this->PageNo-1;
        $nextpagenum = $this->PageNo+1;
        if($list_len==""||ereg("[^0-9]",$list_len))
        {
            $list_len=3;
        }
        $totalpage = ceil($this->TotalResult/$this->PageSize);
        if($totalpage<=1 && $this->TotalResult>0)
        {

            return "共 <strong>1</strong>页<strong>".$this->TotalResult."</strong>条记录";
        }
        if($this->TotalResult == 0)
        {
            return "共 <strong>0</strong>页<strong>".$this->TotalResult."</strong>条记录";
        }
        $purl = $this->GetCurUrl();
        $maininfo = "共 <strong>{$totalpage}</strong>页<strong>".$this->TotalResult."</strong>条";
        $tnamerule = $this->GetMakeFileRule($this->Fields['id'],"list",$this->Fields['typedir'],$this->Fields['defaultname'],$this->Fields['namerule2']);
        $tnamerule = ereg_replace('^(.*)/','',$tnamerule);

        //获得上一页和主页的链接
        if($this->PageNo != 1)
        {
            $prepage.="<a href='".str_replace("{page}",$prepagenum,$tnamerule)."'>上一页</a>r";
            $indexpage="<a href='".str_replace("{page}",1,$tnamerule)."'>首页</a>r";
        }
        else
        {
            $indexpage="首页r";
        }

        //下一页,未页的链接
        if($this->PageNo!=$totalpage && $totalpage>1)
        {
            $nextpage.="<a href='".str_replace("{page}",$nextpagenum,$tnamerule)."'>下一页</a>rn";
            $endpage="<a href='".str_replace("{page}",$totalpage,$tnamerule)."'>末页</a>rn";
        }
        else
        {
            $endpage="末页";
        }

        //option链接
        $optionlist = "";
        /*
        $optionlen = strlen($totalpage);
        $optionlen = $optionlen*10+18;
        $optionlist = "<select name='sldd' style='width:{$optionlen}px' onchange='location.href=this.options[this.selectedIndex].value;'>rn";
        for($mjj=1;$mjj<=$totalpage;$mjj++)
        {
            if($mjj==$this->PageNo)
            {
                $optionlist .= "<option value='".str_replace("{page}",$mjj,$tnamerule)."' selected>$mjj</option>rn";
            }
            else
            {
                $optionlist .= "<option value='".str_replace("{page}",$mjj,$tnamerule)."'>$mjj</option>rn";
            }
        }
        $optionlist .= "</select>";
        */

        //获得数字链接
        $listdd="";
        $total_list = $list_len * 2 + 1;
        if($this->PageNo >= $total_list)
        {
            $j = $this->PageNo-$list_len;
            $total_list = $this->PageNo+$list_len;
            if($total_list>$totalpage)
            {
                $total_list=$totalpage;
            }
        }
        else
        {
            $j=1;
            if($total_list>$totalpage)
            {
                $total_list=$totalpage;
            }
        }
        for($j;$j<=$total_list;$j++)
        {
            if($j==$this->PageNo)
            {
                $listdd.= "$jrn";
            }
            else
            {
                $listdd.="<a href='".str_replace("{page}",$j,$tnamerule)."'>".$j."</a>rn";
            }
        }
        $plist = "";
        if(eregi('info',$listitem))
        {
            $plist .= $maininfo.' ';
        }
        if(eregi('index',$listitem))
        {
            $plist .= $indexpage.' ';
        }
        if(eregi('pre',$listitem))
        {
            $plist .= $prepage.' ';
        }
        if(eregi('pageno',$listitem))
        {
            $plist .= $listdd.' ';
        }
        if(eregi('next',$listitem))
        {
            $plist .= $nextpage.' ';
        }
        if(eregi('end',$listitem))
        {
            $plist .= $endpage.' ';
        }
        if(eregi('option',$listitem))
        {
            $plist .= $optionlist;
        }
        return $plist;
    }

    //获取动态的分页列表
    function GetPageListDM($list_len,$listitem="index,end,pre,next,pageno")
    {
        global $cfg_rewrite;
        $prepage="";
        $nextpage="";
        $prepagenum = $this->PageNo-1;
        $nextpagenum = $this->PageNo+1;
        if($list_len==""||ereg("[^0-9]",$list_len))
        {
            $list_len=3;
        }
        $totalpage = ceil($this->TotalResult/$this->PageSize);
        if($totalpage<=1 && $this->TotalResult>0)
        {
            return "共1页/".$this->TotalResult."条记录";
        }
        if($this->TotalResult == 0)
        {
            return "共0页/".$this->TotalResult."条记录";
        }

        $purl = $this->GetCurUrl();
        if($cfg_rewrite == 'Y')
        {
            $nowurls = ereg_replace("-",".php?",$purl);
            $nowurls = explode("?",$nowurls);
            $purl = $nowurls[0];
        }

        $geturl = "tid=".$this->TypeID."&TotalResult=".$this->TotalResult."&";
        $hidenform = "<input type='hidden' name='tid' value='".$this->TypeID."'>rn";
        $hidenform .= "<input type='hidden' name='TotalResult' value='".$this->TotalResult."'>rn";
        $purl .= "?".$geturl;

        //获得上一页和下一页的链接
        if($this->PageNo != 1)
        {
            $prepage.="<a href='".$purl."PageNo=$prepagenum'>上一页</a>rn";
            $indexpage="<a href='".$purl."PageNo=1'>首页</a>rn";
        }
        else
        {
            $indexpage="<a>首页</a>rn";
        }
        if($this->PageNo!=$totalpage && $totalpage>1)
        {
            $nextpage.="<a href='".$purl."PageNo=$nextpagenum'>下一页</a>rn";
            $endpage="<a href='".$purl."PageNo=$totalpage'>末页</a>rn";
        }
        else
        {
            $endpage="<a>末页</a>";
        }


        //获得数字链接
        $listdd="";
        $total_list = $list_len * 2 + 1;
        if($this->PageNo >= $total_list)
        {
            $j = $this->PageNo-$list_len;
            $total_list = $this->PageNo+$list_len;
            if($total_list>$totalpage)
            {
                $total_list=$totalpage;
            }
        }
        else
        {
            $j=1;
            if($total_list>$totalpage)
            {
                $total_list=$totalpage;
            }
        }
        for($j;$j<=$total_list;$j++)
        {
            if($j==$this->PageNo)
            {
                $listdd.= "<li class="thisclass"><a>$j</a>rn";
            }
            else
            {
                $listdd.="<a href='".$purl."PageNo=$j'>".$j."</a>rn";
            }
        }


        $plist = $indexpage.$prepage.$listdd.$nextpage.$endpage;
        if($cfg_rewrite == 'Y')
        {
            $plist = str_replace('.php?tid=', '-', $plist);
            $plist = str_replace('&TotalResult=', '-', $plist);
            $plist = preg_replace("/&PageNo=(d+)/i",'-\1.html',$plist);
        }
        return $plist;
    }

    //获得当前的页面文件的url
    function GetCurUrl()
    {
        if(!empty($_SERVER["REQUEST_URI"]))
        {
            $nowurl = $_SERVER["REQUEST_URI"];
            $nowurls = explode("?",$nowurl);
            $nowurl = $nowurls[0];
        }
        else
        {
            $nowurl = $_SERVER["PHP_SELF"];
        }
        return $nowurl;
    }
}//End Class
?>

来源:

本文由10bet手机官网发布于高并发,转载请注明出处:织梦DeDeCms列表分页和内容页分页错位解决办法,探秘河北首家人类精子库

上一篇:没有了 下一篇:没有了
猜你喜欢
热门排行
精彩图文