2006-01-08, 10:28 PM
Greetings everyone,
Please bear with me, I am not very experienced with plugins or php. I read the instruction in the readme for making Easy Install plugins, but when I try out my plugin nothing works. Here is the code (the file is called mybbseo.php):
With this plugin, I am trying to achieve a file edit in calendar.php that changes:
I really appreciate anybody's help. Thanks!
Please bear with me, I am not very experienced with plugins or php. I read the instruction in the readme for making Easy Install plugins, but when I try out my plugin nothing works. Here is the code (the file is called mybbseo.php):
<?php
function mybbseo_info()
{
return array(
"name" => "MyBB SEO",
"description" => "--",
"website" => "--",
"author" => "--",
"authorsite" => "--",
"version" => "1.0",
//A link to a page with update information. It should be a dynamic page because variables are passed to it
"update" => "--",
//Will you allow your user to be able to update the plugin with an automatic script?
"update_download" => TRUE,
//Does this file have a readme? (it should be stored in "PLUGIN_NAME_readme()" function)
"readme" => TRUE,
//Do you want to force people to read the readme before they install it?
//There isn't much point in setting this to true. They need to have the plugin active before it can be used =P
"force_readme" => FALSE,
//EI Compatiable
"ei" => TRUE,
);
}
$mybbseo_install = array();
$ei_install_index = 0;
$mybbseo_install = array();
$mybbseo_install[$ei_install_index] = array();
$mybbseo_install[$ei_install_index]['file'] = 'calendar.php';
$mybbseo_install[$ei_install_index]['find'] = array();
$mybbseo_install[$ei_install_index]['find'][] = 'addnav($lang->nav_calendar, "calendar.php");';
$mybbseo_install[$ei_install_index]['code'] = array();
$mybbseo_install[$ei_install_index]['code'][] = 'addnav($lang->nav_calendar, "calendar.html");';
$mybbseo_install[$ei_install_index]['position'] = 'replace';
//Your activation function
function mybbseo_activate(){
global $plugin_ei, $config, $mybbseo_install;
if(defined('EI_INSTALLED') && EI_INSTALLED){
$plugin_ei->setupEI(mybbseo_info());
$plugin_ei->install($mybbseo_install);
}
}
//Your deactivation function
function test_plugin_deactivate(){
global $plugin_ei, $config, $mybbseo_install;
if(defined('EI_INSTALLED') && EI_INSTALLED){
$plugin_ei->setupEI(mybbseo_info());
$plugin_ei->uninstall($mybbseo_install);
}
}
?>
With this plugin, I am trying to achieve a file edit in calendar.php that changes:
addnav($lang->nav_calendar, "calendar.php");
toaddnav($lang->nav_calendar, "calendar.html");
I really appreciate anybody's help. Thanks!