当前位置: 首页 > 图文教程 > 网络编程 > PHP > 我的论坛源代码(三)

PHP
php 多线程上下文中安全写文件实现代码
PHP类的使用 实例代码讲解
用php实现让页面只能被百度gogole蜘蛛访问的方法
php 学习笔记
PHP编程过程中需要了解的this,self,parent的区别
php 操作excel文件的方法小结
使用PHP获取网络文件的实现代码
PHP 巧用数组降低程序的时间复杂度
php下将XML转换为数组
php 文件上传代码(限制jpg文件)
php 无极分类(递归)实现代码
PHP 采集获取指定网址的内容
PHP 将图片按创建时间进行分类存储的实现代码
PHP 存储文本换行实现方法
PHP 批量更新网页内容实现代码
用PHP查询搜索引擎排名位置的代码
用php实现的获取网页中的图片并保存到本地的代码
php实现首页链接查询 友情链接检查的代码
处理php自动反斜杠的函数代码
php实现的遍历文件夹下所有文件,编辑删除

PHP 中的 我的论坛源代码(三)


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-10-12   浏览: 33 ::
收藏到网摘: n/a

显示主题内容页面。
<HTML>
<HEAD>
<TITLE>狐网论坛</TITLE>
<STYLE type=text/css>
P {FONT-FAMILY: normal; FONT-SIZE: 9pt; LINE-HEIGHT: 14pt}
DIV {FONT-FAMILY: normal; FONT-SIZE: 9pt; LINE-HEIGHT: 14pt}
</STYLE>
<LINK href="js/cpcw.css" rel=stylesheet /LINK>
<?php
include "linkfox.inc.php";
include "info.inc.php";
?>
</HEAD>
<body bgcolor="#FFFFFF" text="#000000" id=all>
<?
$query="select * from foxbbs where id='".$id."'"; //这个ID是从上一页面也就是FOXBBS.PHP里传过来的。
$req=mysql_query($query);
if ($req) {
$bbsmes=mysql_fetch_array($req);
$djnum=$bbsmes["djnum"]+1; //点击数加一
$query="update foxbbs set djnum='$djnum' where id='".$id."'";
$req=mysql_query($query);
}
$query="select * from useinfo where usename='".$bbsmes["usename"]."'"; //从用户信息库里取出发帖用户的信息
$req=mysql_query($query);
if ($req) {
$useinfo=mysql_fetch_array($req);
switch ($useinfo[11]) //因为我是用一位数字来表示用户身份
{
case ($useinfo[11]==1):
$useinfo[11]="会员";
break;
case ($useinfo[11]==2):
$useinfo[11]="版主";
break;
case ($useinfo[11]==3):
$useinfo[11]="管理员";
break;
case ($useinfo[11]==4):
$useinfo[11]="站长";
break;
default:
$useinfo[11]="游客";
break;
}
}
?>
<table width="100%" cellpadding="4" cellspacing="0" border="0">
<tr>
<td height="20">
<div align="right"></div>
</td>
<td height="20" width="75"> </td>
<td height="20" width="75"> </td>
<td height="20" width="75"> </td>
<td height="20" width="75"> </td>
</tr>
<tr>
<td height="20">
<div align="right"></div>
</td>
<td height="20" width="75">
<div align="center"><a href="reguse.php?action=xy"><img src="/upload/tech/20091012/20091012013241_19ca14e7ea6328a42e0eb13d585e4c22.gif" width="74" height="21" border="0"></a></div>
</td>
<td height="20" width="75">
<div align="center"><a href="useinfo.php?action=find"><img src="/upload/tech/20091012/20091012013241_b55ec28c52d5f6205684a473a2193564.gif" width="74" height="21" border="0"></a></div>
</td>
<td height="20" width="10%"><a href="useinfo.php?action=use"><img src="/upload/tech/20091012/20091012013242_298f95e1bf9136124592c8d4825a06fc.gif" width="74" height="21" border="0"></a></td>
<td height="20" width="75"><a href="foxbbs.php?d=q"><img src="/upload/tech/20091012/20091012013242_076a0c97d09cf1a0ec3e19c7f2529f2b.gif" width="74" height="21" border="0"></a></td>
</tr>
<tr>
<td height="20">
<div align="left">当前位置:<font color="#0000FF">狐网─>狐网论坛─>论题:</font></div>
</td>
<td>
<div align="center"><a href="foxbbs.php"><img src="/upload/tech/20091012/20091012013246_a760880003e7ddedfef56acb3b09697f.gif" width="70" height="20" border="0"></a></div>
</td>
<td>
<div align="center"><a href="post.php"><img src="/upload/tech/20091012/20091012013246_02e74f10e0327ad868d138f2b4fdd6f0.gif" width="70" height="20" border="0" alt="发布新帖"></a></div>
</td>
<td height="20" width="10%">
<div align="center"><? echo "<a href='repal.php?action=add&id=".$id."&zt=".$bbsmes[3]."&use=".$use."'><img src='/upload/tech/20091012/20091012013247_fc3cf452d3da8402bebb765225ce8c0e.gif' width='70' height='20' border='0' alt='回复此贴'></a>"; ?></div>
</td>
<td height="20" width="10%">
<div align="center"><a href="reguse.php?action=dl"><img src="/upload/tech/20091012/20091012013247_a2557a7b2e94197ff767970b67041697.gif" width="70" height="20" border="0"></a></div>
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr bgcolor="#000000">
<td colspan="2">
<table width="100%" border="0" cellspacing="1" cellpadding="1">
<tr bgcolor="#009999">
<td width="20%">
<div align="center"><font color="#FFFFFF">原贴作者</font></div>
</td>
<td width="80%">
<div align="center"><font color="#FFFFFF">原 贴 内 容</font></div>
</td>
</tr>
<tr bgcolor="#eeeeee" valign="top">
<td width="20%">
<div align="center"> <? //在用户信息库里没存放表情图象的路径和扩展名
echo $useinfo[2]."<br>";
echo "<img src='images/".$bbsmes[2]."'.gif><br>";
echo $useinfo[11]."<p>";
echo "发帖数 [".$useinfo["ftnum"]."]<br>";
?></div>
</td>
<td width="80%"><div align="left"> <?
$ft="foxbbs/".$bbsmes[5].".fox"; //取出存放的文件名
$message=@file($ft); //读出文件内容
for ($i=0;$i<count($message);$i++)
{ if (ord(substr($message[$i],0,1))==161) //第一位是否全角空格
echo $message[$i];
else {
$message[$i]="  ".trim($message[$i]);
echo $message[$i]; //显示主题内容
}
}
?></div></td>
</tr>
<tr bgcolor="#009999">
<td width="20%">
<div align="left"><img src="/upload/tech/20091012/20091012013248_860320be12a1c050cd7731794e231bd3.gif" width="14" height="11"><? echo $bbsmes[4]; ?></div>
</td>
<td width="80%">
<div align="left"><?
if ($useinfo[9]=="不告诉你")
echo "<img src='/upload/tech/20091012/20091012013248_b137fdd1f79d56c7edf3365fea7520f2.gif' width='43' height='17'>";
else echo "<a href='mailto:".$useinfo[8]."'><img src='/upload/tech/20091012/20091012013248_b137fdd1f79d56c7edf3365fea7520f2.gif' width='43' height='17' alt='给我发邮件' border='0'></a>";
echo "  <a href='".$useinfo[9]."' ><img src='/upload/tech/20091012/20091012013249_3a835d3215755c435ef4fe9965a3f2a0.gif' width='43' height='17' alt='我的主页' border='0'></a>";
echo "  <a href='useinfo.php?action=look'><img src='/upload/tech/20091012/20091012013249_b86e8d03fe992d1b0e19656875ee557c.gif' width='43' height='16' alt='我的详细信息' border='0'></a>";
echo "  <a href='useinfo.php?action=edit'><img src='/upload/tech/20091012/20091012013250_32bb90e8976aab5298d5da10fe66f21d.gif' width='43' height='17' alt='修改信息' border='0'></a>";
echo "  <a href='foxbbs.php?action=find&user=".$useinfo[0]."'><img src='/upload/tech/20091012/20091012013250_e0ec453e28e061cc58ac43f91dc2f3f0.gif' width='43' height='17' alt='查找该用户的所以文章' border='0'></a>";
echo "  <a href='repal.php?action=add&use=".$useinfo[13]."&id=".$id."&zt=".$bbsmes[3]."&c=dd'><img src='/upload/tech/20091012/20091012013251_30ef30b64204a3088a26bc2e6ecf7602.gif' width='43' height='17' alt='引用该用户的文章回复' border='0'></a>";
echo "  <a href='#'><img src='/upload/tech/20091012/20091012013251_c16a5320fa475530d9583c34fd356ef5.gif' border='0' alt='".$bbsmes[11]."'></a>";
?> </div>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<?
$hfft="foxbbs/".substr($bbsmes[5]).".bbs";
if (file_exists($hfft)) //是否有回复
{
$tem=@file($hfft);
$temp=implode("",$tem); //先把数组转变成字符串,不用加分融符
$tem=explode("δεζ",$temp);
$num=count($tem)-1;
for ($i=0;$i<$num;$i++)
{ $x=$i+1;
$temp=explode("ㄞㄚㄓ",$tem[$i]); //把每条回复信息分开
if ($temp[5]>0) $temp[5]="images/".$temp[5].".gif"; //显示回复内容
else $temp[5]="/upload/tech/20091012/20091012013251_84f7e69969dea92a925508f7c1f9579a.gif";
if (!$temp[6]) $temp[6]="不想告诉你";
echo "<tr><td><table width='100%' border='0' cellspacing='1' cellpadding='1'>";
echo "<tr bgcolor='#009999'><td width='20%'><div align='center'><font color='#FFFFFF'>回贴作者</font></div></td>";
echo "<td width='80%'><div align='center'><font color='#FFFFFF'>回 复 内 容 (第<font color='00ff00'>NO.".$x."</font>号)</font></div></td></tr>";
echo "<tr bgcolor='#eeeeee' valign='top'><td width='20%'><div align='center'>".$temp[1]."<br><img src='".$temp[5]."'><br>OICQ:".$temp[2]."<br>来自:".$temp[6]."<font color='#FFFFFF'></font></div></td>";
echo "<td width='80%'><div align='left'>".$temp[0]."</div></td></tr>";
echo "<tr bgcolor='#009999'><td width='20%'><div align='left'><font color='#FFFFFF'><img src='/upload/tech/20091012/20091012013248_860320be12a1c050cd7731794e231bd3.gif' width='14' height='11'>".$temp[7]."</font></div></td>";
echo "<td width='80%'><div align='left'>";
echo "<a href='mailto:".$temp[4]."'><img src='/upload/tech/20091012/20091012013248_b137fdd1f79d56c7edf3365fea7520f2.gif' width='43' height='17' alt='给我发邮件' border='0'></a>";
echo "  <a href='".$temp[3]."' ><img src='/upload/tech/20091012/20091012013249_3a835d3215755c435ef4fe9965a3f2a0.gif' width='43' height='17' alt='我的主页' border='0'></a>";
echo "  <a href='#'><img src='/upload/tech/20091012/20091012013251_c16a5320fa475530d9583c34fd356ef5.gif' border='0' alt='".$temp[8]."'></a>";
echo "</div></td></tr>";
echo "</table></td></tr>";
}
}
?>
</tr>
</table>
</body>
</html>