Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //Disallow direct Initialization for extra security.
- if(!defined("IN_MYBB"))
- {
- die("You Cannot Access This File Directly. Please Make Sure IN_MYBB Is Defined.");
- }
- // Hooks
- $plugins->add_hook('global_start', 'myfirstplugin_global_start');
- // Information
- function myfirstplugin_info()
- {
- return array(
- "name" => "My First Plugin",
- "description"=> "This is my first plugin! :)",
- "website" => "http://mywebsite.com",
- "author" => "Vernier",
- "authorsite" => "http://mywebsite.com",
- "version" => "1.0",
- "guid" => "",
- "compatibility" => "*"
- );
- }
- // Activate
- function myfirstplugin_activate() {
- global $db;
- $myfirstplugin_group = array(
- 'gid' => 'NULL',
- 'name' => 'myfirstplugin',
- 'title' => 'My First Plugin',
- 'description' => 'Settings For My First Plugin',
- 'disporder' => "1",
- 'isdefault' => "0",
- );
- $db->insert_query('settinggroups', $myfirstplugin_group);
- $gid = $db->insert_id();
- $myfirstplugin_setting = array(
- 'sid' => 'NULL',
- 'name' => 'myfirstplugin_enable',
- 'title' => 'Do you want to enable My First Plugin?',
- 'description' => 'If you set this option to yes, this plugin be active on your board.',
- 'optionscode' => 'yesno',
- 'value' => '1',
- 'disporder' => 1,
- 'gid' => intval($gid),
- );
- $db->insert_query('settings', $myfirstplugin_setting);
- rebuild_settings();
- }
- // Deactivate
- function myfirstplugin_deactivate()
- {
- global $db;
- $db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name IN ('myfirstplugin_enable')");
- $db->query("DELETE FROM ".TABLE_PREFIX."settinggroups WHERE name='myfirstplugin'");
- rebuild_settings();
- }
- function myfirstplugin_global_start(){
- global $mybb;
- if ($mybb->settings['myfirstplugin_enable'] == 1){
- echo "Dies wird IMMER angezeigt xD \n";
- if($mybb->usergroup['cancp'] == 1){
- echo "Dies wird IMMER angezeigt xD";
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement