Error creating banner ads formats initial database table: '.html_entities(@mysql_error()).'

'; } if(!_dbQuery($sql[1], 'CREATE')) { $sql_error[1] = '

Error creating banner ads campaign initial database table: '.html_entities(@mysql_error()).'

'; } if(!_dbQuery($sql[2], 'CREATE')) { $sql_error[2] = '

Error creating banner ads tracking initial database table: '.html_entities(@mysql_error()).'

'; } if(!_dbQuery($sql[3], 'CREATE')) { $sql_error[3] = '

Error creating banner ad place initial database table: '.html_entities(@mysql_error()).'

'; } // insert default settings if(!isset($sql_error[0]) && !_dbQuery("SELECT COUNT(*) FROM ".DB_PREPEND."phpwcms_ads_formats", 'COUNT')) { @_dbQuery($sql[4], 'INSERT'); if(@mysql_error()) { $sql_error[4] = '

Error inserting default banner ads formats entries: '.html_entities(@mysql_error()).'

'; } } if(!is_dir(PHPWCMS_CONTENT.'ads')) { // try to create the ads directory if(!@is_writable(PHPWCMS_CONTENT)) { @chmod(PHPWCMS_CONTENT, 0777); } umask(0); if(!@mkdir(PHPWCMS_CONTENT.'ads', 0777)) { $sql_error[5] = '

The necessary folder "ads" does not exist.
'; $sql_error[5] .= 'Script was not able to create it here "'.PHPWCMS_BASEPATH.$phpwcms["content_path"].'ads" inside of web root directory.

'; $sql_error[5] .= '

Check permissions or create missing folder "ads" using FTP client.
Set permissions to 777.

'; } else { // thanks wordpress ;-) $stat = @stat(dirname(PHPWCMS_CONTENT.'ads')); @chmod(PHPWCMS_CONTENT.'ads', $stat['mode'] & 0007777); } } if(is_dir(PHPWCMS_CONTENT.'ads') && !file_exists(PHPWCMS_CONTENT.'ads/adtracking.php')) { if(!copy($phpwcms['modules'][$module]['path'].'setup/adtracking.php', PHPWCMS_CONTENT.'ads/adtracking.php')) { $sql_error[6] = '

Adtracking file "adtracking.php" could not be written to '; $sql_error[6] .= '"'.PHPWCMS_BASEPATH.$phpwcms["content_path"].'ads".

'; } } echo '

Banner ads setup

'; if(!count($sql_error)) { echo '

All inital db tables and values were created.

'; echo '

Please delete folder setup which can be found inside the module folder here:
'; echo str_replace(PHPWCMS_ROOT, '', $phpwcms['modules'][$module]['path']).'

'; if(!is_writable(PHPWCMS_CONTENT.'ads')) { echo '

Before you continue please check permissions of "'.PHPWCMS_BASEPATH.$phpwcms["content_path"].'ads". It has to b set to chmod 777.

'; } } else { echo implode(LF, $sql_error); } ?>