Our site www.viart.com site is operated by latest Viart Shop 5 with default Clear design
PHP specific questions

Validation image (captcha) doesn't show up

First, please make sure you've activated "Random Image Validation" option in admin. Please see all places where it could be activated here:
http://www.viart.com/spam_alert_how_to_ptotect_your_shop.html

If you see an empty space instead of captcha it could be a problem with fonts. We recommend to open the script "validation_image.php" and replace this line:

if (function_exists("imagettftext")) {

with this one:
if (function_exists("imagettftext") && false) {

Then only numbers will be used for captcha.

If it doesn't work as well then most likely the validation image is not displayed because GD library is not activated in the php settings on your server. Contact your hosting provider and ask them to install it for you. read more...read more...

Shared SSL not clearing cart after payment

This is a normal way how the shared SSL works. The reason is in the PHP session not transmitted onto the other domain where shared SSL certificate is located. To remove this problem, we would advise to use a dedicated SSL. read more...read more...

Warning: Access denied for user ...

Please check your "includes/var_definition.php" file. Variable $db_user should contain a valid MySQL user that has rights to select, insert, update, delete. See also 'How to add a user for my database?' read more...read more...

Warning: Failed opening './includes/db_.php

Please check your "includes/var_definition.php" file.
Variable $db_type should contain either "mysql" or "pgsql" value.
E.g.:
// database parameters
$db_type = "mysql";
$db_name = "db_1"; read more...read more...

How to add php code in custom blocks

You can add PHP code to a custom block with the help of PHP tags, and work the contents using $block_body variable. This variable consists of all the HTML text you have in your block.

To activate PHP code functionality for custom blocks, please go to System > Global Settings and select where you want to run PHP code. Also, don't forget to switch from the 'WYSIWYG HTML Editor' to 'Textarea Editor' to view the code in your custom blocks correctly. Then add a new custom block in CMS > Custom Blocks and insert the code in the 'Block Content' area.

The basic code will look like this:

Feel free to add any text here <br> Something <?php echo "1";>
// simple php code

or like this:

Feel free to add any text here <br> Something <?php $block_body = str_replace("Something", "Anything", $block_body); ?>
// php code with a variable replacement

Here is an example of code that can be used in the footer body:

┬ęCopyRight 2004 - {current_year} - All Rights Reserved
<?php
$block_body = str_replace("{current_year}", date("Y"), $block_body);
?>

But please note, executing PHP in admin panel is not very secure that's why from version 4.0 we implemented a new way of adding blocks in CMS - create a PHP script and place it in "blocks_custom" folder then add a new block in CMS > CMS Blocks where specify the name of your script. Then you can select your new block in CMS > Pages Layouts. Also you can specify HTML template for block in CMS > Pages Layouts > new block settings (click on 'tools' icon near block). read more...read more...

How to set the maximum upload limit?

Actually, there is a special setting in the 'php.ini' file:
; Maximum allowed size for uploaded files.
upload_max_filesize = 2M

This means that the maximum size of uploaded files is 2 Mb.
So, all other files that exceed 2 Mb should be uploaded via an FTP program into the appropriate folder for downloadable products. read more...read more...

The administration logs us out quicker than we'd like

There is a "session.cookie_lifetime" setting in php.ini which you can increase to a larger value then admin session will last longer.

For example, you can upload php.ini file to 'admin' folder with one line below
session.gc_maxlifetime = 3600

It should increase session timeout for administrator up to 1 hour.
read more...read more...