len4090
百度=白度=摆度=竞价=黑幕
级别: PHPWind 7 测试组
模范会员奖
楼主  发表于: 2008-06-15 12:46

 首页幻灯图5格美化FOR pw6.3正式版 (支持gif,jpg,png,公告。广告。标签完美显示)

图片:
pw6.3演示地址:http://www.pw63.cn
以前5.3的演示地址:http://www.78st.cn/bbs
加强版更新说明:整加了版块屏蔽功能,让某些版块不调用!
修改方法很简单:
在你修改好的代码里,查找
Copy code
$showforum="(pf.f_type = 'forum' or pf.f_type = 'former')";

有2个,分别是图片和文章列表的!再这代码下面加上:
Copy code
$showfid="(pf.fid!=13 and pf.fid!=14 and pf.fid!=49)";

我这里是个列子,比如我不然它调用fid为 13 14 和 49的版块!你可以根据自己需要按格式增加或删除,如只屏蔽fid为13的版块代码为$showfid="(pf.fid!=13)";

最后查找:

Copy code
and ".$showforum."

再其后面加上
Copy code
and ".$showfid."


比如我这个完整句子的红色部分:
$query = $db->query("SELECT pt.tid,pt.author,pt.subject,pt.postdate,pt.hits FROM pw63_threads pt LEFT JOIN pw63_forums pf USING(fid) where pt.ifcheck='1' and ".$showforum." and ".$showfid." and pf.password = '' order by pt.postdate desc limit 0,$listnum");

好了!完工!最后说明下!安装出错!请下再附件里修改好的文件,参照贴里的步骤,代码用附件里的!因为pw会把完整的代码替换或转成ubb的!所以安装有可能出错! 




哈哈!不喜欢pw6.3自带的哪个首页调用!还是喜欢自己5.3的!就升级下!这次能支持GIF和PNG图片了!
打开你的风格模板的index.htm文件(默认:论坛根目录\template\wind\index.htm)
在第一行找到
Copy code
<!--<?php print <<<EOT
-->

