Пример #1
0
 function install_banner_system()
 {
     parent::plug_manager();
     tep_define_vars($this->admin_path . 'back/admin_defs.php');
     // Default Options
     $this->options_array = array('banners_path' => 'images/banners/', 'display_left' => 1, 'display_right' => 1, 'display_top' => 1, 'display_bottom' => 1, 'clicks' => 1, 'impressions' => 1, 'template' => 'stock', 'strings' => 'front', 'abox' => true, 'ascripts' => array(FILENAME_DEFAULT, FILENAME_LANGUAGES_SYNC, FILENAME_BANNERS));
     $this->title = 'Banner System';
     $this->author = 'Mark Samios';
     $this->icon = 'banner.png';
     $this->version = '1.00';
     $this->framework = '1.12';
     $this->help = '';
     tep_read_contents($this->admin_path . 'readme.txt', $this->help);
     $this->front = 1;
     $this->back = 1;
     $this->status = 1;
     $this->template_path = 'front/templates/';
     // The array of files that operate on the web-front
     // Left(Key)     => Source File with Path (to copy file from)
     // Right(Value)  => Destination Path and File (to copy source file to)
     $this->files_array = array('front/banner_system.php' => $this->web_path . 'banner_system.php', 'front/defs.php' => $this->web_path . 'defs.php', 'front/banner_system.js' => $this->web_path . 'banner_system.js', 'front/launcher.tpl' => $this->web_path . 'launcher.tpl');
     // The array of files that operate on the administration end
     // Left(Key)     => Source Path/File (to copy file from)
     // Right(Value)  => Destination Path only (to copy source file to)
     $this->admin_files_array = array('back/admin_banners.php' => 'banners.php', 'back/admin_banners_strings.php' => DIR_WS_STRINGS . 'banners.php');
     // Common Template filenames
     $this->template_array = array('banner.tpl' => $this->web_template_path . 'banner.tpl');
     $this->front_strings_array = array('web_strings.php');
     $this->sql_file = $this->admin_path . 'database.sql';
     $this->config_form = $this->admin_path . 'config_form.tpl';
     $this->strings = tep_get_strings($this->admin_path . 'strings.php');
 }
Пример #2
0
 function install_comments_system()
 {
     parent::plug_manager();
     tep_define_vars($this->admin_path . 'back/admin_defs.php');
     $this->options_array = array('text_pages' => 1, 'text_collections' => 1, 'image_collections' => 1, 'mixed_collections' => 0, 'display_rating' => true, 'rating_steps' => 5, 'text_include' => false, 'collection_include' => true, 'anti_bot' => false, 'anti_bot_strict' => false, 'auto_display' => 1, 'rss' => true, 'strings' => 'front', 'template' => 'stock', 'abox' => true, 'ascripts' => array(FILENAME_DEFAULT, FILENAME_COMMENTS));
     $this->title = 'Comments System';
     $this->author = 'Mark Samios';
     $this->icon = 'comments.png';
     $this->version = '1.01';
     $this->framework = '1.12';
     $this->help = '';
     tep_read_contents($this->admin_path . 'readme.txt', $this->help);
     $this->front = 1;
     $this->back = 1;
     $this->status = 1;
     $this->template_path = 'front/templates/';
     $this->default_steps = 5;
     // The array of files that operate on the web-front
     // Left(Key)     => Source File with Path (to copy file from)
     // Right(Value)  => Destination Path and File (to copy source file to)
     $this->files_array = array('front/comments_system_css.php' => DIR_WS_CATALOG . 'comments_system_css.php', 'front/comments_system_rss.php' => DIR_WS_CATALOG . 'comments_system_rss.php', 'front/comments_system.php' => $this->web_path . 'comments_system.php', 'front/defs.php' => $this->web_path . 'defs.php', 'front/cscss.css' => $this->web_path . 'cscss.css');
     // The array of files that operate on the administration end
     // Left(Key)     => Source Path/File (to copy file from)
     // Right(Value)  => Destination Path only (to copy source file to)
     $this->admin_files_array = array('back/admin_comments.php' => 'comments.php', 'back/admin_comments_strings.php' => DIR_WS_STRINGS . 'comments.php');
     // Common Template filenames
     $this->template_array = array('comments_form.tpl' => $this->web_template_path . 'comments_form.tpl', 'comments_posted.tpl' => $this->web_template_path . 'comments_posted.tpl', 'thumbs-up.png' => $this->web_template_path . 'thumbs-up.png', 'thumbs-down.png' => $this->web_template_path . 'thumbs-down.png');
     $this->front_strings_array = array('web_strings.php');
     $this->sql_file = $this->admin_path . 'database.sql';
     $this->config_form = $this->admin_path . 'config_form.tpl';
     $this->strings = tep_get_strings($this->admin_path . 'strings.php');
 }
