Add an Admin Menu Link to a Custom Plugin

Link: https://support.brilliantdirectories.com/support/solutions/articles/12000024699

This article explains how to add a custom plugin to the Plugins menu in the website's Admin area.

Plugin menu links are stored in the plugin_records database table. Each record defines a plugin's display name, destination URL, and whether it is active.

Database Table

PropertyValue
Table Nameplugin_records
Storage EngineInnoDB
Collationutf8mb4_unicode_ci

Table Structure

The plugin_records table contains the following columns:

ColumnDescription
plugin_record_idPrimary key.
activeDetermines whether the plugin appears in the Admin area (1 = Active, 0 = Inactive).
variable_nameUnique internal identifier for the plugin.
nick_nameDisplay name shown in the Plugins menu.
link_urlURL used to access the plugin. For example: /admin/go.php?widget=XXXXXXXXXXX

Creating the plugin_records Table

Log in to the website's database.

If the plugin_records table does not already exist, run the following SQL statement:

Copy
CREATE TABLE IF NOT EXISTS `plugin_records` (
    `plugin_record_id` bigint(20) NOT NULL AUTO_INCREMENT,
    `active` tinyint(1) NOT NULL,
    `variable_name` varchar(80) NOT NULL,
    `nick_name` varchar(80) NOT NULL,
    `link_url` varchar(100) NOT NULL,
    PRIMARY KEY (`plugin_record_id`),
    UNIQUE KEY `variable_name` (`variable_name`)
) ENGINE=InnoDB
DEFAULT CHARSET=utf8mb4
COLLATE=utf8mb4_unicode_ci
COMMENT='This table stores links to widgets accessed through go.php';

Adding a Plugin

Create a new record in the plugin_records table using the column structure described above.

The link_url field accepts a complete URL rather than only a widget name. This allows additional GET parameters to be included when needed.

Note: There is currently no Admin interface for managing plugin_records. New records must be added directly to the database.