# GeekLog Configuration File

## Setting up config.php

GeekLog's server settings are configured in a text file called config.php. It is necessary to edit this file to get your system running as well as configuring it to your preferences. This file contains a set of variables that are defined below:

### Database Settings

Variable | Default Value | Description
--- | --- | ---
_DB_dbms | mysql | Do not change! This tells Geeklog that it's dealing with a MySQL database - and currently, that is the only type of database that is supported.
_DB_host | localhost | Database Server (to be entered in the form: hostname:port:unixsocket). In most cases you won't need to change the default value.
_DB_name | geeklog | Database Name
_DB_user | root | Database User Account
_DB_pass | null | Database User Password
_DB_table_prefix | gl_ | Allows you to change the default table names for Geeklog
_DB_mysqldump_path | /usr/bin/mysqldump | Complete path to the mysqldump utility (part of MySQL) for making backups of your Geeklog database
allow_mysqldump | 1 | Enable or disable the backup functionality (1 = on, 0 = off)

### Server Settings

Variable | Default Value | Description
--- | --- | ---
path | /path/to/geeklog/ | Base file system path for your site (trailing slash necessary)
path_system | /path/to/geeklog/system/ | Path to your system directory for your site (trailing slash necessary). This directory holds the code libraries used throughout Geeklog
path_html | /path/to/geeklog/public_html/ | Path to your web tree directory for your site (trailing slash necessary). This directory holds all the web pages used by Geeklog.
path_log | /path/to/geeklog/logs/ | File system path for the log files
path_language | /path/to/geeklog/language/ | location of the Geeklog language files
rdf_file | HTML path with "/backend/geeklog.rdf" suffix | File system path for the RDF file. This file allows you to share your site's headlines with others
backup_path | Base path with "/backups/" suffix | location where mysqldump (see above) will store database backups

### Site Settings

Variable | Default Value | Description
--- | --- | ---
site_name | GeekLog Site | Name of your site
site_slogan | Another Nifty GeekLog Site | Slogan for your site. This is added to the HTML title field.
site_mail | admin@example.com | E-mail address for all admin mail
site_url | http://www.yourdomain.com | Base URL for your site (no trailing slash)
theme | XSilver | Default theme to use on the site
layout_url | Site URL path, with layout dir and default layout | Location of the default layout
path_themes | /path/to/geeklog/public_html/layout/ | Directory where all themes reside
path_layout | /path/to/geeklog/public_html/layout/XSilver/ | Path to current theme directory
allow_user_themes | Can be 1 or 0 | If set to 1, users can set their own theme that the site uses
allow_user_language | Can be 1 or 0 | If set to 1, users can select the language for the site navigation
allow_user_photo | Can be 1 or 0 | If set to 1, users can upload a photo to their profile
site_enabled | true | A Geeklog site can be disabled quickly (e.g. for maintenance) by setting this to 'false'.
site_disabled_msg | 'Geeklog Site is down. Please come back soon.' | This contains the message to display when a Geeklog site is disabled. If the text begins with "http:" then visitors are redirected to that URL.

### Locale Settings

Variable | Default Value | Description
--- | --- | ---
language | english | Name of your language file. Additional language files may be available for download at http://www.geeklog.net. If you translate a language file, please send it to us. Also see Localization below.
locale | en-gb | Locale for the system
date | %A, %B %d %Y @ %I:%M %p %Z | Date format used for most of the site, including story displays. See date formats below.
daytime | %m/%d %I:%M%p | Date format used when a shorter date is needed. See date formats below.
shortdate | %x | Date format this is the shortest date. See date formats below.
dateonly | %d-%b | Short date format (day and month only), to be used e.g. in the Upcoming Events and Older Stories blocks. See date formats below.
timeonly | %I:%M %p %Z | Format string for the time only, to be used e.g. on the Event Details page. See date formats below.
default_charset | iso-8859-1 | Character encoding used by Geeklog when serving HTML pages or sending email. Only used if the language file did not already set another character encoding.

### Session Settings

