MyBB Community Forums

Full Version: Having some funny issue with a new plugin
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I made a simple plugin which does some template edits...and they work fine..the only Issue im seeing is even if the Plugin is activated

In the Plugin List the Control still shows " Install & activate this bad boy "
And does not change to "Deactivate"

This is the structure of the plugin which I have.

Quote:<?php
if(!defined("IN_MYBB"))
{
die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
}

function myplugin_info()
{
//Return Array code given here!!
}

function myplugin_install()
{
}

function myplugin_activate()
{
global $lang;
require MYBB_ROOT.'/inc/adminfunctions_templates.php';
//The template edit code given here
}

$plugins->add_hook("memberlist_start", "myfunc");
function myfunc_loadhook()
{
global $lang;
//Loaded a lang file
}

function myplugin_is_installed()
{

}

function myplugin_deactivate()
{
require MYBB_ROOT.'/inc/adminfunctions_templates.php';
//Given the template Replace code here to replace what had been changed
}

function myplugin_uninstall()
{
}

?>

When it gets activated all my codes run properly but the only issue I see is that the Text does not change to Deactivate
[Image: 2usvrcz.png]
Remove the myplugin_install(), myplugin_uninstall() and myplugin_is_installed() functions. They are just needed if you want to make something there. And then you have to change the myplugin_is_installed() function in a way, that it returns true if the plugin is installed Wink
Wow that worked... Smile thanks a lot!!!