Coppermine PostNuke
From OptionC
This is primarily for integrating Coppermine Photo Gallery (http://coppermine-gallery.net/index.php) with the PostNuke Content Management System (http://www.postnuke.com) (using the pnCPG (http://www.casnuy.com) unified login module. It was originally used for PostNuke 0.750 and Coppermine 1.3.4. We are now testing it for Coppermine 1.4.1-beta, but cannot recommend it for production use. However, as I go through this, I noticed they pushed 1.3.5 on 2005-09-25; when I upgrade, I'll change this.
| Table of contents |
|
|
Installation
In general, I've found this to be a relatively forgiving install. I've forgotten many steps, yet been able to go back and recover by reconfiguring. However, the one thing I have yet to get working is pnCPG (unified logon) with the 1.4.1-beta.
Preparation
- Coppermine Download (http://sourceforge.net/project/showfiles.php?group_id=89658)
- pnCPG Download (http://www.casnuy.com/pn750/modules.php?op=modload&name=UpDownload&file=index)
Here are the "listed" requirements for Coppermine
- A web server that supports PHP
- A MySQL database You need at least version 3.23.23 or better (4.x recommended). Your mySQL user needs permissions to perform CREATE, ALTER, SELECT, UPDATE, DELETE (most user have these permissions when webhosted; if you don't have them, you won't be able to use any pre-made scripts at all)
- A database needs to be set up that coppermine can use - the install script will not create a database for you. In most webhosted environments, you already have at least one database set up for you by your webhost.
- PHP (version 4.1.0 or better), either compiled with the support for the GD library or permission to use the exec() function for the ImageMagick "convert" utility in order to make thumbnails and reduced size images.
- An image library: either GD (PHP has to be compiled to support it) or ImageMagick.
Image Libary
As I already had the web environment, the only issue was the image library. Although I did tests with imagemagick, I had problems with large imports. Coppermine isn't particularly supportive of large file sizes, but I don't restrict my users from publishing full-size images (so that others can print from them). As such, I opted for php4-gd. Your mileage may vary, but you need to pick one of the following.
- imagemagick (Debian places the files in "/usr/bin" - you need to know the path for the install)
- php4-gd
MySQL
You need to know the basic mysql information. If you can, create a database and dedicated user for Coppermine. If not, the tables can have a prefix (which defaults to cpgVERSION_NUMBER). Either way you need the username and password for a user than can add tables to the database.
Base Coppermine
Extract Coppermine to the install location - pnCPG recommends _not_ installing it to modules; if you do you'll need to make some changes (explained in the pnCPG readme file)
unzip cpg1.3.4.zip
The documentation is in cpg134/docs/index.htm.
If you want to do any bulk uploading, create a directory now:
mkdir PATH/cpg134/albums/bulk_upload
Then:
chown -R www-data.www-data cpg134 chmod 0755 PATH/cpg134/albums PATH/cpg134/include
Or:
chown -R user.user cpg134 chmod 0777 PATH/cpg134/albums PATH/cpg134/include
Point a browser to http://my.url.domain/cpg134/install.php and follow the directions. You be prompted for an admin id/password, the mysql database information, and the imagemagick path (only needed if imagemagick is your image manipulation library).
Coppermine 1.4.1 Beta
The directions for the installation of 1.3.4 work cleanly, with the change of file name, for 1.4.1 beta.
pnCPG (unified logon)
pnCPG allows for a single sign-on with Coppermine/PostNuke. It is not a fully integrated port of Copperming, although the documentation does have tips for increasing the degree of integration. There are (as of this writing) three verions of pnCPG - pnCPG27 (for Coppermine 1.3.x and PostNuke 0.750), pnCPG3 (for Coppermine 1.4.x and PostNuke 0.750), and pnCPG3.1 (for Coppermine 1.4.x and PostNuke 0.760). These directions have been tested with pnCPG27.
Unzip pncpg to the modules directory:
cd $POSTNUKE_PATH/modules unzip $WHERE_YOUR_FILE_IS/pnCPG27.zip chown -R www-data.www-data pnCPG cp pnCPG/Coppermine/index_pn.php $CPG_PATH
Initialize and activate the modules through the postnuke admin screen. Navigate to:
Administration > modules
Choose "regenerate" if you do not see pnCPG listed. Once it is, select "initialize" then "activate."
Go to the pnCPG administration module and set the relevant values (such as the directory of the Coppermine install). The values for location of database server, database name and password should only be required for problem installations; otherwise the base PostNuke information is used.
If you want to be able to navigate to Coppermine, you need to add a menu item. For example, go to:
Administration > blocks > Main Menu (edit)
And add:
Title: Photos
URL: {pnCPG}
Description: Photo Gallery...
(Note that the form of the "URL" may be different than other modules you are used to. It is correct, and if you try "[pnCPG]" you'll be chastised.)
We want to make sure we block access, so we change permissions (postnuke admin screen), even though we already have a generic block.
Administration > permissions
Select "New Group Permission" and add:
GROUP COMPONENT INSTANCE PERMISSIONS LEVEL Unregistered pncpg .* None
After you add it, you may need to move it through your permissions list. PostNuke checks from the top of the list, and processes all allows, so since we are denying all unregistered users access, we need to make sure this is above any generic allows.
Since we are blocking access, we hide this menu item from unregistered users (note that we are still in "Administration > permissions") by adding the following to any other Menublocks:
Unregistered Menublock:: Main Menu:(Photos): None
Modification Tips
Configuration Options
These are entirely personal preferences; they can be modified through the normal "groups" interface.
- Turn off "User Can Send eCards"
- Increase allocation from 1MB to 100MB
Remove double scroll bar
THIS DOESN'T WORK FOR AUTOTHEME - ACTUALLY, I haven't gotten it to work at all.
In order to remove Double Scroll bars and always move to the top of the page :
- Put iframe_SSI.html in the root folder of your postnuke site.
- Open header.php in the root and insert just above the line saying:
themeheader();
this code:
include ("iframe_SSI.html");
and you will see something like this:
include ("iframe_SSI.html");
themeheader();
How to remove the Logout option within Coppermine
We use pnCPG single sign-on modules (http://www.casnuy.com/pn750/modules.php?op=modload&name=UpDownload&file=index) (as there is not currently a full Coppermine PostNuke port) for integration. As the stand-alone "logout/login" options can be quite confusing for Coppermine in an embedded environment, it is common to disable it. However, the notes in $PATH/modules/pnCPG/pndocs/TIPS.txt to disable this can result in errors, so we do this instead.
- Open up profile.php and Delete/Comment Out line 242 (in 1.3.4) (ability to change the Coppermine password).
<input type="submit" name="change_pass" value="{$lang_register_php['change_pass'
]}" class="button">
- In each theme, change:
'{LOGIN_TGT}' => "login.php?referer=$REFERER",
'{LOGIN_LNK}' => $lang_main_menu['login_lnk'],
'{LOGOUT_TGT}' => "logout.php?referer=$REFERER",
'{LOGOUT_LNK}' => $lang_main_menu['logout_lnk'] . " [" . USER_NAME . "]",
- To:
'{LOGIN_TGT}' => "",
'{LOGIN_LNK}' => "",
'{LOGOUT_TGT}' => "",
'{LOGOUT_LNK}' => "",
Disable Picture Editor
Cropping and rotating photos is a bit touchy - what size photos is works on and which options tend to depend on a variety of server variables. To make it clean I just disabled it, per the following...
Change Default Album Permissions
The default is "public", and to make it inaccessible, even to those browsing directly, it needs to be "registered users." Since it isn't an option when creating the album, and I couldn't find anywhere in the code to change the default, I guessed it was just coming from the database, so I switched the default for:
Database: Cpg (or whatever) Table: Prefix_albums Field: Visibility
From 0 to 2
0 - Public 1 - Private 2 - Registered Users
Recommended Reading
- Coppermine 1.3.x manual (http://coppermine-gallery.net/demo/cpg13x/docs/index.htm)
- Coppermine 1.4.x manual (http://coppermine-gallery.net/demo/cpg14x/docs/index.htm)

