Skip to content

Commit

Permalink
マイクロ秒を秒に戻す処理を関数化。
Browse files Browse the repository at this point in the history
  • Loading branch information
satopian committed Nov 18, 2023
1 parent 65e0cc7 commit c4ce328
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions potiboard5/potiboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

// POTI-board EVO
// バージョン :
const POTI_VER = 'v6.15.5';
const POTI_VER = 'v6.15.6';
const POTI_LOT = 'lot.20231118';

/*
Expand Down Expand Up @@ -1106,8 +1106,7 @@ function regist(){
}
if($pchk){
//KASIRAが入らない10桁のUNIX timeを取り出す
$ltime= $logver==="6" ? substr($ltime,0,-3) :
(strlen($ltime)>12 ? substr($ltime,-13,-3) : $ltime);
$ltime=microtime2time($ltime,$logver);
$interval=time()-(int)$ltime;
if(RENZOKU && ($interval>=0) && ($interval < RENZOKU)){error(MSG020,$dest);}
if(RENZOKU2 && ($interval>=0) && ($interval < RENZOKU2) && $dest){error(MSG021,$dest);}
Expand Down Expand Up @@ -3327,14 +3326,20 @@ function getId ($userip) {
}

// 古いスレッドへの投稿を許可するかどうか
function check_elapsed_days ($time,$logver=false) {
function check_elapsed_days ($microtime,$logver=false) {

$time = ($logver==="6") ? (int)substr($time,0,-3) : (int)substr($time, -13, -3);
$time = microtime2time($microtime,$logver);

return ELAPSED_DAYS //古いスレッドのフォームを閉じる日数が設定されていたら
? ((time() - $time)) <= ((int)ELAPSED_DAYS * 86400) // 指定日数以内なら許可
: true; // フォームを閉じる日数が未設定なら許可
}
//マイクロ秒を秒に戻す
function microtime2time($microtime,$logver){

return $logver==="6" ? (int)substr($microtime,0,-3) :
(int)(strlen($microtime)>12 ? substr($microtime,-13,-3) : (int)$microtime);
}

//逆変換テーブル作成
function get_lineindex ($line){
Expand Down

0 comments on commit c4ce328

Please sign in to comment.