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

このコミットが含まれているのは:
may 2024-04-25 20:28:38 +09:00
コミット 2c6c53ca0a
5個のファイルの変更353行の追加328行の削除

ファイルの表示

@ -43,9 +43,7 @@ krsort($thread_list, SORT_NUMERIC);
if (isset($_POST['submit'])){
$cookie = (isset($_COOKIE)?$_COOKIE:[]);
foreach ($cookie as $c_key => $c_content){
if (strpos($c_key, 'login') !== false){
setcookie($c_key, '', time(), '/');
}
setcookie($c_key, '', time(), '/');
}
//「フォーム再送信の確認」を防止
header('Location:bbs.php');

ファイルの表示

@ -1,146 +1,146 @@
<?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';
function fix_date($date){
$date = explode(' ', $date)[0];
return $date;
}
$bbs_dir = $d_root.'/sqlike/bbs';
//定義
//どの板
if (isset($_GET['Board'])){
$board = (int)$_GET['Board'];
} else {
$board = 1;
}
if (empty($_GET['Board'])){
$board = 1;
}
//セッションの代用
$session_num = one_time_pass(50, 100);
set_session($board, $session_num);
//掲示板のデータを読み込み
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}"])?$_COOKIE["comment:{$board}"]:'');
$s_title=(isset($_COOKIE["title:{$board}"])?$_COOKIE["title:{$board}"]:'');
###########html開始
html_head($board_title.'-', $board_description, $d_root.'/sqlike/css/form/bbs.css', true);
//タイトル・一覧表示
echo '<h1>'.$board_title.'</h1>'.$board_content.'<p><br></p><p><a href="/bbs.php">掲示板ホームへ</a></p><p><br></p><main>';
echo '<table border="1"><thead><tr><th width="23%">タイトル</th><th width="23%">作成者</th><th width="23%">最終更新</th><th width="23%">作成日</th><th width="6%">件</th></tr></thead><tbody>';
$thread_count = 0;
$split_len = 15;
$board_path = $bbs_dir.'/'.$board;
$thread_list = [];
if ((int)$board >= 10){
$board_num = $board.'-';
} else {
$board_num = $board;
}
(isset($_GET['View'])?$view_list = (int)$_GET['View']:$view_list = 0);
(($view_list >= 2)?$view_list = $split_len * ($view_list -1):$view_list = 0);
$start = $view_list;
$end = $view_list + $split_len;
//スレッドを探す
$files = scandir($board_path);
if ($files !== false){
foreach ($files as $file){
if (preg_match('/^[0-9]+\.txt/', $file) === 1){
$id = str_replace('.txt', '', $file);
$thread_list[filemtime($board_path.'/'.$file).'.'.$id] = $id;
}
}
}
//並び替える
krsort($thread_list, SORT_NUMERIC);
foreach ($thread_list as $time => $thread_id){
if (($thread_count >= $start) and ($thread_count < $end)){
$thread_file = $board_path.'/'.$thread_id.'.txt';
$thread_title = get($thread_file, 1);
if ($thread_title !== false){
$thread_data = get($thread_file, 2);
if (!empty($thread_data)){
$value = explode("'", $thread_data);
list($comment_id, $name, $key, $date, $color, $content, $edit_pass) = $value;
$thread_n = substr_count(file_get_contents($thread_file), PHP_EOL) -1;
echo '<tr><td><a href="/thread.php?Area='.$board_num.$thread_id.'">'.$thread_title.'</a></td><td><span class="usr">'.user_page($name, $key).'</span></td><td>'.date('Y年m月d日', (int)$time).'</td><td>'.fix_date($date).'</td><td>'.$thread_n.'</td></tr>';
}
}
}
++$thread_count;
}
if ($thread_count === 0){
echo '<tr><td colspan="5">まだスレッドがありません。あなたが一番乗りです。</td></tr>';
}
echo '</tbody></table><p><br></p>';
//ページ分けしないといけない場合
if ($thread_count > $split_len){
echo '<p>複数ページに分けられました。</p><p><br></p>';
if ($start === 0){
echo '<span class="split" style="background:transparent;color:#000;">1</span>';
} else {
echo '<a href="/board.php?Board='.$board.'" class="split">1</a>';
}
$split = 0;
$split_count = 2;
while ($split + $split_len < $thread_count){
if ($end / $split_len === $split_count){
echo ' <span class="split" style="background:transparent;color:#000;">'.$split_count.'</span>';
} else {
echo ' <a href="/board.php?Board='.$board_num.'&View='.$split_count.'" class="split">'.$split_count.'</a>';
}
$split = $split + $split_len;
++$split_count;
}
}
//フォーム
echo '</main><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="board" value="'.$board.'"><input type="hidden" name="session_num" value="'.$session_num.'"><p><label><b>タイトル</b><input type="text" name="title" value="'.h($s_title).'"></label></p><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><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="make_thread_view" class="enter">確認</button></label></p><p><label class="file">画像を選択<input type="file" name="image" accept="image/*"></label></p></form>';
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';
function fix_date($date){
$date = explode(' ', $date)[0];
return $date;
}
$bbs_dir = $d_root.'/sqlike/bbs';
//定義
//どの板
if (isset($_GET['Board'])){
$board = (int)$_GET['Board'];
} else {
$board = 1;
}
if (empty($_GET['Board'])){
$board = 1;
}
//セッションの代用
$session_num = one_time_pass(50, 100);
set_session($board, $session_num);
//掲示板のデータを読み込み
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_lz');
$s_content=(isset($_COOKIE["comment:{$board}"])?$_COOKIE["comment:{$board}"]:'');
$s_title=(isset($_COOKIE["title:{$board}"])?$_COOKIE["title:{$board}"]:'');
###########html開始
html_head($board_title.'-', $board_description, $d_root.'/sqlike/css/form/bbs.css', true);
//タイトル・一覧表示
echo '<h1>'.$board_title.'</h1>'.$board_content.'<p><br></p><p><a href="/bbs.php">掲示板ホームへ</a></p><p><br></p><main>';
echo '<table border="1"><thead><tr><th width="23%">タイトル</th><th width="23%">作成者</th><th width="23%">最終更新</th><th width="23%">作成日</th><th width="6%">件</th></tr></thead><tbody>';
$thread_count = 0;
$split_len = 20;
$board_path = $bbs_dir.'/'.$board;
$thread_list = [];
if ((int)$board >= 10){
$board_num = $board.'-';
} else {
$board_num = $board;
}
(isset($_GET['View'])?$view_list = (int)$_GET['View']:$view_list = 0);
(($view_list >= 2)?$view_list = $split_len * ($view_list -1):$view_list = 0);
$start = $view_list;
$end = $view_list + $split_len;
//スレッドを探す
$files = scandir($board_path);
if ($files !== false){
foreach ($files as $file){
if (preg_match('/^[0-9]+\.txt/', $file) === 1){
$id = str_replace('.txt', '', $file);
$thread_list[filemtime($board_path.'/'.$file).'.'.$id] = $id;
}
}
}
//並び替える
krsort($thread_list, SORT_NUMERIC);
foreach ($thread_list as $time => $thread_id){
if (($thread_count >= $start) and ($thread_count < $end)){
$thread_file = $board_path.'/'.$thread_id.'.txt';
$thread_title = get($thread_file, 1);
if ($thread_title !== false){
$thread_data = get($thread_file, 2);
if (!empty($thread_data)){
$value = explode("'", $thread_data);
list($comment_id, $name, $key, $date, $color, $content, $edit_pass) = $value;
$thread_n = substr_count(file_get_contents($thread_file), PHP_EOL) -1;
echo '<tr><td><a href="/thread.php?Area='.$board_num.$thread_id.'">'.$thread_title.'</a></td><td><span class="usr">'.user_page($name, $key).'</span></td><td>'.date('Y年m月d日', (int)$time).'</td><td>'.fix_date($date).'</td><td>'.$thread_n.'</td></tr>';
}
}
}
++$thread_count;
}
if ($thread_count === 0){
echo '<tr><td colspan="5">まだスレッドがありません。あなたが一番乗りです。</td></tr>';
}
echo '</tbody></table><p><br></p>';
//ページ分けしないといけない場合
if ($thread_count > $split_len){
echo '<p>複数ページに分けられました。</p><p><br></p>';
if ($start === 0){
echo '<span class="split" style="background:transparent;color:#000;">1</span>';
} else {
echo '<a href="/board.php?Board='.$board.'" class="split">1</a>';
}
$split = 0;
$split_count = 2;
while ($split + $split_len < $thread_count){
if ($end / $split_len === $split_count){
echo ' <span class="split" style="background:transparent;color:#000;">'.$split_count.'</span>';
} else {
echo ' <a href="/board.php?Board='.$board_num.'&View='.$split_count.'" class="split">'.$split_count.'</a>';
}
$split = $split + $split_len;
++$split_count;
}
}
//フォーム
echo '</main><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="board" value="'.$board.'"><input type="hidden" name="session_num" value="'.$session_num.'"><p><label><b>タイトル</b><input type="text" name="title" value="'.h($s_title).'"></label></p><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><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="make_thread_view" class="enter">確認</button></label></p><p><label class="file">画像を選択<input type="file" name="image" accept="image/*"></label></p></form>';
html_foot($d_root.'/js/text_color.js', '');

