Plugin Development
ClipBucket was inspired by Wordpress For the Development however its not as efficient as Wordpress, we will try to get things done vial available options
​
Good news is Vodlix & ClipBucket share the same Core for the Plugins

Folder Strucuture

1
- plugins
2
|-plugin_folder
3
|- plugin_name.php
4
|- plugin_name_install.php //Call when plugin is about to install
5
|- plugin_name_uninstall.php //Caled when plugin is about to uninstall
6
​
7
//Example
8
​
9
- plugins
10
|-global_announcement
11
|-global_announcement.php
Copied!

Plugin Meta

Just like wordpress, you have mention the plugin detail at the top in comments just as shown below
1
<?php
2
/*
3
Plugin Name: Global announcement
4
Description: This will let you post a global announcement on your website
5
Author: Arslan Hassan
6
ClipBucket Version: 1.8
7
Plugin Version: 1.0
8
Website: http://google.com/
9
*/
10
​
11
​
Copied!

Plugin Installation Script

This is pure PHP Script, nothing fancy, we usually just call DB Queries in it. e.g
1
​
2
//Creating Table for anncoument if not exists
3
function install_global_announcement()
4
{
5
global $db;
6
$db->Execute(
7
'CREATE TABLE IF NOT EXISTS '.tbl("global_announcement").' (
8
`announcement` text NOT NULL
9
) ENGINE=InnoDB DEFAULT CHARSET=utf8;;'
10
);
11
12
//inserting new announcment
13
$db->Execute("INSERT INTO ".tbl('global_announcement')." (announcement) VALUES ('')");
14
}
15
​
16
​
17
//This will first check if plugin is installed or not, if not this function will install the plugin details
18
install_global_announcement();
Copied!

Plugin Uninstall Script

1
//Function used to uninstall Plugin
2
function un_install_global_announcement()
3
{
4
global $db;
5
$db->Execute(
6
'DROP TABLE '.tbl("global_announcement").''
7
);
8
}
9
​
10
un_install_global_announcement();
Copied!

Resource from ClipBucket

Getting Started With Plugins
ClipBucket Documentation

Global Announcement Tutorial

Creating Advance Global Announcement Plugin for ClipBucket
ClipBucket Documentation

Understanding Plugin Development

​
Last modified 11d ago