I’m adding some outside database queries to a EE template. It works great, but whenever I uncomment the pi_usage section of the $plugin_info array, it seems that the usage code is always run. When I view all the plugins, it just shows the usage information for my plugin, and when I view a template that uses the plugin, I just get the text for the plugin.
Here’s most of the code:
<?php
$plugin_info = array(
'pi_name' => 'E21 Price Lookup',
'pi_version' =>'0.75',
'pi_author' =>'David Lim',
'pi_description' => 'E21 Product Price Lookup (US Only)',
'pi_usage' => E21_price::usage()
);
/**
* E21_price Class
*
* @package ExpressionEngine
* @category Plugin
* @author David Lim
* @copyright Copyright (c) 2010, David Lim
*/
class E21_price {
var $return_data = '';
function E21_price() {
...
}
function usage() {
ob_start();
?>
The E21 Plugin provides product information from E21.
{exp:e21_price}part_code{/exp:e21_price}
<?php
$buffer = ob_get_contests();
ob_end_clean();
return buffer;
}
}Any suggestions?
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.