模仿OSO的论坛(二)


Posted in PHP onOctober 09, 2006

read.php(用来显示相关主题内容)
<HTML><HEAD><TITLE>疑难问题</TITLE>
<LINK href="mypic/style.css" rel=STYLESHEET type=text/css></HEAD>
<BODY bgColor=#cccc99 bottomMargin=0 leftMargin=0 topMargin=0 marginwidth="0" marginheight="0">
      <TABLE border=0 cellPadding=0 cellSpacing=0 width="100%" class=body_br >
        <TBODY>
  <TR>
    <TD vAlign=top><BR>
      <TABLE align=center border=0 cellPadding=3 cellSpacing=0 width=100%>
        <TBODY>
          <TD>主 题:<FONT class=mid  
          color=#993333><B>
<?php
include "connect.inc.php";
$query = "select * from guestbook where id=".$theme_id;
$res = mysql_query($query);  
$row = mysql_fetch_array($res);  
echo $row['theme'];
?>
</B></FONT></TD></tr><tr>
          <TD align=middle vAlign=top width=100%><A  
            href="post.php"><IMG  
            border=0 src="mypic/post.gif"></A>  
            <A href="reply.php?theme_id=<?php echo $row['id'] ?>"><IMG  
            border=0  
            src="mypic/reply.gif"></A> <A  
            href="faq.php?page=1"><IMG  
            border=0  
          src="mypic/theme.gif"></A></TD></TR>
<?php
   if ($row['answer_count']>5)
    {echo "<TR> <TD>分 页:<FONT class=mid >";
    for ($j=1;$j<=($row['answer_count']-1)/5+1;$j++) {
       if ($j==$page) echo "<FONT color=#999999> [".$j."]</FONT> </A>";  
       else echo "<A href='read.php?theme_id=".$row['id']."&page=".$j."'[".$j."]</FONT> </A>";  
       }}
      echo "   共有帖子".$row['answer_count']."个</TD>";
$this_id=$row['id'];
$query = "select id from guestbook where id<".$this_id." and type=1 order by id DESC";
$res = mysql_query($query);  
$row = mysql_fetch_row($res);  
$pre_id=$row[0];
$query = "select id from guestbook where id>".$this_id." and type=1 order by id";
$res = mysql_query($query);  
$row = mysql_fetch_row($res);  
$next_id=$row[0];
?>
</TR>
</TBODY></TABLE>
      <TABLE align=center border=0 cellPadding=4 cellSpacing=2 width=100%>
        <TBODY>
        <TR>
          <TD align=middle bgColor=#6f6f6f width="20%"><FONT color=#ffffff>作  
            者</FONT></TD>
          <TD align=middle bgColor=#6f6f6f width="80%"><FONT color=#ffffff>内  
            容</FONT></TD></TR>
<?php
$query = "select * from guestbook where main_id=".$theme_id." or id=".$theme_id." order by time_open DESC limit ".strval(($page-1)*5).",5";
$res = mysql_query($query);  
function TdBackColor() {
  static $ColorStr;
  if ($ColorStr=="#ededed") {
    $ColorStr="#dedede";
  } else {
    $ColorStr="#ededed";
  }
  return($ColorStr);
}
for ($i=1;$i<=5;$i++)
{$row = @mysql_fetch_array($res);  
if(!$row) break;  
$ColorStr=TdBackColor();
echo "<TR>";
echo "<TD align=middle bgColor=".$ColorStr." vAlign=top width='20%'><FONT";  
echo "class=mid><B>";  
echo $row['name']."</B></FONT></TD>";
echo "<TD bgColor=".$ColorStr." vAlign=top width='80%'>";
echo "<TABLE border=0 cellPadding=0 cellSpacing=0 width='100%'>";
echo "<TBODY>";
echo "<TR>";
echo "<TD align=middle width=30><IMG align=ABSCENTER border=0";  
echo " src='mypic/icon".$row['icon'].".gif'></TD>";
echo "<TD><FONT color=#336699>发表于: ".$row['time_open']."</FONT></TD>";
echo "<TD align=right></TD></TR>";
echo "<TR>";
echo "<TD colSpan=3>";
echo "<HR SIZE=1>";
echo "</TD></TR></TBODY></TABLE>".$row['content']."</TD></TR>";
echo "<TR>";
}
?>      
        <TR align=right bgColor=#6f6f6f>
          <TD> </TD>
          <TD><A  
            href="read.php?theme_id=<?php echo $pre_id?>&page=1"><FONT  
            color=#ffffff>上一个主题</FONT></A>    <A  
            href="read.php?theme_id=<?php echo $next_id?>&page=1"><FONT  
            color=#ffffff>下一个主题</FONT></A> </TD></TR></TBODY></TABLE>
      <HR SIZE=1 width=100%>
