Coppermine 1.3.5 FAQ

FAQ for Coppermine Photo Gallery v1.3.5
For credits and copyrights, see Coppermine documentation

There are always the same questions asked on the support forums for Coppermine Photo Gallery; that's why we decided to start a little FAQ on this issues.

Table of contents:


 

Installation

What are the minimum requirements for the use of Coppermine 1.3. ?



[top of page]

What's GD and how can I get it?

GD is a graphical library which enables PHP to do image manipulation. You can download it at www.boutell.com/gd/. You will need to recompile PHP on (L)Unix systems, depending on your setup Apache as well. Most recent versions of PHP come with GD - go for a package. On most windows systems, you can just enable it in the php.ini file. (this can of course only be done if you're running your own server; if you're with a webhost: find out if your webspace has gd; if not: ask your webhost if you can have it or get another webhost).


[top of page]

What's ImageMagick and how can I get it?

ImageMagick is a graphical library for image manipulation. You can download it at imagemagick.org. There are sources available for Unix, Linux, Mac and Windows executables, as well as binary packages for various server operating systems. You can only install ImageMagick if you are running your own server, or you have shell access to it - you can not install ImageMagick if you're webhosted.


[top of page]

How do I find out which version of PHP I have?

create a blank file named "info.php", put this code into it: <?php phpinfo(); ?>, upload this file to your webserver and run it in your browser (e.g. http://www.yourdomain.com/info.php). In the very first line it should say "PHP Version X.Y.Z"
Please note: leaving info.php on your server might be a security risk; either delete it after use or move it into a password protected directory!
 
In cpg1.3.0 (or better), there's a phpinfo file (phpinfo.php) within the coppermine folder (you'll have to be logged in as admin though) - simply point your browser to http://yourdomain.tld/your_coppermine_folder/phpinfo.php .


[top of page]

How do I find out which version of GD I have?

create a blank file named "info.php", put this code into it: <?php phpinfo(); ?>, upload this file to your webserver and run it in your browser (e.g. http://www.yourdomain.com/info.php). Look for a table like this:

gd
GD Supportenabled
GD Version1.6.2 or higher
FreeType Supportenabled
FreeType Linkagewith TTF library
JPG Supportenabled
PNG Supportenabled
WBMP Supportenabled

Please note: leaving info.php on your server might be a security risk; either delete it after use or move it into a password protected directory!
 
In cpg1.3.0 (or better), there's a phpinfo file (phpinfo.php) within the coppermine folder (you'll have to be logged in as admin though) - simply point your browser to http://yourdomain.tld/your_coppermine_folder/phpinfo.php .


[top of page]

What's the difference between GD1 and GD2?

GD2 will create pictures with better quality (intermediate and thumbnails).

Here's an example taken from w-nailer: about resizing
(Original pic size: 1024 x 768 pixels):
GD 1.8.4:
ImageCreate
ImageCopyResized
128 x 96 pixels
GD 2.0.1:
ImageCreateTrueColor
ImageCopyResampled
128 x 96 pixels
Upgrading GD lib when coppermine is already installed will therefor not affect the pictures which are already created, but only new ones. You can not upgrade nor install GD lib unless you're running your own webserver - only your webhost can!


[top of page]

What are the steps to get Coppermine running?

as stated in the readme:

  1. Download Coppermine
  2. Unzip it to your harddrive
  3. Upload the stuff to your server
  4. chmod the folders "include" and "albums" for the script (the webserver, that is) to have read/write access
  5. point your browser to http://www.yoursite.com/coppermine/install.php and follow the directions of the install file (basically the mySQL-tables will be created there and the config table will be filled with default values)
  6. after successfull installation, delete install.php from your webserver
  7. point your browser to http://www.yoursite.com/coppermine/ , log in as admin, admin mode and do the config job (customizing your coppermine)
  8. Play around, toy a little, test if everything works
  9. Publish your site by linking it (e.g. from your homepage)


[top of page]

How can I install ImageMagick or GD?

You can only install ImageMagic or GD if you're running your own server or if you have at least shell access to your webserver. If you're hosted by a webhost you can only contact your webhost and ask them to install it for you or choose another webhost.


[top of page]