ファイルの表示

@ -9,14 +9,23 @@ $bbs_dir = $d_root.'/sqlike/bbs';
//定義
if (isset($_POST['submit'], $_POST['name'], $_POST['key']) && $_POST['submit'] === 'set'){
setcookie('name', $_POST['name'], time() + 999999, '/');
$_SESSION['key'] = $_POST['key'];
header('Location:./');
}
//セッションの代用
$session_num = one_time_pass(50, 100);
set_session('mkboard', $session_num);
$html_file = $d_root.'/sqlike/html/form/ext_board.html';
if (file_exists($html_file)){
$html = explode('{NEW_BOARD}', file_get_contents($html_file));
@ -29,8 +38,8 @@ echo $html[0];
$html = explode('{FORM}', $html[1]);
$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_key=(isset($_SESSION['key'])?$_SESSION['key']:'');
$s_edit_pass=(isset($_SESSION['edit_pass'])?$_SESSION['edit_pass']:'');
$trip_key = t_key(h($s_name), h($s_key));
$full_name = h($s_name).'◆'.$trip_key;
$user_revel_file = $d_root.'/sqlike/user/revel/'.encode_a(h($s_name)).'('.encode_a($trip_key).').txt';
@ -88,4 +97,6 @@ echo '<form action="./mkboard.php" method="POST" id="form">
}
echo $html[1].'<p>*あなたは<b>'.$post_count.'回</b>投稿しています。</p>';
html_foot('', '');

