Skip to content

Commit df61b85

Browse files
committed
続きを描くたびに動画のurlが変わっていたのを修正。旧テンプレートでも以前と同じように動作する。
1 parent 08815a2 commit df61b85

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

petitnote/index.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
//https://paintbbs.sakura.ne.jp/
44
//1スレッド1ログファイル形式のスレッド式画像掲示板
55

6-
$petit_ver='v1.203.2';
7-
$petit_lot='lot.20260406';
6+
$petit_ver='v1.205.1';
7+
$petit_lot='lot.20260406.2';
88

99
$lang = ($http_langs = $_SERVER['HTTP_ACCEPT_LANGUAGE'] ?? '')
1010
? explode( ',', $http_langs )[0] : '';
@@ -1674,9 +1674,12 @@ function pchview(): void {
16741674

16751675
aikotoba_required_to_view();
16761676

1677+
$id = basename((string)filter_input_data('GET', 'id'));//最初に投稿した時刻をidに
1678+
16771679
$imagefile = basename((string)filter_input_data('GET', 'imagefile'));
1680+
$id = $id ?: pathinfo($imagefile, PATHINFO_FILENAME);//旧テンプレート互換
1681+
16781682
$no = (string)filter_input_data('GET', 'no',FILTER_VALIDATE_INT);
1679-
$id = pathinfo($imagefile, PATHINFO_FILENAME);
16801683
if(!is_file(LOG_DIR."{$no}.log")){
16811684
error($en? 'The article does not exist.':'記事がありません。');
16821685
}
@@ -1690,7 +1693,7 @@ function pchview(): void {
16901693
}
16911694
if(strpos($line,"\t".$id."\t")!==false){
16921695
list($_no,$sub,$name,$verified,$com,$url,$imgfile,$w,$h,$thumbnail,$painttime,$log_img_hash,$tool,$pchext,$time,$first_posted_time,$host,$userid,$hash,$oya)=explode("\t",trim($line));
1693-
if($id===$time && $no===$_no && $pchext){
1696+
if(($id===$first_posted_time || $id===$time) && $no===$_no && $pchext){
16941697
$resid=$first_posted_time;
16951698
$flag=true;
16961699
break;

petitnote/template/basic/parts/threads_loop.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ <h3 class="imginfo_wrap">
9393
<span><a href="?mode=to_continue&id=<?=h($res['time'])?>&no=<?=h($res['no'])?>"><?php if($en):?>Continue<?php else:?>続きを描く<?php endif;?></a></span>
9494
<?php endif;?>
9595
<?php if($res['anime']):?>
96-
<span><a href="?mode=pchview&imagefile=<?=h($res['img'])?>&no=<?=h($res['no'])?>" target="_blank" rel="noopener"><?php if($en):?>Animation<?php else:?>動画<?php endif;?></a></span>
96+
<span><a href="?mode=pchview&id=<?=h($res['first_posted_time'])?>&no=<?=h($res['no'])?>" target="_blank" rel="noopener"><?php if($en):?>Animation<?php else:?>動画<?php endif;?></a></span>
9797
<?php endif;?>
9898
</div>
9999
<?php endif;?>

0 commit comments

Comments
 (0)