Coppermine Photo Gallery v1.5.x: Documentation and Manual

Table of Contents
No translation available

Variables & Constants

System Global Variables

Global Variables are being populated once, but can be change during runtime. You can use the global variables from within your plugins, but don't forget to make them global when using from within functions or classes.

Variable name Defined in Type Description
$superCage include/ Construct used to contain the server vars sanitized by Inspekt
$CONFIG include/ All values of the coppermine configuration.
$CPG_PHP_SELF include/ Replacement for the potentially less secure superglobal $_SERVER['PHP_SELF'], $PHP_SELF and similar that may or may not exist on particular servers that get's removed in Coppermine using Inspekt.
$REFERER / $CPG_REFERER include/ Slightly sanitized improvement to the super global query string.
$LINEBREAK include/ String containing a line break that will work both is *nix as well as Windows.
$BRIDGE include/ / bridge file Bridging variable - contains all bridge settings.
$THEME_DIR include/ The folder name of the theme set in config.
$ICON_DIR include/ The directory where the iconset resides at: if the theme comes with icons, the variable will point to the icons subfolder of the theme. Otherwise, the default icon folder will be used.
$FAVPICS include/ The favorites of the current visitor.
tbc (list is incomplete). All devs please contribute and populate the list.

Back to top

Coppermine Constants

Constants are being populated once. They can not be changed during runtime. You can use the coppermine constants from within your plugins.

Category ID that contains the user galleries. Always is set to 1.
Constant name Defined in Description
COPPERMINE_VERSION include/ The version of coppermine
COPPERMINE_VERSION_STATUS include/ The status of your coppermine version (alpha, beta or stable)
IN_COPPERMINE Coppermine core files that are meant to be run directly in the browser The constant makes sure that include files are not being run directly: the files that are meant to be run contain the constant definition and after that the include command. The include files don't contain the constant definition, but a conditional die. To make sure that your plugin files aren't being run directly, add the following line at the top:
if (!defined('IN_COPPERMINE')) {
    die('Not in Coppermine...');
DEFAULT_LANGUAGE include/ Default language (set up by the admin) in config (may differ from $CONFIG['lang'] during runtime, as that may have been overridden.
UDB_INTEGRATION include/ Name of the bridge file.
GALLERY_ADMIN_MODE include/ If populated, the user is an admin and admin-menu hasn't been turned off. It's recommended to use this constant to check if the admin is logged in. Use code like this:
    cpg_die(ERROR, $lang_errors['access_denied'], __FILE__, __LINE__);
USER_IS_ADMIN bridge/ (by default: bridge/ If populated, the user is an admin.
USER_ADMIN_MODE include/ The "user admin mode" hardly is used any longer - it's a relict from cpg1.3.x and might be dropped in future versions. The definition is
so it get's populated if a user is logged in and has permission to have personal albums. The constant does not get populated if an admin is logged in, unless he hides the admin controls.
USER_ID bridge/ (by default: bridge/ The user ID of the logged in user - helpfull to send the user to his profile.
USER_CAN_CREATE_ALBUMS bridge/ (by default: bridge/ The name of this constant may be a bit misleading: actually, it doesn't show if the user has got permission to create albums in public categories. Instead, it just shows if the user is allowed to have personal galleries.
USER_GROUP_SET bridge/ (by default: bridge/ Contains the groups the user is a member of (as a coma-separated list).
THEME_HAS_MENU_ICONS themes/yourtheme/theme.php
THEME_HAS_RATING_GRAPHICS themes/yourtheme/theme.php
THEME_HAS_NAVBAR_GRAPHICS themes/yourtheme/theme.php
THEME_HAS_FILM_STRIP_GRAPHIC themes/yourtheme/theme.php
THEME_HAS_NO_SYS_MENU_BUTTONS themes/yourtheme/theme.php
THEME_HAS_NO_SUB_MENU_BUTTONS themes/yourtheme/theme.php
USER_GAL_CAT include/
FIRST_USER_CAT include/ Value for the first ID of the user gallery category - this is where the numbering scheme starts. By default is set to 10000, which should give all admins plenty of room for admin-defined categories (possible IDs 2 to 9999).
TEMPLATE_FILE include/ Default is template.html. Don't change unless you really know what you're doing.
INFORMATION include/ Constant used by the cpg_die function to hard-code the caption of a die message
ERROR include/ Constant used by the cpg_die function to hard-code the caption of a die message
CRITICAL_ERROR include/ Constant used by the cpg_die function to hard-code the caption of a die message
tbc (list is incomplete). All devs please contribute and populate the list.

Back to top