找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 235|回复: 0
打印 上一主题 下一主题

一个模仿oso的php论坛程序源码(之三)第1/2页

[复制链接]

2500

主题

2513

帖子

7520

积分

论坛元老

Rank: 8Rank: 8

积分
7520
跳转到指定楼层
楼主
发表于 2018-2-14 09:25:29 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

            程序三:readforum.php  
  
  
论坛信息   
  
  
  
  
  
  
  
  
  
  
  
0) {  
   $theme_id = $readflag;  
}  
if (empty($theme_id)) {  
   $theme_id = 0;  
}   
//echo $username;  
//echo $useremail;  
//echo $userhttp;  
//echo $forumtitle;  
//echo $fouumface;  
//echo $forumcontent;   
if (($readflag == 0) and ($theme_id == 0)) {   //增加数据  
    if (empty($username)) {  
       print "错误,请核对数据";  
    }  
     $res=mysql_query("SELECT max(id) + 1 AS rid FROM fr_t_forumtitle",$dbh);   
    $row=mysql_fetch_array($res);  
    if (empty($row["rid"])) {  
       $theme_id = 1;   
    } else {  
      $theme_id = $row["rid"] + 1;   
    }  
    $tempstr = " insert into fr_t_forumtitle(id,state,readcount,replycount,title,";  
    $tempstr = $tempstr."createman,replytime) ";  
    $tempstr = $tempstr." values(".$theme_id.",'0',0,-1,'".$forumtitle."','".$username."',now());";  
    $res=mysql_query($tempstr,$dbh);  
}  
if ($readflag == 0 ) {  
    $forumcontent =  nl2br($forumcontent);  
    $tempstr = " insert into fr_t_forumcontent(id,content,replyman,replyemail,";  
    $tempstr = $tempstr."replyhttp,replytime,replyface)";  
    $tempstr = $tempstr." values(".$theme_id.",'".$forumcontent."','".$username."','".  
        $useremail."','".$userhttp."',now(),".$forumface.");";  
    $res=mysql_query($tempstr,$dbh);  
    $tempstr = " update fr_t_forumtitle set readcount = readcount +1,replycount = replycount + 1,";  
    $tempstr = $tempstr."replytime = now(),replyman ='".$username."' where id=".$theme_id;   
    $res=mysql_query($tempstr,$dbh);  
} else {  
    $tempstr = " update fr_t_forumtitle set readcount = readcount +1 where id =".$theme_id;  
    $res=mysql_query($tempstr,$dbh);  
}  
?>  
  当前位置:主页——论坛——论坛内容   &nbsp [/td]
  
  
[table]  
  [tr]   
    [td]主题:  
        
    [/td]  
    [td]   
      

  
    [/td]  
    [td]   
    [url=addforum.php?theme_id='.$theme_id.']      print 'target="_top">

[/url]';  
    ?>  
    [/td]  
    [td]   
      


            1[url=]2[/url][url=]下一页[/url][url=]阅读全文[/url]
            
        
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

用户反馈
客户端