MyBB Community Forums

Full Version: I don't know what's wrong.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I am a total noob in making plugins.
This is my first.

What did I do wrong?

error :
Parse error: syntax error, unexpected $end in /home/neofus/public_html/beta/inc/plugins/myplugin.php on line 43

My Plugin
[attachment=18785]
(2010-07-03, 09:52 PM)NeoFusion720 Wrote: [ -> ]I am a total noob in making plugins.
This is my first.

What did I do wrong?

error :
Parse error: syntax error, unexpected $end in /home/neofus/public_html/beta/inc/plugins/myplugin.php on line 43

My Plugin


Try it now
unexpected $end usually means that you forgot to close a function }
I closed it and re-uploaded it for him Wink
Error fixed but another one popped up. Now theres something wrong with activation. I think that my plugin contains loads of bugs, so if some experienced plugin maker could fix this I would be so happy Smile
your plugins is not actually doing anything, just changing a template

also theres no is_installed function
(2010-07-03, 11:46 PM)Darkmew Wrote: [ -> ]your plugins is not actually doing anything, just changing a template

also theres no is_installed function
Ya it's meant to do that, and how do I add the installed function?
/**
 * ADDITIONAL PLUGIN INSTALL/UNINSTALL ROUTINES
 *
 * _install():
 *   Called whenever a plugin is installed by clicking the "Install" button in the plugin manager.
 *   If no install routine exists, the install button is not shown and it assumed any work will be
 *   performed in the _activate() routine.
 *
 * function hello_install()
 * {
 * }
 *
 * _is_installed():
 *   Called on the plugin management page to establish if a plugin is already installed or not.
 *   This should return TRUE if the plugin is installed (by checking tables, fields etc) or FALSE
 *   if the plugin is not installed.
 *
 * function hello_is_installed()
 * {
 *		global $db;
 *		if($db->table_exists("hello_world"))
 *  	{
 *  		return true;
 *		}
 *		return false;
 * }
 *
 * _uninstall():
 *    Called whenever a plugin is to be uninstalled. This should remove ALL traces of the plugin
 *    from the installation (tables etc). If it does not exist, uninstall button is not shown.
 *
 * function hello_uninstall()
 * {
 * }
 *
 * _activate():
 *    Called whenever a plugin is activated via the Admin CP. This should essentially make a plugin
 *    "visible" by adding templates/template changes, language changes etc.
 *
 * function hello_activate()
 * {
 * }
 *
 * _deactivate():
 *    Called whenever a plugin is deactivated. This should essentially "hide" the plugin from view
 *    by removing templates/template changes etc. It should not, however, remove any information
 *    such as tables, fields etc - that should be handled by an _uninstall routine. When a plugin is
 *    uninstalled, this routine will also be called before _uninstall() if the plugin is active.
 *
 * function hello_deactivate()
 * {
 * }
 */

and i'm betting the reason the activate is acting funny is because its not sensing if it's installed/activated
Actually it doesnt need to. That is only needed if you need it to run something specifically if it's installed.

Generally you need:

function myplugin_info()
{
//functions here
}

function myplugin_activate()
{
// template adds here
}

function myplugin_deactivate()
{
//reverse those changes here
}
Could someone download the file I posted, and edit it so it works?

Thanks..
Pages: 1 2