Menu
Users
GENU
Currently, there are 1 guest(s) and 0 registered user(s) online.
Under development - Last update: Sat, Sep 29th 2007
  1. Overview
    1. Modularity
    2. Languages
    3. Templates
  2. Can I have my website looks the way I want it to be?
  3. Can I add menu blocks?
  4. Can I add personal pages?

  1. Overview

    GENU is a Content Management System written with PHP language and using a database server (MySQL, PostgreSQL or SQLite). It is fully customisable since it use a templates system and support multiple languages.

    GENU is an open-source software distributed under the terms of the GNU GPL license.

    Features:

    • Easy installation
    • Full customisation with templates
    • Multiple languages interface
    • Unlimited news organised into unlimited categories
    • Comments system with reply and edit possibilities
    • Bulletin board
    • Polls
    • Users management
    • Complete administration interface
    • Search engine
    • Submit and send news functions
    • Smilies support
    • BBCodes or HTML tags support
    • Headlines generation
    • And more ...

    Requirements:

    • A webserver or web hosting account
    • PHP 4.3.0 or higher (with mail function enabled, preferably)
    • A MySQL database (4.1 or higher) or a PostgreSQL database (7.0 or higher) or SQLite database support in PHP 5.x

    1. Modularity

      - to write -

    2. Languages

      The languages files are located in the languages/ directory. These files consist of an array containing predefined variables and their replacement strings. Each language file contains the same predefined variables, only strings are translated. Example:

      1.  <?php// in english.php:
      2.  
      'JANUARY' => 'January',
      3.  
      4.  
      // in french.php:
      5.  
      'JANUARY' => 'Janvier',
      6.  
      7.  
      // in spanish.php:
      8.  
      'JANUARY' => 'Enero',

      If you are interested in creating and maintaining one translation file, please contact me at raoul at genu dot org. Thanks in advance.

    3. Templates

      A simple template class allows to keep HTML code in external files (.htpl) which are completely free of PHP code. These files are located in the templates/ directory and its subdirectories. They contain predefined variables (see the list in templates/variables.txt file) substituted when the code is interpreted. These variables can be various types: a portion of HTML code, a string, a number...

      Actually, the template class has the following features: substitution of variables and blocks (recursive or not). Below, the documentation about the class (inspired from the PHPLib):

      1.  <?php// Include required file
      2.  // template.php is located in the includes/ directory
      3.  
      include('./../includes/template.php');
      4.  
      5.  
      // Create the object $template of the class template
      6.  // Set the root directory where the template files will be stored
      7.  
      $template = new template($root);
      8.  
      // Example:
      9.  
      $template = new template('./../templates/default');
      10.  
      11.  
      // Set the template file
      12.  
      set_file($name$file);
      13.  
      // Example:
      14.  
      set_file('index''news/index.htpl');
      15.  
      16.  
      // Set the value of a template variable
      17.  
      set_var($name$value '');
      18.  
      // Example with a single variable:
      19.  
      set_var('PAGE_TITLE''News - Index');
      20.  
      // Example with an array:
      21.  
      set_var(array('PAGE_TITLE' => 'News - Index''SITE_NAME' => 'GENU'));
      22.  
      23.  
      // Set a block in a template variable of a parent file
      24.  
      set_block($parent$name$block);
      25.  
      // Example:
      26.  
      $template->set_block('index''NEWS_BLOCK''news');
      27.  
      28.  
      // Substitute the values of template variables and display the template file or block
      29.  
      parse($name$block ''$loop false);
      30.  
      // Example with files:
      31.  
      parse('index');
      32.  
      // Example with blocks:
      33.  
      parse('NEWS_BLOCK''news'true);

      Then, the templates variables or blocks can be used in templates files.

      1.  <?php// A template variable must be used between braces
      2.  
      {variable}
      3.  
      // Example:
      4.  
      {PAGE_TITLE}
      5.  
      6.  
      // A block
      7.  
      <!-- BEGIN block -->
      8.    {
      variable}
      9.  <!-- 
      END block -->
      10.  
      // Example:
      11.  
      <!-- BEGIN NEWS_BLOCK -->
      12.    {
      NEWS_TEXT}
      13.  <!-- 
      END NEWS_BLOCK -->

  2. Can I have my website looks the way I want it to be?

    Yes. Simply edit templates files (.htpl) and the style sheet (.css) located in the templates/ directory. By default, GENU use XHTML and CSS2 languages but you can use HTML language if you want.

    You can also create your own layout using the predefined template variables.

  3. Can I add menu blocks?

    Yes. Simply edit templates files: usually header.htpl or footer.htpl but it depends on if you are using templates provided with GENU or your own layout. In the last case, you should know better than me how to add menu blocks. Below, an example of code to add a menu block to the default template:

    1.  <?php<div class="leftTitle">Menu title</div>
    2.  <
    div class="leftContent">
    3.      <
    ul>
    4.          <
    li><a href="/path/to/first_link" title="First link">First link</a></li>
    5.          <
    li><a href="/path/to/second_link" title="Second link">Second link</a></li>
    6.          <
    li><a href="/path/to/third_link" title="Third link">Third link</a></li>
    7.      </
    ul>
    8.  </
    div>

  4. Can I add personal pages?

    Yes. Below, an example of code to generate an about page. The file 'about.php' is placed in the WHERE_GENU_IS_INSTALLED/pages/ directory of your webserver:

    1.  <?php// Include required file
    2.  // common.php is located in the includes/ directory
    3.  
    include('./../includes/common.php');
    4.  
    5.  
    // Display page header (content of header.htpl)
    6.  // 'About' is the title of the page following the site name
    7.  // Example: GENU - About
    8.  
    page_header('About');
    9.  
    10.  
    // Set the template file
    11.  
    $template->set_file('about''pages/about.htpl');
    12.  
    13.  
    // Set a template variable using the language array
    14.  
    $template->set_var('BACK_HOME'$lang['BACK_HOME']);
    15.  
    16.  
    // Example of an array of template variables
    17.  //$current_time = date('D, M jS Y, g:i a');
    18.  //$template->set_var(array('BACK_HOME' => $lang['BACK_HOME'], 'CURRENT_TIME' => $current_time));
    19.  
    20.  // Substitute the values of template variables and display the template file
    21.  
    $template->parse('about');
    22.  
    23.  
    // Display page footer (content of footer.htpl)
    24.  
    page_footer();

    And an example of the template file 'about.htpl', placed in the WHERE_GENU_IS_INSTALLED/templates/default/pages/ directory, if you are using the default template:

    1.  <?php<div class="rightMain">
    2.    <
    div class="rightTop">My about page header</div>
    3.    <
    div class="rightContent">My about page text</div>
    4.  </
    div>
    5.  <
    div class="rightBottom"><a href="./../index.php" title="">{BACK_HOME}</a></div>
GENU 2008.0-dev, Copyright © 2003-2008 Raoul Proença
Page generated in 1.538 s with 4 SQL queries