1 edb Mar 15, 2008 04:12
3 edb Mar 15, 2008 07:11
Button locations WITHIN any given toolbar won't be affected, but the ORDER of the toolbars probably will.
Untested because I've moved my toolbars all over the back office, but I'm pretty sure that ... aw heck one sec and lemme look at something...
Okay yeah what will happen is that the toolbar-generating plugin with the lowest number will be on the top of the toolbar stack. So in the example above instead of seeing smilies ABOVE videos you would get videos on top.
BTW I do not know how it decides which is on top (for toolbars) or which renders first (for renderers) when two plugins have the same priority.
4 john Mar 15, 2008 07:14
Cool, thanks for that. I will fiddle with ID's and see what happens.
5 edb Mar 15, 2008 07:32
One thing I couldn't do because it is a very simple hack is group them by if it is a renderer or not. Really it's only the renderers that matter wrt priority, but I didn't see a simple way to ensure having only that type show up, or to group them that way.
6 john Mar 15, 2008 08:51
It strikes me that an adapted version of this would be a great way to publish a list of CREDITS to developers of ACTIVE plugins......
off to read your code :)
7 edb Mar 15, 2008 10:04
That'd be an adaptation of BOPIT - not this tiny little hack. All this hack does is read what's in the evo_plugins table, and information there is very sparse. For example "plug_name" and "plug_shortdesc" are actually null in all my plugins according to that table, and the idea of "author" doesn't even exist in that table.
I suppose if I was smart and not so hung up on getting it done and calling it done I'd have queried the evo_pluginevents table to find which ones were html renderers so I could at least group them together. Probably find that within that group you find the toolbar makers too. I'm not sure that there will be findable cases of priority conflict outside of the renderers yah? So really I should go back in time, not post this, correct it with another table query, then accelerate the the present and ask "what am I talking about because it's all there". But hey I'm lazy about that sort of thing.
PS: I actually started with BOPIT as source material and gave up very quickly due to my inability to grasp concepts more advanced than "shiny object".
8 yabba Mar 15, 2008 10:51
John wrote:
It strikes me that an adapted version of this would be a great way to publish a list of CREDITS to developers of ACTIVE plugins......
off to read your code :)
Like this ( [url=http://waffleson.co.uk/2007/10/credits]credits[/url] ) ? :roll:
To get a list of the renderer plugins you could do something like this :
global $AvailablePlugins;
if( empty($AvailablePlugins) || ! is_a( $AvailablePlugins, 'Plugins_no_DB' ) )
{
load_class('plugins/model/_plugins_admin_no_db.class.php');
$AvailablePlugins = & new Plugins_admin_no_DB();
$AvailablePlugins->discover();
$AvailablePlugins->sort('priority');
}
$AvailablePlugins->restart();
while( $a_Plugin = & $AvailablePlugins->get_next() )
{
if( in_array( $a_plugin->apply_rendering, array( 'opt-in', 'opt-out', 'stealth', 'lazy' ) )
{ // this is possibly a renderer plugin
echo $a_plugin->name.' - priority '.$a_plugin->priority;
}
}
Completely untested of course ;)
¥
9 john Mar 15, 2008 11:00
So, where do I put that, and be nice!!
10 yabba Mar 15, 2008 11:02
The code was for EdB ;)
I can send you a copy of my credits plugin if you want that?
¥
11 edb Mar 15, 2008 11:14
Nah man I'm not too interested in running a list like that, but it's a cool plugin for sure. For most people it'd be cool is what I mean. For you it's just a way to give yourself link-love :roll:
You should publish that plugin if it doesn't rely too much on the rest of whatever you've done to your core to make it happen.
Oh wait a minute: does it talk about installed plugins or just uploaded ones? I noticed after adding whatever plugin I just made to BOPIT that BOPIT told me I was missing one of my own, so I uploaded it but didn't install it. BOPIT told me I had the latest version and was good to go - green. er... uh... er... :roll:
For the purposes of this tiny little hack all I wanted to do was be able to see all the plugin priorities at a glance, and change them if need be. Knowing nothing about $AvailablePlugins, and having a direct link to PHP, I figured I could talk to the database and get some good info from it. I was obviously wrong given that the database doesn't know jack, but I have actually managed to improve my little hack a little bit. It now sorts the plugins into "HTML Renderers", "Toolbar Makers", and "Everything else".
And now I'm desperately concerned that I totally screwed up something. Something like auto-P and it's inability to play nice under almost any condition stk can put into practical use yah?
12 john Mar 15, 2008 11:20
I can send you a copy of my credits plugin if you want that?
Yes, I would like that. As EdB said, it should be a public plugin in fairness to all plugin developers
13 yabba Mar 15, 2008 11:58
EdB wrote:
For most people it'd be cool is what I mean. For you it's just a way to give yourself link-love :roll:
I need to get out more ;)
EdB wrote:
Oh wait a minute: does it talk about installed plugins or just uploaded ones?
That snippet showed all uploaded plugins. This one from my credits plugin just shows installed ones ... ish
function get_plugin_list()
{
global $Plugins;
$credits = array();
$download_link = $this->get_htsrv_url( 'download' );
foreach( $Plugins->index_ID_rows as $installed_plugin )
{
$a_plugin = & $Plugins->get_by_ID( $installed_plugin[ 'plug_ID' ] );
if( $a_plugin->name != $this->name )
{
$credits[ strtolower( $a_plugin->name ) ] = '<li>'.( $a_plugin->group == 'AstonishMe' ?
action_icon( 'download the plugin', 'download', $download_link.'&am_plug='.$a_plugin->code ).' '
: '' ).'<a href="'.$a_plugin->get_help_url().'" title=" visit the plugins help page " class="ext">'.
( empty( $a_plugin->name ) ? 'Unknown' : $a_plugin->name ).' v'.$a_plugin->version.'</a> by '.$a_plugin->author.'</li>';
}
}
ksort( $credits );
return '<ul>'.implode( '', $credits ).'</ul>';
}
( code broken to fit forums )
John wrote:
I can send you a copy of my credits plugin if you want that?
Yes, I would like that. As EdB said, it should be a public plugin in fairness to all plugin developers
Give me chance to delete all the auto zip stuff and I'll zip it up ;)
¥
Ok, so if I go through and give each plugin it's own unique ID number it wont effect which anything else like button location in the toolbars etc etc?