LINUX.BE
[ english - nederlands - français - deutsch ]

find:

Structure
Dag Wieërs

Directory-based

The files are organized into as many directories as needed, not only does it simplify the whole situation, but it forces you to think before adding stuff. If you have a lot of information concerning a topic, you might want to create a new directory and split it into several files. all those files then are added to a menu-file (called menu.inc) with a title (preferably the title of the page). Every directory has such a menu-file _and_ a main-index (index.php).

What happens when I enter a page?

To clarify what exactly happens, I'll sum things up:
  • First of all, linux-shared.inc is loaded, according to what your URI is, it'll change its basedir. (eg. /nl/ or /fr/) linux-shared.inc has got most of the library-functions.
  • Since it now knows what its basedir is, it'll load its linux-local.inc. This will define some language dependant variables and localesettings.
  • Then your page will be parsed, $meta, $link, $menu and $string-variables and commonHeader() executed. commonHeader() will:
    • check whether all buttons exist, if not create the missing ones on the fly.
    • include menu.inc.
    • check if all links in the menu-exist, act otherwise. (override menu.inc with $menu-variables.
    • add $meta-data into html and authors' email to subtitle.
    • randomly pick a news-service and generate the headlines.
  • your main-page will then be showed (running any additional code).
  • commonFooter() will be ran and closes the file.
It's not that complicated, is it? And the author of the page can _still_ write its own php-code. (but ofcourse, if it's generic stuff, it's better to add it to the main-library linux-shared.inc)

What files are related to me?

Ok, let's show you an example of a simple page. This is a menu-file, menu.inc:
<?
// $Id: structure.php,v 1.6 1999/08/03 23:32:06 dag Exp $

   $menu["Index"]=		"/";
   $menu["What is Linux ?"]=	"/linux/";
   $menu["Business"]=		"/business/";
   $menu["Education"]=		"/education/";
   $menu["User groups"]=	"/usergroups/";
   $menu["Events"]=		"/events/";
   $menu["Projects"]=		"/projects/";
   $menu["Open source"]=	"/open-source/";
   $menu["Links"]=		"/links/";
   $menu["News"]=		"/news/";
   $menu["About Linux.be"]=	"/about/";
   $menu[""]=			"";
   $menu["Nederlands"]=		"/nl/";
   $menu["Français"]=		"/fr/";
   $menu["Deutsch"]=		"/de/";
?>
I don't think this need a comment ;)

Let's move on to an example-page. That must be a bit harder, right? This file is the stripped down cvs.php:

<?
  $meta["author"]="Dag Wieërs and Wim Vandeputte";
  $meta["email"]="dag@wieers.com,wvdputte@reptile.rug.ac.be";
  $meta["id"]='$Id: structure.php,v 1.6 1999/08/03 23:32:06 dag Exp $';

  $link["CVS BUBBLES"]="http://www.loria.fr/~molli/cvs-index.html";
  $link["man cvs"]=$MANPAGE."cvs";

  commonHeader("CVS");
?>
CVS is a system which enables a group of people to co-operate. For
a group of volunteers and professionals like us, it's a great tool
to use. You only have to focus on your own work. CVS will take care
of merging it with the shared source-tree (aka the repository). I'm
going to try to explain the basic functions, those you'll need the
most and which you can't live without. For more information check
the related links below !

<?commonTitle("Anonymous CVS")?>
Those interested in the inners of the website can download the
www-repository anonymously by doing the following:
<pre>
export CVSROOT=cvs@badlands.rug.ac.be:/cvs
export CVS_RSH=/usr/bin/ssh
cvs checkout www/
</pre>
<b>Beware:</b> this way you cannot commit changes to the 
repository, this is only useful to peek into the repository.

<?commonTitle("Getting a local copy of the repository")?>
Imagine you like the idea of helping us, then you need to have your
own copy of the repository, a copy of the files. 

If you already know how to deal with CVS and you now have a
CVS-account, then you'll have to do the following to get the 
test-repository:
<pre>
cvs checkout test/
</pre>
This will connect to the <i>CVSROOT</i> and get the 
specified repository with the given <i>name</i>. Now 
you're free to make changes to your local copy of the repository. 
<i>test/</i> is the test-repository, our main 
repository is called <i>www/</i>.  

<?commonFooter()?>
That's it ! The meta-data isn't needed, but it sure makes things easier. You can add meta-data if you want, some meta-data is generated on the fly. You can check this by adding ?debug=on to the URL and check the source-code. Ofcourse you can override the $menu (as we did with errors.php) but in most cases that won't be necessary.

What functions are there?

So there are few functions (at this time) you can/_have_ to use.
  • commonHeader($title)
  • commonTitle()
  • commonLine()
  • commonFooter()
In the future we'll add some more functions, like commonImage() and commonWindow(), but everything depends on what it is used for. Contact me to discuss this.

What html-code should I use?

The only codes you need to use (if you want to use something differently, let me know how we can work this out) are:
  • <b> </b>
  • <i> </i>
  • <u> </u>
  • <pre> </pre>
  • <em> </em>
  • <p>
To find out what other things are possible, check the PHP-documentation. Please don't experiment with weird stuff unless you know what you're doing and if you do, tell me ! Maybe it's better to add it to the library or maybe it's already implemented (or can it be done better).
Last updated: 03 August 1999
Linux® is a registered trademark of Linus Torvalds