Пример #3
0
 function install_right_column()
 {
     parent::plug_manager();
     tep_define_vars($this->admin_path . 'back/admin_defs.php');
     $this->options_array = array('text_pages' => 1, 'text_collections' => 1, 'image_collections' => 1, 'template' => 'stock', 'strings' => 'front', 'abox' => true, 'ascripts' => array(FILENAME_DEFAULT, FILENAME_LANGUAGES_SYNC, FILENAME_RIGHT_CONTENT));
     $this->title = 'Right Column';
     $this->author = 'Mark Samios';
     $this->icon = 'right_column.png';
     $this->version = '1.02';
     $this->framework = '1.12';
     $this->help = '';
     tep_read_contents($this->admin_path . 'readme.txt', $this->help);
     $this->front = 1;
     $this->back = 1;
     $this->status = 1;
     $this->template_path = 'front/templates/';
     // $this->web_path points to the plugins folder of the webfront
     // Key/Left => Source Path/File (to copy file from)
     // Value/Right => Destination Path only (to copy source file to)
     $this->files_array = array('front/right_column.php' => $this->web_path . 'right_column.php', 'front/defs.php' => $this->web_path . 'defs.php');
     // The array of files that operate on the administration end
     // Left(Key)     => Source Path/File (to copy file from)
     // Right(Value)  => Destination Path only (to copy source file to)
     $this->admin_files_array = array('back/admin_right_content.php' => 'right_content.php', 'back/admin_right_content_strings.php' => DIR_WS_STRINGS . 'right_content.php');
     // Common Template filenames
     $this->template_array = array('right_collection.tpl' => $this->web_template_path . 'right_collection.tpl', 'right_text.tpl' => $this->web_template_path . 'right_text.tpl', 'right_box.tpl' => $this->web_template_path . 'right_box.tpl');
     $this->front_strings_array = array('web_strings.php');
     $this->sql_file = $this->admin_path . 'database.sql';
     $this->config_form = $this->admin_path . 'config_form.tpl';
     $this->strings = tep_get_strings($this->admin_path . 'strings.php');
 }
Пример #4
0
 function comments_system()
 {
     // Force this plugin to operate only with the following scripts
     $this->scripts_array = array(FILENAME_GENERIC_PAGES, FILENAME_COLLECTIONS);
     $this->form_box = 'process_comments_system';
     $this->storage = array('css_buttons' => array(), 'visible_button' => '', 'process' => false);
     $this->entry_result = array();
     $this->max_buttons = 50;
     $this->form_show = false;
     // Call the parent to set operation path and activation conditions
     parent::plugins_base();
     // Load plugin configuration settings
     $this->options = $this->load_options();
     // Load the plugin specific strings
     $strings_array = array('web_strings.php');
     $this->strings = $this->load_strings($strings_array);
     // Load the plugin definitions files/tables
     tep_define_vars($this->fs_path . 'defs.php');
     // Prepare and validate the comments templates, disable plugin on errors
     $this->comments_form = $this->fs_template_path . 'comments_form.tpl';
     $this->comments_posted = $this->fs_template_path . 'comments_posted.tpl';
     if (!is_file($this->comments_form) || !is_file($this->comments_posted)) {
         $this->change(false);
     }
 }
