论坛风格切换切换到宽版
  • 4415阅读
  • 11回复

[求助]首页五格每个格的大小怎么调,代码如下 [复制链接]

上一主题 下一主题
 

发帖
3149
金钱
738
威望
3015
只看楼主 倒序阅读 使用道具 楼主  发表于: 2008-06-10
演示地址www.bo-ran.com


<!--<?php
//首页调用开始
//默认只显示开放、正规板块,不显示隐藏、投票、认证板块

//幻灯图开始
$cachepics=R_P."data/bbscache/index_toppics.php";//幻灯图片缓存文件
$cachepicstime=3;//幻灯图片缓存自动更新时间,单位秒
//下一句设置要显示的板块类型,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) {//只调用5个主题的图片
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=10;//会员在线时间排行显示个数
$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);
//会员排行+主题排行结束

//首页调用结束
[ 此贴被博然不是疯子在2008-06-12 01:29重新编辑 ]
不要轻言放弃,否则对不起自己~~ 博然影视站http://www.bo-ran.com


发帖
3149
金钱
738
威望
3015
只看该作者 沙发  发表于: 2008-06-10
     
不要轻言放弃,否则对不起自己~~ 博然影视站http://www.bo-ran.com


发帖
3149
金钱
738
威望
3015
只看该作者 板凳  发表于: 2008-06-11
有没有人知道起码进来告诉一声呀


成空帖了
不要轻言放弃,否则对不起自己~~ 博然影视站http://www.bo-ran.com

离线xiaoj8mao

发帖
12976
金钱
1106
威望
2047
只看该作者 3楼 发表于: 2008-06-11
没演示吗?
离线hxpxxx.com
发帖
30
金钱
198
威望
0
只看该作者 4楼 发表于: 2008-06-11
你写的真的太好了,不错。很厉害
我要是有你一半的技术可以了!!!!!!!!!!!


长沙电工培训 欢迎您的报名
[2008-6-1 17:22:54]
湖南手机维修学校 请选湖湘人自己的品牌学校[2008-6-1 15:03:46]
湖南电脑维修学校 首选湖湘人自己的品牌学校[2008-6-1 14:59:16]
湖南家电维修学校 要选就选湖湘人自己的学校[2008-6-1 14:49:39]

发帖
3149
金钱
738
威望
3015
只看该作者 5楼 发表于: 2008-06-12
引用第3楼xiaoj8mao于2008-06-11 15:57发表的  :
没演示吗?



www.bo-ran.com
不要轻言放弃,否则对不起自己~~ 博然影视站http://www.bo-ran.com

离线fxplxw
发帖
144
金钱
191
威望
2
只看该作者 6楼 发表于: 2008-06-12
要调整的不在这里,在下面代码里
离线dlxu
发帖
9
金钱
175
威望
0
只看该作者 7楼 发表于: 2008-06-12
在你index.htm那个文件的下面width="24%是设置的

发帖
3149
金钱
738
威望
3015
只看该作者 8楼 发表于: 2008-06-13
引用第7楼dlxu于2008-06-12 17:20发表的  :
在你index.htm那个文件的下面width="24%是设置的

谢谢了~~~
不要轻言放弃,否则对不起自己~~ 博然影视站http://www.bo-ran.com

发帖
30
金钱
175
威望
0
只看该作者 9楼 发表于: 2008-06-13
  有点看不懂
离线mapley

发帖
20457
金钱
408
威望
5912
只看该作者 10楼 发表于: 2008-06-13
帮顶下
在线len4090

发帖
52060
金钱
43710
威望
833426
只看该作者 11楼 发表于: 2008-06-13
在还有段代码上  有%几的
快速回复
限80 字节
温馨提示:欢迎交流讨论,请勿纯表情、纯引用!
 
上一个 下一个