Enthropia Labs

Please login or register.

Login with username, password and session length
Advanced search  

News:

Welcome to the new iBegin Labs forum!

Author Topic: Feedback: Custom Extensions  (Read 397 times)

David Cramer

  • Developer
  • Administrator
  • Sr. Member
  • *****
  • Posts: 448
    • View Profile
    • Email
Feedback: Custom Extensions
« on: May 23, 2009, 03:02:39 pm »
For 1.0, what would you like to see changed or included in the "easy to use" API for creating your own extensions?

I think it's fairly straightforward and works well right now but the biggest change I can see is making extensions easier to distribute.

What I'm thinking, is that rather than a local_feeds.inc.php we'll do two things:

1: extensions/

Extensions would be placed in the extensions subfolder, rather than piled into a single file. This will allow you to easily distribute your extension as a zip file (folder->extension.php+icon.png).

2: themes/

All of the pages which are rendered (outside of the admin) would be stuck into a themes/default/ directory.
Logged

David Cramer

  • Developer
  • Administrator
  • Sr. Member
  • *****
  • Posts: 448
    • View Profile
    • Email
Re: Feedback: Custom Extensions
« Reply #1 on: May 23, 2009, 07:32:58 pm »
New extension support is in 0.99.7, here's the current README text:

Please see the included wpcodex extension for an example of how to create a custom extension and include it.

Extensions should in the following format:

   extensions/<name>/
   extensions/<name>/extension.inc.php -- define your extension class here
   extensions/<name>/icon.png -- 16x16 identifying image

You may include multiple classes in extension.inc.php, but without overriding get_icon_url they will all try to use icon.png.

Your class must still be registered using the following line of code:

   $lifestream->register_feed('ClassName');
Logged

rpcutts

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Feedback: Custom Extensions
« Reply #2 on: October 05, 2009, 12:15:37 pm »
I copied the wpcodex folder and renamed it testfeed.
I then changes a fe of the lines so it's like this:

Code: [Select]
<?php
class Lifestream_TestFeed extends Lifestream_WikipediaFeed
{
const ID 'testing';
const NAME 'TestFeed';
const URL 'http://www.google.com/';

function get_public_url()
{
return 'http://codex.wordpress.org/index.php?title=User:'.urlencode($this->options['username']);
}

function get_url()
{
return 'http://codex.wordpress.org/index.php?title=Special:Contributions&feed=rss&target='.urlencode($this->options['username']);
}
}
$lifestream->register_feed('Lifestream_TestFeed');
?>


The testfeed does not appear in the plugin.
Is there more to it?
Logged

rpcutts

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Feedback: Custom Extensions
« Reply #3 on: October 05, 2009, 03:58:11 pm »
hmmm... I think it was a cache issue.
Logged