[imc-sf-active] static sites with smarty

Pseudo Punk bart at indymedia.org
Mon Dec 20 13:40:29 PST 2004


Hey,

I'm advincing with smarty stuff. so far i've done the following things:

/classes/pages/
    - quite a lot works. methods shrink amazingly. you don't need to
      assign a lot in the execute() method, smarty does most of it.

date/time presentation.
    - 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 **
local/includes
    - 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.

sitename/static
    - 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).

GENERAL REMARKS.
*caching*
    - 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
times
    (then we write a page wich includes stuff for each articel in each
language subdir and we're set).

*sf-style stuff*
    - 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:
	    - php-files
	    - 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.

Bart


-- 
mtop looks like the revolution!

http://wvl.indymedia.org  |     bart at indymedia.org
http://thepits.be         |     bart at thepits.be
http://pseudopunk.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 mailing list