Пример #5
0
 function install_download_system()
 {
     parent::plug_manager();
     tep_define_vars($this->admin_path . 'back/admin_defs.php');
     $front_defs = tep_web_files('FILENAME_GENERIC_PAGES', 'FILENAME_COLLECTIONS');
     // Default Options
     $this->options_array = array('text_pages' => 1, 'collections' => 1, 'display_col' => 1, 'download_count' => 1, 'download_count_show' => 1, 'download_path' => 'pub/', 'download_method' => 'get', 'default_status' => 1, 'template' => 'stock', 'abox' => true, 'ascripts' => array(FILENAME_DEFAULT, FILENAME_DOWNLOAD), 'fscripts' => array_values($front_defs));
     $this->title = 'Download System';
     $this->author = 'Mark Samios';
     $this->icon = 'download.png';
     $this->version = '1.00';
     $this->framework = '1.12';
     tep_read_contents($this->admin_path . 'readme.txt', $this->help);
     $this->front = 1;
     $this->back = 1;
     $this->status = 1;
     $this->template_path = 'front/templates/';
     // The array of files that operate on the web-front
     // Left(Key)     => Source File with Path (to copy file from)
     // Right(Value)  => Destination Path and File (to copy source file to)
     $this->files_array = array('front/download_system.php' => $this->web_path . 'download_system.php', 'front/tables.php' => $this->web_path . 'tables.php');
     // The array of files that operate on the administration end
     // Left(Key)     => Source Path/File (to copy file from)
     // Right(Value)  => Destination Path only (to copy source file to)
     $this->admin_files_array = array('back/admin_download.php' => 'download.php', 'back/admin_download_strings.php' => DIR_WS_STRINGS . 'download.php');
     // Common Template filenames
     $this->template_array = array('web_strings.php' => $this->web_template_path . 'web_strings.php', 'download_form.tpl' => $this->web_template_path . 'download_form.tpl', 'download_text.tpl' => $this->web_template_path . 'download_text.tpl');
     $this->sql_file = $this->admin_path . 'database.sql';
     $this->config_form = $this->admin_path . 'config_form.tpl';
     $this->strings = tep_get_strings($this->admin_path . 'strings.php');
 }
Пример #6
0
 function admin_right_column()
 {
     $this->box = 'abstract_box';
     // Call the parent to set operation path and activation conditions
     parent::plugins_base();
     $options = $this->load_options();
     tep_define_vars($this->admin_path . 'back/admin_defs.php');
     $this->strings = tep_get_strings($this->admin_path . 'back/admin_strings.php');
     $this->scripts_array = array(FILENAME_RIGHT_CONTENT, FILENAME_DEFAULT);
 }
 function admin_download_system()
 {
     // Call the parent to set operation path and activation conditions
     parent::plugins_base();
     $options = $this->load_options();
     tep_define_vars($this->admin_path . 'back/admin_defs.php');
     $this->strings = tep_get_strings($this->admin_path . 'back/admin_strings.php');
     $this->main_script = FILENAME_DOWNLOAD;
     $this->scripts_array[] = $this->main_script;
 }
Пример #8
0
 function download_system()
 {
     // Call the parent to set operation path and activation conditions
     parent::plugins_base();
     // Load the plugin options
     $this->options = $this->load_options();
     // Load the plugin strings
     $this->strings = tep_get_strings($this->fs_template_path . 'web_strings.php');
     // Load the database tables for the box content
     tep_define_vars($this->fs_path . 'tables.php');
     // Check the templates if the files are not present disable the plugin
     $this->form_box = $this->fs_template_path . 'download_form.tpl';
     $this->form_text = $this->fs_template_path . 'download_text.tpl';
     if (!is_file($this->form_box) || !is_file($this->form_text)) {
         $this->change(false);
     }
     $this->form_name = 'process_download_system_box';
     $this->download_entries = array();
 }
