function AddResToThread($CryptKey, $bbs, $key, $submit, $FROM, $mail, $MESSAGE) { global $_GLOBAL, $_PATH, $CookieExpires, $BoardPath, $Out, $ThreadID, $BoardID; $BoardID = $bbs; $ThreadID = $key; if (ThreadExists($BoardPath, $BoardID, $key) === 0) { ThrowError("存在しないThreadID"); } $_SETTING = parse_ini_file($BoardPath . "/" . $BoardID . "/SETTING.TXT"); setcookie("SETCOOKIE", "OK", time() + $CookieExpires); setcookie("NAME", $FROM, time() + $CookieExpires); setcookie("MAIL", $mail, time() + $CookieExpires); setcookie("EXPIRES", time() + $CookieExpires, time() + $CookieExpires); if ($FROM === "") { $FROM = $_SETTING["BBS_NONAME_NAME"]; } AddRes($CryptKey, $BoardPath, $BoardID, $ThreadID, $FROM, $mail, $MESSAGE); $Out->Set("bbs_res"); }
<?php $ErrorText = "404 NotFound"; if (isset($_PATH[2])) { $ThreadID = str_replace(".dat", "", $_PATH[2]); if (ThreadExists($BoardPath, $BoardID, $ThreadID)) { $Out->Set("dat"); } else { $Out->Set("404"); } } else { $Out->Set("404"); }
if (isset($_GET["bbs"])) { $BoardID = $_GET["bbs"]; } elseif (isset($_PATH[2])) { $BoardID = $_PATH[2]; } else { $ErrorText = "スレッドが分からないよ"; } if (isset($_GET["key"])) { if (ThreadExists($BoardID, $_GET["key"])) { $ThreadID = $_GET["key"]; $ThreadDat = file_get_contents($BoardPath . "/" . $BoardID . "/dat/" . $ThreadID . ".dat"); } else { ThrowError("指定されたスレッドはない。"); } } elseif (isset($_PATH[3])) { if (ThreadExists($BoardPath, $BoardID, $_PATH[3])) { $ThreadID = $_PATH[3]; $ThreadDat = file_get_contents($BoardPath . "/" . $BoardID . "/dat/" . $ThreadID . ".dat"); } else { ThrowError("指定されたスレッドはない。"); } } else { ThrowError("不正なURL"); } if (isset($_GET["st"])) { $St = $_GET["st"]; } else { $St = ""; } if (isset($_GET["to"])) { $To = $_GET["to"];