viewnew.php
<?
/************************************************************************/
/* Wanderer Board : */
/* =========================== */
/* Version: .2.0 Beta II */
/* */
/* ----------PHPの酷 版权所有------------ */
/* -----http://phpiscool.yeah.net-------- */
/************************************************************************/ // 看起来大家都很想在首页上显示最新文章,我就把自己的程序抓出来放在论坛程序包里 :)
// 请注意设置 $wdbpath="wdb/"; // WDB安装的绝对路径
$forumnum=1; // 需要显示的版块ID,也就是你看 wdblist?forumid=xxx , 这个xxx
是多少 list($info6)=file("forum$forumnum/last_mo.php");
list(,$num6)=explode("│",$info6);
$article=file("forum$forumnum/list.php");
$c=min(count($article),5); // 显示最近5个帖子
?>
<table border=0 cellpadding=1 cellspacing=0 width=300 align="center">
<tbody>
<tr>
<td>
<div align="center"><img src="wdb/images/system/10stars.gif"
align="middle"></div>
</td>
</tr>
<tr>
<td>
<table bgcolor=#9BAE5C border=0 cellpadding=1 cellspacing=0 width="100%">
<tbody>
<tr>
<td>
<table border=0 cellpadding=5 cellspacing=0 width="100%">
<tbody>
<tr bgcolor=#ffffff class=c>
<td>
<p align=center><font size="2"> 讨论区版有帖子<font
color=red><b>
<? echo $num6; ?>
</b></font>篇</font></p>
<font size="2">
<? for ($i=0; $i<$c; $i++){
$detail=explode("│",$article[$i]);
if ($detail[4]=="ran") //得到表情图片start
$detail[4]="wdb/images/emotion/0.gif";
else
$detail[4]="wdb/images/emotion/".$detail[4];
$lastdetail=explode(",",$detail[8]);
if ($lastdetail[0]!=$detail[0]) //得到主题
$lastdetail[0]="回 ".$detail[0];
else
$lastdetail[0]="新 ".$detail[0];
if (strlen($lastdetail[0])>=40) $lastdetail[0]=substr($lastdetail[0],0,37)."...";
echo " <img src=$detail[4] width=13 height=13> <a href=wdb/wdbread.php?
forumid=$forumnum&filename=$detail[5] target=_blank>$lastdetail[0]</a> - $lastdetail
[1]<br>";
}
?>
</font>
<p align=right><font size="2"><a href="wdb/index.php"
target="_blank">进入论坛说几句
</a></font></p>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
-------------------------------------------------------------------------------- 首页加入新贴代码如下
--------------------------------------------------------------------------------
<iframe scrolling="no" src="viewnew.php" frameborder=0 width=410 height=350>
</iframe>
<?
/************************************************************************/
/* Wanderer Board : */
/* =========================== */
/* Version: .2.0 Beta II */
/* */
/* ----------PHPの酷 版权所有------------ */
/* -----http://phpiscool.yeah.net-------- */
/************************************************************************/ // 看起来大家都很想在首页上显示最新文章,我就把自己的程序抓出来放在论坛程序包里 :)
// 请注意设置 $wdbpath="wdb/"; // WDB安装的绝对路径
$forumnum=1; // 需要显示的版块ID,也就是你看 wdblist?forumid=xxx , 这个xxx
是多少 list($info6)=file("forum$forumnum/last_mo.php");
list(,$num6)=explode("│",$info6);
$article=file("forum$forumnum/list.php");
$c=min(count($article),5); // 显示最近5个帖子
?>
<table border=0 cellpadding=1 cellspacing=0 width=300 align="center">
<tbody>
<tr>
<td>
<div align="center"><img src="wdb/images/system/10stars.gif"
align="middle"></div>
</td>
</tr>
<tr>
<td>
<table bgcolor=#9BAE5C border=0 cellpadding=1 cellspacing=0 width="100%">
<tbody>
<tr>
<td>
<table border=0 cellpadding=5 cellspacing=0 width="100%">
<tbody>
<tr bgcolor=#ffffff class=c>
<td>
<p align=center><font size="2"> 讨论区版有帖子<font
color=red><b>
<? echo $num6; ?>
</b></font>篇</font></p>
<font size="2">
<? for ($i=0; $i<$c; $i++){
$detail=explode("│",$article[$i]);
if ($detail[4]=="ran") //得到表情图片start
$detail[4]="wdb/images/emotion/0.gif";
else
$detail[4]="wdb/images/emotion/".$detail[4];
$lastdetail=explode(",",$detail[8]);
if ($lastdetail[0]!=$detail[0]) //得到主题
$lastdetail[0]="回 ".$detail[0];
else
$lastdetail[0]="新 ".$detail[0];
if (strlen($lastdetail[0])>=40) $lastdetail[0]=substr($lastdetail[0],0,37)."...";
echo " <img src=$detail[4] width=13 height=13> <a href=wdb/wdbread.php?
forumid=$forumnum&filename=$detail[5] target=_blank>$lastdetail[0]</a> - $lastdetail
[1]<br>";
}
?>
</font>
<p align=right><font size="2"><a href="wdb/index.php"
target="_blank">进入论坛说几句
</a></font></p>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
-------------------------------------------------------------------------------- 首页加入新贴代码如下
--------------------------------------------------------------------------------
<iframe scrolling="no" src="viewnew.php" frameborder=0 width=410 height=350>
</iframe>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货