phpGraphy configuration

4.1. Changing the configuration

Starting from release 0.9.11, configuring phpGraphy is much more easier, there is now a nice GUI (Graphic User Interface) in addition to the traditionnal manual editing.

Using the GUI – The graphical interface is accessible once logged-in as admin by clicking on “phpGraphy Settings” in the admin’s menu. You’ll be able to browse through the left menu to review and/or modify the different configuration options. Note that some directives are not modifiable via the interface as setting a bad value might break your configuration, you’ll have to use the manual method to change those ones. Some directives are marked with a red note that recommend the use of the installation process as they might also break some part of your site if misconfigured.

Doing it manually – The use of this method is recommended for advanced users or if you’ve become very familiar with phpGraphy and want to modify a directive which could not be set via the GUI. phpGraphy configuration is now based on a ini file called config.ini.php located in the conf/ sub-directory of your installation. Even tough the filename finish with a .php extension, the file follow the .ini format. It should only contain directives which have a different value from phpGraphy’s default (See phpGraphy initialization process(FIXME:Create link). For a list of allowed directives, please refeer to the next section Configuration directives reference

4.2. Configuration directives reference

admin_ip

Category: main/misc (Advanced)

Type: string

Your IP address, it need to be provided during the installation procedure so that nobody else is able to create an administrator account on your behalf. If you don’t know what your IP address is don’t worry it will be given to you during the installation procedure.

Example: “193.29.43.244”, “192.168.0.1”, “127.0.0.1”convert_path

Type: string

Obsolete since version: 0.9.11

Replaced by: thumb_generator_path

If you use convert as $config[‘thumb_generator’], you can specify its path using this directive (leave blank for auto detection).

Example: “/usr/bin/convert”cover_picture_mode

Category: display/layout

When using the ‘picture’ mode of ‘directory_display_mode’ and no cover picture is actually set for a directory, what should phpGraphy do about it ? ‘random’ Select automatically one random picture from the directory ‘manual’ Don’t do anything and let you handle the situation Note that the ‘random’ mode can slow down your site as it does scan the content of every directory without cover.

Default value: randomdata_dir

Category: main/path (Advanced)

Type: string

Path to data files (with a trailing slash ‘/’). This directory is mainly used with the flat file database backend but it contains also others data files like one for the EXIF function.

Example: “data/” or “../data/”

Default value: data/database_type

Category: main/database

This define your database backend. For now, you have the choice between ‘file’ for default Flat Files Database and ‘mysql’ for MySQL.

Default value: filedb_host

Category: main/database (Advanced)

Type: string

Name of the host running the MySQL database, if you don’t know try the default setting ‘localhost’, else ask your hosting compagny. NOTE: Only needed if using MySQL.

Example: ‘localhost’, ‘mysql.provider.com’db_name

Category: main/database (Advanced)

Type: string

Name of the database that will contain phpGraphy tables. NOTE: Only needed if using MySQL.

Example: ‘phpgraphy’, ‘accountname’db_pass

Category: main/database

Type: string

Password of your MySQL account. NOTE: Only needed if using MySQL.db_prefix

Category: main/database (Advanced)

Type: string

Prefix used for phpGraphy tables NOTE: Only needed if using MySQL.

Example: ‘phpg_’, ‘phpgraphy_’db_use_mysql_pconnect

Category: main/database (Advanced)

Enable/disable MySQL persistent connection ‘mysql_pconnect()’ See http://www.php.net/manual/en/features.persistent-connections.php for details. NOTE: Only needed if using MySQL.

Default value: 1db_user

Category: main/database (Advanced)

Type: string

Username of your MySQL account. NOTE: Only needed if using MySQL.debug_mode

Category: main/behavior (Advanced)

Change verbosity of the errors messages. If you have any problems that you can’t resolve, start by increasing the value of this setting. Keep also in mind that setting a high level of debugging might reveal details about your configuration. 0 = disabled, 1 = normal, 2 = verbose, 3 = development/debugging, 4 = development/debugging+

Default value: 2default_file_permissions

Category: main/behavior (Advanced)

Type: int

If set, file permissions will be changed to the value specified here, acceptable values are the same as the ones accepted by the chmod command of the form 0xxx. See http://php.net/manual/en/function.chmod.php for details

Example: ‘0664’, ‘0644’, ‘0600’directory_display_mode

Category: display/layout

Choose the way you want to display directories when in browsing mode. ‘picture’ display a picture with a nice frame border effect around, handle directory title and also display statistics for each directory (numbers of files and sub-directories) ‘icon’ display a small folder icon just before the directory name. ‘name’ oldschool mode, only display the directory name.

Default value: picturedirs_sort_by

Category: display/layout (Advanced)

Default sort method for directory, you can choose between ‘filename’ (default) and ‘datetime’.

Example: “filename” or “datetime”

Default value: filenamedirs_sort_order

Category: display/layout (Advanced)

Default sort order for directories, you can choose between ‘asc’ (default) and ‘desc’ (reverse)

Example: “asc” or “desc”

Default value: descexclude_files_preg

Category: display/pictures (Advanced)

Type: string

This variable contain a perl regexp (Regular Expression) of files/directories to exclude when parsing directories. Please modify it carefully as an improper value may break your whole site and/or render previously invisible files visible.

Default value: /^(\..*|_comment|thumbs.db)/ifiles_sort_by

Category: display/layout (Advanced)

Default sort method for files, you can choose between ‘filename’ (default) and ‘datetime’.

Example: “filename” or “datetime”

Default value: filenamefiles_sort_order

Category: display/layout (Advanced)

Default sort order for directories, you can choose between ‘asc’ (default) and ‘desc’ (reverse)

Example: “asc” or “desc”

Default value: aschighest_rating

Category: modules/rating

Type: int

The maximum rating that can be given to a picture, from 1 to this number Change this carefully, especially if you have already some pictures rated as it would falsify the results.

Default value: 5highres_min_level

Category: display/pictures

Type: int

Mininum level to be able to see high resolution pictures, Value can be from 0 to 999. “1” means that you need to be authenticated to see them, “0” mean that everyone as access to them.

Default value: 1icons_dir

Type: string

Obsolete since version: 0.9.11

Path to icons/images used by phpGraphy (with trailing ‘/’), default should be fine in most cases.

Example: “graphics/” or “someothername/”install_mode

Category: main/misc (Advanced)

Enable install_mode, you’ll then be redirected to the installation process pagesiptc_title_field

Obsolete since version: 0.9.11

Replaced by: metadata_title_field

This define which IPTC field should be used to fill (if empty) the picture title/description.

Example: ‘Iptc.ObjectName’ or ‘Iptc.Headline’language_file

Category: main/lang

Change the default language to one available in base/lang/ directory. Please note that the english language will still be used as fall-back, so if you get some english text, it means that the external language file is incomplete.

Example: “lang_fr.inc.php”lr_limit

Category: display/pictures (Advanced)

Type: string

Size (in bytes) where we generate a low resolution picture. Basically, if the picture is bigger than this size, a low resolution picture will be generated.

Example: “1024*100” mean that if a picture is more than 100KBytes, we generate a low res.

Default value: 102400lr_quality

Category: display/pictures (Advanced)

Quality (from 10 to 100) of the generated low resolution pictures.

Default value: 80lr_res

Category: display/pictures

Type: string

Size (in pixels) of the generated low resolution pictures.

Default value: 800×600metadata_title_field

Category: modules/metadata

This define which EXIF/IPTC field should be used to fill (if empty) the picture title.

Example: ‘Iptc.ObjectName’ or ‘Iptc.Headline’ or ‘Exif.JpegComment’

Default value: Iptc.ObjectNamemovie_extractor

Category: main/imagetools

Tool used to extract frames from movies and generate a thumbnail from it “ffmpeg” requires exec() permission and the ffmpeg binary to be installed and accessible from php. “none” is the default choice

Default value: nonemovie_extractor_path

Category: main/imagetools (Advanced)

Type: string

If you use ffmpeg as ‘movie_extractor’, you may have to specify its path using this directive if not autodetected (ie: not in the $PATH, %PATH%).

Example: “/usr/bin/ffmpeg” or “C:\FFmpeg\FFmpeg.exe”nb_col

Category: display/layout (Advanced)

Type: int

Maximum number of columns per page to display the thumbnails. See also nb_thumbs_max.

Example: “5” mean that you’ll get 5 columns of pictures per page

Default value: 3nb_last_added

Category: modules/lastadded

Type: int

Numbers of pictures/directories on the last added pictures/directories page

Default value: 10nb_last_commented

Category: modules/comments

Type: int

Numbers of pictures on the last commented pictures page

Default value: 10nb_pic_max

Type: string

Obsolete since version: 0.9.11

Replaced by: nb_thumbs_max

Maximum number of pictures per column (2 columns per page)

Example: “5” mean that you’ll get 10 pictures per pagenb_thumbs_max

Category: display/layout (Advanced)

Type: int

Maximum number of thumbnails per page. See also nb_col.

Example: “10” mean that you’ll get 10 pictures per page

Default value: 12nb_top_rating

Category: modules/rating

Type: int

Numbers of pictures on the top rated pictures page

Default value: 10picture_link_action

Category: display/layout (Advanced)

Action when clicking on a picture (lowres/highres) in display mode ‘nextpic’ Jump to the next picture of the current directory (or a random one when in random mode) ‘switchres’ Switch between High Resolution and Low Resolution pictures. Note that access to High Resolution pictures is limited by highres_min_level, such if the user hasn’t sufficients privileges, the link won’t even be displayed.

Default value: nextpicpictures_dir

Category: main/path (Advanced)

Type: string

Path to your pictures (with a trailing slash ‘/’), replace the old $root_config variable

Example: “pictures/” or “/home/http/htdocs/pictures/” or “../pictures/”)

