2011-09-19, 06:46 PM
I made a test plugin and it works fine, i.e. activate add sample data to index template , and upon deactivating it also works fine, i.e. remove sample data. I am getting this error when I activate this plugin and check my index page. and got this error on index page.
Here is the my test plugin code,
Warning [2] call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'testplugin' was given - Line: 100 - File: inc/class_plugins.php PHP 5.2.17 (Linux)
Here is the my test plugin code,
<?php
if(!defined("IN_MYBB"))
{
die ("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
}
$plugins->add_hook("index_start","testplugin");
function testplugin_info()
{
return array(
"name"=> "test plugin",
"description"=> "This is test description",
"website"=> "www.example.com",
"author"=> "sunjava1",
"authorsite"=> "www.vubscs.tk",
"version"=> "1.0",
);
}
function testplugin_activate(){
require MYBB_ROOT."/inc/adminfunctions_templates.php";
find_replace_templatesets("index", "#".preg_quote('{$forums}')."#i", '{$forums} <br> this is test ');
}
function testplugin_deactivate(){
require MYBB_ROOT."/inc/adminfunctions_templates.php";
find_replace_templatesets("index", "#".preg_quote('{$forums} <br> this is test ')."#i", '{$forums}');
}
?>