Please login or register.

Login with username, password and session length
Advanced search  

News:

You need/want an older version of sNews ? Download an older/unsupported version here.

Pages: [1] 2

Author Topic: Plugin System  (Read 11075 times)

centered

  • Guest
Plugin System
« on: April 02, 2008, 02:29:29 AM »

Since there is discussion on mods and plugins why not bring the discussion to on thread.

I am all for it for a future mod and/or future version of sNews. 

What do you all think?
Logged

Fred K

  • Still trying to learn stuff
  • ULTIMATE member
  • ******
  • Karma: 130
  • Posts: 2728
    • Personal
Re: Plugin System
« Reply #1 on: April 02, 2008, 07:39:26 AM »

It's a good idea. <whisper style="loud">actually I think it's a no-brainer</whisper>
The only issue is the possible impact it has on sNews as a KISS system. But I have faith in the Big Brains of this group... ;)
Logged

funlw65

  • Hero Member
  • *****
  • Karma: 96
  • Posts: 771
    • Country Lab
Re: Plugin System
« Reply #2 on: April 02, 2008, 07:40:51 AM »

Next step of evolution.

This way, sNews will `protect` his core. Untouched by modders, optimized for speed, easy mantained by sNews dudes. For plugin sistem we need an API. And a very good Help/Doc for API. Huge project!
Logged

Armen

  • Sr. Member
  • ****
  • Karma: 41
  • Posts: 338
    • http://www.funnydays.ru
Re: Plugin System
« Reply #3 on: April 02, 2008, 10:38:46 AM »

Next step of evolution.

This way, sNews will `protect` his core. Untouched by modders, optimized for speed, easy mantained by sNews dudes. For plugin sistem we need an API. And a very good Help/Doc for API. Huge project!

... and a lot of conditions in the core, since LOTS of stuff HAS to be hardcoded (in processing(), for example) and mods will be valid only for unmodded version of sNews.

I don't think it's a good idea.
Logged
Now ogres, oh, they're much worse. They'll make a suit from your freshly peeled skin. They'll shave your liver, squeeze the jelly from your eyes... Actually, it's quite good on toast.

centered

  • Guest
Re: Plugin System
« Reply #4 on: April 02, 2008, 12:20:22 PM »

Next step of evolution.

This way, sNews will `protect` his core. Untouched by modders, optimized for speed, easy mantained by sNews dudes. For plugin sistem we need an API. And a very good Help/Doc for API. Huge project!

... and a lot of conditions in the core, since LOTS of stuff HAS to be hardcoded (in processing(), for example) and mods will be valid only for unmodded version of sNews.

I don't think it's a good idea.

First, aren't all mods based on an unmodded version of the core? 
Logged

Armen

  • Sr. Member
  • ****
  • Karma: 41
  • Posts: 338
    • http://www.funnydays.ru
Re: Plugin System
« Reply #5 on: April 02, 2008, 12:27:52 PM »

Next step of evolution.

This way, sNews will `protect` his core. Untouched by modders, optimized for speed, easy mantained by sNews dudes. For plugin sistem we need an API. And a very good Help/Doc for API. Huge project!

... and a lot of conditions in the core, since LOTS of stuff HAS to be hardcoded (in processing(), for example) and mods will be valid only for unmodded version of sNews.

I don't think it's a good idea.

First, aren't all mods based on an unmodded version of the core? 

Yes. But the thing is: one can analyze the mod before applying it to the MODDED sNews instance. When the mod is applied as a module... Are you going to make modular system to have artificial intelligence? If not, then this system is going to... You know what I mean, equilni, I'm sure you do: connect incompatible modules.

And to implement the simpliest modular system to sNews is going to take a LOT of changes to the core and sNews logics. Is it worth even trying, when they'll only be compatible with vanilla snews instance?

Modular system is very good for finalized commercial products - when there's no reason to dive into the code. sNews is a developers dream - do what you want. Why bother trying to constrain the developer?
« Last Edit: April 02, 2008, 12:31:27 PM by Armen »
Logged
Now ogres, oh, they're much worse. They'll make a suit from your freshly peeled skin. They'll shave your liver, squeeze the jelly from your eyes... Actually, it's quite good on toast.

centered

  • Guest
Re: Plugin System
« Reply #6 on: April 02, 2008, 12:54:15 PM »

