""
Documentation daCode : daCode webmaster's guide
Chapitre 3. Configuration reference

 

Site configuration

These are reasonable default values, you may not need to change them to experiment daCode

 

logo

Character string: Name of the logo to use, without extension. Must use PNG.

 

aboutlogo

Character string. Informations about the logo. Do it short. It will be displayed below the logo on all pages.

 

minilogo

Character string. Name of the tiny logo/banner to use in the PDA version. JPG only. This is used for the PDA version and for the Mozilla Sidebar.

 

defaultlang

echsrt. Default language ID. Two languages are actually available:

  • en: English (the default);

  • fr: French.



 

visiblenewsfile

Boolean. Controls whether script name must appear in URLs. Set it to 0 if you don't want the script name to appear in the URL.

 

anonymous_comments

Boolean. Allow anonymous comments if set at 1, deny them otherwise.

 

restricted_registration

Character string. Determine whether anyone may create an account or only the admin. Leave it empty to allow anybody to open an account.

 

valid_tags

Array of character strings. List of valid HTML tags in comments. The aim is to forbid any possibility of DHTML. Below is an exemple:


    $this->valid_tags = array (
      'b','i','s','u',
      'em','tt','strong','blockquote',
      'ol','ul','li',
      'p'
      );
      
   


 

valid_tags_board

Array of character strings. List of valid HTML tags in board. Same decalration as valid_tags.

 

no_access_msg

Character string. Message displayed if a user tries to access a page without authorization (mostly people trying to access administration pages without being admin). Use \n for newlines.

 

supp_fields

List of supplementary fields you want for users informations except the basic ones. For each field, following values must be assigned:

  • length: width and height (optional) in lines, as a comma separated list;

  • max_length: maximal width;

  • type: input type ('text' or 'textarea') -- FIXME hmmm, not sure, see supp_fields_types below;

  • public:

    • 1: data are visible to anyone;

    • 0: only authenticated users can view them.



Exemple declaration follows:

    
      $this->supp_fields = array (
      'photo'       => array(
      'length'  => '30',
      'max_length'  => '255',
      'type'        => 'url',
      'public'  => '1'
      ),
      'icq' =>   array(
      'length'  => '9',
      'max_length'  => '10',
      'type'        => 'icq',
      'public'  => '1'
      ),
      'pgp' =>   array(
      'length'  => '8',
      'max_length'  => '8',
      'type'        => 'pgp',
      'public'  => '1'
      )
      );
      
   
Warning: all types used in supp_fiels must be declared in supp_fields_types.

 

supp_fields_types

Here you define the types used for the supplementary fields above. For each, you have a method value, which is associated to the usage of the type on users pages. Exemple follows.


    
      $this->supp_fields_types = array(
      'text'    =>   array(
      'method'  =>   'htmlentities($val);'
      ),
      'textarea'    =>   array(
      'method'  =>   'htmlentities($val);'
      ),
      'url' =>   array(
      'method'  =>   '"".'.
      'htmlentities($val)."";'
      ),
      'icq' =>   array(
      'method'  =>   '""'.
      '.htmlentities($val)."";'
      ),
      'pgp' =>   array(
      'method'  =>   '""'.
      '.htmlentities($val)."";'
      )
      );
      
   
TODO: add a bit of explanations about supp_fields_types.

 

user_boxes

Hash of hashes. List of user boxes. These are the boxes you allow them to choose in their preferences. They all have to be un backends class ! (for security reasons). Exemple follows.

Format:


    'name' => array 
      with array being (not every parameter is used by every box): 
      'function' => string: the function to use,
      'info' => string: general information,
      'force' => 1 or 0: if 1, forces the box to be displayed,
      'url' => string: the URL of the site where the news come from. 
      
      
   
For exemple:

    $this->user_boxes = array (
      //Internal values (modules from daCode)
      //These are only a selection from the variety of
      //modules and internal boxes available. 
      
      'loginbox'=>array(
      'function'  => '$user->loginbox()',
      'info'      => 'Login Box',
      'force'       => '1'
      ),
      'edito'=>array(
      'function'  => '$sidebox->edito()',
      'info'      => 'Edito'
      ),
      'board'=>array(
      'function'  => '$board->print_message()',
      'info'      => 'Board'
      ),
      'calendar'=>array(
      'function'  => '$cal->calbox($pageday, $pagemonth, $pageyear)',
      'info'      => 'Calendar'
      ),
      'tips'=>array(
      'function'  => '$tips->get_random()',
      'info'      => 'Tips'
      ),
      'archive'=>array(
      'function'  => '$news->show_archive(10,$section,$topic,1,1)',
      'info'      => 'Archive'
      ),
      'admin'=>array(
      'function'  => '$admin->adminbox()',
      'info'      => 'Admin'
      ),
      
      //External values (backends). These functions connect to other
      //servers to grab the laterst headlines, usually. 
      
      'kernel'=>array(
      'function'  => '$backends->kernel()',
      'info'      => 'Kernel',
      'url'     => 'http://www.kernel.org/'
      ),
      'rfc'=>array(
      'function'  => '$backends->rfc()',
      'info'      => 'RFCs'
      ),
      );
      
   
