[imc-sf-active] static sites with smarty
bart at indymedia.org
Mon Dec 20 13:40:29 PST 2004
I'm advincing with smarty stuff. so far i've done the following things:
- quite a lot works. methods shrink amazingly. you don't need to
assign a lot in the execute() method, smarty does most of it.
- in the page_handler script, we do setlocale('LC_TIME') per
$language, then smarty's date_format can handle the output.
(this is a big ++ since, we don't really need code to do it :-)
** Producer stuff **
- i've created templates for the includes. it's quite basic, but it
works. it does this:
- sets includes to include('local/include/...) so we basically
only need an include_path for the static site.
- writes includes out to local/include/$lang, where lang is either
$lang or $lang.'mix'
- if we write custom smarty functions, we can do tons of things here.
- we create per language (and if it's configured also $lang.'mix'
directories were static sites go.
- mix is for presentation of a site in language $x but with content
from all languages.
- pages go in templates/static_pages. (i only have an index here).
- whatever we cache, will have to go to local/cache/ so also articles
and comments (we better split cache of arts & comms).
if we don't do this, we're fucked, we'll have to store the article x
(then we write a page wich includes stuff for each articel in each
language subdir and we're set).
- we need some configuration so we can do both. it shouldn't be too
hard to do ...
* static-site concept *
- the idea isn't really to do dynamic-master and static mirrors, but a
concept with 3 parts:
- 1 master site were dbase writes happens and producing takes
place. (this is like the site we have now).
- ev. multiple dynamic sites. for this we need:
- a replicated dbase.
- an sf-active install.
(here we do dbase reads for search..)
(note: such a dyn. site doesn't have to be a mirror, the
search can link to static mirrors
- static mirrors. just php files which do include('');
(actually, static mirrors can be 2 types:
- media files.
some things will change. we'll need ways to browse news per month without
having to need to do a dbase search. archives will need some
reorganisation and so on ...
feel free to comment.
mtop looks like the revolution!
http://wvl.indymedia.org | bart at indymedia.org
http://thepits.be | bart at thepits.be
gebruik vrije software -- Debian GNU/Linux -- http://debian.org
gpg --keyserver keys.indymedia.org --recv-keys be196251
More information about the imc-sf-active