I'm short on webspace. Is there a "minimum install"?

This is of course a contradiction in terms: running a gallery page usually means you will need a lot of webspace for your pics, but if you only want to publish some pics and have little webspace left, there are some files that don't have to be uploaded or can be removed if not needed. It is however recommended that only experienced users create a minimum install; when in doubt, go for the full install.

  1. Remove all languages that you don't need (if your users are all from the same country).
    It's recommended that you keep English anyway even if your users use another language, just for you as admin to be able to temporarily switch to English.
    Delete all files in the lang-subfolder of your coppermine install except yourlanguage.php (e.g. if you're using french, delete all files but /lang/french.php and /lang/french-utf-8.php).
    Webspace that can be saved (maximum): 2.9 MB
  2. Remove all language files that come with an encoding you don't need
    You'll notice that for each language there are two files in the lang-folder: yourlanguage.php and yourlanguage-utf-8.php. You will need the utf-8 files only if you chose "Unicode(utf-8)" in "Character encoding" on your config page. Using Unicode (utf-8) will display the gallery in the language your page visitor has set in his browser. If you haven't chosen Unicode (utf-8) in coppermine config, it's safe to delete all language files with "utf-8" in their filenames from the lang folder.
    Webspace that can be saved (maximum): 1.7 MB
  3. Remove all unnecessary themes
    Remove all themes you won't use from your themes folder. If you're using a customized theme, it's recommended to leave the classic/default theme in place for administrative purposes.
    Example: if you're using the theme "Eyeball" that comes with coppermine, you can safely delete the sub-folders "classic", "fruity", "hardwired", "igames", "mac_ox_x", "project_vii", "rainy_day", "styleguide" and "water_drop" from your themes folder.
    Webspace that can be saved (maximum): 1 MB
  4. Remove the docs folder
    The docs folder contains documents that are meant to help you set up and administer coppermine, but it doesn't have to be on your webserver. You can safely delete the docs folder from your webserver (or even don't upload it in the first place), but it's strongly recommended to keep the docs folder on your local machine for reference.
    Webspace that can be saved (maximum): 0.5 MB
  5. Remove bridge files
    The bridge files are being used for integration of coppermine with a bulletin board software like phpBB, YaBB SE, SMF etc. If you're not using bbs integration at all it is safe to delete the whole bridge folder from your webserver (or not upload it in the first place). If you are using bbs integration, you will have to keep the bridge file that corresponds to the bbs you're using - it's safe to delete all other bridge files that exist inside the bridge folder.
    Webspace that can be saved (maximum): 137 KB
  6. Remove the flags
    If you're not going to use the "select language by flags" option from the coppermine menu, it's safe to delete the flags folder (/your_coppermine_folder/images/flags/). If you are using the flags option, you can of course delete all flags you don't use at all.
    Webspace that can be saved (maximum): 80 KB
  7. Remove files that are needed for install or upgrade only
    Once Coppermine has been installed and is "up-and-running", you can safely delete the files that are needed for installing only: from the coppermine root folder, delete install.php, installer.css, update.php, upgrade-1.0-to-1.2.php. You can delete the folder "sql" as well.
    If you want to update/upgrade your coppermine install later (once a new version comes out), you will of course have to re-upload the update files and the sql folder to your webserver.
    Webspace that can be saved (maximum): 73 KB
Summary: a minimum install of coppermine will need approx. 3.3 MB of webspace.
[top of page]

Upload

General Upload Troubleshooting

When troubleshooting uploads in CPG 1.3, you are advised to change the upload settings in the Groups console to 'Single uploads only' and to activate 'Debug mode' in the Config console. Changing this setting negates some of the error masking done in the multiple upload setting. This will allow you to access more detailed error messages.

First and foremost: check your permissions on the /albums, /albums/userpics, and /albums/edit directories. All should be 777 or 755.
If you don't know what we mean when we write 777 or 755, you need to do a Google search on UNIX file permissions. Windows has a similar set of file permissions. You can usually set these permissions using your FTP client.
For those of you who skim over statements written in red letters, I will repeat to try to get your attention:
Yes, we are writing about something that could apply to YOU.
 