Variable | Default Value | Description
--- | --- | ---
cookie_ip | 1 | Session ID to contain IP address of user as well as random number. This is more secure but will more than likely require dialed up users to login each and every time. (0=no, 1=yes)
default_perm_cookie_timeout | 604800 | Permanent cookie timeout in seconds (604800 = 1 week).
session_cookie_timeout | 7200 | Session cookie timeout (in seconds).
cookie_session | gl_session | What the session ID is stored as in the cookie.
cookie_name | geeklog | The name of the cookie.
cookie_path | / | Cookie path.

### Login settings

Variable | Default Value | Description
--- | --- | ---
loginrequired | 0 | Login is required to access any part of the site. When set to 1, this overrides the following settings. When you only want to block access to certain parts of the site, set this to 0 and select from the following settings.
submitloginrequired | 0 | When set to 1, only registered users can submit stories, links, and events
commentsloginrequired | 0 | When set to 1, only registered users can submit comments
linksloginrequired | 0 | When set to 1, only registered users can access the links area
pollsloginrequired | 0 | When set to 1, only registered users can access the list of recent polls
calendarloginrequired | 0 | When set to 1, only registered users can access the calendar
statsloginrequired | 0 | When set to 1, only registered users can access the site stats
searchloginrequired | 0 | When set to 1, only registered users can use the advanced search. When set to 2, the simple search is blocked for anonymous users, too.
profileloginrequired | 0 | When set to 1, only registered users can view another user's profile
emailuserloginrequired | 0 | When set to 1, only registered users can use the email submission form to send an email to another user
emailstoryloginrequired | 0 | When set to 1, only registered users can email stories

### Submission Settings

Variable | Default Value | Description
--- | --- | ---
storysubmission | 1 | Enable (1) or disable (0) the story submission queue
linksubmission | 1 | Enable (1) or disable (0) the link submission queue
eventsubmission | 1 | Enable (1) or disable (0) the event submission queue
usersubmission | 1 | Enable (1) or disable (0) the user submission queue
allow_domains | '' | When user submission is enabled this can contain a comma-separated list of domain names from which user submissions will not be queued (but approved automatically). Example: 'mycompany.com,myothercompany.com'
notification | array() | Send an email notification to `$_CONF['site_email']` when a new story, link, or event has been submitted or a new user has registered with the site. The `array()` can hold any combination of the strings `'story'`, `'link'`, `'event'`, and `'user'` (separated by commas), depending on which notification(s) you want. Example: `array('story','user');` would send notifications when a new story has been submitted or a new user has registered. No notifications would be sent for new links or events.
postmode | plaintext | Sets the default submission mode to 'html' or 'plaintext'
speedlimit | 45 | Minimum delay between submissions in seconds. This helps prevent Denial of Service (DOS) attacks
skip_preview | 0 | If 1, allows submission of stories and comments without previewing (i.e. the submission form will always have a Preview and a Submit button).

### Topic, What's New & E-mail Settings

Variable | Default Value | Description
--- | --- | ---
sortmethod | sortnum | alpha = Sort topics in topic list alphabetically sortnum = Sort topics in topic list by sort number
showstorycount | 1 | Show the number of stories in a topic in the Section block (0=no, 1=yes)
showsubmissioncount | 1 | Show the number of story submissions for a topic in the Section block (0=no, 1=yes)
showemptysearchresults | 0 | Show empty result blocks even when search returned no hits for stories, events, links, etc. (0=no, 1=yes)
whosonline_threshold | 300 | How long, in seconds, users can be idle before removing them from the whosonline block
emailstories | 0 | Let users get stories e-mailed to them (0=no, 1=yes), aka Daily Digest. Please note that this requires cron and the use of PHP as a shell script.
emailstorieslength | 1 | When emailstories (above) is enabled, send only the title and the link to the new stories (0), or send the entire introtext (1) or send the first n characters from the introtext (where n = any other number)
emailstoriesperdefault | 0 | When set to 1, new users will be subscribed to the daily digest automatically when they register with the site.
newstoriesinterval | 86400 | Stories are "new" if they are this many seconds old.
newcommentsinterval | 172800 | Comments are "new" if they are this many seconds old.
newlinksinterval | 1209600 | Links are "new" if they are this many seconds old.
hidenewstories | 0 | Set to 1 to hide new stories from What's New block.
hidenewcomments | 0 | Set to 1 to hide new comments from What's New block.
hidenewlinks | 0 | Set to 1 to hide new links from What's New block.
copyrightyear | (commented out) | Set this to the year you want to appear in the copyright notice of your site's footer. If not set, Geeklog will use the current year.

