SCLUB免費論壇申請-使用者論壇's Archiver

n7197 發表於 2013-8-2 22:53

仿DX2.5~主題列表頁插件效果"7.0-7.2通用

[i=s] 本帖最後由 n7197 於 2013-8-2 22:55 編輯 [/i]

[attach]22222[/attach]

[url=http://n7197.66rt.com/]效果參考本站[url]http://n7197.66rt.com/[/url][/url]

本代碼的效果是在頁內文字廣告位的位置隨機展示10個有圖片附件存在的主題(每次展示的主題會有少許的變化,每次主題展示的順序也是隨機的)

首先進入後台設置——工具——數據調用——添加——主題列表

所在版塊:全部的開放版塊

主題列表頁面(forumdisplay.php)專用: 否

起始數據行數: 0

顯示資料條數:14

標題最大字節數: 0

標題最大字節數包含版塊名稱: 否

顯示主題分類前綴: 否

顯示分類信息前綴: 否

顯示主題的高亮特性: 是

推薦主題過濾: 否

鏈接打開位置: 在新窗口打開

主題排序方式:720小時內流覽次序倒序排序
(設置為720小時,你必須保證你選擇的版塊內720小時內有14個帖子被人流覽過,否則就沒效果了,當然我有理由相信你的論壇不會連這點訪問量都沒有,如果你論壇訪問量比這要求還少的,請不要放置我的代碼)

強制字符轉換: 無[code]<style type="text/css">
.main {
width: 100% !important;
margin-left: -0px !important;
}
.content {
margin-left: 0px !important
}
#sidebar,#sidebar_img,.shadowline {
display: none !important;
}
#ad_text div{
margin:0px auto 0; margin-left:5px;
}
.mn {
overflow:hidden;
}
.tl .bm_c {
padding: 0;
}
.guessulike_bm .bm_c,.guessulike_bml .bm_c {
overflow: hidden;
padding-bottom: 0;
zoom: 1;
}
.guessulike_bml .bm_h {
padding-top: 8px;
height: auto;
line-height: 1.8;
white-space: normal;
}
.guessulike_kw {
}
.guessulike_kw span {
display: inline-block;
margin: 0 5px -5px 0;
padding-left: 5px;
height: 19px;
line-height: 19px;
background: #F7F6ED url() no-repeat 0 0;
overflow: hidden;
}
.guessulike_kw em {
display: inline-block;
vertical-align: top;
}
.guessulike_kw .x {
display: inline-block;
margin-left: 5px;
width: 15px;
height: 19px;
background: url() no-repeat 100% -19px;
text-indent: -9999px;
overflow: hidden;
}
.guessulike_kw .x: hover {
background-position: 100% -38px;
}
.guessulike_bml .guessulike_threadlist {
margin-top: 6px;
padding-top: 10px;
border-top: 1px dotted #DDD;
}
.tl .avt {
vertical-align: top;
padding: 10px 0;
width: 80px;
}
.tl .avt img {
margin-left: 15px;
}
.guessulike_threadlist .avt {
float: left;
}
.guessulike_threadlist .avt img {
padding: 1px;
width: 36px;
height: 36px;
}
.guessulike_threadlist {
overflow: hidden;
margin-bottom: -11px;
}
.ie6 .guessulike_threadlist,.ie7 .guessulike_threadlist {
margin-bottom: -2px;
}
.guessulike_threadlist li {
float: left;
margin-bottom: 10px;
padding-bottom: 6px;
width: 49.9%;
height: 44px;
border-bottom: 1px dotted #DDD;
}
.guessulike_threadlist p {
overflow: hidden;
margin-left: 50px;
padding-right: 10px;
height: 22px;
}
.xs2{
font-size:14px !important;
}
.xg1,.xg1 a{
color:#999 !important;
}
</style>
<div id="cai" style="display:none" align="left">
<table align="center" class="wrap ad_text">
<tr>
<td>
<div class="mn" align="left">
<div class="bm guessulike_bm" align="left">
<div class="bm_h" align="left">
<h2>
<script type="text/javascript">
if (discuz_uid == 0)
{
document.write("您好")
}
else
{
document.write($("umenu").getElementsByTagName("a")[0].innerHTML)
}
</script>, 歡迎光臨</h2>
</div>
<div class="bm_c">
<ul class="guessulike_threadlist cl">
<script type=text/javascript>
var keystr="[node]<div class=\"avt\"><a href=\"{link}\" target=\"_blank\" c=\"1\"><img src=\"{imgattach}\" onerror=\"this.onerror=null;this.src='http://n7197.66rt.com/attachments/day_120626/1206261026c36489cb669c4348.gif'\" width=\"48\" height=\"48\" /></a></div><p class=\"xs2\"><a href=\"{link}\" target=\"_blank\">{subject_nolink}</a></p><p class=\"xg1\">{author} {dateline} 發表在 {forum}</p>||###<div class=\"avt\"><a href=\"{link}\" target=\"_blank\" c=\"1\"><img src=\"{imgattach}\" onerror=\"this.onerror=null;this.src='http://n7197.66rt.com/attachments/day_120626/1206261026c36489cb669c4348.gif'\" width=\"48\" height=\"48\" /></a></div><p class=\"xs2\"><a href=\"{link}\" target=\"_blank\">{subject_nolink}</a></p><p class=\"xg1\">{author} {dateline} 發表在 {forum}</p>||[/node]";
keystr=keystr.split("###");
var keyout = new Array();
for(var c=0; c<keystr.length; c++){
keyout.push(keystr[c].split('||')[0]);
}
var arr = new Array();
while(arr.length < 10)
{
var j = Math.round(Math.random()*(keystr.length-1));
if(!in_array(keyout[j],arr))
{
arr.push(keyout[j]);
}
}
function in_array(needle, haystack) {
if(typeof(needle) == 'string' || typeof(needle) == 'number') {
for(var c in haystack) {
if(haystack[c] == needle) {
return true;
}
}
}
return false;
}

for(var c=0;c<10;c++){
document.write("<li align=\"left\">"+arr[c]+"</li>");
}
</script>
</ul>
</div>
</div>
</div>
</td>
</tr>
</table>
</div>
<script>
if (document.getElementById("ad_text") != null)
{
document.getElementById("ad_text").innerHTML += $("cai").innerHTML;
}
</script>[/code]

superman1024 發表於 2013-8-2 23:48

謝謝樓主的熱心分享

☆~鼻ˇˇ野/ 發表於 2013-8-5 00:30

很好滴資源代碼.....贊一個{:9_364:}

4rphotoclub 發表於 2013-8-18 12:19

果然係十分好的代碼啊

佛缘 發表於 2013-8-22 01:04

果然係十分好的代碼啊吧谢谢楼主

ktp24426 發表於 2013-10-13 12:54

謝謝樓主

那个b 發表於 2014-9-6 15:04

看看 谢谢分享

j0990 發表於 2014-12-30 17:12

代码放哪??????

登陆者 發表於 2020-7-4 20:24

谢谢楼主

5ii 發表於 2020-10-23 19:18

谢谢楼主

頁: [1]

Powered by Discuz! Archiver 7.2  © 2001-2009 Comsenz Inc.