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 [3]

Author Topic: split snews , more customizable ,install mods easier  (Read 20211 times)

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
split snews , more customizable ,install mods easier
« Reply #30 on: May 03, 2007, 11:22:36 am »

Even though you say your kidding... I don't think you should go about doing your own open source project named mNews... I think if you start this, eventually when time permits, do it here... I'm sure there will be people offering their help once you started...

Even though the base script, sNews, is the lightest, simplest, fastest CMS around, and that the main engine is this onefile system, there is nothing preventing the forum members to create some other branches of sNews, such as Bob's MUsNews... (Multiuser version)... Your idea, would certainly attract many people, although not the core population of sNews dudes, that think the first and best idea, is the one to persue...

Thing is that the sole script is made for ease, and simplicity when doing a website... All discussions of modding comes when you know more things (which is not the most common thing... it's just that we, that have this demand, seem to be more visible, right...) and becomes interesting as we do want to add nifty things, but the common user don't need to add these things, but uses sNews only for what it's intended from the start... An easy way of putting up news on the web.

This meaning that this script (the on file "simple" snews) is what is being developed and improved upon all the time. Do a part of the community want another "branch" it's great, but not fully supported by the sNews developers as they focus on the single file mainly...

Oh, I'm rambling, and I'm not sure I say what I'm thinking, but I mean well ;)
Logged
"It's only dead fish that goes with the flow... "
Updated

Ghassem Tofighi

  • Full Member
  • ***
  • Karma: 9
  • Posts: 104
    • http://ght.ir
split snews , more customizable ,install mods easier
« Reply #31 on: May 03, 2007, 02:08:02 pm »

Dear Patric
branching is a good idea.But I'm in a course of military services in my country and I have No Time unfortunately.
I think sNews is a very good base for a very good cms, I saw phpnuke,joomla,wordpress,movable type and ,,,,
the best thing around sNews is power near simplicity! I can memorize all codes to do my job best. I can mastar on code and do what I want,I have to many ideas but unfortunately no time to do :(
I think you must start a tracking system sooner (like trac : http://trac.edgewall.com that I mentioned before) , then good programmers comes here to improve the power with Mods. I think the main engine must be as simple as is, and the power is based on sNews Mods...Like linux core and to many based on linux applications,Like Firefox and to many powerfull extensions. Like sNews and too many Mods in future ;)
Logged
Be A Color Pencil For Painting The World !

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
split snews , more customizable ,install mods easier
« Reply #32 on: May 03, 2007, 02:19:42 pm »

Yupp, I think that is what I'm saying aswell...
Logged
"It's only dead fish that goes with the flow... "
Updated

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
split snews , more customizable ,install mods easier
« Reply #33 on: May 03, 2007, 02:44:15 pm »

I see this as a good discussion. As Agentsmith pointed out a few posts up, several of us have different ideas on how we want to use sNews... site types, added functionality, ease of use for end-users, etc. What we have to remember is that sNews is relatively "new" to most of us as a CMS. I've only been working with it for i year... and I'm still here and working with it because it is a simple system and it has helped me learn to use PHP a lot more than I did at first.

We sNews Dudes continue to 'preach' the principle of keeping sNews in its current simple platform, but I  am looking for a way to add other features in a modular fashion without altering the core snews.php file very much. At this point, I keep adding my ideas to my "to-do" list. But I still haven't settled on how to approach this task. I want to give it enough thought so I can end up with a fairly flexible approach without having to change direcction mid-stream. Eventually... at least for me... a 'bright light' will flash on in my head and that's when I'll get started on it. And... if someone else gets started on it before me, all the better. The key is to share it here to advance the sNews project.
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

tarmithius13

  • Sr. Member
  • ****
  • Karma: 7
  • Posts: 469
split snews , more customizable ,install mods easier
« Reply #34 on: May 03, 2007, 06:54:35 pm »

Baker that is excellent, I did not think of doing that. And if you remove the mod it will affect anything since it will just revert back to the original. Brilliant!!!!
Logged
The trick to flying is to throw yourself at the ground and miss.

Free sNews templates HERE

Ghassem Tofighi

  • Full Member
  • ***
  • Karma: 9
  • Posts: 104
    • http://ght.ir
split snews , more customizable ,install mods easier
« Reply #35 on: May 03, 2007, 07:33:58 pm »

Good job bakercad
but there is the same problem...,how we can split the mods from the main engine?
I love sNews because it split design and code.I write some code that I named it language_select function and I switch between tow language easily! it's because of splitting design and code.
I think a new cms that has 3 units that are accomplish with each other but they are act separately that changing one unit has no effect to another parts:

1)Main engine (only snews main engine)
2)Design engine(only css and index.php file)
3)Extension (Mod) Engine (that add mods)

