Hi!

  I have tried to make a complete modular php cms system. The hardest part
was not selecting which modules to load, but their presentation. I don't
know if what I did was good enough, i.e: the best implementatin, but
somewhat was working.

  What I did was basically query a Mysql table, selecting rows with this
information:

area_id
area_style
area_modules

  "area" was a part of a what I called in my system "canvas". A canvas is
the page, and each "area" was the position of the module in the screen. So:

area_id = 1
area_style = '<div style="width:25%;float:left;border:1px black solid;">'
area_modules = "system/articles/[module]system/stats/[module]user/forum/"

  So I would do:

while(list($idarea,$area_style,$area_modules) = $area_sql_result()) {
    ?><div style="<?php echo $area_style; ?>">
    <?php
   $area_modules = explode('[module]',$area_modules);
   foreach($area_modules as $module_path) {
       require_once ($module_path);
   }
   ?>    </div>
<?php
}

  Indeed, you can see the performance is not very good. A require inside a
foreach, inside a while? But still, it was very easy to manage. A new module
would require you to upload the file, and modify "area_modules".

  After this stage, I was stuck at the "canvas/area" concept. I simply did
not managed to make a good way to let the module know where it should appear
on the page.

  But, I guess you are indeed trying to reinvent the wheel, like I was ;-)

  I would recommend that you look at "PostNuke", a php script that I heard
was trying to accomplish a more modular design. Maybe they have succeed, I
don't know (been a while since I have looked).

  And if you want serious a serious cms, have a look at "Zope", written in
Python. They at least have a large documentation, including for developers.
Maybe in there you can gently 'steal' good programming ideas :-D
--
Julio Nobrega.

Tô chegando:
http://www.inerciasensorial.com.br
"Lauri Vain" <[EMAIL PROTECTED]> wrote in message
000301c1e856$f357e5e0$1431a8c0@tharapita">news:000301c1e856$f357e5e0$1431a8c0@tharapita...
> Hello there,
>
> I'm seriously researching some aspects of writing a content management
> system that would be 'relatively' easy to extend.
>
> My biggest problem is the ground level -- how should the central system
> (that registers modules) work? Ideally, it should be possible to easily
> extended the system -- running the install.php file (or something
> similar) will tell (insert new database rows or will add new rows to the
> configuration file) the central module that a new module was just added
> and also gives instructions, how to use it, with which other modules it
> integrates and where the new files are.
>
> The basic idea is that modifications to existing files (modules)
> shouldn't be made (except the central module, which handles all others).
> Each module should be totally *independent*, but should still integrate
> with the rest of the modules (when marked as possible in the database).
> What I mean by 'integrate' is the following: there are two modules, for
> example, "image gallery" and "articles". Both of them should appear in
> "What's new" part (when the appropriate checkbox will be checked). Also,
> it would be nice when one could choose the option "Publish to articles"
> when inserting a new image gallery (a client event for example -- story
> in pictures). Yes, that's a simplified example.
>
> So, the problem is that there might only be the "article" module at
> first. Later, the "articles" and "What's new" module will be added and
> all three of them should now work together. I hope you catch my drift.
>
> I have quite a few ideas, but I'm sure that our team is just
> re-inventing the wheel. What are your experiences? Are there any good
> books on the subject of creating an extendable content management system
> (preferably from the coders point of view, but not language-specific).
>
> Thanks,
> Lauri
> --
> Tharapita Creations
> [server-client web applications]
> [EMAIL PROTECTED]
> Mobile: +372 53 410 610
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to