Why bother wasting development time reimplementing ideas and code that is already present?  And then debugging the copying and pasting or the code itself?  My needs for my clients is to provide proposals and solutions for their needs.  Anything to help decrease development time is helpful since I don't do web design/development full time.

I don't know exactly how to implement a system like this, I am stating that I think one is needed for development purposes.

I am going to get alot of slack for this but....

If sNews is a developers dream, then why are most developers developing for WP? Why are WP templates so popular?  Most bring functionality the engine all to thier own, and bring functionality through plugins to the admin section.  Case in point - K2, need I say more?

*ducks from the rocks*   

Do i want a WP system, NO, but I think we could take what works and try to implement it ourselves.  I did it with ideas from CMSMS. 

Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: Plugin System
« Reply #7 on: April 02, 2008, 02:27:16 PM »

*ducks from the rocks*   
Do i want a WP system, NO, but I think we could take what works and try to implement it ourselves.  I did it with ideas from CMSMS. 

I agree with EQ's logic. It doesn't hurt to get familiar with what works well in WP and other CMSs in the light to mid-weight category... and learn from it.
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

jackp

  • Newbie
  • *
  • Karma: 2
  • Posts: 32
  • But you said "Stick it there!!"
    • Tim Chard - myEmote
Re: Plugin System
« Reply #8 on: April 08, 2008, 04:01:03 AM »

Since a discussion with Eq a few days ago re plugins vs modded packages, and reading other posts on speed and memory, I still have no idea what would work best for performance. But, in my simpleton mind a modded package would not be as good as a plugin one. ?!?!

What is a developer? What are developers developing for? As sNews developer, having a small core to work with is most favourable, I think. As Website developer, having sNews with plugins is most beneficial, I believe. It all depends on where you want to spend you time coding and what you are developing. I personally like using mods for personal projects (because I enjoy learning new methods) but would prefer plugins for clients since they have no appreciation for the art. They just want a working product.

So I say develop Plugins, pretty please.

Even if it is a just Mod  ;D
Logged

centered

  • Guest
Re: Plugin System
« Reply #9 on: April 08, 2008, 04:21:23 AM »

Thanks Jack
Logged

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4867
  • I'm a self-made man and worships my creator.
    • p-ahlqvist.com
Re: Plugin System
« Reply #10 on: April 08, 2008, 07:56:56 AM »

Mhm, I'm beginning to lean t'wards Jasons reasoning more and more... Core could still be small, onefile, and swift, no ? Ok, onefile will perhaps change, but development, and evolution of something, mustn't (hehe, can one say mustn't ;)) stay, get to a hault because there was a certain philosophy in the beginning...

I'm all for having as small core as possible, with as many features possible, but... for the users ease, and so on, a plug in system is something that should be atleast tested... We do still have Lukas "Mod my sNews" that to my knowledge not anyone have been trying to do something more about, eh ? Why not, yet again, start with that, and see where it leads us ?
Logged
"It's only dead fish that goes with the flow... "
Updated

sNews3M

  • Newbie
  • *
  • Karma: 3
  • Posts: 21
  • nothing can be impeccable in this imperfect world
    • Free Multiuser Multilingual Content Management System sNews 3M CMS
Re: Plugin System
« Reply #11 on: September 13, 2009, 04:42:13 AM »

Not have to change anything in sNewsCMS, it must remain a lightweight one-file system
The idea of plugins system should be based on ideology sNewsCMS

That is, the idea is follows:

If sNewsCMS provides plugins connectivity by changing the engine code, then plugins system must replace parts of sNews source code to pieces of plugin code (which can connects the main plugin code in a separate file)
All source code changes should be described in the plugin file
Managed through Admin Panel plugins system following by this descriptions file and replaces code and then make reverse code replacement when you disable or remove the plugin
Also should be described the database changes (direct changes to plugin installation and reverse changes to plugin disable or delete) and list of plugin files for full plugin deleting
Logged
Free Multiuser Multilingual
Content Management System
sNews 3M CMS
sNews MM 1.6.3
please forgive my terrible english :)

nukpana

  • Hero Member
  • *****
  • Karma: 71
  • Posts: 663
Re: Plugin System
« Reply #12 on: September 13, 2009, 07:02:53 AM »

