include "./diary.conf";
$mode = "";
if(isset($_GET['mode'])) { $mode = $_GET['mode']; }
$mon = "";
if(isset($_GET['mon']))
{
$mon = $_GET['mon'];
$mon = trim($mon);
$mon = htmlentities($mon , ENT_QUOTES , 'utf-8');
$mon = addslashes($mon);
if(!ctype_digit($mon)) { $mon = ""; }
}
$n = "";
if(isset($_GET['n']))
{
$n = $_GET['n'];
$n = trim($n);
$n = htmlentities($n , ENT_QUOTES , 'utf-8');
$n = addslashes($n);
if(!ctype_digit($n)) { $n = ""; }
}
$p = "";
if(isset($_GET['p']))
{
$p = $_GET['p'];
$p = trim($p);
$p = htmlentities($p , ENT_QUOTES , 'utf-8');
$p = addslashes($p);
if(!ctype_digit($p)) { $p = ""; }
}
if($mode == "admin") { admin(); }
if($mon != "") { mon(); }
if($n != "") { day(); }
logselect();
exit;
function logselect()
{
global $fname;
?>
過去ログ
旧日記のバックナンバーです。
2008年
for($nisenhachi=6; $nisenhachi>=1; $nisenhachi--)
{
$nisenhachim = $nisenhachi;
if($nisenhachim < 10) { $nisenhachim = "0". $nisenhachim; }
?>
- =$nisenhachi ?>月
-
}
?>
2007年
for($nisennana=12; $nisennana>=1; $nisennana--)
{
$nisennanam = $nisennana;
if($nisennanam < 10) { $nisennanam = "0". $nisennanam; }
?>
- =$nisennana ?>月
-
}
?>
2006年
for($nisenroku=12; $nisenroku>=1; $nisenroku--)
{
$nisenrokum = $nisenroku;
if($nisenrokum < 10) { $nisenrokum = "0". $nisenrokum; }
?>
- =$nisenroku ?>月
-
}
?>
2005年
for($nisengo=12; $nisengo>=4; $nisengo--)
{
$nisengom = $nisengo;
if($nisengom < 10) { $nisengom = "0". $nisengom; }
?>
- =$nisengo ?>月
-
}
?>
footer();
}
// 月ごと表示
function mon()
{
global $mon,$p,$fname;
// 日付分解 200504
$y = substr($mon, 0, 4);
$m = substr($mon, 4, 2);
// 日付生成 2005/04
$mon = $y ."/". $m;
include "./db/connect.php";
$nonmessage = "";
$monq ="select * from today where date LIKE '". $mon ."%' order by id DESC";
$monr = mysql_query($monq);
while($monv = mysql_fetch_array($monr))
{
// 日付分解 2005/04/10
$d = substr($monv['date'], 8, 10);
if($p == 2) { if($d>=11 && $d<=20) { } else { if($d<=10) { break; } continue; } // 10日以前の記事は読まない
} elseif($p == 3) { if($d>=21) { } else { if($d<=20) { break; } continue; } // 20日以前の記事は読まない
} else { if($d<=10) { } else { continue; } }
$nonmessage = "1";
$count = "0";
/* $tq ="select id from tb where id ='". $monv['id'] ."' order by no DESC";
$tr = mysql_query($tq);
while($tv = mysql_fetch_array($tr)) { $count++; }
if($count != "0") { $count = "
". $count .""; }
*/
$unixtime = $monv['unix'];
$written_time = "";
if($unixtime) { $written_time = date("Y-m-d H:i:sO", $unixtime); $date = date("Y-m-d" , $unixtime); }
else
{
$date = $monv['date'];
$y = substr($date, 0, 4);
$m = substr($date, 5, 2);
$d = substr($date, 8, 2);
$date = $y ."年". $m ."月". $d ."日";
$unixtime = $y ."-". $m ."-". $d;
}
// $message = mb_convert_encoding($monv['message'], "utf-8", "shift_jis");
$message = $monv['message'];
$message = str_replace("
", "
", $message);
// $monv['title'] = mb_convert_encoding($monv['title'], "utf-8", "shift_jis");
?>
=$date ?>
- Permalink
- http://www.jam-graffiti.com/log.html?n==$monv['id'] ?>
=$monv['title'] ?>
echo $message;
echo "
\n";
}
if($nonmessage == "")
{
echo "
該当する記事がありません
\n";
}
include "./db/cloes.php";
footer();
}
// 日ごと表示
function day()
{
global $n;
include "./db/connect.php";
$danq ="select * from today where id ='". $n ."'";
$danr = mysql_query($danq);
$danv = mysql_fetch_array($danr);
$notfound = "";
// 記事がない場合
if($danv['title'] == "")
{
?>
Not Found
該当記事がありません
$notfound = 1;
}
$count = "0";
if(!$notfound)
{
/* $tq ="select id from tb where id ='". $n ."' order by no DESC"; $tr = mysql_query($tq);
while($tv = mysql_fetch_array($tr)) { $count++; }
if($count != "0") { $count = "
". $count .""; }
*/
$message = str_replace("
", "
\n", $danv['message']);
$unixtime = $danv['unix'];
if($unixtime) { $written_time = date("Y-m-d H:i:sO", $unixtime); $date = date("Y-m-d" , $unixtime); }
else
{
$date = $danv['date'];
$y = substr($date, 0, 4);
$m = substr($date, 5, 2);
$d = substr($date, 8, 2);
$date = $y ."年". $m ."月". $d ."日";
$unixtime = $y ."-". $m ."-". $d;
}
// $message = mb_convert_encoding($danv['message'], "utf-8", "shift_jis");
$message = $danv['message'];
$message = str_replace("
", "
", $message);
// $danv['title'] = mb_convert_encoding($danv['title'], "utf-8", "shift_jis");
?>
=$date ?>
- Permalink
- http://www.jam-graffiti.com/log.html?n==$danv['id'] ?>
=$danv['title'] ?>
echo $message;
echo "
\n";
}
include "./db/cloes.php";
footer();
}
// 管理画面入り口
function admin()
{
?>
秘密基地の入り口
footer();
}
function footer()
{
global $c_r;
?>
=$c_r ?>
include"./footer.html" ?>
exit;
}
?>