でPHPの設定情報を確認(出来ない鯖も有るけど) ・もしもの為の.htaccess (CGI禁止SSI禁止Index表示禁止) Options -ExecCGI -Includes -Indexes .txtでも、中身がHTMLだと表示されちゃうので注意 **************************************************************************/ // /* * Heyuri's file uploader. */ if (!file_exists($configFile)) { die("Error: Configuration file $configFile is missing."); } $conf = require_once $configFile; date_default_timezone_set($conf['timeZone']); if(!file_exists($conf['logFile'])) die($conf['logFile']. " is missing. Please create it."); /* draw functions */ function drawHeader(){ global $conf; echo ' '.$conf['boardTitle'].'
'.$conf['boardTitle'].'


'.$conf['boardSubTitle'].'


'; } function drawPageingBar($page=1){ global $conf; $fileCount = getTotalLogLines(); $pages = ceil($fileCount / $conf['filesPerListing']) + 1; if($page === "all"){ echo '[Home] [ALL] [1]'; return; } echo '[Home] [ALL]'; for($i = 1; $i < $pages; $i++) { if($i == $page){ echo '['.$i.']'; }else{ echo '['.$i.']'; } } } function drawFileListing($page=1){ global $conf; $count = $conf['filesPerListing']; if($page == "all"){ $count = getTotalLogLines(); $page = 0; }else{ $page = $page - 1; } $lineOffset = $count * $page; $currentLine = 0; $fileHandle = fopen($conf['logFile'], 'r'); //go to the offest while ($currentLine < $lineOffset && !feof($fileHandle)) { fgets($fileHandle); $currentLine++; } $cookie = getSplitCookie(); // Main header (please adjust the width if you change the display items) echo '
'; if($cookie['showDeleteButton']) echo ''; echo ''; if($cookie['showComment']) echo ''; if($cookie['showFileSize']) echo ''; if($cookie['showMimeType']) echo ''; echo ''; $lineOffset = $currentLine + $count; while ($currentLine < $lineOffset && !feof($fileHandle)) { $line = fgets($fileHandle); if ($line == false || trim($line) == '') { continue; //empty line } $data = createDataFromString($line); $fileName = $conf['prefix'] . getID($data) .'.'. getFileExtension($data); $thumbName = $conf['prefix'] . getID($data) .'_thumb.'. getFileExtension($data); $path = $conf['uploadDir'] . $fileName; $thumbPath = $conf['thumbDir'].$thumbName; if(!file_exists($thumbPath)) $thumbPath = $path; if(preg_match('/video/i', getMimeType($data))) $thumbPath = 'static/images/video_overlay.png'; //if file is a video it will use a default image if(preg_match('/audio/i', getMimeType($data))) $thumbPath = 'static/images/audio_overlay.png'; //if file is an audio it will use a default image if($cookie['showDeleteButton']) echo ''; if($cookie['showPreviewImage']) echo ''; else echo ''; if($cookie['showComment']) echo ''; if($cookie['showFileSize']) echo ''; if($cookie['showMimeType']) echo ''; echo ''; $currentLine = $currentLine + 1; } echo "
DELNAMECOMMENTSIZEMIME

'.$fileName.'
'.$fileName.''. getComment($data) .''. bytesToHumanReadable(getSizeInBytes($data)) .''. getMimeType($data) .'

"; echo 'Used '. bytesToHumanReadable(getTotalUsageInBytes()).'/ '. bytesToHumanReadable($conf['maxTotalSize']).'
'; echo 'Used '.getTotalLogLines().' Files/ '. $conf['maxAmountOfFiles'].' Files
'; } function drawFooter(){ echo '
Heyuri + ずるぽんあぷろだ + レッツ PHP! + 隠れ里の村役場
'; } function drawErrorPageAndExit($mes1,$mes2=""){ global $base_php; drawHeader(); echo '
'.$mes1.'

'.$mes2.'

[Back]'; drawFooter(); exit; } function drawMessageAndRedirectHome($mes1,$mes2=""){ drawHeader(); echo '
'.$mes1.'

'.$mes2.'

[Back] '; drawFooter(); exit; } function drawUploadForm(){ // Post form header (Yakuba modification) // Check if the overall filesize limit for the board has been exceeded global $conf; if(getTotalUsageInBytes() >= $conf['maxTotalSize']){ echo ' The total capacity has exceeded the limit and is currently under posting restriction.
Please notify the administrator.

'; } else{ echo '
MAX UPLOAD SIZE: '. bytesToHumanReadable($conf['maxUploadSize']) .'
DELETION KEY:
COMMENT(※If no comment is entered, the page will be reloaded / URL will be auto-linked.)

Allowed extensionsAllowed extensions: '. implode(", ", $conf['allowedExtensions']) .'
'; } } function drawDeletionForm($fielID){ echo'
Enter your password:
'; } function drawSettingsForm(){ $cookie = getSplitCookie(); echo '
client Settings