PHP头条
热点:

一个模仿oso的php论坛程序源码(之三)_php实例


程序三: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);  
}  
?>  

当前位置:主页——论坛——论坛内容

 

主题:

加新贴字

'; ?>

主题列表

共有帖子 个,已阅读
'; print ' '; print '

'; print '

'; print ' '; print '

作者:'.$row["replyman"].'

'; print ' '; print ' '; print ' 发表于:'.$row["replytime"].''; print ' '; print ' E_mail:'.$row["replyemail"].''; print ' '; print ''.$row["replyhttp"].' '; print ' '; print ' '; print ' '; print '

'.$row["content"].'

'; print ' '; print ' '; print ''; } else { $li_tempr = 0; print ''; print ' '; print ' '; print ' '; print ' '; print ' '; print ' '; print ' '; print ' '; print ' '; print ' '; print '

'; print '

'; print '

作者:'.$row["replyman"].'

'; print '
'; print ' 发表于:'.$row["replytime"].' '; print 'E_mail:'.$row["replyemail"].''; print ''.$row["replyhttp"].'
'; print '

'.$row["content"].'

'; print '
'; } } ?>

----------
https://www.php1.cn/

www.phpzy.comtrue/php/42704.htmlTechArticle一个模仿oso的php论坛程序源码(之三)_php实例 程序三:readforum.php 论坛信息 0) { $theme_id = $readflag; } if (empty($theme_id)) { $theme_id = 0; } //echo $username; //echo $useremail; //echo $userhttp; //echo $forum...

相关文章

PHP之友评论

今天推荐