We repeat -- check your permissions on the /albums, /albums/userpics, and /albums/edit directories. All should be 777 or 755.
 
Yes, we want you to check the permissions of each folder even if you think you have already done this. Yes, we mean it.

Please keep in mind that HTTP uploads are limited by the restrictions placed upon them in PHP's configuration.


 
Things to check:
  1. max_input_time- 60 seconds is the default time limit for uploading files.
    This time limit includes the time it takes for the files to upload, so if you exceed this limit, the file will not even parse, and the browser will not get a response. You can workaround this by trying to upload smaller or fewer files, or you can try uploading over broadband. The best solution, of course, is to increase the time limit to something more in line with your needs.
  2. upload_max_filesize - 2MB is the default limit for individual files.
  3. post_max_size - 8MB is the default limit for post requests.
  4. memory_limit - 8MB is the default size.
  5. PHP's LimitRequestBody - 512KB default limit. (mainly an issue on Redhat/Apache systems. Found in /etc/http/conf.d)
    In general, upload_max_filesize < post_max_size < memory_limit in order for uploads to function properly. Coppermine may warn you if a file exceeds upload_max_filesize, but it cannot warn you if the total size of all the files exceeds the post limit or the memory limit.
  6. file_uploads – This determines whether or not PHP will allow file uploads. It must be set to ‘On’.
  7. upload_tmp_dir – This specifies the temporary directory where PHP stores uploaded files.

The most common issue caused by this setting is an open_basedir warning. In this situation, your server administrator has restricted the files that PHP can work with to a certain directory. If he does not create and specify a temporary directory within the open_basedir restriction, PHP will attempt to use the OS temporary directory, and it will be rebuffed by the open_basedir restriction.

Some notes about the different types of upload mechanisms available in CPG 1.3:
Multiple HTTP uploads are designed to handle a small number of files, and have been capped at 10. Therefore, they are not really suited for large numbers of files unless you have control over your php.ini configuration.
If you are looking to upload in excess of 15 or 20 files at a time, you should consider the batch add process or the XP_Publisher utility. Each has its own drawbacks and advantages.
The batch add process is fast, but it puts quite a load on the server and may experience timeouts. The XP Publisher utility is slower, but it limits the load on the server. Also, it avoids many of the pitfalls caused by the php.ini configuration by uploading each file in the set as an individual post request.


[top of page]

Error Messages

When installing I get the error Fatal error: Call to undefined function: imagecreatefromjpeg() in /include/picmgmt.inc.php on line 168. What does that mean?

This error means that the version of PHP installed on your server has no support for the GD image library.
If the ImageMagick suite is installed on your server you can try to use it, else you have to complain to your webhost (the GD image library is now a standard component of PHP and should normally be installed de facto). Coppermine won't run without gd or image magick.


[top of page]

When installing I get the error Warning: mkdir(dummy) [function.mkdir]: Permission denied in /your/path/to/coppermine/install.php on line 126. What does that mean?

The script must have the right to create and delete files.



[top of page]

I get the error "Warning: Empty Delimiter in search.inc.php line 33". What can I do?

Edit the file include/search.inc.php
Look for the line with
$charset = $CONFIG['charset'] == 'language file' ? $lang_charset : $CONFIG['charset'];
Replace it with :
$charset = $CONFIG['charset'] == 'language file' ? $GLOBALS['lang_charset'] : $CONFIG['charset'];


[top of page]

I get the error Zero Sized Reply during install. What can I do?

Some users experienced this error message during install:

While trying to retrieve the URL: http://yoursite.com/coppermine/install.php
The system returned:
Zero Sized Reply
Reason:
The remote server did not reply any data for this request.
Please try again later
It's unknown why this happens so far - those who have this error simply can't use Coppermine (sorry for that). If you have got an idea what causes this error (and possibly can come up with a solution), please visit the support board and clue us in!


[top of page]

I have the error message Warning: Undefined index: SCRIPT_NAME in /www.your-domain.com/include/init.inc.php on line 90. What can I do?

Try to edit the file include/init.inc.php:
change