Пример #9
0
 function banner_system()
 {
     // Call the parent to set operation path and activation conditions
     parent::plugins_base();
     // Load the plugin options
     $this->options = $this->load_options();
     // Load the plugin strings
     $strings_array = array('web_strings.php');
     $this->strings = $this->load_strings($strings_array);
     //$this->strings = tep_get_strings($this->fs_template_path . 'web_strings.php');
     // Load the database tables for the box content
     tep_define_vars($this->fs_path . 'defs.php');
     $this->banners_array = $this->get_banners();
     $this->banner_template = $this->fs_template_path . 'banner.tpl';
     if (empty($this->banners_array)) {
         $this->change(false);
     }
     $this->group_array = array();
 }
Пример #10
0
 function right_column()
 {
     // Call the parent to set operation path and activation conditions
     parent::plugins_base();
     // Load the plugin options
     $this->options = $this->load_options();
     // Load the plugin strings
     $strings_array = array('web_strings.php');
     $this->strings = $this->load_strings($strings_array);
     // Load the database tables for the box content
     tep_define_vars($this->fs_path . 'defs.php');
     // Check the templates if the files are not present disable the plugin
     $this->box_right = $this->fs_template_path . 'right_box.tpl';
     $this->box_text = $this->fs_template_path . 'right_text.tpl';
     $this->box_collection = $this->fs_template_path . 'right_collection.tpl';
     if (!is_file($this->box_text) || !is_file($this->box_collection) || !is_file($this->box_right)) {
         $this->change(false);
     }
 }
Пример #11
0
 function voting_system()
 {
     // Force this plugin to operate only with the following scripts
     $this->scripts_array = array(FILENAME_GENERIC_PAGES, FILENAME_COLLECTIONS);
     // The form name
     $this->form_box = 'process_voting_system_box';
     // Call the parent to set operation path and activation conditions
     parent::plugins_base();
     // Load plugin configuration settings
     $this->options = $this->load_options();
     // Load the plugin specific strings
     $strings_array = array('web_strings.php');
     $this->strings = $this->load_strings($strings_array);
     tep_define_vars($this->fs_path . 'defs.php');
     $this->votes_form = $this->fs_template_path . 'votes_form.tpl';
     if (!is_file($this->votes_form)) {
         $this->change(false);
     }
 }
Пример #12
0
 function newsletter_system()
 {
     $this->form_box = 'process_newsletter_system_box';
     // Call the parent to set operation path and activation conditions
     parent::plugins_base();
     // Load the plugin options
     $this->options = $this->load_options();
     // Load the plugin strings
     // Load the plugin strings
     $strings_array = array('web_strings.php');
     $this->strings = $this->load_strings($strings_array);
     //$this->strings = tep_get_strings($this->fs_template_path . 'web_strings.php');
     // Load the database tables for the box content
     tep_define_vars($this->fs_path . 'tables.php');
     // Check the templates if the files are not present disable the plugin
     $this->newsletter_form = $this->fs_template_path . 'newsletter_form.tpl';
     if (!is_file($this->newsletter_form)) {
         $this->change(false);
     }
 }