ファイルの表示

@ -1,124 +1,140 @@
<?php
//直接アクセスしちゃだめ
require $d_root.'/hide_php/conf/c.php';
require $d_root.'/hide_php/conf/bbs.php';
function vi_image_file_type($image_file_type){
$o = array('gif','png','jpeg','jpg','webp','ico');
foreach ($o as $t){
if (empty($t)){
return '';
}
if (stripos($image_file_type, $t) !== false){
return $t;
}
}
}
//関数
if (isset($_GET['P'])){
$p = openssl_decrypt(decode_a($_GET['P']), 'aes-256-ecb', file_get_contents($d_root.'/sqlike/own/key.txt'));
if ($p == false){
not_found();
} elseif (preg_match('/^[0-9]+\.(gif|jpeg|jpg|png|webp|ico)/', $p) !== 1){
not_found();
}
$file = $d_root.'/sqlike/bbs/file/'.$p;
if (file_exists($file)){
$type = vi_image_file_type($p);
$size = getimagesize($file);
$date = filemtime($file);
if (empty($type)){
not_found();
} else {
if (isset($_GET['imageonly'])){
$imageonly = (bool)$_GET['imageonly'];
} else {
$imageonly = false;
}
if ($imageonly){
header('Content-Type:image/'.$type);
readfile($file);
} else {
//スレッドをかき集める
$fols = scandir($d_root.'/sqlike/bbs');
foreach ($fols as $b){
if (substr($b, 0, 1) === '.'){
continue;
}
if (preg_match('/^[0-9]+$/', $b) === 1){
$thread_files = scandir($d_root.'/sqlike/bbs/'.$b);
foreach ($thread_files as $thread_file){
if (substr($thread_file, 0, 1) === '.'){
continue;
}
if (preg_match('/^[0-9]+\.txt/', $thread_file) === 1){
$thread_rows = get_rows($d_root.'/sqlike/bbs/'.$b.'/'.$thread_file, 2);
foreach ($thread_rows as $thread_row){
$d = explode("'", $thread_row);
if (strpos($d[5], '{{'.$p.'}}') !== false){
$title = get($d_root.'/sqlike/bbs/'.$b.'/'.$thread_file, 1);
if ($b >= 10){
$b = $b.'-';
}
$area = $b.str_replace('.txt', '', $thread_file).'#'.$d[0];
$name = $d[1];
$key = $d[2];
$color = $d[3];
$description = str_replace('<br>', '', preg_replace('/{{[0-9]+\.(gif|jpeg|jpg|png|webp|ico)}}/', '', $d[5]));
if (strpos($description, '\\\\非表示\\\\') !== false){
not_found();
}
break 3;
}
}
}
}
}
}
if (!isset($description)){
$title = '';
$area = '';
$name = '';
$key = '';
$color = '';
$description = '';
}
######html開始
$replace_array = [
'TITLE' => '添付画像:'.mb_substr(preg_replace('/&gt;&gt;[0-9]+/', '', $description), 0, 20).'-',
'DESCRIPTION' => $description,
'IMAGE_URL' => '/img.php?P='.$_GET['P'],
'WIDTH' => $size[0].'px',
'HEIGHT' => $size[1].'px',
'ALT' => mb_substr(preg_replace('/&gt;&gt;[0-9]+/', '', $description), 0, 7),
'IMAGE_INFOMATION' => '<p>'.date('Y年m月d日 H時i分s秒', $date).'更新、'.user_page($name, $key).'さんの投稿</p><p>'.$description.'</p><p>該当スレッド: <a href="/thread.php?Area='.$area.'">'.$title.'</a></p>'];
$f = $d_root.'/sqlike/html/img/view_image.html';
if (file_exists($f)){
$html = file_get_contents($f);
} else {
readfile($file);
exit;
}
foreach ($replace_array as $word => $result){
$html = str_replace('{'.$word.'}', $result, $html);
}
echo $html;
}
}
} else {
not_found();
}
} else {
not_found();
}
<?php
//直接アクセスしちゃだめ
require $d_root.'/hide_php/conf/c.php';
require $d_root.'/hide_php/conf/bbs.php';
function vi_image_file_type($image_file_type){
$o = array('gif','png','jpeg','jpg','webp','ico');
foreach ($o as $t){
if (empty($t)){
return '';
}
if (stripos($image_file_type, $t) !== false){
return $t;
}
}
}
$bbs_dir = $d_root.'/sqlike/bbs';
//関数
if (isset($_GET['P'])){
$p = s_pass_d(decode_a($_GET['P']));
if ($p == false){
not_found();
} elseif (preg_match('/^[0-9]+\.(gif|jpeg|jpg|png|webp|ico)/', $p) !== 1){
not_found();
}
$file = $bbs_dir.'/file/'.$p;
if (file_exists($file)){
$type = vi_image_file_type($p);
$size = getimagesize($file);
$date = filemtime($file);
if (empty($type)){
not_found();
} else {
if (isset($_GET['imageonly'])){
$imageonly = (bool)$_GET['imageonly'];
} else {
$imageonly = false;
}
if ($imageonly){
header('Content-Type:image/'.$type);
readfile($file);
} else {
//スレッドをかき集める
$fols = scandir($bbs_dir);
foreach ($fols as $b){
if (substr($b, 0, 1) === '.'){
continue;
}
if (preg_match('/^[0-9]+$/', $b) === 1){
$thread_files = scandir($bbs_dir.'/'.$b);
foreach ($thread_files as $thread_file){
if (substr($thread_file, 0, 1) === '.'){
continue;
}
if (preg_match('/^[0-9]+\.txt/', $thread_file) === 1){
$thread_rows = get_rows($bbs_dir.'/'.$b.'/'.$thread_file, 2);
foreach ($thread_rows as $thread_row){
$d = explode("'", $thread_row);
if (strpos($d[5], '{{'.$p.'}}') !== false){
$title = get($bbs_dir.'/'.$b.'/'.$thread_file, 1);
$board = $b;
//非公開板の場合
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;
}
if ($b >= 10){
$b = $b.'-';
}
$area = $b.str_replace('.txt', '', $thread_file).'#'.$d[0];
$name = $d[1];
$key = $d[2];
$color = $d[3];
$description = str_replace('<br>', '', preg_replace('/{{[0-9]+\.(gif|jpeg|jpg|png|webp|ico)}}/', '', $d[5]));
if (strpos($description, '\\\\非表示\\\\') !== false){
not_found();
}
break 3;
}
}
}
}
}
}
if (!isset($description)){
$title = '';
$area = '';
$name = '';
$key = '';
$color = '';
$description = '';
}
######html開始
$replace_array = [
'TITLE' => '添付画像:'.mb_substr(preg_replace('/&gt;&gt;[0-9]+/', '', $description), 0, 20).'-',
'DESCRIPTION' => $description,
'IMAGE_URL' => '/img.php?P='.$_GET['P'],
'WIDTH' => $size[0].'px',
'HEIGHT' => $size[1].'px',
'ALT' => mb_substr(preg_replace('/&gt;&gt;[0-9]+/', '', $description), 0, 8),
'IMAGE_INFOMATION' => '<p>'.date('Y年m月d日 H時i分s秒', $date).'更新、'.user_page($name, $key).'さんの投稿</p><p>'.$description.'</p><p>該当スレッド: <a href="/thread.php?Area='.$area.'">'.$title.'</a></p>'];
$f = $d_root.'/sqlike/html/img/view_image.html';
if (file_exists($f)){
$html = file_get_contents($f);
} else {
readfile($file);
exit;
}
foreach ($replace_array as $word => $result){
$html = str_replace('{'.$word.'}', $result, $html);
}
echo $html;
}
}
} else {
not_found();
}
} else {
not_found();
}