For the backends, see phplib/backends.php3 to find out which ones are available. Here is a short reference of the boxes and modules available as userboxes.
loginbox

The login form, or your personnal infos. Parameters:

  • function: $user->loginbox()

  • info: any string...

  • force: '1' Shall be set a 1, because you always want to have a login box on front page!



messages

The "Personal messages" box. Parameters:

  • function: $message->show_new_title()

  • info: any string...

  • force: '1'. Shall be set a 1, because you always want to have a message box on frant page (if you use the module, of course!).



edito

The edito box. This is free space for the webmaster. The text is defined by the configuration parameter edito. See the edito parameter above. Parameters :

  • function: $sidebox->edito()

  • info: any string...



board

The board box. A simple chat system, available as sidebox. But beware, a group of malevolent molluscs and palmipedes invades any daCode board it can find . Parameters:

  • function: $board->print_message()

  • info: any string...



calendar

The calendar. Allows your users to view the news of day they selected on little calendar. Only available in sidebox. Parameters:

  • function: $cal->calbox($pageday, $pagemonth, $pageyear))

  • info: any string...



webcam

The webcam box. Allows you to add an image to the main page. This box displays a random image. Parameters:

  • function: $webcam->get_random()

  • info: any string...



tips

The tip box. Displays a random tip on the front page. Parameters:

  • function: $tips->get_random()

  • info: any string...



archive

  • function: $news->show_archive(10,$section,$topic,1,1,-1)

  • info: any string...



others

Box which holds the news left out of the front page. Parameters:

  • function: $news->show_archive(10,"","",1,2,0,"Others")

  • info: any string...



admin

The admin box. You want it if you're a moderator, as this box is the only way to access the administration features.

  • function: $admin->adminbox()

  • info: any string...



poll

The poll box. Displays the question and muliple choice for the current poll. Parameters:

  • function: $poll->show_poll()

  • info: any string...





 

default_user_boxes

List. List of userboxes displayed by default. This is a list of the names of the user boxes, or PHP-wise, a list of keys from the user_boxes array. Exemple follows.


    $this->default_user_boxes = array ('edito',
      'loginbox',
      'admin',
      'archive',
      'tips',
      'agenda',
      'kernel'
      );
      
   


 

topfrep

Integer. Time in seconds between the XP ranking is refreshed Default value is "1800".

 

pollvote

Integer. Time in seconds between two votes by the same person (IP address in fact).

 

cachedir

Character string. Directory where HTML fragments (i.e. boxes) are cached. Don't forget the trailing slash !! An empty string means no caching.

 

htmldir

Character string. htdocs/ subdirectory where generated HTML files are stored. An empty string means no caching.

 

mark_outdated

Boolean. Mark outdated cached files instead of deleting them if set to 1. Be aware that it may cause problems with the board.

 

sql_persistant

Boolean. Allow SQL persistant connexions if set to 1.

 

sql_logfile

Character string. Log SQL queries to this file ; log disabled when empty.

 

fortunefile

Character string. Fortune file, if any. An empty string means no fortunes. Fortunes have to be separated by a "%" and an Unix new line ("\n"). Pay attention not to use Windows new lines ("\r\n") or Mac ("\r")!

 

create_tar_dir

Character string. Directory where generated tarfiles are put. This is used to archive themes. /tmp/ is usually a good choice.

 

upload_tar_dir

Character string. Directory where uploaded tarfiles are put to be extracted. /tmp/ is usually a good choice.

 

theme_subdir

Character string. When uploaded themes can be installed, it may be advisable to put them under a specific subdirectory which is writable by PHP. For exemple, if one writes $this->theme_subdir = "contrib/";, all uploaded themes will be put in phplib/themes/contrib.

 

debug

Character string. The debug mode:

  • "none" for no debuging;

  • "stdout" for debuging on the standard output;

  • "file" for debuging into a file ,see debugFile below;

  • "socket" for debugging on a socket, see debugFile below.



 

debugFile

Debug file or host. If you chose "file" for $this->debug, this is the absolute filename of the debug log. If you chose "socket", this is the hostname and port, with the usual syntax: " hostname:port". If you chose "none" or "stdout", this parameter has no effect.

 

disable_view_comments

Boolean. This option toggles the possibility for other users to get a list of comments posted by another user. Set it to one to disable it.