A ready-made shop engine (http://www.vipresellers.com/reseller/xshop.zip) is a set of scripts that let you have an exact copy of TemplateMonster database of web templates in real time; display screeshots and other information on the site; syncronize your database with TemplateMonster database automatically. The engine also includes the billing script that let you send download instructions to your customers upon your approval (the appropriate amount (price of the web template) will be deducted from your deposit automatically). A technology used for a synchronization of Templatemonster database and the database of your template shop is XML. The detailed information of the technology can be found at http://www.w3.org/XML/
Requirements for a template shop:
PHP 4.3.4 or later with XML support;
MySQL 4.0 or later;
2Gb disk space or more for template screenshots and .swf files (more space will be required as new templates are added).
You can also link to images on Templatemonster.com server though it is not recommended to do for at least two reasons:
Security. Customers of your template shop will see a reference to Templatemonster.com;
Reliability. If TemplateMonster.com does not function for some reasons then graphic elements won't be seen at your online shop.
Reseller Shop Engine Framework:
Create a database that will include information about templates on your server. A dump of tables structure can be obtained in sql/start.sql file. Create an XML parser or edit the script www/admin/cron_xml.php to get the data in your DB synchronized with Templatemonster.com database. If run for the first time, the script www/admin/cron_xml.php will fill data in all tables of your database. Add the script to your operating system scheduler. It is recommended to run cron_xml.php every 1..24 hours.
Create a script for downloading screenshots or edit the script www/admin/cron_scr.php. You should add the script cron_scr.php to your operating system scheduler. It is recommended to run cron_scr.php every 300 seconds.
Install the shop engine on your server or develop your own engine on the basis of our scripts to display screenshots and other information about Templatemonster.com products on your website. You can edit or set rules for displaying templates by editing the function show_template() of the inc/show.inc file. You can edit constants for displaying templates and other global parameters used in a template shop by editing the configuration file inc/conf.inc.
When the payment at your website is processed a reseller shop engine invokes the script from www.vipresellers.com with parameters that describe a customer's e-mail and an item number of the template.
An e-mail with download links pointed to an unbranded download host will be sent to the customer. You can change a text of the e-mail in your personal account. The script will deduct an appropriate amount from your account at www.vipresellers.com.
Shop Engine Folders Structure:
HTML folder includes:
admin.inc - contains a navigation for an administration area of the website.
copyright.inc - contains the information about the copyright
footer.inc - contains data that are shown at the very bottom of every page of the website
menu.inc - contains two php functions:
draw_top_menu() - for creating the upper menu
draw_bottom_menu() - for creating the low menu
search.inc - contains a template search form:
search by a type of the product, keyword, category, and author;
search by an item number of the template;
status.inc - contains an order status form at the website
top.inc - contains data shown at the very top of every page of the website.
INC folder includes:
cart.inc - a script containing the function get_shopping_cart() for cart.php page
categories.inc - a script containing the function show_categories_list() for gallery.php page
conf.inc - a primary configuration file. The script contains the following settings that can be configured:
PMYSQL_HOST - a hosting address to access your MySQL database
PMYSQL_USER - username to access your MySQL database
PMYSQL_PASS - password to access your MySQL database
PMYSQL_DB - the name of your database containing information about web templates
SCREENSHOTS_FOLDER - a full path to the folder with screenshots of templates
TMP_DIR - a full path to the temporary folder
URI_XML_ZIP - an URI of a zipped XML file with complete information about all templates
UNZIP_COMMAND - a command for unzipping an XML file
TEMPLATES_PER_ROW - number of rows of templates on gallery.php page
TEMPLATES_PER_COL - number of columns of templates on gallery.php page
SCREENSHOTS_URI - an URI that is used for defining the URI of templates screenshots
SCR_AND_SCRIPT_DOMAIN - some templates screenshots are links to other screenshots or scripts. SCR_AND_SCRIPT_DOMAIN contains the base domain that is used for defining these links
HELP_CENTER_URI - an URI of the neutral help center for customers
CURRENCY - a symbol of the currency
RATE_OF_EXCHANGE - a rate of the currency exchange or percent of your extra charge
AUTO_APPROVED - is a switch for approving orders 'automatically/manually'. You need to give it the value of 1 if you wish customers' orders to be approved automatically once they are approved by the merchant system. At the same time an appropriate amount will be deducted from your reseller balance at www.vipresellers.com and download links will be sent to the customer automatically. You need to give it the value of 0 if you wish customers' orders to be approved manually via an administration control panel.
PURCHASE_URI - an URI of the script which is called as you approve the purchase. As the script with appropriate parameters is called, your account at www.vipresellers.com will be debited for an appropriate amount. At the same time links to download templates will be sent to the customer.
PURCHASE_LOGIN - your login at www.vipresellers.com. The value is necessary for calling the script PURCHASE_URI.
PURCHASE_SECRET_WORD - your SECRET_WORD at www.vipresellers.com. This value is necessary for calling the script PURCHASE_URI.
SHOW_ADULT - is a switch to "show/hide" adult templates. You need to give it the value of 1 to show adult templates at your website. You need to give it the value of 0 to hide adult templates at your website.
DOWNLOAD_DURATION - duration of running the script cron.php that submits the query to download new or updated screenshots from Templatemonster server to your server.
SCREENSHOTS_IN_FOLDER - number of screenshots in the folder. It always must be 100. Do not change the value!
download.inc - contains the function download_screenshots(). The function will copy new or updated template screenshots to your server. Note: the user who calls the script should have enough rights for changing the content of the folder SCREENSHOTS_FOLDER.
entities.inc - contains subsidiary functions for MySQL tables.
merch_sys.inc - the second configuration file containing merchant systems settings. Includes:
CHECKOUT_BUY_URL - an URL where the customer is referred to in the case of the purchase via 2Checkout
CHECKOUT_ID - your unique identifier at 2Checkout
CHECKOUT_SECRET - your secret word at 2Checkout
GOLDCART_BUY_URL - an URL where the customer is referred to in case of the purchase via GoldCart
GOLDCART_SECRET - your secret word at GoldCart
ROBOX_BUY_URL - an URL where is the customer is referred to in case of the purchase via RoboX
ROBOX_LOGIN - your Login at RoboX
ROBOX_PASS1 - your first password at RoboX
ROBOX_PASS2 - your second password at RoboX
STORMPAY_BUY_URL - an URL where the customer is referred to in case of the purchase via StormPay
STORMPAY_EMAIL - your Email at StormPay
STORMPAY_SECRET - your secret word at StormPay
STORMPAY_NOTIFY_URL - an URL of the script which will call StormPay scripts for the purchase notification
STORMPAY_RETURN_URL - an URL of your script where the customer should be referred to after the purchase at StormPay
STORMPAY_CANCEL_URL - an URL of the script which will call StormPay scripts for cancelled order notification
STORMPAY_IP - an IP-address of the StormPay host that will call your scripts
MONEYBOOKERS_BUY_URL - an URL where the customer is referred to in case of the purchase via MoneyBookers
MONEYBOOKERS_NOTIFY_URL - an URL of the script which will call MoneyBookers scripts for the purchase notification
MONEYBOOKERS_RETURN_URL - an URL of the script which will call MoneyBookers scripts for the cancelled purchase notification
MONEYBOOKERS_EMAIL - your Email at Moneybookers
MONEYBOOKERS_SECRET - your secret word at MoneyBookers
mysql.inc - a script containing functions to access MySQL database and run SQL queries
order.inc - a script containing functions for creating orders and changing their status.
All orders are saved in the table orders.
There are three order statuses for merchant system:
0 - the order is not approved by the merchant system
1 - approved by the merchant system
2 - cancelled by the merchant system
There are three order statuses for the seller:
0 - an order is not approved
1 - approved
2 - cancelled
price.inc - a script containing the function get_price() for calculating the price of the template
services.inc - a script containing the function safe_get() for giving the correct value to any variable
show.inc - a script containing different functions for displaying template screenshots at show.php page
templates.inc - a script containing different functions for displaying templates at your website
SQL folder includes a script start.sql for the database initialization.
An SQL-query included in start.sql script will create the following tables in your database:
authors table structure:
categories table structure:
orders table structure:
|time||order date and time|
|mersys||a merchant system name (i.e. "2Checkout", "Moneybookers", "Stormpay", "RoboX")|
|total||a total amount of the order|
|an email address of the customer|
|phone||a phone number of the customer|
|ms_id||a merchant system order ID|
|ms_approved||an indication if the order is approved by the merchant system|
|approved||an indication if the order is approved by the billing system|
|answer||a billing system response after the order is
orders_templ table structure:
|order_id||an order ID|
|templ_id||an item number of the template|
|exclusive||an indication if the order is exclusive|
scr_download table structure:
|templ_id||an item number of the template|
|source||an URI of the template screenshot|
styles table structure:
|id||a style ID|
|name||a style name|
template_categories table structure:
|template_id||an item number of the template|
|category_id||a category ID|
template_styles table structure:
|template_id||an item number of the template|
|style_id||a style ID|
templates table structure:
|id||an item number of the template|
|state||a status of the template|
|price||a price of the template|
|exc_price||an exclusive price of the template|
|inserted_date||an addition date of the template|
|downloads||a number of templates downloads|
|type_id||an identifier of the template type|
|is_adult||an indication if the template belongs to the adult category|
|author_id||an identifier of the template author|
|keywords||a list of keywords associated with the template|
|sources||a list of source files|
|description||a description of the template|
|software_required||a description of the software required to edit the template|
|screenshots_list||a list of screenshots|
|pages||a number of pages|
types table structure:
|id||an identifier of the type|
|name||a type name|
WWW folder includes:
.htaccess - a file where all users who have an access to www/admin folder are listed:
AuthUserFile - a full path to the file containing a list of users and passwords. For example: /usr/local/etc/htpasswd
Require user - a list of users from AuthUserFile who have an access to www/admin folder. Usernames are separated by space.
For more detailed information please apply to the administrator of your server.
cron_xml.php - a script for:
downloading a zipped XML file with complete information about all templates
unzipping XML file
You should add this script to your operating system scheduler. For example at UNIX/LINUX this script must be added to the appropriative crontab file to be invoked by the cron daemon.
It is recommended to run cron_xml.php every 1..24 hours.
cron_scr.php - a script that calls function download_screenshots() function. The function is described in inc/download.inc. The function submits the query to copy template screenshots which are in the download list of src_download table. Screenshots will be copied to your server to www/screenshots folder from Templatemonster.com server. You should run cron_scr.php with a duration of DOWNLOAD_DURATION. The constant of DOWNLOAD_DURATION is specified in seconds in the configuration file inc/conf.inc. It is recommended to set the duration to 300 seconds. You should add this script to your operating system scheduler.
For example, at UNIX/LINUX this script must be added to the appropriative crontab file to be invoked by the cron demon.
index.php - a script showing the administration area navigation.
orders.php - a script for:
collecting information about orders
searching orders by date and status
searching orders by the email of the customer, the phone number of the buyer, an ID of the order, a merchant system ID of the order.
changing the status of the order.
Note: Each time you approve the purchase:
CSS folder includes style.css file that defines the design of your website
IMAGES folder includes graphic elements
MS folder includes:
gc_notify.php - a script for retrieving payment confirmation from GoldCart;
mb_notify.php - a script for retrieving payment confirmation from MoneyBookers;
rx_notify.php - a script retrieving payment confirmation from RoboX;
sp_notify.php - a script for retrieving payment confirmation from StormPay;
Note: download.php is a script for retrieving payment confirmation from 2Checkout.
SCREENSHOTS folder - you should keep screenshots that were copied from Templatemonster.com server here.
Note: The user who calls cron.php script should have enough rights to copy screenshots to SCREENSHOTS folder.
buy.php script is an 'invisible' page for the customer where he/she is referred to after completing the order form at purchase.php. This script stores all information about the order in the database in orders table. After that the customer is referred to proceed with the payment to the page of the appropriate merchant system.
cancel.php - the script retrieving the information about the order cancelled by a merchant system
cart.php - the page showing the shopping cart to the customer. Different actions can be done at this page. The customer can:
delete elements from the shopping cart
empty the shopping cart completely
update the information about products in the shopping cart
be referred to the payment page
download.php - a page where the customer is referred to after proceeding with the payment at the merchant system
faq.php - a page containing Frequently Asked Questions
gallery.php - a page showing the template gallery. The customer is referred to this page when searching templates
index.php - a main page of the website. The page displays three latest web templates
purchase.php - a page where the customer should specify his/her personal details before proceeding with the payment to the merchant system
show.php - a page where the customer can preview all big screenshots of the chosen template
show_cs.php - a page where screenshots of color schemes for 3-colors templates are displayed
status.php - a page with an order status form (a page where the customer can check the status of the purchase using an ID of the purchase)
terms.php - a page containing Terms and Conditions
unique.php - a page where such terms as unique purchase and non-unique purchase are explained