ファイルの表示

@ -1,51 +1,51 @@
<?php
//直接アクセスしちゃだめ
require $d_root.'/hide_php/conf/c.php';
$access_count_file = $d_root.'/sqlike/access/log/access_count.txt';
$c = ['水銀燈', '金糸雀', '翠星石', '蒼星石', '真紅', '雛苺', '雪華綺晶', '薔薇水晶'];
$say = ['よ', 'かしら', 'です', 'だよ', 'なのだわ', 'なの', '。', '.'];
//アクセスカウンター
file_lock('access_count');
if (file_exists($access_count_file)){
$access_count = file_get_contents($access_count_file);
} else {
$access_count = 0;
file_put_contents($access_count_file, '0', LOCK_EX);
}
if (!isset($_COOKIE['accessed'])){
setcookie('accessed', 'yet', time() + 3600 * 24, '/');
unlink_by_date($d_root.'/sqlike/access/log/keep', 3600 * 24);
$ug = (isset($_SERVER['HTTP_USER_AGENT'])?$_SERVER['HTTP_USER_AGENT']:'unset');
$ip = (isset($_SERVER['REMOTE_ADDR'])?$_SERVER['REMOTE_ADDR']:'unset');
$keep_file = $d_root.'/sqlike/access/log/keep/.'.substr(pass($ug.$ip), -10);
if (!file_exists($keep_file)){
file_put_contents($keep_file, '');
file_put_contents($access_count_file, $access_count +1, LOCK_EX);
}
}
file_unlock('access_count');
##################html開始
html_head('','自由で、まったりしていて、優しくてゆるいサイトです。', $d_root.'/sqlike/css/home/index.css', true);
//htmlの分離
$f = $d_root.'/sqlike/html/home/index.html';
if (!file_exists($f)){
exit;
}
$html = explode('{ACCESS_COUNTER}', file_get_contents($f));
echo $html[0];
//アクセスカウンター
$akey = $access_count%7;
echo '<p><span style="background-image:url(/img/'.$c[$akey].'.png);background-repeat:no-repeat;width:24px;height:24px;display:block;float:left;background-size:contain;" title="'.$c[$akey].'"></span>「あなたは'.$access_count.'人目の訪問者'.$say[$akey].'」</p>';
//残り
echo $html[1];
html_foot('', '');
<?php
//直接アクセスしちゃだめ
require $d_root.'/hide_php/conf/c.php';
$access_count_file = $d_root.'/sqlike/access/log/access_count.txt';
$c = ['水銀燈', '金糸雀', '翠星石', '蒼星石', '真紅', '雛苺', '雪華綺晶', '薔薇水晶'];
$say = ['よ', 'かしら', 'です', 'だよ', 'なのだわ', 'なの', '。', '.'];
//アクセスカウンター
file_lock('access_count');
if (file_exists($access_count_file)){
$access_count = file_get_contents($access_count_file);
} else {
$access_count = 0;
file_put_contents($access_count_file, '0', LOCK_EX);
}
if (!isset($_COOKIE['accessed']) || empty($_COOKIE['accessed'])){
setcookie('accessed', 'yet', time() + 3600 * 24, '/');
unlink_by_date($d_root.'/sqlike/access/log/keep', 3600 * 24);
$ug = (isset($_SERVER['HTTP_USER_AGENT'])?$_SERVER['HTTP_USER_AGENT']:'unset');
$ip = (isset($_SERVER['REMOTE_ADDR'])?$_SERVER['REMOTE_ADDR']:'unset');
$keep_file = $d_root.'/sqlike/access/log/keep/.'.substr(pass($ug.$ip), -10);
if (!file_exists($keep_file)){
file_put_contents($keep_file, '');
file_put_contents($access_count_file, $access_count +1, LOCK_EX);
}
}
file_unlock('access_count');
##################html開始
html_head('','自由で、まったりしていて、優しくてゆるいサイトです。', $d_root.'/sqlike/css/home/index.css', true);
//htmlの分離
$f = $d_root.'/sqlike/html/home/index.html';
if (!file_exists($f)){
exit;
}
$html = explode('{ACCESS_COUNTER}', file_get_contents($f));
echo $html[0];
//アクセスカウンター
$akey = $access_count%7;
echo '<p><span style="background-image:url(/img/'.$c[$akey].'.png);background-repeat:no-repeat;width:24px;height:24px;display:block;float:left;background-size:contain;" title="'.$c[$akey].'"></span>「あなたは'.$access_count.'人目の訪問者'.$say[$akey].'」</p>';
//残り
echo $html[1];
html_foot('', '');