<BR></TD></TR>
</TBODY></TABLE>
</FORM>
</html>

PHP 相关文章推荐
PHP Ajax实现页面无刷新发表评论
Jan 02 PHP
PHP define函数的使用说明
Aug 27 PHP
优化php效率,提高php性能的一些方法
Mar 24 PHP
php获取指定(访客)IP所有信息(地址、邮政编码、国家、经纬度等)的方法
Jul 06 PHP
php轻量级的性能分析工具xhprof的安装使用
Aug 12 PHP
thinkPHP下的widget扩展用法实例分析
Dec 26 PHP
深入讲解PHP的Yii框架中的属性(Property)
Mar 18 PHP
PHP全局变量与超级全局变量区别分析
Apr 01 PHP
PHP函数import_request_variables()用法分析
Apr 02 PHP
php自定义函数实现二维数组排序功能
Jul 20 PHP
PHP的自定义模板引擎
Mar 24 PHP
TP5框架请求响应参数实例分析
Oct 17 PHP
模仿OSO的论坛(一)
Oct 09 #PHP
几种显示数据的方法的比较
Oct 09 #PHP
用session做客户验证时的注意事项
Oct 09 #PHP
用php+mysql一个名片库程序
Oct 09 #PHP
PHP与javascript的两种交互方式
Oct 09 #PHP
用PHP和ACCESS写聊天室(六)
Oct 09 #PHP
PHP+javascript模拟Matrix画面
Oct 09 #PHP
You might like
PHP中路径问题的解决方案
2006/10/09 PHP
十天学会php之第三天
2006/10/09 PHP
PHP实现导出带样式的Excel
2016/08/28 PHP
Laravel Memcached缓存驱动的配置与应用方法分析
2016/10/08 PHP
Laravel框架Eloquent ORM修改数据操作示例
2019/12/03 PHP
javascript英文日期(有时间)选择器
2007/05/02 Javascript
简介JavaScript中substring()方法的使用
2015/06/06 Javascript
javascript数组去重的六种方法汇总
2015/08/16 Javascript
详解JavaScript的流程控制语句
2015/11/30 Javascript
基于JavaScript短信验证码如何实现
2016/01/24 Javascript
jQuery Mobile动态刷新页面样式的实现方法
2016/05/28 Javascript
使用do...while的方法输入一个月中所有的周日(实例代码)
2016/07/22 Javascript
Vue.js实现移动端短信验证码功能
2017/03/29 Javascript
详解javascript replace高级用法
2019/02/17 Javascript
Python生成随机MAC地址
2015/03/10 Python
Python 中开发pattern的string模板(template) 实例详解
2017/04/01 Python
python+django+sql学生信息管理后台开发
2018/01/11 Python
Django使用详解:ORM 的反向查找(related_name)
2018/05/30 Python
Atom的python插件和常用插件说明
2018/07/08 Python
python中join()方法介绍
2018/10/11 Python
python 获取页面表格数据存放到csv中的方法
2018/12/26 Python
python 函数中的内置函数及用法详解
2019/07/02 Python
树莓派使用python-librtmp实现rtmp推流h264的方法
2019/07/22 Python
Daniel Wellington官方海外旗舰店:丹尼尔惠灵顿DW手表
2018/02/22 全球购物
Pureology官网:为染色头发打造最好的产品
2019/09/13 全球购物
教育系毕业生中文求职信范文
2013/10/06 职场文书
小学三八妇女节活动方案
2014/03/16 职场文书
我的小天地教学反思
2014/04/30 职场文书
体操比赛口号
2014/06/10 职场文书
庆六一文艺汇演活动方案
2014/08/26 职场文书
毕业生实习期转正自我鉴定
2014/09/26 职场文书
违纪检讨书范文
2015/01/27 职场文书
个人政治思想总结
2015/03/05 职场文书
安全生产学习心得体会
2016/01/18 职场文书
幼儿园家长心得体会
2016/01/21 职场文书
zabbix如何添加监控主机和自定义监控项
2022/08/14 Servers