Releases: webitproff/cot-excel_export
Export to Excel v.2.0.1
Export to Excel via PhpSpreadsheet for Cotonti CMF
Description: Exporting articles, forums, users, products, orders, and payments from a Cotonti-based website database to Excel
The "excel_export" plugin for Cotonti CMF is a simple and universal tool that allows you to export data from any database table into an Excel (.xlsx) file.
After export, the file is automatically downloaded to the user's computer and also saved in the plugins/excel_export/uploads/ directory.
The plugin page displays a list of previously created export files with the ability to download them again.
The plugin uses the PhpSpreadsheet library to generate Excel files and works without Composer.
Important to read
-
To obtain exact table names when you do not currently have direct access to the database, you can use a similar tool called "DB Structure Viewer" for Cotonti CMF.
It provides flexible tools for viewing and exporting database fields, but with two key differences:- it does not use external libraries;
- it does not export to Excel.
This tool displays all tables and fields in the database and can export data to SQL, CSV, JSON, and PHP (as small arrays), with a preview of data in all fields of all database tables.
"DB Structure Viewer" and "Export to Excel" are similar but serve different purposes. -
Separate plugins are available for data import. Visit the Cotonti CMF Extensions Marketplace or browse my projects on GitHub.
Key features
- Dynamic selection of required fields from the selected table for export.
- Custom column names for the first row in the resulting Excel file.
- Limiting the number of exported rows (configurable in plugin settings).
- Saving exported files in the
uploads/directory with the ability to download them later or simultaneously. - Administrative interface in Cotonti with a field selection form and a list of previous export operations with download links.
Dependencies and requirements
- Cotonti CMF: version 0.9.26 or higher.
- PHP: version 8.4 or higher.
- Write permissions for the
logs/anduploads/directories. - Web server access to the
uploads/directory.
Used libraries
- PhpSpreadsheet 1.23.0 — generation of Excel (.xlsx) files.
- ZipStream 2.4.0 — creation of ZIP archives for .xlsx files.
- myclabs/php-enum 1.8.4 — ZipStream dependency for enum handling.
- psr/simple-cache — caching interface (PhpSpreadsheet dependency).
Source libraries
-
PhpSpreadsheet 1.23.0
- GitHub release: https://github.com/PHPOffice/PhpSpreadsheet/releases/tag/1.23.0
- Location:
plugins/excel_export/lib/phpspreadsheet/src/PhpOffice/PhpSpreadsheet/
-
ZipStream 2.4.0
- GitHub release: https://github.com/maennchen/ZipStream-PHP/releases/tag/2.4.0
- Location:
plugins/excel_export/lib/zipstream/src/
-
myclabs/php-enum 1.8.4
- GitHub release: https://github.com/myclabs/php-enum/releases/tag/1.8.4
- Location:
plugins/excel_export/lib/php-enum/src/
-
psr/simple-cache
- GitHub repository: https://github.com/php-fig/simple-cache
- Location:
plugins/excel_export/lib/psr/simple-cache/src/Psr/SimpleCache/
Plugin structure
/plugins/excel_export/
├── excel_export.setup.php # Plugin setup and configuration file
├── excel_export.tools.php # Main admin tool file
├── excel_export.global.php # Global hook connection (required)
├── inc/
│ └── excel_export.functions.php # Export logic and library autoloaders
├── lib/
│ ├── phpspreadsheet/
│ ├── psr/simple-cache/
│ ├── zipstream/
│ └── php-enum/
├── logs/
│ └── export.log # Export debug log
├── tpl/
│ └── excel_export.tools.tpl # Admin interface template
└── uploads/ # Exported Excel files
Installation procedure
1. Download the plugin
- Download the plugin source code and extract the archive.
- Copy the
excel_exportdirectory into the site'splugins/directory (e.g./home/var/public_html/plugins/). - It is recommended to upload files using FileZilla or another FTP client that allows you to verify file integrity.
2. Set directory permissions
- Set permissions to
755forplugins/excel_export/logs. - Set permissions to
755forplugins/excel_export/uploads.
3. Install the plugin in Cotonti
- Go to the admin panel: Site Management → Extensions.
- Find "Export to Excel via PhpSpreadsheet".
- Click Install.
Plugin configuration:
- export_table: database table name without prefix (default:
pages, corresponds tocot_pages). - max_rows: maximum number of exported rows (default: 100, set to
0for unlimited). - Clear cache: Site Management → Cache → Clear cache.
4. Verify uploads directory access
- Ensure that
uploads/is accessible via the web (e.g. https://example.com/plugins/excel_export/uploads/). - If access is denied (403), adjust your web server or
.htaccessrules.
Export workflow and configuration
Select a table for export
Specify the database table (without prefix) in plugin settings, such as pages, forum_posts, users, or market.
Access the export tool
Admin panel → Extensions → Export to Excel via PhpSpreadsheet → Administration.
Direct URL example: https://example.com/admin.php?m=other&p=excel_export
Select fields
- The page displays all fields of the selected table.
- Check the fields you want to export.
- Optionally set custom column names (uppercase field names are used by default).
Export data
- Click Export.
- The
.xlsxfile is downloaded automatically. - The same file is saved in
plugins/excel_export/uploads/.
View previous exports
- The Previous Exports section lists all generated
.xlsxfiles. - Click a file name to download it again.
Example export log
The log file is stored at plugins/excel_export/logs/export.log and is used for debugging.
[2026-02-02 12:04:18] Starting export process
[2026-02-02 12:04:18] Target table: 'pages', Expected table: 'cot_pages'
[2026-02-02 12:04:18] Selected fields: page_id, page_title
[2026-02-02 12:04:18] Executing query: SELECT page_id, page_title FROM cot_pages LIMIT 100
[2026-02-02 12:04:18] Data fetched: X rows
[2026-02-02 12:04:18] Creating new Spreadsheet
[2026-02-02 12:04:18] Setting headers
[2026-02-02 12:04:18] Filling data
[2026-02-02 12:04:18] Generating XLSX to file: /plugins/excel_export/uploads/export_2026-02-02_12-04-18.xlsx
[2026-02-02 12:04:18] File generated successfully
Plugin information
- Name: Export to Excel via PhpSpreadsheet
- Version: 2.0.1
- Initial release: March 16, 2025
- Last update: February 2, 2026
- Author: webitproff
- Package: excel_export
- License: BSD
Download
- GitHub repository: https://github.com/webitproff/cot-excel_export
- Support forum: https://abuyfile.com/forums/cotonti/custom/plugs/topic124
- Hire the author: https://abuyfile.com/users/webitproff
Русский: Плагин Excel Export для Cotonti CMF
Описание: Экспорт в Excel статей, форумов, пользователей, товаров, заказов и платежей из БД сайта на Cotonti
Плагин "excel_export" для Cotonti CMF - это простой и универсальный инструмент, который позволяет экспортировать данные из любой таблицы базы данных в файл формата Excel (.xlsx).
После экспорта файл автоматически скачивается на компьютер пользователя и сохраняется в папке plugins/excel_export/uploads/.
На странице плагина отображается список ранее созданных файлов экспорта с возможностью их скачивания.
Плагин использует библиотеку PhpSpreadsheet для генерации файлов Excel и работает без Composer.
Важно к прочтению
- Для получения точных названий таблиц, если у вас просто нет к ним доступа здесь и сейчас, можно использовать похожий инструмент "DB Structure Viewer" для Cotonti CMF, который также предоставляет гибкие инструменты для просмотра и экспорта полей из базы данных, но с важными двумя отличиями:
- не использует внешних библиотек;
- не экспортирует в Excel.
Он отображает все таблицы и поля в БД и может экспортировать в sql, csv, json, а также в php в виде небольших массивов, с предварительным просмотром данных в полях всех таблиц вашей БД.
"DB Structure Viewer" и "Export to Excel" это похожие, но разные инструменты для разных задач.
- Для импорта данных разработанны другие плагины, посетите Маркетплейс расширений для Cotonti CMF или смотрите мои разработки в репозиториях на GitHub.
Основные возможности
- Динамический выбор нужных полей из нужной таблицы для экспорта.
- Настройка пользовательских названий колонок первой строки в итоговом файле Excel.
- Ограничение количества экспортируемых строк (настра...
Only Pages tables v.1.0.11
Update README.md
for Cotonti 0.9.26 with PHP 8.2
Uses PhpSpreadsheet 1.23.0 without Composer. Tested on Cotonti 0.9.26 with PHP 8.2
RU
История изменений 17.03.2025. версия 1.0.1
-
Пофиксил сохранение пользователських названий колонок таблицы для создаваемого при экспорте файла Excel.
-
Теперь название полей можно писать на кириллице, на латинском+кириллица.
Например:
ID | ALIAS | Статус | Категория | PAGE_TITLE | TEXT-DESC | PAGE_PARSER | PAGE_OWNERID | PAGE_DATE | Дата обновления | Просмотры
Это позволяет легко и гибко подходить к экспорту, если файл Excel используется для импорта товаров в торговые площадки или интернет магазины, для людей, которые не знакомы с полями таблицы БД в Cotonti.
- Расширено логирование на русском языке.
English
Changelog 1.0.1 (March 17, 2025)
Revision history 03/17/2025. version 1.0.1
-
Fixed saving of custom column names of the table for the Excel file created during export.
-
Now the names of the fields can be written in Cyrillic, Latin + Cyrillic.
For example:
ID | ALIAS | Status | Category | PAGE_TITLE | TEXT-DESC | PAGE_PARSER | PAGE_OWNER ID | PAGE_DATE | Update date | Views
This allows for an easy and flexible approach to exporting if an Excel file is used to import products to marketplaces or online stores, for people who are not familiar with the fields of the Cotonti database table.
- Advanced logging in Russian.
