"hide_php" にファイルをアップロード

このコミットが含まれているのは:
may 2024-04-25 20:27:45 +09:00
コミット 87fe73d5e2
1個のファイルの変更117行の追加117行の削除

ファイルの表示

@ -1,117 +1,117 @@
<?php
//直接アクセスしちゃだめ
require $d_root.'/hide_php/conf/c.php';
require $d_root.'/hide_php/conf/submit.php';
require $d_root.'/hide_php/conf/bbs.php';
$bbs_dir = $d_root.'/sqlike/bbs';
//定義
//板とスレッドの検出
(isset($_GET['Area'])?$areas=$_GET['Area']:not_found());
$w = '-';
if (substr_count($areas, $w) === 1){
$area = explode($w, $areas);
$board = (int)$area[0];
$thread = (int)$area[1];
$areas = (string)$board.$w.(string)$thread;
} else {
$board = (int)substr($areas, 0, 1);
$thread = (int)substr($areas, 1);
$areas = (string)$board.(string)$thread;
}
//未指定と0はだ駄目
if (empty($board)){
not_found();
}
if (empty($thread)){
header("Location:board.php?Board={$board}");
exit;
}
//掲示板のデータを読み込み
if ($board < 200){
$board_data = get($bbs_dir.'/boards.txt', $board);
} else {
$board_data = get($bbs_dir.'/user_board/'.$board.'.txt', 1);
}
if (($board_data === false) || empty($board_data)){
not_found();
}
list($board_title, $board_description, $board_content, $board_access_passwd, $board_edit_passwd) = explode("'", $board_data);
if (($board_access_passwd !== '') && (!isset($_COOKIE['login:'.$board]) || (pass(h(s_pass_d($_COOKIE['login:'.$board]))) !== $board_access_passwd))){
header('Location:./login.php?Board='.$board);
exit;
}
//クッキー
$s_name=(isset($_COOKIE['name'])?$_COOKIE['name']:'');
$s_key=(isset($_COOKIE['key'])?s_pass_d($_COOKIE['key']):'');
$s_edit_pass=(isset($_COOKIE['edit_pass'])?s_pass_d($_COOKIE['edit_pass']):'');
$s_color=(isset($_COOKIE['color'])?$_COOKIE['color']:'color_lz');
$s_content=(isset($_COOKIE["comment:{$board}-{$thread}"])?$_COOKIE["comment:{$board}-{$thread}"]:'');
//SEO対策(文書説明)
$thread_file = $bbs_dir.'/'.$board.'/'.$thread.'.txt';
$thread_title = get($thread_file, 1);
$first_comment = get($thread_file, 2);
if ($thread_title === false || empty($first_comment)){
not_found();
}
$first_array = explode("'", $first_comment);
$made_by = $first_array[1];
if (strpos($first_array[5], '\\\\非表示\\\\') !== false){
$first_msg = '非表示';
} else {
$first_msg = mb_substr(preg_replace('/{{[0-9]+\.(gif|jpeg|jpg|png|webp|ico)}}/', '', str_replace('<br>', '', $first_array[5])), 0, 150);
}
#セッションの代用
$session_num = one_time_pass(25, 40);
set_session($areas, $session_num);
$link = '<p><br></p><p><a href="/bbs.php">掲示板ホームへ</a> <a href="/board.php?Board='.$board.'">'.$board_title.'に戻る</a></p><p><br></p>';
######html開始
html_head($thread_title.'-'.$board_title.' ', $made_by.' '.$first_msg.'...', $d_root.'/sqlike/css/form/bbs.css', true);
//タイトル・スレッド表示
$com_count = 0;
$rep_list = [];
if (file_exists($thread_file)){
echo '<h1>'.$thread_title. '</h1><p>最終更新: '.date('Y年m月d日 H時i分', filemtime($thread_file)).'</p><p style="text-align:right;"><a href="#form" title="最下部へ飛びます">下へ移動</a></p><p><br></p><main>';
$thread_data = get_rows($thread_file, 2);
foreach ($thread_data as $row){
if (!empty($row)){
$d = explode("'", $row);
view_comment($d, '', '<br><form action="/MarisaDB1.php" method="POST"><input type="hidden" name="session" value="'.$session_num.'"><input type="hidden" name="area" value="'.$areas.'#'.$d[0].'"><button type="submit" name="submit" value="edit">編集</button></form>');
$rep_list[] = $d[0].' '.$d[1];
++$com_count;
}
}
//フォーム
echo '</main>'.$link.'<p><br></p><p><br></p><form action="/MarisaDB.php" method="POST" enctype="multipart/form-data" id="form"><h2>投稿する</h2>';
post_warning($s_name, $s_key);
echo '<input type="hidden" name="area" value="'.$areas.'"><input type="hidden" name="session_num" value="'.$session_num.'"><p><label><b>名前</b><input type="text" name="name" value="'.h($s_name).'"></label><label>#トリップ<input type="text" name="key" value="'.h($s_key).'"></label></p><p><label>返信<select name="rep"><option value="">指定済み、または指定なし</option>';
$rep_list = $rep_list;
for ($i = 1;$i <= $com_count;++$i){
echo '<option value="'.$i.'">&gt;&gt;'.$rep_list[$i-1].'</option>';
}
echo '</select>(敬称略)</label></p><p><label><b>メッセージ本文</b><br><textarea rows="8" cols="25" name="comment" class="'.$s_color.'" id="text">'.h($s_content).'</textarea></label></p>';
color_options($color_list, $color_name_list, $s_color);
echo '<p><label>編集パスワード<input type="text" name="edit_pass" value="'.h($s_edit_pass).'"></label></p><p style="float:right;"><label><b>投稿ボタンは此方→</b><button type="submit" name="submit" value="comment_thread_view" class="enter">確認</button></label></p><p><label class="file">画像を選択<input type="file" name="image" accept="image/*"></label></p></form>';
} else {
echo '<h1>このスレッドはありません</h1>';
echo $link;
}
html_foot($d_root.'/js/text_color.js', '');
<?php
//直接アクセスしちゃだめ
require $d_root.'/hide_php/conf/c.php';
require $d_root.'/hide_php/conf/submit.php';
require $d_root.'/hide_php/conf/bbs.php';
$bbs_dir = $d_root.'/sqlike/bbs';
//定義
//板とスレッドの検出
(isset($_GET['Area'])?$areas=$_GET['Area']:not_found());
$w = '-';
if (substr_count($areas, $w) === 1){
$area = explode($w, $areas);
$board = (int)$area[0];
$thread = (int)$area[1];
$areas = (string)$board.$w.(string)$thread;
} else {
$board = (int)substr($areas, 0, 1);
$thread = (int)substr($areas, 1);
$areas = (string)$board.(string)$thread;
}
//未指定と0はだ駄目
if (empty($board)){
not_found();
}
if (empty($thread)){
header("Location:board.php?Board={$board}");
exit;
}
//掲示板のデータを読み込み
if ($board < 200){
$board_data = get($bbs_dir.'/boards.txt', $board);
} else {
$board_data = get($bbs_dir.'/user_board/'.$board.'.txt', 1);
}
if (($board_data === false) || empty($board_data)){
not_found();
}
list($board_title, $board_description, $board_content, $board_access_passwd, $board_edit_passwd) = explode("'", $board_data);
if (($board_access_passwd !== '') && (!isset($_SESSION['login:'.$board]) || ($_SESSION['login:'.$board] !== $board_access_passwd))){
header('Location:./login.php?Board='.$board);
exit;
}
//クッキー
$s_name=(isset($_COOKIE['name'])?$_COOKIE['name']:'');
$s_key=(isset($_SESSION['key'])?$_SESSION['key']:'');
$s_edit_pass=(isset($_SESSION['edit_pass'])?$_SESSION['edit_pass']:'');
$s_color=(isset($_COOKIE['color'])?$_COOKIE['color']:'color_r');
$s_content=(isset($_COOKIE["comment:{$board}-{$thread}"])?$_COOKIE["comment:{$board}-{$thread}"]:'');
//SEO対策(文書説明)
$thread_file = $bbs_dir.'/'.$board.'/'.$thread.'.txt';
$thread_title = get($thread_file, 1);
$first_comment = get($thread_file, 2);
if ($thread_title === false || empty($first_comment)){
not_found();
}
$first_array = explode("'", $first_comment);
$made_by = $first_array[1];
if (strpos($first_array[5], '\\\\非表示\\\\') !== false){
$first_msg = '非表示';
} else {
$first_msg = mb_substr(preg_replace('/{{[0-9]+\.(gif|jpeg|jpg|png|webp|ico)}}/', '', str_replace('<br>', '', $first_array[5])), 0, 150);
}
#セッションの代用
$session_num = one_time_pass(25, 40);
set_session($areas, $session_num);
$link = '<p><br></p><p><a href="/bbs.php">掲示板ホームへ</a> <a href="/board.php?Board='.$board.'">'.$board_title.'に戻る</a></p><p><br></p>';
######html開始
html_head($thread_title.'-'.$board_title.' ', $made_by.' '.$first_msg.'...', $d_root.'/sqlike/css/form/bbs.css', true);
//タイトル・スレッド表示
$com_count = 0;
$rep_list = [];
if (file_exists($thread_file)){
echo '<h1>'.$thread_title. '</h1><p>最終更新: '.date('Y年m月d日 H時i分', filemtime($thread_file)).'</p><p style="text-align:right;"><a href="#form" title="最下部へ飛びます">下へ移動</a></p><p><br></p><main>';
$thread_data = get_rows($thread_file, 2);
foreach ($thread_data as $row){
if (!empty($row)){
$d = explode("'", $row);
view_comment($d, '', '<br><form action="/MarisaDB1.php" method="POST"><input type="hidden" name="session" value="'.$session_num.'"><input type="hidden" name="area" value="'.$areas.'#'.$d[0].'"><button type="submit" name="submit" value="edit">編集</button></form>');
$rep_list[] = $d[0].' '.$d[1];
++$com_count;
}
}
//フォーム
echo '</main>'.$link.'<p><br></p><p><br></p><form action="/MarisaDB.php" method="POST" enctype="multipart/form-data" id="form"><h2>投稿する</h2>';
post_warning($s_name, $s_key);
echo '<input type="hidden" name="area" value="'.$areas.'"><input type="hidden" name="session_num" value="'.$session_num.'"><p><label><b>名前</b><input type="text" name="name" value="'.h($s_name).'"></label><label>#トリップ<input type="text" name="key" value="'.h($s_key).'"></label></p><p><label>返信<select name="rep"><option value="">指定済み、または指定なし</option>';
$rep_list = $rep_list;
for ($i = 1;$i <= $com_count;++$i){
echo '<option value="'.$i.'">&gt;&gt;'.$rep_list[$i-1].'</option>';
}
echo '</select>(敬称略)</label></p><p><label><b>メッセージ本文</b><br><textarea rows="8" cols="25" name="comment" class="'.$s_color.'" id="text">'.h($s_content).'</textarea></label></p>';
color_options($color_list, $color_name_list, $s_color);
echo '<p><label>編集パスワード<input type="text" name="edit_pass" value="'.h($s_edit_pass).'"></label></p><p style="float:right;"><label><b>投稿ボタンは此方→</b><button type="submit" name="submit" value="comment_thread_view" class="enter">確認</button></label></p><p><label class="file">画像を選択<input type="file" name="image" accept="image/*"></label></p></form>';
} else {
echo '<h1>このスレッドはありません</h1>';
echo $link;
}
html_foot($d_root.'/js/text_color.js', '');