Пример #13
0
 function initialize()
 {
     extract(tep_load('http_headers', 'database'));
     if (!$this->reset()) {
         return;
     }
     $languages_query_raw = "select language_id, language_name, language_path, language_code from " . TABLE_LANGUAGES . " order by sort_id";
     $this->languages = $db->query_to_array($languages_query_raw, 'language_id');
     $language = isset($_GET[$this->name]) ? (int) $_GET[$this->name] : 0;
     if (!$language) {
         $language = (int) $this->get_cookie($this->name);
     }
     $error = false;
     if (empty($language) || !isset($this->languages[$language])) {
         if (empty($this->languages)) {
             return;
         }
         $tmp_array = array('language_id' => $this->default, 'language_path' => $this->path, 'language_code' => $this->code);
         $error = true;
     } else {
         $tmp_array = $this->languages[$language];
     }
     $this->current = $tmp_array['language_id'];
     $this->path = $tmp_array['language_path'];
     $this->code = $tmp_array['language_code'];
     if (!$error && isset($_COOKIE[$this->name]) && $this->current == $_COOKIE[$this->name]) {
         $this->cookie = true;
     } else {
         $this->new_id = true;
         unset($_COOKIE[$this->name]);
         unset($_GET[$this->name]);
         $http->set_cookie($this->name);
         $http->set_cookie($this->name, $this->current, -1);
     }
     if ($this->default) {
         $fs_includes = tep_front_physical_path(DIR_WS_CATALOG_INCLUDES);
         $this->define_file($fs_includes . 'database_language.php');
     }
     tep_define_vars(DIR_FS_INCLUDES . 'database_tables.php');
     $this->started = true;
 }
