Skip to content

Commit

Permalink
v0.99.13
Browse files Browse the repository at this point in the history
  • Loading branch information
sakots committed Aug 30, 2021
1 parent 1813b53 commit 17967a8
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 9 deletions.
3 changes: 3 additions & 0 deletions rois/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,9 @@
//クッキー保存日数
define('SAVE_COOKIE', '7');

//日付フォーマット
define('DATE_FORMAT', 'Y/m/d H:i:s');

//強制sageレス数( 0 ですべてsage)
define('MAX_RES', '20');

Expand Down
28 changes: 22 additions & 6 deletions rois/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
//--------------------------------------------------

//スクリプトのバージョン
define('ROIS_VER','v0.99.12'); //lot.210830.0
define('ROIS_VER','v0.99.13'); //lot.210830.1

//設定の読み込み
require(__DIR__.'/config.php');
Expand Down Expand Up @@ -104,6 +104,9 @@
//テーマがXHTMLか設定されてないなら
defined('TH_XHTML') or define('TH_XHTML', 0);

//日付フォーマット
defined('DATE_FORMAT') or define('DATE_FORMAT', 'Y/m/d H:i:s');

//初期設定(初期設定後は不要なので削除可)
init();

Expand Down Expand Up @@ -719,6 +722,9 @@ function def() {
}
//引用の色
$res['com'] = quote($res['com']);
//日付をUNIX時間に変換して設定どおりにフォーマット
$res['created'] = date(DATE_FORMAT, strtotime($res['created']));
$res['modified'] = date(DATE_FORMAT, strtotime($res['modified']));
$ko[] = $res;
$j++;
}
Expand All @@ -737,6 +743,9 @@ function def() {
}
//引用の色
$bbsline['com'] = quote($bbsline['com']);
//日付をUNIX時間に
$bbsline['created'] = date(DATE_FORMAT, strtotime($bbsline['created']));
$bbsline['modified'] = date(DATE_FORMAT, strtotime($bbsline['modified']));
$oya[] = $bbsline;
$i++;
}
Expand Down Expand Up @@ -976,6 +985,9 @@ function res(){
}
//引用の色
$res['com'] = quote($res['com']);
//日付をUNIX時間に
$res['created'] = date(DATE_FORMAT, strtotime($res['created']));
$res['modified'] = date(DATE_FORMAT, strtotime($res['modified']));
$ko[] = $res;
//投稿者名取得
if (!in_array($res['name'], $rresname)) {//重複除外
Expand All @@ -996,6 +1008,9 @@ function res(){
}
//引用の色
$bbsline['com'] = quote($bbsline['com']);
//日付をUNIX時間に
$bbsline['created'] = date(DATE_FORMAT, strtotime($bbsline['created']));
$bbsline['modified'] = date(DATE_FORMAT, strtotime($bbsline['modified']));
$oya[] = $bbsline;
if (!in_array($bbsline['name'], $rresname)) {
$rresname[] = $bbsline['name'];
Expand Down Expand Up @@ -1308,15 +1323,15 @@ function paintcom($tmpmode){
$fp = fopen(TEMP_DIR.$file, "r");
$userdata = fread($fp, 1024);
fclose($fp);
list($uip,$uhost,$uagent,$imgext,$ucode,,$tool,$starttime,$postedtime,$uresto) = explode("\t", rtrim($userdata)."\t");
list($uip,$uhost,$uagent,$imgext,$ucode,,$starttime,$postedtime,,$tool) = explode("\t", rtrim($userdata)."\t");
$file_name = preg_replace("/\.(dat)\z/i","",$file); //拡張子除去
if(is_file(TEMP_DIR.$file_name.$imgext)) //画像があればリストに追加
//描画時間を$userdataをもとに計算
//(表示用)
$ptime = calcPtime((int)$postedtime - (int)$starttime);
//描画時間(内部用)
$pptime = (int)$postedtime - (int)$starttime;
$tmplist[] = $ucode."\t".$uip."\t".$file_name.$imgext."\t".$tool."\t".$ptime."\t".$pptime;
$tmplist[] = $ucode."\t".$uip."\t".$file_name.$imgext."\t".$ptime."\t".$pptime."\t".$tool;

}
}
Expand All @@ -1325,7 +1340,7 @@ function paintcom($tmpmode){
if(count($tmplist)!=0){
//user-codeとipアドレスでチェック
foreach($tmplist as $tmpimg){
list($ucode,$uip,$ufilename,$tool,$ptime,$pptime) = explode("\t", $tmpimg);
list($ucode,$uip,$ufilename,$ptime,$pptime,$tool) = explode("\t", $tmpimg);
if($ucode == $usercode||$uip == $userip){
$tmp[] = $ufilename;
}
Expand Down Expand Up @@ -1588,10 +1603,11 @@ function picreplace(){
$fp = fopen(TEMP_DIR.$file, "r");
$userdata = fread($fp, 1024);
fclose($fp);
list($uip,$uhost,$uagent,$imgext,$ucode,$urepcode,$starttime,$postedtime) = explode("\t", rtrim($userdata)."\t");//区切りの"\t"を行末にして配列へ格納
list($uip,$uhost,$uagent,$imgext,$ucode,$urepcode,$starttime,$postedtime,,$tool) = explode("\t", rtrim($userdata)."\t");//区切りの"\t"を行末にして配列へ格納
$file_name = pathinfo($file, PATHINFO_FILENAME ); //拡張子除去
if($file_name && is_file(TEMP_DIR.$file_name.$imgext) && $urepcode === $repcode){
$find=true;break;
$find = true;
break;
}

}
Expand Down
4 changes: 2 additions & 2 deletions rois/picpost.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// このスクリプトはPaintBBS(藍珠CGI)のPNG保存ルーチンを参考に
// PHP用に作成したものです。
//----------------------------------------------------------------------
// 2021-08/30 使用ツールも記録 by sakots
// 2021/08/30 使用ツールも記録 by sakots
// 2021/05/17 エラーが発生した時はお絵かき画面から移動せず、エラーの内容を表示する。
// 2021/02/17 $badfileが未定義の時は拒絶画像の処理をしない。
// 2021/01/30 picpost.systemlogの設定をpicpost.phpに移動。raw POST データ取得処理を整理。
Expand Down Expand Up @@ -247,7 +247,7 @@ function error($error){
$stime = isset($u['stime']) ? $u['stime'] : '';
$resto = isset($u['resto']) ? $u['resto'] : '';
//usercode 差し換え認識コード ツール 描画開始 完了時間 レス先 を追加
$userdata .= "\t$usercode\t$repcode\t$tool\t$stime\t$time\t$resto";
$userdata .= "\t$usercode\t$repcode\t$stime\t$time\t$resto\t$tool";
}
$userdata .= "\n";
if(is_file(TEMP_DIR.$imgfile.".dat")){
Expand Down
2 changes: 1 addition & 1 deletion rois/save.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function chibi_die($message) {
$resto = (string)filter_input(INPUT_GET, 'resto');

//usercode 差し換え認識コード ツール 描画開始 完了時間 レス先 を追加
$userdata .= "\t$usercode\t$repcode\t$tool\t$stime\t$time\t$resto";
$userdata .= "\t$usercode\t$repcode\t$stime\t$time\t$resto\t$tool";
$userdata .= "\n";
// 情報データをファイルに書き込む
$fp = fopen(TEMP_DIR.$imgfile.".dat","w");
Expand Down

0 comments on commit 17967a8

Please sign in to comment.