/[LeafOK_CVS]/fenglin/bbs/post_service.php
ViewVC logotype

Diff of /fenglin/bbs/post_service.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.1 by sysadm, Fri Apr 4 03:35:16 2025 UTC Revision 1.4 by sysadm, Sat Apr 5 15:19:16 2025 UTC
# Line 6  Line 6 
6          require_once "../lib/lml.inc.php";          require_once "../lib/lml.inc.php";
7          require_once "./check_sub.inc.php";          require_once "./check_sub.inc.php";
8          require_once "../lib/str_process.inc.php";          require_once "../lib/str_process.inc.php";
9  ?>  
 <?  
10          force_login();          force_login();
11    
12          $id = (isset($_POST["id"]) ? intval($_POST["id"]) : 0);          $id = (isset($_POST["id"]) ? intval($_POST["id"]) : 0);
# Line 363  Line 362 
362                  }                  }
363          }          }
364    
365          //Process upload attachment          // Get upload quota and used space
366          $atta_id_list = "-1";          $atta_id_list = "-1";
367          $attachment_count = (isset($_FILES['attachment']['error']) ? count($_FILES['attachment']['error']) : 0);          $attachment_count = (isset($_FILES['attachment']['error']) ? count($_FILES['attachment']['error']) : 0);
368            if ($attachment_count > $BBS_upload_count_limit)
         if ($attachment_count >= $BBS_upload_count_limit)  
369          {          {
370                  $result_set["return"]["code"] = -1;                  $result_set["return"]["code"] = -1;
371                  array_push($result_set["return"]["errorFields"], array(                  array_push($result_set["return"]["errorFields"], array(
# Line 624  Line 622 
622                          while ($row = mysqli_fetch_array($rs))                          while ($row = mysqli_fetch_array($rs))
623                          {                          {
624                                  //Send notification message                                  //Send notification message
   
625                                  $msg_content = "[hide]SYS_Reply_Article[/hide]有人回复了您所发表/回复的主题文章,快来".                                  $msg_content = "[hide]SYS_Reply_Article[/hide]有人回复了您所发表/回复的主题文章,快来".
626                                          "[article " . $tid . "#" . $aid . "]看看[/article]《" . $r_title . "》吧!\n";                                          "[article $aid]看看[/article]《" . $r_title . "》吧!\n";
627    
628                                  $sql = "INSERT INTO bbs_msg(fromUID, toUID, content, send_dt, send_ip)                                  $sql = "INSERT INTO bbs_msg(fromUID, toUID, content, send_dt, send_ip)
629                                                  VALUES($BBS_sys_uid, " . $row["UID"] . ", '" .                                                  VALUES($BBS_sys_uid, " . $row["UID"] . ", '" .
# Line 646  Line 643 
643    
644                          mysqli_free_result($rs);                          mysqli_free_result($rs);
645                  }                  }
646                  else                  else // Post new article
647                  {                  {
648                          $tid = $aid;                          $tid = $aid;
649                  }                  }
# Line 683  Line 680 
680                  }                  }
681          }          }
682    
683            // Link content to article
684          $sql = "UPDATE bbs_content SET AID = $aid WHERE CID = $cid";          $sql = "UPDATE bbs_content SET AID = $aid WHERE CID = $cid";
685    
686          $rs = mysqli_query($db_conn, $sql);          $rs = mysqli_query($db_conn, $sql);
# Line 695  Line 693 
693                  exit(json_encode($result_set));                  exit(json_encode($result_set));
694          }          }
695    
696            // Link attachments to article
697          $sql = "UPDATE upload_file SET ref_AID = $aid WHERE AID IN ($atta_id_list)";          $sql = "UPDATE upload_file SET ref_AID = $aid WHERE AID IN ($atta_id_list)";
698    
699          $rs = mysqli_query($db_conn, $sql);          $rs = mysqli_query($db_conn, $sql);
# Line 707  Line 706 
706                  exit(json_encode($result_set));                  exit(json_encode($result_set));
707          }          }
708    
709          //Add log          // Add log
710          $rs = article_op_log($aid, $_SESSION["BBS_uid"], ($id == 0 ? "A" : "M"), client_addr(), $db_conn);          $rs = article_op_log($aid, $_SESSION["BBS_uid"], ($id == 0 ? "A" : "M"), client_addr(), $db_conn);
711          if ($rs == false)          if ($rs == false)
712          {          {


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1