Пример #14
0
             $error_string = ERROR_GLOBAL_DBASE_CREATE;
             redirect($_SERVER['SCRIPT_NAME'] . '?action=database&error_string=' . $error_string);
         }
     }
     $errors_array[] = ERROR_GLOBAL_UPLOADING_DATABASE;
     break;
 case 'finish':
     read_contents(FILE_TMP_FRONT_SERVER, $contents);
     eval($contents);
     read_contents(FILE_TMP_DBASE, $contents);
     eval($contents);
     read_contents(FILE_TMP_CONFIG, $contents);
     eval($contents);
     chdir(DIR_FS_CATALOG);
     require DIR_FS_CLASSES . 'database.php';
     tep_define_vars(DIR_FS_INCLUDES . 'database_tables.php');
     //require(DIR_FS_INCLUDES . 'database_tables.php');
     $g_db = new database();
     $g_db->connect();
     pre_configure_site();
     if (INSTALL_SEO_URLS == 1) {
         $contents = '#-MS- SEO-G Added' . "\n" . 'Options +FollowSymLinks' . "\n" . 'RewriteEngine On' . "\n" . 'RewriteBase ' . DIR_WS_HTTP_CATALOG . "\n\n" . '# Note whatever extension you use it should match the SEO-G configuration -> extension on the admin end even if its blank' . "\n" . '# Also the separators defined in the SEO-G for the various entities should be included in the rule here.' . "\n\n" . '# Rules for extensionless URLs' . "\n" . '# 1. Using a trailing slash' . "\n" . '#RewriteRule ^(.*)/$ root.php?$1&%{QUERY_STRING}' . "\n\n" . '# 2. Not using a trailing slash links with alphanumeric characters and hyphens' . "\n" . '#RewriteRule ^([a-z0-9_-]+)$ root.php?$1&%{QUERY_STRING}' . "\n\n" . '# Rules for URLs with extensions' . "\n" . '#RewriteRule ^(.*).asp$ root.php?$1.asp&%{QUERY_STRING}' . "\n" . '#RewriteRule ^(.*).(htm|html|asp|jsp|aspx)$ root.php?$1.*&%{QUERY_STRING}' . "\n\n" . '# Current Rules to support multiple extensions' . "\n" . '#RewriteRule ^([a-z0-9_-]+)$ root.php?$1&%{QUERY_STRING}' . "\n" . 'RewriteRule ^([/a-z0-9_-]+)$ root.php?$1&%{QUERY_STRING}' . "\n" . 'RewriteRule ^(.*)/$ root.php?$1&%{QUERY_STRING}' . "\n" . 'RewriteRule ^(.*).(htm|html|asp|jsp|aspx)$ root.php?$1.*&%{QUERY_STRING}' . "\n" . '#-MS- SEO-G Added EOM' . "\n";
         $result = write_contents('.htaccess', $contents);
         if (!$result) {
             $errors_array[] = ERROR_GLOBAL_WRITE_HTACCESS;
         }
         $contents = '#-MS- Disable SEO-G on admin folder' . "\n" . 'Options +FollowSymLinks' . "\n" . 'RewriteEngine On' . "\n" . 'RewriteBase ' . DIR_WS_HTTP_CATALOG . 'admin/' . "\n" . 'RewriteRule ^(.*)$ $1 [L]' . "\n" . '#-MS- SEO-G Added EOM' . "\n";
         chdir(DIR_FS_CATALOG . 'admin/');
         $result = write_contents('.htaccess', $contents);
         if (!$result) {
             $errors_array[] = ERROR_GLOBAL_WRITE_HTACCESS;
Пример #15
0
error_reporting(E_ALL & ~E_NOTICE);
//ini_set('error_reporting', E_ALL|E_STRICT);
//ini_set('error_reporting', E_ALL);
//ini_set('display_errors', 1);
// define the project version
define('PROJECT_VERSION', 'I-Metrics CMS with osCommerce MS2.2');
require DIR_FS_FUNCTIONS . 'general.php';
$tmp_array = tep_load('debug');
$g_debug =& $tmp_array['cDebug'];
require DIR_FS_CLASSES . 'object_info.php';
$tmp_array = tep_load('http_headers');
$g_http =& $tmp_array['http'];
// define general functions used application-wide
require DIR_FS_FUNCTIONS . 'html_output.php';
// include the list of project filenames and tables
tep_define_vars(DIR_FS_INCLUDES . 'filenames.php');
$tmp_array = tep_load('defs');
$cDefs = $tmp_array['cDefs'];
$g_server =& $cDefs->server;
$g_relpath =& $cDefs->relpath;
$g_script =& $cDefs->script;
$g_media =& $cDefs->media;
$g_ajax =& $cDefs->ajax;
$g_cookie_domain =& $cDefs->cookie_domain;
$g_cookie_path =& $cDefs->cookie_path;
$check_host = $cDefs->request_type == 'SSL' ? 'https://' : 'http://';
$check_host .= $_SERVER['HTTP_HOST'];
if ($check_host != $cDefs->server) {
    tep_redirect();
}
$check_host = substr($_SERVER['REQUEST_URI'], 0, strlen(DIR_WS_ADMIN));
Пример #16
0
 function create_references()
 {
     extract(tep_load('database'));
     tep_define_vars($this->admin_path . 'back/admin_defs.php');
     $fields_array = $db->query_to_array("show fields from " . TABLE_CUSTOMERS);
     $fields_names = tep_array_invert_flat($fields_array, 'Field', 'Field');
     if (!isset($fields_names['newsletter'])) {
         $db->query("alter table " . TABLE_CUSTOMERS . " add newsletter text null");
     }
     $check_query = $db->query("select group_id from " . TABLE_TEMPLATES_GROUPS . " where group_title = '" . $db->filter(PLUGIN_NEWSLETTER_TEMPLATE_GROUP) . "'");
     if (!$db->num_rows($check_query)) {
         $sql_data_array = array('group_title' => $db->prepare_input(PLUGIN_NEWSLETTER_TEMPLATE_GROUP));
         $db->perform(TABLE_TEMPLATES_GROUPS, $sql_data_array);
     }
 }
Пример #17
0
 function delete_references()
 {
     extract(tep_load('database'));
     tep_define_vars($this->admin_path . 'back/admin_defs.php');
     $db->query("drop table if exists " . TABLE_VOTES);
 }
Пример #18
0
 function load_strings()
 {
     extract(tep_load('defs'));
     $path = $this->path;
     if (!empty($path)) {
         $path .= '/';
     }
     $file = DIR_FS_STRINGS . $path . FILENAME_COMMON;
     tep_define_vars($file);
     $file = DIR_FS_STRINGS . $path . $cDefs->script;
     if (is_file($file)) {
         require_once DIR_FS_STRINGS . $path . FILENAME_LCONFIG;
         tep_define_vars($file);
     }
 }