If sNewsCMS provides plugins connectivity by changing the engine code, then plugins system must replace parts of sNews source code to pieces of plugin code (which can connects the main plugin code in a separate file)
All source code changes should be described in the plugin file
Managed through Admin Panel plugins system following by this descriptions file and replaces code and then make reverse code replacement when you disable or remove the plugin
Also should be described the database changes (direct changes to plugin installation and reverse changes to plugin disable or delete) and list of plugin files for full plugin deleting

I think that is already established as to what needs to be done.  The big question is, when will it happen and what release?  2.0 is not even a a glimmer in anyone's eyes and for this to happen for 1.6/1.7, the whole thing would need to be rewritten almost from the ground up.  I will give you a hint:

Code: [Select]
function singlePost() {
$gbl = ResultSet();
execPlugin( 'prePostText' ); // Hooks plugins to this section before the article text
echo execPlugin('postText', $gbl['text']); // This allow the string to be manipulated
execPlugin( 'postPostText' ); // Hooks plugin to this section after the article text
}

Here you can plugin a h2 linkable title mod, h3 description mod, summary mod, image gallery mod, all before the post content.  Then afterwards  you can have your infoline, comment form, etc etc. any which way you want it. But in comparison to the current function articles, alot would need to be stripped out.

« Last Edit: September 13, 2009, 03:04:57 PM by nukpana »
Logged

sNews3M

  • Newbie
  • *
  • Karma: 3
  • Posts: 21
  • nothing can be impeccable in this imperfect world
    • Free Multiuser Multilingual Content Management System sNews 3M CMS
Re: Plugin System
« Reply #13 on: September 13, 2009, 12:01:40 PM »

This idea of addons system not require rewriting sNewsCMS from the ground up.
This idea is not based on plugins hooks, this idea based on replace source code by addons system.
Logged
Free Multiuser Multilingual
Content Management System
sNews 3M CMS
sNews MM 1.6.3
please forgive my terrible english :)

nukpana

  • Hero Member
  • *****
  • Karma: 71
  • Posts: 663
Re: Plugin System
« Reply #14 on: September 13, 2009, 03:04:39 PM »

this idea based on replace source code by addons system.
If I am understanding you correctly, it sounds like Luka's mod my sNews idea here: http://snewscms.com/forum/index.php?topic=5995.0
--sarcasm--  This idea took off very well because of the fact that you have mods that replace mods and you have mod packages and the like.  --/sarcasm--

Most software and CMSs have an API for developers to add functionality.  This CMS should be no different for add on/ plugin whatever functionality.  If it is truely a developer's tool, then it should be defined as such for a developer to work with - refactored code and made to scale.

The below is an example of a hook system.  Alot of CMS systems use something similar.

Code: (Note, globals are replaced by function calls) [Select]
// sudo code
function singlePost() {
   $gbl = ResultSet();
   execPlugin( 'prePostText' ); // Hooks plugins to this section before the article text
   echo execPlugin('postText', $gbl['text']); // This allow the string to be manipulated
   execPlugin( 'postPostText' );   // Hooks plugin to this section after the article text
}

function postListing() {
    $gbl = ResultSet();
    return $gbl['postList'];
}

function postList() {
  $postList = postListing();
  foreach ($postList as $post) {
    execPlugin( 'prePostListText' ); // Hooks plugins to this section before the article text
    echo execPlugin('postListText', $post); // This allow the string to be manipulated
    execPlugin( 'postPostListText' );   // Hooks plugin to this section after the article text   
  }
}

Now I want a customized infoline for the postList h3 header
Code: (Note, globals are replaced by function calls) [Select]
install-h3-hdr();
function install-h3-hdr() {
   $activePlugins = activePluginList();  // the func would query the db for active plugins
   if ( !in_array( 'this-h3-hdr', $activePlugins ) ) {
      if (  s( 'topInfoline' ) )  // delete this from settings
  } else {
    if  (  s( 'topInfoline' ) ) return;
    else // install into settings
  }
}

// what function, and where to apply it
addPlugin( 'this-h3-hdr', 'prePostText' );
addPlugin( 'this-h3-hdr', 'prePostListText' );

function this-h3-hdr() {
   $gbl = ResultSet();
   if ( s( 'topInfoline' ) != 1 ) return;
   else {
      return '<h3>Written by '.$gb;['author'].' and tagged '.$gbl['tags'].'</h3>';
   }
}

Alot easier don't you think?
 
« Last Edit: September 13, 2009, 04:32:03 PM by nukpana »
Logged
Pages: [1] 2