I'm speaking about some new branch of sNews.
Logged
Be A Color Pencil For Painting The World !

piXelatedEmpire

  • MIA
  • ULTIMATE member
  • ******
  • Karma: 37
  • Posts: 1401
  • currently MIA
split snews , more customizable ,install mods easier
« Reply #36 on: May 04, 2007, 01:51:29 am »

wow baker that is a terrific solution! The only cath I can see if if you need to MOD several function for several different MODS, the overlapping of MODded function files.

Still, it leaves the core relatively untouched.  I think I'm going to employ this approach for future projects! Cheers! :D
Logged
my apologies to the sNews crew, but I will be MIA for the forseeable future

Ghassem Tofighi

  • Full Member
  • ***
  • Karma: 9
  • Posts: 104
    • http://ght.ir
split snews , more customizable ,install mods easier
« Reply #37 on: May 04, 2007, 02:59:39 pm »

let think about bakercad solution, Is it possible to add in each function such trick?
Logged
Be A Color Pencil For Painting The World !

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
split snews , more customizable ,install mods easier
« Reply #38 on: May 04, 2007, 03:16:21 pm »

Quote from: ght
let think about bakercad solution, Is it possible to add in each function such trick?
(saying the same thing in a different way...)

You can use Bakercad's solution (post #35) in any function within snews.php. Its purpose is to cause a new function of the same name in a new file (in his mods folder) to override the existing function... or allow the existing function to operate if the new function file does not exist. So, with this in mind, you could leave the override string(s) in the existing function and take the override function file out of the mods folder and the existing function will still operate.
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

Ghassem Tofighi

  • Full Member
  • ***
  • Karma: 9
  • Posts: 104
    • http://ght.ir
split snews , more customizable ,install mods easier
« Reply #39 on: May 04, 2007, 05:06:29 pm »

bakercad solution is improved in this way :

Mod_Grabber mod :D
-----------------------
1) add a table of mods with these fields:
               A)name    B)author  C)information     D)version E)active

sample data :  archive - bakercad - bakercad's mod -   1.0      - YES

2)add this function to the core :

function mods($variable) {
$mod_active = retrieve('active', 'mods', 'name', $variable);
if (file_exists(db('modpath').$variable.'.php') && $mod_active=='YES')

{ include(db('modpath').$variable'.php');
  return true;
}
    else {
  return false;
}

3)add a section in "administration" in the "site" section below the "Setting" that has name : "Mods"
you should add mods in this variable too.
$l['cat_listSEF'] = 'home,archive,contact,sitemap,rss,login,administration,admin_category,admin_article,article_new,extra_new,page_new,categories,articles,extra_contents,pages,settings,files,logout';
you should write a functions to grab all mods from mod directory.and show in this section and a link to active/deactive each mod.

4)in each function you must do what bakercad did. with this change:

function archive() {
    if (!mods ('archive'))
    {
    echo '

'.l('archive').'

';
    }
}


BUT THE MAIN PROBLEM:

mods in general change multiple functions.this is very important consideration in mod management section.
bakercad's solution only consider such mods that only deal with one function.yes it's really easy to change one function with an external php file.but the main problem is designing an architecture that will be independent from the core.there will be conflicts if we don't consider this problem.change each function leads to errors in to many another mods.(it's similar to linux package dependencies!)

A WEAK SOLUTION -Second type of Mods:Plugins
I suggest a weak solution,we have an external php function for each basic function and if any plugin change some function you must change that function in that external file (and don't change the core)
I mean plugins have a shared directory of external functions of main sNews core and if you want to change each function of sNews you must change or create that function in mods directory.if there is not an external function (like archive.php) sNews uses it's original function,but if there is,sNews use that external.

Now when you write a new plugin you must only mention which sections of each function must be changed.the shared mod directory is for this changes.

for example you wrote a plugin with this name : print_friendly

1)this function change functions a,b,c,d.

2)in mods directory you create/change a.php, b.php, c.php, d.php (change when another plugin use the modified a or be or c or d function,create when for the first time this plugin use a modified version)

3)in plugin directory (directory that has print_friendly.php) you create a directory for each plugin to make what you want with this plugins (for example you want use a css,some images and...all connections is handled by print_friendly.php)

4)there will be a plugin management section for active/deactive and ..., and when you deactive it you must manually change external functions.

it maybe there was such errors in my writings and codes and it because when I was writing this post I was in hurry!I hope you understand what I said ;)
Logged
Be A Color Pencil For Painting The World !

mofey

  • Newbie
  • *
  • Karma: 0
  • Posts: 2
split snews , more customizable ,install mods easier
« Reply #40 on: May 15, 2007, 11:53:31 pm »

Why you don't want sNews to be a new Wordpress?
What do you want it to be? A Joomla-in-one-file?

I think there needs to be an easy way to install mods. This is a very important feature and is very popular among different projects actually.
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
split snews , more customizable ,install mods easier
« Reply #41 on: May 16, 2007, 02:08:31 am »

Quote from: mofey
1. Why you don't want sNews to be a new Wordpress?
2. What do you want it to be? A Joomla-in-one-file?
3. I think there needs to be an easy way to install mods. This is a very important feature and is very popular among different projects actually.
1. At this stage in its development... sNews is a DEVELOPER'S tool developed by developers for developers. It is not designed or intended to be a consumer-friendly 'Plug & Play' CMS product. As such... sNews is not in the same class as Wordpress or Joomla. Those projects, in particular, have been around for several years more than sNews... and sNews is really still in its infancy development-wise.
2. There is no such thing as a Joomla in one file. sNews is in a class of its own - a single-file CMS. that's what Luka... the sNews core author... wants it to be and - by and large - the sNews Dudes continue to work with and support that vision.
3. No one is suggesting there doesn't need to be an easier way to install mods. It is a good idea... but it is not on the core development to-do list. Some Dudes discuss this issue off and on (through another channel) and... let's just say there are a couple of approaches under consideration. It won't come overnight, tho, as whatever we eventually come up with has to work well with sNews... so it must be well thought out. It will also likely be developed outside the core development process (as a side project) so It will take time... maybe 6 months... maybe a year... maybe less.
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

mofey

  • Newbie
  • *
  • Karma: 0
  • Posts: 2
split snews , more customizable ,install mods easier
« Reply #42 on: May 16, 2007, 03:18:54 am »

1. At this stage of development sNews is no longer a DEVELOPER'S tool  :D
2. You could separate the core and extensions from each other. You already have A LOT of features in one single file that don't have to do much with a simple dynamic page script, don't you think?
3. I suggest an easy way for development and installation of mods. It would be great to have a centralized location on the site that is dedicated solely for that purpose to attract both developers and users. I think you underestimate the potential of this. I use firefox and miranda on a daily basis, and many people do so because of the clean application and great extensibility.
Logged
Pages: 1 2 [3]