Web Catalog | PHP Script - Documentation

Web Catalog

Thank you for purchasing web catalog PHP script. If you have any questions that are beyond the scope of this help file, please feel free to email roman.codecanyon@gmail.com. Thanks so much!


Note. You can view framework's requirements by accessing the requirement checker script via following URL: http://your-domain.com/requirements 
Note. If you installed script not in web-root directory then you need to add RewriteBase /subdir/ into .htaccess

Database Settings

This application is build on Yii framework.
So, The main Web application configuration file located in ~/root/protected/config/main.php
Open this file and let's begin with configure database settings. Find following lines and set your own mysql settings

// Mysql with host: localhost and databse name catalog
'connectionString' => 'mysql:host=localhost;dbname=catalog',

// whether to turn on prepare emulation
'emulatePrepare' => true,

// db username
'username' => 'root',

// db password
'password' => '',

// default cahrset
'charset' => 'utf8',

// table prefix
'tablePrefix' => 'directory_',

// cache time to reduce SHOW CREATE TABLE * queries
'schemaCachingDuration' => 60 * 60 * 24 * 30,


SMTP Mail server

SMTP mail server is an important part of the application, beacuse it's used for different notifications, contact form and etc.
See below how to setup settings. The same config file:
// Mailer extension
'mailer' => array(

'SMTPAuth' => true,

// smtp server's port
'Port' => 25,

// server's host
'Host' => 'mail.your-host.com',

// username
'Username' => 'username',

// password
'Password' => 'password',

// letter's charset
'CharSet' => 'UTF-8',


While app is using cookie-based authorization, we need to encrypt cookies.
The encryption key is set in main config:
'encryptionKey' => 'pnkRVLZC6Oj87H2G8qmsNN',
I suggest to change it to random 24 characters long string. For exemaple:
'encryptionKey' => 'o0uli7wsk5qrknq6lzimmn53',


If none of your URLs do not work, it seems that Web server doesn't allows for configuration overrides using .htaccess
In this way you need to set:
in main config file.

HTTPS Support

In order to get full support of HTTPS you must have Free Unbranded account or Paid account. If you have Free Unbranded account, then paste verification HTML provided by Pagepeeker before verification process.


'pagePeekerVerify'=>'Verification html',
You can find a table below describing different cases

Pagepeeker account type Configuration
Free Unbranded Account
'pagePeekerVerify'=>'Verification html',
Basic Account
Advanced or Premium Account


By default all public forms are protected with image captcha, however this is not a full security against spammers. The script takes advantage of reCaptcha. To integrate reCaptcha go to official reCaptcha page and generate Site key and Secret key keys. Next, open ~root/protected/config/recaptcha.php file and fill out the config:

'public-key' => 'Site key goes here',
'private-key' => 'Secret key goes here',

Cron jobs

This app very closely linked with cron jobs, because it has to generate sitemap and check external dofollow links.
You have possibility to do this in two different ways: via command line or using 3rd party services to run command via browser.
1. Let's begin with command line:
Firstly, open: ~/root/protected/config/console.php file and configure it.
// your website name: for example: http://your-domain.com
'hostInfo' => 'http://your-domain.com',

// if you installed script not in root directory, then you need to set baseUrl. For example : /catalog
'baseUrl' => '',
Next you need is to add following lines into your cron job shedule:
0 0 * * * /usr/bin/php /path/to/web/root/protected/sitemap.php >/dev/null 2>&1
NOTE! Script already support multiple sitemap generation. Each sitemap has maximum of 50 000 URLs. If you want to change this number go to: ~/root/protected/commands/SitemapCommand.php and set any number of $urlCount property.
0 0 * * * /usr/bin/php /path/to/web/root/protected/premiumchecker.php >/dev/null 2>&1
0 0 * * * /usr/bin/php /path/to/web/root/protected/linkcalculator.php >/dev/null 2>&1
0 0 * * * Time and date for your task. In our case cron will be executed every day
/usr/bin/php path to php command
/path/to/web/root/protected/sitemap.php physical path to script
>/dev/null 2>&1 this mean that all output from this command should be shoved into a black hole. I.e just do nothing with output.
2. Using 3rd paty service as cron job:
There is a lot of 3rd party services you can find, which will send requests to defined URL every X time.
Open main config file and find following line:
Set up your sicret key (ex. "abc")
'cronKey' => 'abc',
Now, to generate sitemap or check external dofollow links you need request this URL:
Pay attention! GET variable "key" must be equal to what you have set in config file. In our case it's "abc"
Note. If you installed script in sub-direcotry, then URL should look like this: http://your.domain/subdir/index.php?r=cron/sitemap&key=abc
Note. You can generate sitemap in admin panel. Go to admin panel -> tools -> generate sitemap
Remains only register this URL in your 3rd party service.

Admin Panel

Once you configured main settings, it's time access admin panel. Go to:
or(if you set 'showScriptName'=>true)
By default, username and password equals "admin". Of course you must change them. Log in and click on your name(Administrator) on the right top. Select "change password" from dropdown menu and fill up the form. Do the same thing to change name, login. 
NOTE! If you forgot your password, then you can reset login and password with default values(admin, admin). Run this query in database to reset password and login.

UPDATE `directory_user` 
WHERE id = 1;
Now you need to create root categories (for each language). Go to: admin panel -> manage roots -> create tree.
After creation you need to populate each tree with new categories.
Click on "manage tree". The interface is friendly, so I think you will not have any difficulties.
NOTE! After creating/updating/moving categories you need to clear cache. To do this go to admin panel -> tools -> clear cache

How to

Question: How to calculate how much URLs contains each category?
Answer: Since this process require a lot of calculation and queries to database, it can be done in 2 ways: via admin panel or by setting it as cron job.
1. Via admin panel: Go to admin panel -> tools -> Calculate how much URLs contains each category
2. As cron (command): 0 0 * * * /usr/bin/php /path/to/web/root/protected/linkcalculator.php >/dev/null 2>&1

Question. I've done a lot of changes in admin panel. Approved some URLs, added new categories or updated existing ones, but don't see any changes on the front-end version. What to do?
Answer: This To increase maximum performance the app is very closely linked with caching. To flush it go to: admin panel -> tools -> clear cache



To get dofollow backlink, user must set up text-link or banner. All banners stored in ~/root/banners/ directory. Replace existing ones with your own.
Supported formats:  .jpg  .jpeg  .gif  .png  .bmp


To see the list of available languages find this line:

'languages'=>array('ru'=>'Русский', 'en'=>'English'),

Set up default app language.

You can setup as as many languages as you want. For example, let's translate application to German.
First of all, create directory with chosen language. In our case language ID will be de.
Copy all files from ~/root/protected/messages/en/ to ~/root/protected/messages/de/
Next, open and translate them :)
Note. Each file contains an array, so you only need to translate only values. Leave keys as is.