### Calendar Settings

Variable | Default Value | Description
--- | --- | ---
personalcalendars | 0 | Allow account holders to have a personal calendar
showupcomingevents | 1 | Show up-coming events (0=no, 1=yes)
upcomingeventsrange | 14 | Number of days that "Upcoming Events" will look ahead.
event_types | Anniversary, Appointment, Birthday, Business, Education, Holiday, Meeting, Miscellaneous, Personal, Phone Call, Special Occasion, Travel, Vacation | The set of event types that are used both on the public calendar and the user's personal calendars

### Story Settings

Variable | Default Value | Description
--- | --- | ---
maximagesperarticle | 5 | max. number of images you can have in a story
backend | 1 | Create an RSS/RDF file for the stories in rdfpath (0=no, 1=yes)
limitnews | 10 | Number of stories to limit the index page to, this same number will appear in the older stuff block
minnews | 1 | Minimum numbers of stories than can appear on a topic page
contributedbyline | 1 | Show author username to public, and enable search by username (0=no, 1=yes)
article_image_align | right | Which side of article the topic image should be shown (right or left)
hideemailicon | 0 | When set to 1, this will disable the ability to send a story by email. It will also hide the email icon from stories and the "Email Article To a Friend" from the Story Options block.
hideprintericon | 0 | When set to 1, this will disable display of a story in a "printer friendly" format. It will also hide the printer icon from stories and the "View Printable Version" from the Story Options block.
showfirstasfeatured | 0 | When set to 1, this will render the first story on any page using the templates for a featured story, even if that story is not featured. This will even be applied to the first story on page 2 of a topic page, for example.

### Comment Settings

Variable | Default Value | Description
--- | --- | ---
commentspeedlimit | 45 | Number of seconds between posting a comment for the user
comment_limit | 100 | Most number of comments to show at any one time
comment_mode | threaded | How to display comments (threaded, nested, flat or nocomments)
comment_code | 0 | Default value for new stories: Comments enabled (0) or disabled (-1)

### Poll Settings

Variable | Default Value | Description
--- | --- | ---
maxanswers | 10 | Maximum number of possible answers for the poll editor
answerorder | submitorder | Sort answers by the number of results ('voteorder') or keep the order in which they were entered ('submitorder')
pollcookietime | 86400 | Number of seconds to set a poll answer cookie to time out on
polladdresstime | 604800 | Number of seconds to set a poll answer IP address to time out on

### Links Settings

Variable | Default Value | Description
--- | --- | ---
linkcols | 3 | Number of columns to use when listing the categories in the links section. Set to 0 if you don't want categories listed.
linksperpage | 10 | Number of links to show per page. Set to 0 to show all links at once.

Note: When setting both 'linkcols' and 'linksperpage' to 0 you get back the old-style (pre-1.3.6) layout of the links section.

### Image Settings

Variable | Default Value | Description
--- | --- | ---
image_lib | '' (empty string) | Set this to either 'imagemagick' or 'netpbm' if images should be resized during upload. Leave as '' if you don't want images to be resized or if you don't have those packages available.
path_to_mogrify | (commented out) | If you chose 'imagemagick' for $_CONF['image_lib'] above, then this should hold the complete path to the mogrify binary (from the ImageMagick package), e.g. '/usr/bin/mogrify'. You will need a fairly recent version of ImageMagick for this to work (version 5.4.9 or newer is recommended).
path_to_netpbm | (commented out) | If you chose 'netpbm' for $_CONF['image_lib'] above, then this should hold the complete path to the directory where the binaries from the netpbm package are kept, e.g. '/usr/bin/netpbm/'. Note that the path must end in a slash. Precompiled binaries of the netpbm package for various platforms can be downloaded from the Homepage of the Gallery project.
max_image_width | 300 | Max. width of an image in pixels. If it exceeds this, it is either rejected or resized (depending on the setting of $_CONF['image_lib'] above).
max_image_height | 300 | Max. height of an image in pixels. If it exceeds this, it is either rejected or resized (depending on the setting of $_CONF['image_lib'] above).
max_image_size | 1048576 (equals 1 MB) | Max. size of an image in bytes. If it exceeds this, it is either rejected or resized (depending on the setting of $_CONF['image_lib'] above).
max_photo_width | 96 | Max. width of a user photo in pixels. If it exceeds this, it is either rejected or resized (depending on the setting of $_CONF['image_lib'] above).
max_photo_height | 96 | Max. height of a user photo in pixels. If it exceeds this, it is either rejected or resized (depending on the setting of $_CONF['image_lib'] above).
max_photo_size | 65536 (equals 64 KB) | Max. size of a user photo in bytes. If it exceeds this, it is either rejected or resized (depending on the setting of $_CONF['image_lib'] above).

