[WordPress] 外掛分享: Library Viewer

首頁外掛目錄 › Library Viewer
WordPress 外掛 Library Viewer 的封面圖片
400+
安裝啟用
★★★★★
5/5 分(13 則評價)
5 天前
最後更新
問題解決
WordPress 3.0.0+ PHP 7.4+ v3.3.1 上架:2019-07-07

內容簡介

揭密:
LIBRARY VIEWER FILE MANAGER ADD-ON已經發佈了!來看看吧 😉

使用 Library Viewer,你可以顯示你的 (FTP) 伺服器某個「特定資料夾」的包含檔案和資料夾給前端使用者查看。

與其他類似的插件相比,最大的不同是:
1. 你可以允許使用者查看檔案是否存在,但如果使用者未登錄 (或者不是管理員、作者等),就無法打開檔案。
2. 你可以允許使用者在自定義檢視器中查看檔案,或將其重新導向到你選擇的 RESTful 網路服務(下面有範例)。

範例

對於此插件(免費版本),「特定資料夾」是你的 httpdocs(yoursite.com/library) 中的「library」資料夾。
如果你想顯示不在 yoursit.com/library 中的其他資料夾(及其檔案),你需要使用Library Viewer Pro的路徑參數。

這個插件在 WordPress 網站中添加了 [library-viewer] 短碼!
所以,你只需要在帖子、頁面、小工具等中添加這個短碼,就可以在前端顯示資料夾和檔案。

[library-viewer] 短碼還有可選參數,可以擴展插件的功能:

參數說明

  參數文檔和使用案例

  LIBRARY VIEWER 的參數

have_file_access(have_file_access 參數用於決定哪些使用者可以查看檔案)
my_doc_viewer(my_doc_viewer 參數用於決定在哪個檢視器中打開檔案)
login_page(login_page 參數用於定義使用者必須登錄的登錄頁面-如果需要的話)

  LIBRARY VIEWER PRO 的參數

path(path 參數允許我們選擇要在前端顯示的資料夾。當我們說「資料夾」時,指的是該資料夾的內容,即包含此資料夾的資料夾和檔案)
waiting_seconds(waiting_seconds 參數設置使用者等待重新導向到登錄頁面並查看檔案的時間(0: 立即重新導向)。)
breadcrumb(breadcrumb 參數決定是否在前端的圖書館中顯示 breadcrumb 或不顯示。)
hidden_folders(hidden_folders 確定哪些資料夾不會在前端的圖書館中顯示,並且無法使用。)
shown_folders(shown_folders 參數確定哪些資料夾將在前端的圖書館中顯示,並且可以使用。)
hidden_files(hidden_files 參數決定哪些檔案不會在前端的圖書館中顯示,並且無法使用。)
shown_files(shown_files 參數確定哪些檔案將在前端的圖書館中顯示,並且可以使用。)
url_suffix(url_suffix 允許你在 URL 中添加後綴,這樣你就可以在同一頁面上多次使用 [library-viewer] 短碼。)

  LIBRARY VIEWER 文件管理器插件的參數

delete_folder(delete_folder 參數決定哪些使用者可以刪除資料夾。)
delete_file(delete_file 參數決定哪些使用者可以刪除檔案。)

外掛標籤

開發者團隊

⬇ 下載最新版 (v3.3.1) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Library Viewer」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

New in Version 3.3.0: Admin Library Viewer!
You can now manage and browse your library directly from your WordPress dashboard. Go to Media > Library Viewer to get started.
Library Viewer allows you to display files and folders from your server directly on your WordPress site.
By default, the free version displays the contents of the “library” folder located in your site’s root directory (example: yoursite.com/library). To display any other directory, you can use the path parameter available in Library Viewer Pro.
Whether you want to create a public document library, a members-only download area, or an internal file portal, Library Viewer provides a lightweight and flexible solution.
Unlike traditional file manager plugins, Library Viewer focuses on controlled visibility and flexible file access.
You can:

Allow users to browse files without allowing them to open or download them
Restrict file access based on login status or user roles
Open files using custom viewers or external services
Integrate file access with WooCommerce purchases
Manage your library directly from the WordPress dashboard

Live Demo
Explore a working example of Library Viewer:
View Demo
Ideal Use Cases

Document libraries
Members-only downloads
WooCommerce customer downloads
Internal company file portals
Educational resources
Front-end file management systems

Key Features

Access Control: Allow users to browse files but restrict opening them to logged-in users or specific roles.
Custom Viewer: Open files in a custom viewer or redirect them via a web service of your choice.
Breadcrumb Navigation: Easy navigation through subfolders.
Search & Filter: Show or hide specific files and folders (Pro version).

Quick Start

