Installation Guide for CodeFu.net's URL Rotator Script
http://www.codefu.net
These Flash tutorials may help you through this process.
Quick Start
- The script requires a database. You may either create a new database or use an existing one.
The steps to create a database depend on your hosting provider; most providers allow you to manage your database through your hosting account's control panel.
-
Once a database exists for use with the script you can now create the database tables; your hosting account's control panel may have a program called phpMyAdmin to help with this.
The file 'url_rotator.sql' contains the database table schemas. You can use this file with phpMyAdmin.
- Edit the file called 'config.inc.php' inside the 'include' directory.
You will need to provide your database details, the site_email_address, and the short_base_url values.
- Upload the url directory, files and subdirectories.
- Go to the login page for the rotator, this will usually be
http://www.yourserver.com/url/
- Login as
Username: admin
Password: rotator
- Test the various functions to ensure everything is set up correctly.
-
You can now change the admin password and email address and begin using the rotator.
You can create a user-level account for yourself if you wish, and create accounts for your members.
Fine-grade Configuration
Once the script is installed and is running correctly you can begin configuring it exactly how you want.
The configuration is done by editing the config.inc.php file, so you will need to edit the file on your computer and then
reupload it to the include/ folder for the changes to take effect.
Configuring User-Levels
User-Levels provide a convenient way of giving members different limits. A User-Level controls the Max Portal limit, Max Destinations per Portal limit, Traffic Diversion Interval, and the Traffic Diversion URL of a member.
You can create as many different User-Levels as you require.
Here I will demonstrate how to create two User-Levels.
The first User-Level will have a small limit on the number of Portals/Destinations that can be created, and every 1 in 10 hits to a member's Portal will go to http://www.mysite.com/join.html
The second User-Level will have much higher limits on the number of Portals/Destinations that can be created, and no traffic will be diverted from the member's Portals.
This is what should be placed in the User Level section in the config.inc.php file, differences in the two User-Levels have been bolded:
# User Level 1
# They are limited to 1 Portal, and 15 Destinations in that Portal
# 1 in 10 hits is diverted to http://www.mysite.com/join.html
$GLOBALS['config_settings']['user_level'][1]['max_portals'] = 1;
$GLOBALS['config_settings']['user_level'][1]['max_destinations_per_portal'] = 15;
$GLOBALS['config_settings']['user_level'][1]['traffic_diversion_interval'] = 10;
$GLOBALS['config_settings']['user_level'][1]['traffic_diversion_url'] = 'http://www.mysite.com/join.html';
# User Level 2
# Members of this User-Level have bigger limits, and no traffic diversion.
$GLOBALS['config_settings']['user_level'][2]['max_portals'] = 200;
$GLOBALS['config_settings']['user_level'][2]['max_destinations_per_portal'] = 1000;
$GLOBALS['config_settings']['user_level'][2]['traffic_diversion_interval'] = 0;
$GLOBALS['config_settings']['user_level'][2]['traffic_diversion_url'] = '';
Besides the User-Levels that you can define in the config.inc.php file you can give a Member a Custom User-Level with their own specific limits. So, for example the administrator can give themselves a Custom User-Level by going to the Manage Members page, finding their account on that page, and selecting Edit Member. From there they can assign themselves a Custom User-Level and give themselves whatever Max Portal limit they desire.
User-Levels that are defined in the config.inc.php file can later be changed by re-editing the file. Both existing and new Members of the modified User-Levels will use the new values.
Configuring Members that use the Signup Page
The script includes a signup page to allow a web visitor to sign themselves up to the system. There is a section in the config.inc.php file to specify how the Members should be created. Signups can also be disabled from the configuration file.
Other Configuration Options
The rest of the config.inc.php file allows for very fine grade configuration. Fortunately, for most people these settings can be left with their default values so you don't have to touch them at all. For those that are interested you can look through the file to see what options are available. There are comments throughout the file to help you understand the purpose of the settings.
Changing the Design and Appearance
There are two ways of changing the appearance of the script:
The first method is to edit the .css stylesheets under the template directory. These stylesheets allow changing of the colors and fonts of the pages, and you will need some CSS (cascading style sheet) knowledge for this. You can make your own color-schemes by copying one of the existing ones and then editing header.tpl.php to add the new stylesheet to the color-scheme selector list box.
The second method is to edit the *.tpl.php files in the template directory. You only need to edit the templates if you want change more than colors/fonts such as adding or removing page content. For example, if you wanted to change the header/footers of the script to match into the rest of your site you would need to edit header.tpl.php and footer.tpl.php. If you edit the header.tpl.php file you should take care that all the external .js scripts are still being linked in (look at the <head> section). Since the templates are mostly HTML with PHP intermixed you will need to have good HTML knowledge, and at least a basic understanding of PHP would be very beneficial.
It is recommended that instead of editing the original template files that you create a new template based on the original, and you edit your copy. You can do this by copying the entire 'original' folder and renaming your copy to something else. Then edit the 'template' setting in the config.inc.php to use your new template.
Translating to other languages
The words used in the script can be translated to different languages. To add support for a language look inside the language/ folder. You will need to copy english.terms.php, english.email.php and english.help.php and name them yourlanguage.terms.php, yourlanguage.email.php and yourlanguage.help.php respectively. These files can then be edited with your preferred text editor. Comments are placed at the beginning of the english.terms.php to give you help. You can add support for as many languages as you want. Please consider sending in your translated files so that they can be included in the main product.
A Note about Ioncube Loaders
Inside the ioncube/ directory are the loaders that are needed to decode the PHP files. You will find loaders for the most common PHP versions and operating systems in this directory.
To save time you only need to upload the loader that matches your server PHP version (4.0, 4.1, etc) and operating system (freebsd, linux, etc). Uploading all of the loaders will not cause problems so you can do so if you wish.
If the loader for your particular PHP version or operating system was not included in the ioncube/ directory you may download one for free from ioncube.com