Developer Installation and Configuration Help for Crop2Size™ Plugin for Zen Cart™
Installation Procedure
Introduction
In order to install and configure the Crop2Size™ web-based image cropping tool, it is recommended that the person installing Crop2Size™ have a working technical knowledge of the following topics:
- Website application installation and management
- The server directory structure
- Installing Crop2Size
- Installing Crop2Size™ in FCKeditor
- Installing Crop2Size™ in Joomla Content Management System
Prerequisite Checklist
Before installing the plugin, the following components must be installed and operational:
- PHP4 or PHP5
- GD Library 2.0.1 or later, or an API equivalent
- WinZip® file compression utility or equivalent
- Zen Cart
In addition, you must have previously downloaded the Crop2Size™ distribution package to your server. If you have previously installed the "Editor - FCKeditor Plugin" for Zen Cart, you should use the smaller Crop2Size-only package. Backing up your Zen Cart files before starting installation is recommended. If you are installing FCKeditor for the first time on a clean Zen Cart installation, the only preexisting file that will be overwritten is: admin/includes/languages/english/extra_definitions/editors_list.php. If you are installing the Crop2Size-only package after previously installing FCKeditor, the only preexisting file that will be overwritten is: editors/fckeditor/fckconfig.js
Installing Crop2Size™ onto the Server
The following instructions describe the steps necessary for integrating the Crop2Size™ image editor plugin into the Zen Cart online store tool running on your site's server. If you are installing in FCKeditor or Joomla, or integrating with your own software, please use the instructions linked above instead.
- Un-pack the download package you receive using WinZip or a similar archiving program. Unzip the files to a temporary location, not to the folders containing the Zen Cart installation files.
- Upload or copy the files into your Zen Cart installation directory. (On Linux use a command like: "\cp -a -f crop2size_zencart_plugin/* <zenroot>/" )
- If you are installing on a Windows server, skip to step 4. If you are installing on Linux, follow these instructions:
Setting Server and Log File Permission Levels
You must set permission levels for the appropriate directories and log files so that the configuration script can create the necessary files and folders.
Note: You must set the permission levels prior to running the the configuration script.
Your server needs read permissions on all Crop2Size™ directories and write permissions ("chmod 0775") on:
- editors/fckeditor/editor/plugins/crop2size/crop2size
- editors/fckeditor/editor/plugins/crop2size/crop2size/scripts
- editors/fckeditor/editor/plugins/crop2size/crop2size/xml
- editors/fckeditor/editor/plugins/crop2size/crop2size/tmp
- your gallery directory (default: editors/fckeditor/editor/plugins/crop2size/crop2size/gallery)
- your gallery icon directory (default: editors/fckeditor/editor/plugins/crop2size/crop2size/gallery/icons)
If you are running the mod_secure firewall module you will need to make the following additional changes:
In the root directory of your website add a .htaccess file containing the following lines:
SecFilterEngine Off
SecFilterScanPOST Off
- Using a standard web browser, run the crop2size/crop2size/configure.php script file. (See below for details)
For example: http://[your path to zencart]/editors/fckeditor/editor/plugins/crop2size/crop2size/configure.php
where "[your path to zencart]" is the path to the Zen Cart installation on your server. - If you are installing on a Windows server, skip to step 6. If you are installing on Linux, follow this instruction:
Once you are done with configuration, you may remove write permissions from:
- crop2size/crop2size/scripts
- crop2size/crop2size/xml
- Login to your Zen Cart Adminisration area, go to My Store under Configuration, find HTML Editor and set to FCKeditor.
- Clear your browser's cache
- Mozilla Firefox: Tools⇒Clear Private Data⇒(Select All)⇒Clear Data Now
- Microsoft Internet Explorer: Tools⇒Delete Browsing History⇒Delete All
- Log in to Zen Cart Administration again. FCK should now be your Zen Cart editor and Crop2Size™ should function correctly.
- Delete the download package files from the temporary location where you first unpacked them.
Configuring Crop2Size™ on the Server
Following are the specific parameters requested by the configure.php script. You must successfully run configure.php once during the installation procedure. You can always change these later by running configure.php again.
- Relative URL of the base directory of the Crop2Size™ application.
This parameter should point from your web root to the Crop2Size™ installation. For example: if configure.php Crop2Size™ is at http://yoursite.com/somepath/crop2size/crop2size/configure.php, you would put "/somepath/"
- Title for Crop2Size.
Change the text to be shown at the top of the Crop2Size™ application. The default text is "Crop2Size".
- Alternative save text.
The default is "Save to Server" for the standalone configuration.
- Maximum upload file size.
Allows you to restrict the file size of images used in the program.
- The location for the php style error logfile.
Specify a directory which is writable by your web server, and a file name.
- The location for the trace debug file.
Specify a directory which is writable by your web server, and a file name.
- Delete gallery images after...
Specify a maximum lifespan of gallery images
- Expire editing session and delete work images after...
Specify a maximum lifespan for temporary images used in processing
- Version of the cropper to use
Ensure that FCK Embedded is selected.
- Disable the Collapse option on the cropper
By default the cropper always stays full size, but there is an option to allow the right side menu area to collapse when not in use
- Start the cropper with the menu collapsed
If you do not disable collapse, this allows you to choose whether the program starts collapsed or expanded
- Allow saving to the server
Choose No if you want to restrict users to saving images locally
- Include Webcam capture
Allow acquiring images directly from a webcam
- Directory for gallery
The path from crop2size/Crop2Size™ to your gallery directory. Note that this can be changed dynamically by setting a session variable called "gallerydir". See Configuring the Save Location instructions below.
- JPEG Image Quality
What quality value to use for saving images. Higher values (closer to 100) give higher image quality but also larger files. Lower values (closer to 1) give smaller files but also lower image quality. Default is 70.
Completing the Crop2Size™ Installation
Point your browser to crop2size/crop2size/crop2size.html and verify that Crop2Size™ functions correctly.
Log in to Zen Cart Administration, edit an item and verify that the Crop2Size™ icon appears in the FCKeditor toolbar. Click the Crop2Size™ icon and verify that Crop2Size™ opens and functions correctly.
Configuring the Save Location
Images can be saved in two ways: to the user's local machine and to a gallery on the server. Where that gallery resides can be configured by setting the gallery directory during standard configuration (see above). But you can also change the gallery directory dynamically by setting a session variable called "gallerydir".
For example, you could have users log in to your php website and set the "gallerydir" session variable based on their user data. Crop2Size™ will then use that user-specific gallery directory for the duration of the user's session.
Remember that the "gallerydir" variable must be a path from crop2size/Crop2Size™ to your preferred gallery directory. If you wish to have the gallery directory reside outside of the Crop2Size™ directories, your path must start with "../../".
Licensing
If you have received a 30-day trial license or have purchased a license from Crop2Size.com, place the license.key file you received in the crop2size/crop2size/ directory and ensure that the webserver has read permissions on the file. With the file in place, clear your browser's cache and run Crop2Size. The program should no longer show the "DEMO" watermark on all images.More Information
For additional information, see the list of Frequently Asked Questions (FAQs).