### Content Control Settings

Variable | Default Value | Description
--- | --- | ---
allowablehtml | <p>,<b>,<i>,<a>,<em>,<br>,<tt>,<hr>,<li>,<ol>, <div>,<ul> | Allowed HTML in stories submissions and comments.
adminhtml | the values from allowablehtml (above) plus HTML tags for tables | Allowed HTML that only admin users can use
censormode | 1 | Censor submissions and comments (0=no, 1=yes)
censorreplace | *censored* | Text to replace a censored word with
censorlist | array("fuck","cunt","fucker","fucking","pussy","cock", "c0ck","cum","twat","clit","bitch","fuk","fuking", "motherfucker") | An array of censored words

## Localization

Localizing GeekLog is fairly easy. All strings are contained in a language file. The default file that ships with the tarball is english.php. People interested in translating Geeklog to other languages are encouraged to join the geeklog-translations mailing list. All important information concerning translating Geeklog will be posted there.

### Locale and Date Formats

You can set the locale and date format in the config.php file. To set the locale, set the variable to the proper string or if you leave it blank it will pull the default locale from the operating system. The date formats are handled by your locale. Isn't that smart? Locale names are OS dependent. On most UNIX hosts, you can find locale codes in the /usr/share/locale/locale.alias file and on some systems the command locale -a will display all available locales on a system. If a locale doesn't exist you can create it using the localedef command.

More info on locale: http://www.opengroup.org/onlinepubs/7908799/xbd/locale.html
More info on localdef: http://www.opengroup.org/onlinepubs/7908799/xcu/localedef.html

### Date Format Syntax

- `%a - abbreviated weekday name according to the current locale`
- `%A - full weekday name according to the current locale`
- `%b - abbreviated month name according to the current locale`
- `%B - full month name according to the current locale`
- `%c - preferred date and time representation for the current locale`
- `%C - century number (the year divided by 100 and truncated to an integer, range 00 to 99)`
- `%d - day of the month as a decimal number (range 00 to 31)`
- `%D - same as %m/%d/%y`
- `%e - day of the month as a decimal number, a single digit is preceded by a space (range ' 1' to '31')`
- `%h - same as %b`
- `%H - hour as a decimal number using a 24-hour clock (range 00 to 23)`
- `%I - hour as a decimal number using a 12-hour clock (range 01 to 12)`
- `%j - day of the year as a decimal number (range 001 to 366)`
- `%m - month as a decimal number (range 1 to 12)`
- `%M - minute as a decimal number`
- `%n - newline character`
- `%p - either `am' or `pm' according to the given time value, or the corresponding strings for the current locale`
- `%r - time in a.m. and p.m. notation`
- `%R - time in 24 hour notation`
- `%S - second as a decimal number`
- `%t - tab character`
- `%T - current time, equal to %H:%M:%S`
- `%u - weekday as a decimal number [1,7], with 1 representing Monday`
- `%U - week number of the current year as a decimal number, starting with the first Sunday as the first day of the first week`
- `%V - The ISO 8601:1988 week number of the current year as a decimal number, range 01 to 53, where week 1 is the first week that has at least 4 days in the current year, and with Monday as the first day of the week.`
- `%W - week number of the current year as a decimal number, starting with the first Monday as the first day of the first week`
- `%w - day of the week as a decimal, Sunday being 0`
- `%x - preferred date representation for the current locale without the time`
- `%X - preferred time representation for the current locale without the date`
- `%y - year as a decimal number without a century (range 00 to 99)`
- `%Y - year as a decimal number including the century`
- `%Z - time zone or name or abbreviation`
- `%% - a literal `%' character`