Then add new key=>value pair into config file

'languages'=>array('ru'=>'Русский', 'en'=>'English', 'de'=>'Deutsch'),

Next you need to add alphabet for newly created language. To do this open ~root/protected/extensions/ealphabet/alphabet.php and append array with new key value pair.

Go ahead, now we need to translate country names. Go to ~root/protected/extensions/ecountry/countrylist/ directory. Create new file. The name must be in following format: {Language_ID}.php. For instance: fr.php Next, copy content from en.php file, paste into newly created file and begin translation.

And the final step is to create new root category in admin panel. To do this, go to:
admin panel -> manage roots -> create tree

Template and Theme

This app has template system based on themes. It mean that you can create your own or modify already existing theme.
Admin theme location:
Public theme location:
This directories contains folders with available themes. By default admin and public sections have classic theme.
How to create your own custom theme.
Below listed steps how to create custom admin theme. You can use same algorithm for public section.
  1. Create folder in ~/root/themes/admin/metalic
  2. Copy all files from ~/root/themes/admin/classic into newly created directory.
  3. Modify HTML/CSS/Images as you want
  4. Switch theme name in config file
'themes' => array(
'admin' => 'metalic',
'public' => 'classic',

Application options

Some useful options you need to know.
'name'=>'Web Catalog', // Brand name. Not translatable

'language' => 'en', // Default app language

"enableSystemLogging"=>true, // whether to log every action in admin panel

'default_timezone' => 'Europe/Vilnius', // Default app timezone. More: http://www.php.net/manual/en/timezones.php

'badLoginCount' => 3, // When you three times filled up authorization form with invalid credentials, next time you will need to enter captcha as well

"checkPremiumLink" => 2, /* This value used for external dofollow link checking (remeber we already set cron in previous section). It has been made not to check manually all premium links.For example. You have approved http://php5developer.com link as premium link. By the rules, this webpage should refer back to your catalog.
So, if script  2 times will not find dofollow back link, then it will change type from premium to regular.*/

"backURL"=>false, /* Here you can change text and banner backlink. By default this value equals false which mean that backlink is absolute path of installed script. For example: http://catalog.php5developer.com
or if installed in subdirectory:

'searchUrlPerPage' => 10, // Number of found URLs per page

'searchCatPerPage' => 20, // Number of found categories per page

'minUrlSearchLength' => 3, // Minimum character length for URL searching

'minCatSearchLength' => 2, // Minimum character length for category searching

'catCacheTime' => 3600 * 5, // Time in seconds. Nested categories.

'contactEmail' => 'contact-form@mail.com', // Email which will receive all messages from contact form

'notificationEmail' => 'no-reply@mail.com', /* Email which will send automatic notifications.For example. When user submit url for approval and etc.*/

'notificationName' => 'No-reply',