I’m trying to create my first plugin with EE and it’s not letting me use the syntax after doing so.
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
$plugin_info = array(
'pi_name' => 'vBulletin Usergroups',
'pi_version' => '1.0',
'pi_author' => 'NGU',
'pi_author_url' => 'http://website.com/',
'pi_description' => 'vBulletin Elite Usergroup',
'pi_usage' => Vbulletinusergroups::usage()
);
class Vbulletinusergroups
{
public $return_data = "";
// --------------------------------------------------------------------
/**
* Vbulletinusergroups
*
* This function returns a list of members
*
* @access public
* @return string
*/
public function __construct()
{
// I'm going to hide this bit for privacy
}
// --------------------------------------------------------------------
/**
* Usage
*
* This function describes how the plugin is used.
*
* @access public
* @return string
*/
public static function usage()
{
ob_start(); ?>
The Vbulletinusergroups Plugin allows you to detect if they are a member of a usergroup on vB.
{exp:Vbulletinusergroups}
<?php
$buffer = ob_get_contents();
ob_end_clean();
return $buffer;
}
// END
}
?>
/* End of file pi.Vbulletinusergroups.php */
/* Location: ./system/expressionengine/third_party/Vbulletinusergroups/pi.Vbulletinusergroups.php */Is there anything wrong with this? When I use {exp:Vbulletinusergroups} in a template I’m getting:
Error
The following tag has a syntax error:
{exp:Vbulletinusergroups}
Please correct the syntax in your template.
Hi Kohnt01, The plugin tag {exp:Vbulletinusergroups} will call the __construct method of your plugin so you need to check the code within it. You can output like:For the above your plugin tag, it will return ABCD. Hope, it would help you.$this->return_data = 'ABCD';
I did actually have this, but if you look in the code I hid it so it wasn’t shared with the public. I’ve put in your example and it’s still telling me that syntax doesn’t exist, so please let me know if I’ve done anything wrong:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
$plugin_info = array(
'pi_name' => 'vBulletin Usergroups',
'pi_version' => '1.0',
'pi_author' => 'NGU',
'pi_author_url' => 'http://website.com/',
'pi_description' => 'vBulletin Elite Usergroup',
'pi_usage' => Vbulletinusergroups::usage()
);
class Vbulletinusergroups
{
public $return_data = "";
// --------------------------------------------------------------------
/**
* Vbulletinusergroups
*
* This function returns a list of members
*
* @access public
* @return string
*/
public function __construct()
{
$this->return_data = 'ABCD';
}
// --------------------------------------------------------------------
/**
* Usage
*
* This function describes how the plugin is used.
*
* @access public
* @return string
*/
public static function usage()
{
ob_start(); ?>
The Vbulletinusergroups Plugin allows you to detect if they are a member of a usergroup on vB.
{exp:Vbulletinusergroups}
<?php
$buffer = ob_get_contents();
ob_end_clean();
return $buffer;
}
// END
}
?>Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.