Create a folder named “library” in your server root (e.g. public_html/library)
Upload your files and folders inside it
Add the shortcode [library-viewer] to any page or post
Publish the page and view your library
(Optional) Use shortcode parameters to control access and behavior
To view your library in the backend, navigate to Media > Library Viewer.

Library Viewer Admin Pages
ADMIN PAGE DOCUMENTATION
The Library Viewer Admin Pages feature, introduced in version 3.3.0, brings library functionality directly into your WordPress dashboard.
It is designed for site owners and administrators who need quick access to their libraries without visiting the front end.
Unlike a single fixed admin screen, Library Viewer allows you to register multiple Library Viewer Admin Pages, each with its own configuration, permissions, and displayed library.
For advanced usage and full configuration options, please refer to the Admin Page Documentation.
Key Features of the Admin Page:

Centralized Browsing: View all files and folders in your “library” folder (or in other directories when using Library Viewer Pro) directly from the Media > Library Viewer menu.
Customizable Access: You can define exactly which user roles or capabilities (e.g., editors, custom roles) have permission to view this admin page.
Flexible Display: The admin page uses the same powerful engine as the shortcode. In the “Library to display” field, you can set any [library-viewer] shortcode with the parameters of your choice (as described in the Parameters Documentation) to customize the backend display.
Easy Navigation: Includes a dedicated “Settings” tab where you can change the page title and manage access permissions without touching any code.

How to Use:

Go to your WordPress Dashboard.
Navigate to Media > Library Viewer.
Use the Library tab to browse your files.
Switch to the Settings tab to customize the title or restrict access to specific roles.

Parameters Documentation
  FULL PARAMETERS DOCUMENTATION AND USE CASES
  PARAMETERS OF LIBRARY VIEWER

have_file_access (have_file_access parameter controls which users can access and view files.)
my_doc_viewer (my_doc_viewer parameter defines which viewer is used to open files.)
login_page (login_page parameter sets the login page where users are redirected if authentication is required)

  PARAMETERS OF LIBRARY VIEWER FOR WOOCOMMERCE

have_file_access=”customer_with_folder_access” (The customer_with_folder_access value for the have_file_access parameter grants access to users who purchased a product with folder access.)
sold_on (sold_on parameter specifies the WooCommerce product required to unlock folder access.)

  PARAMETERS OF LIBRARY VIEWER PRO

path (path parameter defines which server folder is displayed in the front-end library. When we refer to a “folder,” we mean the folder’s contents, including any subfolders and files within it.)
guest_view_access (guest_view_access parameter controls whether guest users can view folder contents. By default, all users can see folder contents, but they cannot open files.)
waiting_seconds (waiting_seconds parameter Sets delay before redirecting users to login (0 = immediate redirect))
breadcrumb (breadcrumb parameter enables or disables breadcrumb navigation)
hidden_folders (hidden_folders parameter hides specific folders from the library view)
shown_folders (shown_folders parameter explicitly defines which folders are visible.)
hidden_files (hidden_files parameter hides specific files from the library view.)
shown_files (shown_files parameter explicitly defines which files are visible.)
url_suffix (url_suffix parameter adds a URL suffix to allow multiple library instances on the same page.)

  PARAMETERS OF LIBRARY VIEWER FILE MANAGER ADD-ON

delete_folder (delete_folder parameter controls permission to delete folders.)
delete_file (delete_file parameter controls permission to delete files.)
rename_folder (rename_folder parameter controls permission to rename a folder.)
rename_file (rename_folder parameter controls permission to rename a file.)
create_folder (create_folder parameter controls permission to create a folder.)
upload_file (upload_file parameter controls permission to upload a file.)
unzip_file (unzip_file parameter controls permission to unzip a zip file.)
download_folder (download_folder parameter allows downloading folders as ZIP files.)
download_file (download_file parameter allows downloading individual files.)

 
FULL PARAMETERS DOCUMENTATION AND USE CASES
 
Hooks Documentation
From 2.0.0 version and then, there are many hooks that you can customize the functionality of this plugin.
You can read more in HOOKS DOCUMENTATION
Read also in my blog: How to add PHP hooks in your WordPress Site
Premium Extensions Features

With LIBRARY VIEWER PRO you can:

Display any folder on your server, not just the default “library” folder.
Customize URLs with hooks and parameters.
Show or hide the breadcrumb with a simple shortcode parameter.
Gain full control over which folders and files are displayed or hidden.
Forbid direct access to files, ensuring they are only accessible via the Library Viewer.

With the LIBRARY VIEWER FOR WOOCOMMERCE ADD-ON you can:

Grant library access to customers who purchase specific products.
Create a “Members Only” file area linked to WooCommerce purchases.

With the LIBRARY VIEWER FILE MANAGER ADD-ON you can:

Allow users to upload, rename, delete, and manage files directly from the front-end.
Use the library as a powerful front-end file manager for your admins or specific user roles.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon