Recent Topics

New b2evolution programmer

Started by on Feb 24, 2006 – Contents updated: Feb 24, 2006

Feb 24, 2006 17:00    

Is a plugin the best way to implement a new sidebar item? If so, what is the best way to get started with plugin programming?

Feb 24, 2006 20:26

What are you wanting to add to the sidebar? If it's something simple you can just add the code directly to the skin. If you do need to make a plugin, then here's how I suggest you get started:

1. Download b2evolution 1.6-alpha or get the latest code from CVS. (The plugin system has changed quite a bit in the new CVS code, but it's not released yet.)

2. Make a copy of /plugins/_test.plugin.php and rename it to _YOURPLUGINNAME.plugin.php .

3. Start editing. It's pretty well documented, so you should be able to see what code does what. You'll need the SkinTag event to insert things into a skin, and last time I checked, there wasn't a skintag example in the test plugin. So take a look at _categories.plugin.php to see how that part works.

4. When you're ready to test your plugin, install it in the backoffice to see what it does. You can keep working on the plugin after you install it.

Feb 24, 2006 20:31

yes, it's the best way.

You could look at the calendar or the archives list plugins for examples of sidebar item plugins.

Mar 30, 2006 03:03

My PHP skills are not what you would call "advanced", but I think I mostly understand what is going on.

But just to clarify: what does a plugin actually do?

Does it basically define variables, functions, classes, etc., and then all you have to do is make a minor change to your skin (1 line?) to include something complicated like, for example, categories. Or can you actually tell the plugin to insert something into your skin (on to your page) without modifying your skin?

Thanks,

Mar 30, 2006 03:15

Your first guess was right. You have to add something to the skin. It usually looks like this:

Code

$Plugins->call_by_code( 'mostCmts', array() );

That array can contain some more options.


Form is loading...

Photo gallery software – This forum is powered by b2evolution CMS, a complete engine for your website.