替换成:
Copy code
<!--<?php
//首页调用开始
//默认只显示开放、正规板块,不显示隐藏、投票、认证板块//幻灯图开始
$cachepics=R_P."data/bbscache/index_toppics.php";//幻灯图片缓存文件
$cachepicstime=60;//幻灯图片缓存自动更新时间,单位秒
//下一句设置要显示的板块类型,forum开放板块,former正规板块,hidden隐藏板块
$showforum="(pf.f_type = 'forum' or pf.f_type = 'former')";
if (($timestamp-@filemtime($cachepics)>=$cachepicstime)){
$query=$db->query("SELECT pt.tid,pt.fid,pt.subject,pa.attachurl FROM pw_threads pt
,pw_attachs pa,pw_forums pf where pt.tid = pa.tid and pt.fid = pf.fid and pa.type='img' and pt.ifcheck='1' and ".$showforum." and pf.password = ''
ORDER BY pt.postdate DESC
LIMIT 60
"); //可以根据需要调整,我这里是估算每个主题有10张图片的情况下。 $imgcontent="<?php\n";
$pics=$links=$texts="";
$rs_i=0;
while ($imginfo = $db->fetch_array($query) and $rs_i<6) {//只调用6个主题的图片
if(($rs_tid!=$imginfo[tid])&&(eregi("\.(jpg|gif|png)$",$imginfo[attachurl]))){
$pics.=$db_bbsurl."/".$attachpath."/".$imginfo[attachurl]."|";
$links.=$db_bbsurl."/read.php?tid=".$imginfo[tid]."|";
$texts.=$imginfo[subject]."|";
$rs_i++;//同一主题的只要最后上传的那张图片
}
$rs_tid=$imginfo[tid];
} $pics=substr($pics,0,-1);
$links=substr($links,0,-1);
$texts=substr($texts,0,-1); $pics='$pics="'.$pics.'";';
$links='$links="'.$links.'";';
$texts='$texts="'.$texts.'";'; $imgcontent = $imgcontent.$pics."\n".$links."\n".$texts."\n?>";
writeover($cachepics,$imgcontent);
}
@require_once($cachepics);
//幻灯图结束
//会员排行+主题排行开始
$cachelist=R_P."data/bbscache/index_toplist.php";//主题排行缓存文件
$cachelisttime=30;//主题排行自动更新时间,单位秒
//下一句设置要显示的板块类型,forum开放板块,former正规板块,hidden隐藏板块
$showforum="(pf.f_type = 'forum' or pf.f_type = 'former')";
if(($timestamp-@filemtime($cachelist)>=$cachelisttime)){
$listnum=10;//主题显示个数
$listlength=26;//主题标题长度
$listnum1=6;//会员在线时间排行显示个数
$memberonline=$memberposttoday=$newthreads=$digestthreads=$replythreads="";//会员在线时间排行开始
$query = $db->query("SELECT m.uid,m.username,md.onlinetime FROM pw_members m LEFT JOIN pw_memberdata md USING(uid) WHERE md.onlinetime order by md.onlinetime desc limit 0,$listnum1");
$c_i=1;//初始化图片序号
while($members=$db->fetch_array($query)){
$members[onlinetime]=(int)($members[onlinetime]/3600);
$i=0;
while((5*$i*$i+15*$i)<=$members[onlinetime]){
$i++;
$C=5*$i*$i+15*$i;
$N=$i;
}
$more=$C-$members[onlinetime];
$lv=$N;
if($lv > 48) $lv = 48;
$memberonline.="<img src='$imgpath/top/c_".$c_i.".gif' align='absmiddle' width='11' height='11'> <a href='profile.php?action=show&uid=$members[uid]' title='在线等级:{$lv} 级\n在线时长:{$members[onlinetime]} 小时\n升级剩余时间:{$more} 小时'>$members[username]</a> <img src='$imgpath/top/{$lv}.gif'><br />";
$c_i++;
}
unset($members);
unset($c_i);
//会员在线时间排行结束//会员当日发帖排行开始
$query=$db->query("SELECT m.uid,m.username,md.todaypost FROM pw_members m LEFT JOIN pw_memberdata md USING(uid) WHERE md.lastpost>'$tdtime' ORDER BY md.todaypost DESC limit 0,$listnum");
$c_i=1;//初始化图片序号
while($members=$db->fetch_array($query)){
$memberposttoday.="<img src='$imgpath/top/c_".$c_i.".gif' align='absmiddle' width='11' height='11'> <a href='profile.php?action=show&uid=$members[uid]'>$members[username]</a> $members[todaypost]<br />";
$c_i++;
}
unset($members);
unset($c_i);
//会员当日发帖排行结束//最新发表主题开始
$query = $db->query("SELECT pt.tid,pt.author,pt.subject,pt.postdate,pt.hits FROM pw_threads pt LEFT JOIN pw_forums pf USING(fid) where pt.ifcheck='1' and ".$showforum." and pf.password = '' order by pt.postdate desc limit 0,$listnum");
$c_i=1;//初始化图片序号
while($threads=$db->fetch_array($query)){
$threads[postdate]=date("Y-m-j g:i",$threads[postdate]);
$subject=substrs($threads[subject],$listlength);
$newthreads.="<img src='$imgpath/top/c_".$c_i.".gif' align='absmiddle' width='11' height='11'> <a href='read.php?tid=$threads[tid]' title='主题:$threads[subject]\n作者:$threads[author]\n时间:$threads[postdate]\n浏览:$threads[hits] 次'>$subject</a><br />";
$c_i++;
}
unset($threads);
unset($c_i);
//最新发表主题结束//社区精华主题开始
$query = $db->query("SELECT pt.tid,pt.author,pt.subject,pt.postdate,pt.lastpost,pt.lastposter,pt.hits,pt.replies FROM pw_threads pt LEFT JOIN pw_forums pf USING(fid) where pt.ifcheck='1' and pt.digest > 0 and ".$showforum." and pf.password = '' order by pt.postdate desc limit 0,$listnum");
$c_i=1;//初始化图片序号
while($threads=$db->fetch_array($query)){
$threads[postdate]=date("Y-m-j g:i",$threads[postdate]);
$threads[lastpost]=date("Y-m-j g:i",$threads[lastpost]);
$subject=substrs($threads[subject],$listlength);
$digestthreads.="<img src='$imgpath/top/c_".$c_i.".gif' align='absmiddle' width='11' height='11'> <a href='read.php?tid=$threads[tid]' title='主题标题:$threads[subject]\n主题作者:$threads[author]\n发表时间:$threads[postdate]\n浏览次数:$threads[hits] 次\n最新回复:$threads[lastposter]\n回复时间:$threads[lastpost]\n回复次数:$threads[replies] 次'>$subject</a><br />";
$c_i++;
}
unset($threads);
unset($c_i);
//社区精华主题结束//最新回复主题开始
$query = $db->query("SELECT pt.tid,pt.author,pt.subject,pt.postdate,pt.lastpost,pt.lastposter,pt.hits,pt.replies FROM pw_threads pt LEFT JOIN pw_forums pf USING(fid) where pt.ifcheck = '1' and pt.replies > 0 and ".$showforum." and pf.password = '' order by lastpost desc limit 0,$listnum");
$c_i=1;//初始化图片序号
while($threads=$db->fetch_array($query)){
$threads[postdate]=date("Y-m-j g:i",$threads[postdate]);
$threads[lastpost]=date("Y-m-j g:i",$threads[lastpost]);
$subject=substrs($threads[subject],$listlength);
$replythreads.="<img src='$imgpath/top/c_".$c_i.".gif' align='absmiddle' width='11' height='11'> <a href='read.php?tid=$threads[tid]' title='主题标题:$threads[subject]\n主题作者:$threads[author]\n发表时间:$threads[postdate]\n浏览次数:$threads[hits] 次\n最新回复:$threads[lastposter]\n回复时间:$threads[lastpost]\n回复次数:$threads[replies] 次'>$subject</a><br />";
$c_i++;
}
unset($threads);
unset($c_i);
//最新回复主题结束@writeover($cachelist,"<?php\n\$memberonline=\"$memberonline\";\n\$memberposttoday=\"$memberposttoday\";\n\$newthreads=\"$newthreads\";\n\$digestthreads=\"$digestthreads\";\n\$replythreads=\"$replythreads\";\n?>");
}
@require_once($cachelist);
//会员排行+主题排行结束//首页调用结束print <<<EOT
-->





继续查找:
Copy code
<div id="topList_1" class="t" style="display:none"></div>

在[b]上面添加:
Copy code
<!-- 主题排行开始 -->
<div class="t">
<table cellspacing="0" cellpadding="0" width="100%">
<tr class="tr3 tac">
<td width="18%"><span class="b" style="color:#FF6699">社区最新图片</span></td>
<td width="22%"><span class="b" style="color:#669900">最新发表主题</span></td>
<td width="23%"><span class="b" style="color:#0066FF">最新回复主题</span></td>
<td width="23%"><span class="b" style="color:#FF3300">社区精华主题</span></td>
<td width="18%"><span class="b" style="color:#FF9933">今日发帖排行</span></td>
</tr>
<tr class="tr3">
<td align="center">
<script type="text/javascript">
<!--
var focus_width=170 //flash的宽度,可以根据需要调整
var focus_height=140 //flash的高度,可以根据需要调整
var text_height=30//flash文本的高度,可以根据需要调整
var swf_height = focus_height+text_height
var swf_height = focus_height+text_height

var pics="$pics"
var links="$links"
var texts="$texts"

document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="[url]http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6[/url],0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">');
document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="pixviewer.swf"><param name="quality" value="high"><param name="bgcolor" value="#F4FBFF">');
document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">');
document.write('<embed src="pixviewer.swf" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" bgcolor="#ffffff" quality="high" width="'+ focus_width +'" height="'+ swf_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="[url]http://www.macromedia.com/go/getflashplayer"[/url] />');
document.write('</object>');

//-->
</script>
</td>
<td class="f_two" style="vertical-align:top;">$newthreads</td>
<td style="vertical-align:top;">$replythreads</td>
<td class="f_two" style="vertical-align:top;">$digestthreads</td>
<td style="vertical-align:top;">$memberposttoday</td>
</tr>
</table>
</div>
<!-- 主题排行结束 -->



附件!把pixviewer.swf放你的论坛跟目录下,top文件夹放你的images下!index.htm为修改好的我文件,你没修改你的index.htm的话 可以直接覆盖!
附件: pixviewer.rar (10 K) 下载次数:1042
附件: top.rar (2 K) 下载次数:929
附件: index(修改好的文件).rar (9 K) 下载次数:1083
本帖最近评分记录:
  • 威望:+1(@望穿秋水@) 美图论坛
  • 威望:+3(cosh) 谢谢您为论坛所做的贡献
  • 威望:+2(一只船的港)
  • gjjx
    努力学习
    级别: 四星会员
    1楼  发表于: 2008-06-15 12:47
    支持下。。
    len4090
    百度=白度=摆度=竞价=黑幕
    级别: PHPWind 7 测试组
    模范会员奖
    2楼  发表于: 2008-06-15 12:47
      附上修改好的文件


    位置可以任意调节!公告下方 等等!需要的你不会调节就 直接联系我!
    附件: index(修改好的文件).rar (9 K) 下载次数:185
    青蛙表哥
    级别: 二星会员
    3楼  发表于: 2008-06-15 12:58
    谢谢,正需要呢,,,,,我需要的是只显示哪一个版块的图片,现在这样刚刚好用上,,只要把!=改成=号就可以了,非常感谢哦
    韩剧|日剧|港台剧|下载----新开饰品新店http://shop35490280.taobao.com/ 大量饰品出售
    sunan
    我们一起,一睡不醒。
    级别: 论坛版主
    热心助人奖 优秀版主奖 插件大师奖
    4楼  发表于: 2008-06-15 13:28
    谢谢分享。
    【广告招租PM】 【×××】 呵呵,我们現在终于甚麼都不是了。
    lostindream
    虚无
    级别: 六星会员
    5楼  发表于: 2008-06-15 13:32
    谢谢分享。
    xyhxxxkoko
    级别: 初来乍到
    6楼  发表于: 2008-06-15 21:09
    顶下
    honglake
    济溪-绿之梦
    级别: 四星会员
    7楼  发表于: 2008-06-15 22:50
    老大 那10个主题下面怎么空了一行哦 能消除么
    honglake
    济溪-绿之梦
    级别: 四星会员
    8楼  发表于: 2008-06-15 22:51
    另外 我上传了那个文件 可是图片还是无法显示
    len4090
    百度=白度=摆度=竞价=黑幕
    级别: PHPWind 7 测试组
    模范会员奖
    9楼  发表于: 2008-06-15 23:04
    Quote:
    引用第7楼honglake于2008-06-15 22:50发表的 :
    老大 那10个主题下面怎么空了一行哦 能消除么

    var text_height=30//flash文本的高度,可以根据需要调整

    把这个30改成15或者更新就可以解决!但最好不要少于10!
    shzmgj
    我累了 我想休息了
    级别: 五星会员
    10楼  发表于: 2008-06-15 23:27
    kao。本地测试不调用
    石河子大学论坛欢迎您!--http://www.shzdx.cn
    zjy168
    级别: 二星会员
    11楼  发表于: 2008-06-15 23:37
    谢谢楼主了,用了,很好。
    honglake
    济溪-绿之梦
    级别: 四星会员
    12楼  发表于: 2008-06-16 00:38
    Quote:
    引用第9楼len4090于2008-06-15 23:04发表的  :

    var text_height=30//flash文本的高度,可以根据需要调整

    把这个30改成15或者更新就可以解决!但最好不要少于10!

    多谢楼主大人了
    cosh
    只懂借鉴,不懂技术
    级别: 四星会员