1 edb Aug 07, 2009 14:18
3 edb Aug 07, 2009 16:30
That's what I figured would have to be done, or maybe just leave it out entirely, but then I noticed another problem. The second (and in theory multiple) installation of the plugin doesn't have a 'code' associated with it. I assume because the code is already in use? Anyway when going to the widgets subtab on a blog's settings one sees only one opportunity to select the plugin. That might be related to the lack of code for the subsequent installations?
I just thought of something, which made me think of something else. My mind is so full of shit it should be quite fertile with regard to growing ideas eh? I'm going to ponk around in my head and see if I can't mentally imagine a way to have the plugin make a tools subtab which then creates "free html" bits that can be selected via a widgets subtab. Dunno.
For a cheap answer I could simply make a plugin that gets one installation and is named appropriately for the specific end use in mind, then copy it with new name and code for the next purpose. And so on. Not so bad for someone who is hip to playing inside a plugin, but it'll technically address the root issue I'd like to resolve.
4 yabba Aug 07, 2009 18:00
For the "unique code" bit, this works in whissip
function PluginInit()
{
$this->short_desc = $this->T_('Eventually this will be a working plugin!');
if( empty( $this->code ) && $this->ID > 0 )
{
$this->code = 'amblogmenu_'.$this->ID;
}
}
With or without a code I see all instances in widgets.
As an aside, to have unlimited installs it's less coding to not define $number_of_installs in the first place ;)
class am_blogmenu_plugin extends Plugin
{
var $name = 'AM Blog Menu';
var $code = 'amblogmenu';
var $priority = 50;
var $version = '0.1';
var $author = 'AstonishMe';
var $group = 'AstonishMe';
var $help_url = '';
var $apply_rendering ='never';
function PluginInit()
{
$this->short_desc = $this->T_('Eventually this will be a working plugin!');
if( empty( $this->code ) && $this->ID > 0 )
{
$this->code = 'amblogmenu_'.$this->ID;
}
}
Not tried for unique (definable) title yet, but bets it's easily doable ;)
¥
*edit*
*cough* this comes from the muppet that defines $apply_rendering ... be warned :P
5 edb Aug 07, 2009 20:03
¥åßßå wrote:
*cough* this comes from the muppet that defines $apply_rendering ... be warned :P
HEY! Are you calling me a muppet?!?!? I always define all the bits. In alphabetical order.
I'll play with it but for now I'll be happy with single-purpose plugins with one instance each.
6 yabba Aug 07, 2009 21:26
EdB wrote:
I always define all the bits. In alphabetical order.
That just makes you an AnalMuppet :|
Widgets used to be able to have custom titles, based on plugin (instance) title, in the widget list though ;)
¥
7 blueyed Oct 08, 2009 16:07
I think the code could/should get enumerated automatically, if it's already in use.. - during install of a second instance of the plugin.
8 edb Oct 08, 2009 16:21
That'd be really smart :)
Throw in having it automagically put a (#) after the name in the plugin list and you got yourself a ... a ... (#) after the name in the plugin list I guess.
With NiBL List I had to give it a second code then change the name to something different is the thing. On the plugins tab and the widget list it gave it the stock name twice - of course - so you just have to know to do that.
EdB wrote:
Just set it to NULL.
Well, perhaps you could change Plugin::$name dynamically? I know this would be kind of ugly, but I don't know of another way.