Default value: pictures/postcomment_min_level

Category: modules/comments

Type: int

Minimum level required to post comments on images. 0 means that everybody (including non authenticated visitors) can post comments. Any value greater than 0 means that you need to be authenticated will a level at least equal to the one specified here.rating_pre_votes

Category: modules/rating (Advanced)

Type: int

When using ‘average’ as rating_score_mode, add some default votes with an average rating, this is to avoid that a picture with a single vote of 5 get a highest final rating than a picture with 4 votes of 5 and 1 vote of 4. It can be assimilated to a counter-balance. Value is a integer between 0 and 9.

Default value: 3rating_score_mode

Category: modules/rating

Choose the way the global rating (score) is calculated for a picture. ‘average’ – Add the sum of all votes plus the rating_pre_votes and divide by the number of votes ‘formula’ – Use a formula that will compute average rating and number of votes to give a score. This method give a better thought as the number of votes as a real impact on the final score.

Default value: averageroot_dir

Type: string

Obsolete since version: 0.9.11

Replaced by: pictures_dir

Path to your pictures (with trailing ‘/’).

Example: “pictures/” or “/home/http/htdocs/pictures/” or “../pictures/”)rotate_tool

Category: main/imagetools

Tool used to losslessly rotate your pictures. You can choose between “exiftran” and “jpegtran”, both require exec() permission and of course the choosen binary need to be accessible from php. “manual” is an equivalent to disabled as it will hide the rotate options. note: “auto” is obsolete since 0.9.11