$PHP_SELF = isset($HTTP_SERVER_VARS['REDIRECT_URL']) ? $HTTP_SERVER_VARS['REDIRECT_URL'] : $HTTP_SERVER_VARS['SCRIPT_NAME'];
to
$PHP_SELF = $HTTP_SERVER_VARS['PHP_SELF'];


[top of page]

When I try to upload a picture I get the error message Impossible to move somepic.jpg to albums/userpics/ | Warning: move_uploaded_file(/tmp/phpezCYKr) [function.move-uploaded-file]: failed to create stream: Operation not permitted. What's wrong?

You should contact the admin of your webhost because usually you can't change the location of the temporary directory for file uploads yourself (it is part of PHP configuration) .
If the open basedir restriction is in effect on your site then the temp directory for file uploads should be one that you can access.


[top of page]

When I try to upload a picture I get the error message Warning: opendir(./albums/edit): failed to open dir: No such file or directory. What's wrong?



[top of page]

When uploading I get the error Warning: Undefined variable: HTTP_POST_VARS in include/init.inc.php on line 43. What can I do?

Check if your version of PHP fullfills the minimum requirements for Coppermine. If your version is 4.1.0 or better, then this error is probably caused by a misconfiguration of your server, so Coppermine isn't to blame in the first place. If the server isn't yours to configure properly (that is: if you're with a webhost), you can try this workaround (at your own risk):
Edit the file "init.inc.php" and look for

$PHP_SELF = isset($HTTP_SERVER_VARS['REDIRECT_URL']) ? $HTTP_SERVER_VARS['REDIRECT_URL'] : $HTTP_SERVER_VARS['SCRIPT_NAME'];
Replace it with
$PHP_SELF = $HTTP_SERVER_VARS['PHP_SELF'];


[top of page]


 

Setup / Administration

How can I include a link in an album description or the caption of a pic?

Coppermine understands the following bbCodes (the same bbCodes that are used by phpBB) in image and album description:

code output
[b]bold text[/b]
bold text
[i]italic[/i]
italic
[url=http://www.foo.com/bar.html]URL text[/url]
URL text
[email]user@domain.tld[/email]
user@domain.tld
[top of page]

I don't want to show the last uploads on the start page. How do I edit what's shown on the start page of coppermine?

  1. login as admin into your CPG
  2. click on "Admin Mode" if it is not already enabled
  3. Click on Config in the "Admin Menu"
  4. under "Album list view" use the above provided keywords: (e.g. catlist/alblist/random,2/lastup,2 means "category list, album list, 2 rows of random pics, 2 rows of last uploads")


[top of page]

How do I remove/edit the bottom line "Powered by Coppermine" ?

You mustn't remove the line - it's part of the deal: you're allowed to use Coppermine on your site, but the line stays! It's more than justified to give credit where credit is due; be glad you're able to use such a great piece of software for free.
You are allowed to change the way the line looks by editing the CSS class to make it fit into the design of your site; edit /themes/yourtheme/style.css, look for the class "Footer" and change it as you wish.
Note: don't ask stupid questions on removing this line in the Coppermine Photo Gallery Support Board - your posting will be deleted!


[top of page]

I want to buy a license for Coppermine (and get rid of the "Powered by Coppermine" line). How?

As Coppermine itself is based on OpenSource software published under GNU/GPL (which allows the modification of the code, but disallows to sell the code, modified or not), you can not purchase a version of coppermine with the credit line removed. Read the file COPYING that comes with the distribution of Coppermine for details.


[top of page]

I don't want to use the feature XYZ of Coppermine. How can I remove it?

Just remove the link; edit /themes/yourtheme/theme.php, look for the feature you want to remove and comment out the HTML code.
Example: if you want to remove the ecard-feature, just look for

<td align="center" valign="middle" class="navmenu" width="48">
<a href="{ECARD_TGT}" title="{ECARD_TITLE}">
<img src="images/ecard.gif" width="16" height="16" border="0" align="absmiddle" alt="{ECARD_TITLE}"></a>
</td>
and replace it with
<!--<td align="center" valign="middle" class="navmenu" width="48">
<a href="{ECARD_TGT}" title="{ECARD_TITLE}">
<img src="images/ecard.gif" width="16" height="16" border="0" align="absmiddle" alt="{ECARD_TITLE}"></a>
</td>-->


[top of page]

How do I add a custom header/footer to Coppermine?

There are these files to look for:



[top of page]

How do I create an album that anyone can add photos to?

(assuming you have already created at least one category with at least one album where the uploads should go to):



[top of page]

How can I backup my coppermine database?

There's no built-in backup solution for coppermine available yet. Meanwhile, backup your directory/file structure via good old ftp and use a tool like phpMyAdmin to backup the database (many webhosts that offer mySQL also offer a pre-installed version of phpMyAdmin - go for that!). PhpMyAdmin is easy to install: just download the distribution, unzip it to your harddrive, edit one config file and upload it to your server.
Here's a small "howto backup a database with phpMyAdmin":



[top of page]

The fullsize-pic doesn't pop up when clicking on the intermediate size pic. What's wrong?

You probably over-edited your template: you'll definitely need the line <script type="text/javascript" src="scripts.js"></script> inside /themes/yourtheme/template.html to make the pop-up window work...
The <head>-part of your template file should look like this:

<head>
<title>{TITLE}</title>
<meta http-equiv="Content-Type" content="text/html; charset={CHARSET}" />
{META}
<link rel="stylesheet" href="themes/default/style.css" />
<script type="text/javascript" src="scripts.js"></script>
</head>
- just check the default theme that comes with coppermine if you're unsure.


[top of page]

How can I let unregistered users see the thumbnails only, but not the actual pictures?

Edit displayimage.php and add
if (!USER_ID) cpg_die(ERROR, 'You need to register to access this page', __FILE__, __LINE__);
just before

/**************************************************************************
* Local functions definition
**************************************************************************/


[top of page]

How can I prevent other sites linking directly to the pictures in my gallery instead of the gallery page?

Prevent "hotlinking" by creating a .htaccess file in the albums folder and adding this:

SetEnvIfNoCase Referer "^http://www.yourdomian.com/" locally_linked=1
SetEnvIfNoCase Referer "^http://yourdomain.com/" locally_linked=1
SetEnvIf Referer "^$" locally_linked=1
<FilesMatch "\.(gif|png|jpe?g)$">
  Order Allow,Deny
  Allow from env=locally_linked
</FilesMatch>
This will only work on linux/unix and only if you're allowed to do that by your webhost or if you run your own server!


[top of page]

I tried to change the language on the config page, but it doesn't work. What's wrong?

"Character encoding" is probably set (or has been set sometime ago) to UTF-8 on your config page.
When UTF-8 is selected, Coppermine chooses your language file based on your browser configuration and stores the value in a cookie. This overrides the value stored in the CONFIG.
To fix that:



[top of page]

How do I let guests, not only registered users to put comments on pictures?

To change the settings by album (above steps must have been made):


[top of page]

I can't upload with the upload feature. What's wrong?

If you get the error message No picture was uploaded. If you have really selected a picture to upload, check that the server allows file uploads..., check if there's a problem with HTTP uploads on your server - they may have been disabled or improperly configured. In phpinfo(), check that "file_uploads" is ON, "upload_max_filesize" is something like 2M and "upload_tmp_dir" is a valid directory!


[top of page]

How do I change the order of categories?



[top of page]

I can't delete a certain picture with ftp. What can I do?

It is not Coppermine that doesn't let you delete the picture, it is your FTP server. The problem is due to the configuration of your server. Try to delete your picture from within the script.
If PHP on your server runs under the user nobody then all files created by any PHP script (this is not specific to Coppermine) will be owned by nobody. There is no way to change that.
 

0777 should not be the default mode for directories because it may be completely unsafe, if your gallery is running on a shared server and PHP safe mode is not enabled, anybody having an account on the server can possibly delete your pictures. There have been several threads on this issue on the Menalto Gallery forum and several users have seen their gallery hacked and destoyed because of that. This issue is not specific to Photo galleries, it applies to all PHP scripts that create directories. Provided you have write access to a directory, you can delete any file it contains, even if you don't have write access to the file itself.
 
I prefer to have 20 persons complaining LOUDLY and REPEATINGLY that they have to contact their sysadmin to uninstal Coppermine, that this is an issue and possibly switching to another gallery because of that rather than 1 person complaining that all his pictures have been erased.
 
If you disagree spend you time reading :
http://www.zend.com/manual/function.mkdir.php
http://www.zend.com/manual/function.chmod.php
rather than posting in this forum.
 
It is the decision of the sysadmin to run PHP as an Apache module and the fact that all files/dir created by PHP be owned by nobody for instance is the result of this decision. So sysadmins should not complain when you ask them to remove some files or directory.
 
On the webhost this site is running on, everything works fine when directory are created with mode 755 and all files/dir created by PHP are owned by the chezgreg user which is the user I use when connecting by FTP. Also if one of the file/directory on my site has a mode of 777, the server will shutdown my site and send me an email warning me that this is unsafe.
 
Greg



[top of page]

I can't upload big pics. What's wrong?

The max. size of pics is limited by various settings - to find out why you can't upload big picks, check the following:



[top of page]

I can't login to Coppermine. What's wrong?

This is most likely a cookie issue:



[top of page]

How can I change the sorting order of the albums?

By default the album appear in the order they were created. If you want to adjust the sorting order, do this:



[top of page]

I don't use the intermediate pictures anymore. How can I delete them to gain disk space?


[top of page]

How do albums and folders work in coppermine?

  1. When you create an album, it is a 'virtual' album. Coppermine doesn't create a folder for this album on the server's hard drive, it leaves the pictures where they are on the server, and uses the database to know which pic belongs in which album. You can move pics from album to album, but this is all done in the database, the pics are never moved on the server.
  2. When you upload by html, using the 'upload' link, coppermine places the pic (and the thumb and normal size copies) in the 'userpics' directory.
  3. When you upload by ftp, you should place the pics in a folder you create, within the 'albums' folder, but not in the 'userpics' folder. You can create as many folders/sub-folders here as you want. You can call these folders anything you want, but we recommend mirroring the category/album structure you have created on the site, for eae of use.
  4. When you batch add, coppermine asks you what album you want to put the pics in, but it leaves the pics where they are on the server.

[top of page]

How can I move albums from one category to another?


 

Add-ons / Modifications / Hacks

How can I change the order of the pics when editing them?

By default, the pics are shown alphabetically when you edit them. To change the sorting order to "by date", edit editpics.php and change
$result = db_query("SELECT * FROM {$CONFIG['TABLE_PICTURES']} WHERE aid = '$album_id' ORDER BY filename LIMIT $start, $count");
to
$result = db_query("SELECT * FROM {$CONFIG['TABLE_PICTURES']} WHERE aid = '$album_id' ORDER BY pid LIMIT $start, $count");


[top of page]

How can I create a menu that's shown on the right side of the gallery?

When the template.html is read, it is split in 2. What is before the {GALLERY} tag is output by the pageheader function, what is after by the pagefooter function.
If your menu is in the "footer" you need to modify your theme.php file

   $template_vars = array(
      '{LANG_DIR}' => $lang_text_dir,
      '{TITLE}' => $CONFIG['gallery_name'].' - '.$section,
      '{CHARSET}' => $CONFIG['charset'] == 'language file' ? $lang_charset : $CONFIG['charset'],
      '{META}' => $meta,
      '{GAL_NAME}' => $CONFIG['gallery_name'],
      '{GAL_DESCRIPTION}' => $CONFIG['gallery_description'],
      '{MAIN_MENU}' => theme_main_menu(),
      '{ADMIN_MENU}' => theme_admin_mode_menu()
   );

   echo template_eval($template_header, $template_vars);
will become
   $template_vars = array(
      '{LANG_DIR}' => $lang_text_dir,
      '{TITLE}' => $CONFIG['gallery_name'].' - '.$section,
      '{CHARSET}' => $CONFIG['charset'] == 'language file' ? $lang_charset : $CONFIG['charset'],
      '{META}' => $meta,
      '{GAL_NAME}' => $CONFIG['gallery_name'],
      '{GAL_DESCRIPTION}' => $CONFIG['gallery_description'],
   );

   echo template_eval($template_header, $template_vars);
and
echo $template_footer;
will become
   $template_vars = array(
      '{MAIN_MENU}' => theme_main_menu(),
      '{ADMIN_MENU}' => theme_admin_mode_menu()
   );

   echo template_eval($template_footer, $template_vars);


[top of page]

How can I send a user directly to his private album once he logs in?

edit
login.php
and search for
pageheader($lang_login_php['login'],"<META http-equiv=\"refresh\" content=\"3;url=$referer\">");

and add before it
$referer = 'index.php?cat='.(FIRST_USER_CAT+$USER_DATA['user_id']);


[top of page]

How can I prevent unregistered user from viewing the gallery?

edit
displayimage.php and index.php and search.php and thumbnails.php
and search for

require('include/init.inc.php');

and add after it
if (USER_ID){

} else {
{
   $redirect = $redirect . "login.php";
   header("Location: $redirect");

   exit();
        }
}



[top of page]

How can I display the name of the uploader with the picture info?

Warning: this is quite a complicated hack for a newbie to perform!
Edit displayimage.php and search for:
$info[$lang_picinfo['Filename']] = htmlspecialchars($CURRENT_PIC_DATA['filename']);
add after it:
$info[$lang_picinfo['Username']] = htmlspecialchars($CURRENT_PIC_DATA['user_name']);.
Then open /include/functions.inc.php and search for following in function get_pic_data():
if($select_columns != '*') $select_columns .= ', title, caption';
and replace it with:
if($select_columns != '*') $select_columns .= ', title, caption, user_name';.
After that search for:
$result = db_query("SELECT $select_columns from {$CONFIG['TABLE_PICTURES']} WHERE aid='$album' $approved $ALBUM_SET ORDER BY $sort_order $limit");
and replace it with:
$result = db_query("SELECT $select_columns from {$CONFIG['TABLE_PICTURES']} AS p LEFT JOIN {$CONFIG['TABLE_USERS']} AS u ON u.user_id = p.owner_id WHERE p.aid='$album' $approved $ALBUM_SET ORDER BY $sort_order $limit");
Then you have to add the language string for the username. Open /lang/yourlang.php and search for:
$lang_picinfo = array(
and add after that:
'Username' => 'Username',
Also you need to execute this query in MySQL (with a tool like phpMyAdmin):
ALTER TABLE `cpg11d_pictures` ADD INDEX ( `owner_id` );
(If your table_prefix is not cpg11d_ then you need to change it in the query)


[top of page]

How do I enable clickable links in custom user fields?

edit displayimage.php and change
$info[$CONFIG['user_field'.$i.'_name']] = make_clickable($CURRENT_PIC_DATA['user'.$i]);
into
$info[$CONFIG['user_field'.$i.'_name']] = bb_decode($CURRENT_PIC_DATA['user'.$i]);
 
In order to allow the use of BBCodes in custom fields: you can then have something like
[url]http://www.somesite.com/foo/bar.php?whatever=42[/url]
or
[url=http://www.somesite.com/foo/bar.php?whatever=42]link to some site![/url]
in your custom user fields (which of course have to be enabled first in the config page)


[top of page]

How can I sort the thumbnails by user defined (custom) fields?

  1. edit /includes/functions.inc.php
    change
    $sort_array = array('na' => 'filename ASC', 'nd' => 'filename DESC', 'da' => 'pid ASC', 'dd' => 'pid DESC'); 
    to
       $sort_array = array(
          'na' => 'filename ASC',
          'nd' => 'filename DESC',
          'da' => 'pid ASC',
          'dd' => 'pid DESC',
          'f1a' => 'user1 ASC',
          'f1d' => 'user1 DESC',
          'f2a' => 'user2 ASC',
          'f2d' => 'user2 DESC',
          'f3a' => 'user3 ASC',
          'f3d' => 'user3 DESC',
          'f4a' => 'user1 ASC',
          'f4d' => 'user1 DESC'
       );
    
  2. edit /themes/yourtheme/theme.php


[top of page]

How do I enable IPTC support?

edit /includes/picmgmt.inc.php and search for
$imagesize = getimagesize($image);
replace with:

$imagesize = getimagesize($image,&$info);
$iptc = iptcparse($info["APP13"]);
if (is_array($iptc)) {
$caption.=$iptc['2#120'][0];
$title.=$iptc['2#105'][0];
(is_array($iptc['2#025'])) && ($keywords.=implode(" ", $iptc['2#025']));
}
This hack hasn't been tested, use at your own risk...!


[top of page]

How can I add some output directly before the line "Powered by Coppermine"?

Edit /themes/yourtheme/theme.php, look for echo $template_footer and add the stuff you want to output in a line before it, like print '<span class="footer"><a href="http://www.mylink.com/foo.htm">My Link</a></span>';


[top of page]

Common PHP errors and how to get rid of them...

There are a lot of people (especially PHP newbies) that post questions like I get the error "Parse error: parse error in XXX" and don't know what to do about it. That's why I translated this list of common errors (and a solution how to fix them) from the original german article in Dr. Web :



[top of page]

Can I rename template.html to template.php to include PHP code in my template?

No, this is simply not the way coppermine works; for "normal" pages the name of the extension tells the webserver wether the file should be parsed by the PHP interpreter. The template files within the themes folder are not being parsed this way - the extension .html was just chosen to make editing easier. You can not have PHP code in the template file, no matter how you name it - that's it!


[top of page]

How can I prevent users from saving (stealing) my pictures?

You can not completely prevent users from stealing your pics - that's the way the www works: if a picture is being displayed in the browser, the user already has a copy of it on his hard drive. There are however some methods to make it harder for newbie users to steal your pics:



[top of page]


 

I'm running my own server

How do I enable gd on my Windows server?

GD 1.x 2.x are normally part of all standard PHP distributions under Windows
To check if you have it, go to the directory where you installed PHP, go to the "extensions" subdir and see if you have a file named "php_gd2.dll".
Sometimes you also need to edit your php.ini file (located in windows directory normally) and remove the ";" that is at the beggining of the line:
extension=php_gd2.dll (at the end of the file). This will cause PHP to load the GD2 extension.
Whenever you make changes to php.ini, remember that you may need to restart your webserver.
ImageMagick it quite complicated to use under Windows
Greg


[top of page]

How do I enable ImageMagick on my Windows server?

ImageMagick is quite complicated to set up on Windows. There are several things to be taken into account. The Coppermine support board is not the right place to ask for help on installing it, as it deals with Coppermine, not "How to set up a server" (most people on the Coppermine boards don't run their own webserver, but they have webspace by a webhost). Instead, try to find support boards on the internet that deal with this special topic.


[top of page]


 

Coppermine Support board

These are (alas) not-so-frequently-asked-questions on the support board. Before posting on the Support board (or, in fact, any board), please read this:

I don't know PHP/mySQL...

No problem with that, everyone has been a newbie once he started, but: please don't start each and every posting by stating "I'm a newbie", "I don't know anything about PHP" etc.
Mostly, one can tell that by your question itself, no need to apologize...


[top of page]

I've posted my question a while ago, but nobody answers. What the...?

The support board is not a hotline. Although there are many visitors to the site, only a few do actually support - on a free, voluntary base. We don't get paid for it, we have a life, a job, a family. We are away sometimes.
If you don't get an answer to your question:



[top of page]

How should I write my question?

If you have a question, make sure you provide as much information as possible:



[top of page]

I've run into trouble. What should I do first (before posting on the board)?



[top of page]

Hey, by looking at your profile I can see you're German/French/Whatever. Can I post a question in that language?

Please do not post in another language than English - this way, others may benefit from your question (and the answer), too. Don't be afraid to write "bad english" - no one will laugh at you, and most visitor's first language isn't english either!


[top of page]

May I email/pm/im you for support?

No you mustn't! Post your question on the Coppermine support board (publicly) - if we (the community) don't find a solution and I have the time and I want to I'll email/pm/im you!


[top of page]

Who are you anyway?

We are a group of people who decided to form a team to develop Coppermine further - check the team page for details...


[top of page]


 
This FAQ is a work in progress, please contribute in the Coppermine Photo Gallery Support Board (don't contact me to ask for fixes of your Coppermine install). Please report any bugs, typos etc.
Check the online-version of this document for updates!
Have fun!

GauGau (aka Joachim Mueller) - coppermine dev team



[top of page]


SourceForge.net LogoPowered by Sourceforge.net