dondominio / ddnotes
一款用于管理邮箱内笔记的插件。该插件的主要优势在于其将笔记直接保存到数据库中的方式。
Requires
- php: >= 7.3
This package is auto-updated.
Last update: 2024-09-26 07:42:44 UTC
README
本插件旨在将用户的笔记直接保存到数据库,而不是文件系统中。
您可以使用EasyMDE Editor创建基于文本的笔记,包括纯文本、Markdown或HTML。
此外,您还可以上传PDF文件和图片作为笔记保存。在插件中创建的任何类型的笔记都可以随时下载。
以下技术被用于开发它
安装
从本仓库下载所有文件,将父文件夹重命名为 ddnotes
并将其移动到Roundcube的 plugins
文件夹。
- 将此插件文件夹放入Roundcube的
plugins
目录中 - 将
ddnotes
添加到您的Roundcube配置中的$config['plugins']
从GitHub下载插件时,您需要创建一个名为 ddnotes
的目录并将文件放入其中,忽略下载存档中的根目录。
文件结构如下
📦ddnotes
┣ 📂includes
┃ ┣ 📂DOMPurify
┃ ┣ 📂fontawesome
┃ ┣ 📂marked
┃ ┣ 📂tinymde
┃ ┣ 📜ddnotes_model.php
┃ ┗ 📜ddnotes_response.php
┣ 📂localization
┃ ┣ 📜ca_ES.inc
┃ ┣ 📜de_DE.inc
┃ ┣ 📜en_US.inc
┃ ┣ 📜es_ES.inc
┃ ┗ 📜fr_FR.inc
┣ 📂skins
┃ ┣ 📂elastic
┃ ┃ ┣ 📂css
┃ ┃ ┃ ┗ 📜main.css
┃ ┃ ┣ 📂js
┃ ┃ ┃ ┗ 📜main.js
┃ ┃ ┗ 📂templates
┃ ┃ ┃ ┗ 📜index.html
┃ ┗ 📂larry
┃ ┣ 📂css
┃ ┃ ┗ 📜main.css
┃ ┣ 📂images
┃ ┃ ┣ 📜note.png
┃ ┃ ┣ 📜note_both.png
┃ ┃ ┗ 📜note_selected.png
┃ ┣ 📂js
┃ ┃ ┗ 📜main.js
┃ ┗ 📂templates
┃ ┗ 📜index.html
┣ 📂SQL
┃ ┣ 📜mssql.initial.sql
┃ ┣ 📜mysql.initial.sql
┃ ┣ 📜oracle.initial.sql
┃ ┣ 📜postgres.initial.sql
┃ ┗ 📜sqlite.initial.sql
┣ 📜LICENSE
┣ 📜README.md
┣ 📜composer.json
┣ 📜config.inc.php.dist
┣ 📜ddnotes.php
┗ 📜defaults.inc.php
配置文件
此步骤不是必须的。此插件已包含一个具有必要配置的 default.inc.php
以正确运行。
在第一级文件夹中,您将找到一个名为 config.inc.php.dist
的文件。您必须复制它并将副本重命名为 config.inc.php
并编辑插件参数。
cd plugins/ddnotes
cp config.inc.php.dist config.inc.php
在此文件中,您可以调整插件设置以限制它允许的文件扩展名。还可以调整笔记的 upload_max_filesize
和 note_max_filesize
。
/** * Max size of the note. Notes content are saved via `longblob` column type. * The size of this column is not the same as the file size at the computer filesystem. * So this value must be always greatter than the upload_max_filesize. * This value is represented as bytes. * null refers to no limit */ "note_max_filesize" => null, /** * Max size of the files/images uploads. * This value must be always smaller than the note_max_filesize. * This value is represented as bytes. * null refers to server upload_max_filesize */ "upload_max_filesize" => null,
允许的格式如下
图像
- .jpeg
- .jpg
- .png
文件
文本
- .txt
- .md (markdown)
- .html
这是在 config.inc.php.dist
中的默认扩展名配置
/** * Extensions that plugin supports */ "extensions" => [ /** * Image extensions for upload */ "image" => ["jpg", "jpeg", "png"], /** * File extensions for upload */ "application" => ["pdf"], /** * Text file extensions for upload * They must be plain text based because they will be used with the editor * Tested with "markdown", "plain" and "html" * The first extension on this array will be the default at Elastic skin */ "text" => ["plain", "markdown", "html"], ]
编辑 config.inc.php
如果您想更改允许的笔记格式,例如不允许.html文件,只需从 "text"
数组中删除 "html"
。
索引 "image"
、"application"
和 "text"
必须始终存在,即使它们为空。
MySQL表
此插件将信息保存到数据库中,因此需要创建一个表来保存这些信息。为此,我们将使用来自 SQL
文件夹的创建文件,具体取决于我们使用的数据库。您可以打开它们并直接运行其内容。在MySQL的情况下,您可以通过PHPMyAdmin或终端执行此操作。
mysql -u USER -p PASS < /folder/to/roundcube/plugins/ddnotes/SQL/mysql.initial.sql
支持的语言
- es - 西班牙语
- ca - 加泰罗尼亚语
- en - 英语
- fr - 法语
- de - 德语