Default value: manualrotate_tool_args

Category: main/imagetools (Advanced)

Type: string

Use this variable to redefine default arguments passed to rotate_tool, change this with care, default should be fine in most cases.

Example: for jpegtran, “-copy all -perfect”rotate_tool_path

Category: main/imagetools (Advanced)

Type: string

If you’ve setup a rotate_tool and it doesn’t work, you might need to specify its path here.

Example: “/usr/bin/exiftran”script_name

Category: main/behavior (Advanced)

Type: string

Use *ONLY* if you have problem with forms. On some PHP installation, the global variable SCRIPT_NAME is filled with erronous values. It should normally contain the path to access your page like “/phpgraphy/index.php” or “index.php” but in some cases it get filled in with values like “/cgi-bin/php” If you’re in this case, use this directive to correct the problem.

Example: “index.php” or “/phpgraphy/index.php”theme

Category: display/layout

Name of the active theme (located under themes/ with a valid theme structure)

Example: “default”, “mytheme”

Default value: defaultthumb_aspect

Category: display/pictures

Aspect of generated thumbnails. ‘normal’ (default) preserve the ratio between width and height, the largest side won’t be larger than the one specified in thumb_res. ‘square’ picture is cropped in the center, also note that only the left number of thumb_res is used.

Default value: normalthumb_generator

Category: main/imagetools

Tool used to generate thumbnails/lowresolution pictures. “gd” is the default and recommended choice. “convert” requires exec() permission and the ImageMagick to be installed and accessible from php. “manual” is a fallback choice if you want to handle thumbnails and low res images yourself. note: The “auto” option is obsolete since version 0.9.11

Default value: gdthumb_generator_path

Category: main/imagetools (Advanced)

Type: string

If you use convert as ‘thumb_generator’, you may have to specify its path using this directive if it’s not autodetected (ie: not in the $PATH, %PATH%). note: This directive replace the old ‘convert_path’ one

Example: “/usr/bin/convert” or “C:\ImageMagick\convert.exe”thumb_quality

Category: display/pictures (Advanced)

Quality (from 10 to 100) of the generated thumbnails

Default value: 60thumb_res

Category: display/pictures

Type: string

Size (in pixels) of the generated thumbnails, width per height. Note that thumb_aspect will influes on the final dimensions by preserving or not the aspect ratio.

Example: “100×100”

Default value: 100×100thumbs_order

Category: display/layout (Advanced)

Set the order to display the thumbnails L2R (left to right starting from the top), T2B (top to bottom starting from the left), R2L (right to left starting from the top)

Example: “L2R” mean that you’ll get the first picture on the top left corner and

Default value: T2B