function install_quick_updates()
{
    global $db;
    $project = PROJECT_VERSION_MAJOR . '.' . PROJECT_VERSION_MINOR;
    if (substr($project, 0, 5) == "1.3.8" || substr($project, 0, 5) == "1.3.9") {
        $db->Execute("INSERT INTO " . TABLE_CONFIGURATION_GROUP . " VALUES ('', 'Quick Updates', 'Quick Updates Configuration', '1', '1')");
        $group_id = mysql_insert_id();
        $db->Execute("UPDATE " . TABLE_CONFIGURATION_GROUP . " SET sort_order = " . $group_id . " WHERE configuration_group_id = " . $group_id);
        $db->Execute("INSERT INTO " . TABLE_CONFIGURATION . " (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES \n\t\t(NULL, 'Display the ID.',                          'QUICKUPDATES_DISPLAY_ID',          'true',  'Enable/Disable the products id displaying',                     " . $group_id . ", '1', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'), \n\t\t(NULL, 'Display the thumbnail.',                   'QUICKUPDATES_DISPLAY_THUMBNAIL',   'true',  'Enable/Disable the products thumbnail displaying',              " . $group_id . ", '2', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, 'Modify the model.',                        'QUICKUPDATES_MODIFY_MODEL',        'true',  'Enable/Disable the products model displaying and modification', " . $group_id . ", '3', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, 'Modify the name.',                         'QUICKUPDATES_MODIFY_NAME',         'true',  'Enable/Disable the products name editing',                      " . $group_id . ", '4', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, 'Modify the Description.',                  'QUICKUPDATES_MODIFY_DESCRIPTION',  'true',  'Enable/Disable the displaying and modification of products description', " . $group_id . ", '5', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, 'Modify the status of the products.',       'QUICKUPDATES_MODIFY_STATUS',       'true',  'Allow/Disallow the Status displaying and modification',       " . $group_id . ", '6',  NULL, NOW(), NULL,  'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, 'Modify the weight of the products.',       'QUICKUPDATES_MODIFY_WEIGHT',       'true',  'Allow/Disallow the Weight displaying and modification?',      " . $group_id . ", '7',  NULL, NOW(), NULL,  'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, 'Modify the quantity of the products.',     'QUICKUPDATES_MODIFY_QUANTITY',     'true',  'Allow/Disallow the quantity displaying and modification',     " . $group_id . ", '8',  NULL, NOW(), NULL,  'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, 'Modify the manufacturer of the products.', 'QUICKUPDATES_MODIFY_MANUFACTURER', 'false', 'Allow/Disallow the Manufacturer displaying and modification', " . $group_id . ", '9',  NULL, NOW(), NULL,  'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, 'Modify the class of tax of the products.', 'QUICKUPDATES_MODIFY_TAX',          'false', 'Allow/Disallow the Class of tax displaying and modification', " . $group_id . ", '10', NULL, NOW(), NULL,  'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, 'Modify the category.',                     'QUICKUPDATES_MODIFY_CATEGORY',     'true',  'Enable/Disable the products category modify',                 " . $group_id . ", '11', NULL, NOW(), NULL,  'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, 'Display price with all included of tax.',  'QUICKUPDATES_DISPLAY_TVA_OVER',    'true',  'Enable/Disable the displaying of the Price with all tax included when your mouse is over a product', " . $group_id . ", '20', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, 'Display the link towards the products information page.',                       'QUICKUPDATES_DISPLAY_PREVIEW',            'false', 'Enable/Disable the display of the link towards the products information page ',                      " . $group_id . ", '30', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, 'Display the link towards the page where you will be able to edit the product.', 'QUICKUPDATES_DISPLAY_EDIT',               'true',  'Enable/Disable the display of the link towards the page where you will be able to edit the product', " . $group_id . ", '31', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, 'Activate or desactivate the commercial margin.',                                'QUICKUPDATES_ACTIVATE_COMMERCIAL_MARGIN', 'true',  'Do you want that the commercial margin be activate or not ?'," . $group_id . ", '40', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, 'Modify the sort order.',                   'QUICKUPDATES_MODIFY_SORT_ORDER',        'true', 'Enable/Disable the products sort order modify',               " . $group_id . ", '12', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, 'Use popup edit.',                          'QUICKUPDATES_MODIFY_DESCRIPTION_POPUP', 'true', 'Enable/Disable using popup edit link to description editing', " . $group_id . ", '13', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),') ");
    } elseif (substr($project, 0, 3) == "1.5") {
        $db->Execute("INSERT INTO " . TABLE_CONFIGURATION_GROUP . " VALUES ('', 'Quick Updates', 'Quick Updates Configuration', '1', '1')");
        $group_id = $db->Insert_ID();
        $db->Execute("UPDATE " . TABLE_CONFIGURATION_GROUP . " SET sort_order = " . $group_id . " WHERE configuration_group_id = " . $group_id);
        zen_register_admin_page('quick_updates_config', 'BOX_CATALOG_QUICK_UPDATES', 'FILENAME_CONFIGURATION', 'gID=' . $group_id, 'configuration', 'Y', 103);
        $db->Execute("INSERT INTO " . TABLE_CONFIGURATION . " (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function)  VALUES \n\t\t(NULL, 'Display the ID.',                          'QUICKUPDATES_DISPLAY_ID',          'true',  'Enable/Disable the products id displaying',                     " . $group_id . ", '1', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'), \n\t\t(NULL, 'Display the thumbnail.',                   'QUICKUPDATES_DISPLAY_THUMBNAIL',   'true',  'Enable/Disable the products thumbnail displaying',              " . $group_id . ", '2', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, 'Modify the model.',                        'QUICKUPDATES_MODIFY_MODEL',        'true',  'Enable/Disable the products model displaying and modification', " . $group_id . ", '3', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, 'Modify the name.',                         'QUICKUPDATES_MODIFY_NAME',         'true',  'Enable/Disable the products name editing',                      " . $group_id . ", '4', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, 'Modify the Description.',                  'QUICKUPDATES_MODIFY_DESCRIPTION',  'true',  'Enable/Disable the displaying and modification of products description', " . $group_id . ", '5', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, 'Modify the status of the products.',       'QUICKUPDATES_MODIFY_STATUS',       'true',  'Allow/Disallow the Status displaying and modification',       " . $group_id . ", '6',  NULL, NOW(), NULL,  'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, 'Modify the weight of the products.',       'QUICKUPDATES_MODIFY_WEIGHT',       'true',  'Allow/Disallow the Weight displaying and modification?',      " . $group_id . ", '7',  NULL, NOW(), NULL,  'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, 'Modify the quantity of the products.',     'QUICKUPDATES_MODIFY_QUANTITY',     'true',  'Allow/Disallow the quantity displaying and modification',     " . $group_id . ", '8',  NULL, NOW(), NULL,  'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, 'Modify the manufacturer of the products.', 'QUICKUPDATES_MODIFY_MANUFACTURER', 'false', 'Allow/Disallow the Manufacturer displaying and modification', " . $group_id . ", '9',  NULL, NOW(), NULL,  'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, 'Modify the class of tax of the products.', 'QUICKUPDATES_MODIFY_TAX',          'false', 'Allow/Disallow the Class of tax displaying and modification', " . $group_id . ", '10', NULL, NOW(), NULL,  'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, 'Modify the category.',                     'QUICKUPDATES_MODIFY_CATEGORY',     'true',  'Enable/Disable the products category modify',                 " . $group_id . ", '11', NULL, NOW(), NULL,  'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, 'Display price with all included of tax.',  'QUICKUPDATES_DISPLAY_TVA_OVER',    'true',  'Enable/Disable the displaying of the Price with all tax included when your mouse is over a product', " . $group_id . ", '20', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, 'Display the link towards the products information page.',                       'QUICKUPDATES_DISPLAY_PREVIEW',            'false', 'Enable/Disable the display of the link towards the products information page ',                      " . $group_id . ", '30', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, 'Display the link towards the page where you will be able to edit the product.', 'QUICKUPDATES_DISPLAY_EDIT',               'true',  'Enable/Disable the display of the link towards the page where you will be able to edit the product', " . $group_id . ", '31', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, 'Activate or desactivate the commercial margin.',                                'QUICKUPDATES_ACTIVATE_COMMERCIAL_MARGIN', 'true',  'Do you want that the commercial margin be activate or not ?'," . $group_id . ", '40', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, 'Modify the sort order.',                   'QUICKUPDATES_MODIFY_SORT_ORDER',        'true', 'Enable/Disable the products sort order modify',               " . $group_id . ", '12', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, 'Use popup edit.',                          'QUICKUPDATES_MODIFY_DESCRIPTION_POPUP', 'true', 'Enable/Disable using popup edit link to description editing', " . $group_id . ", '13', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),') ");
    } else {
        // unsupported version
        // i should do something here!
    }
}
function install_quick_updates()
{
    global $db;
    $project = PROJECT_VERSION_MAJOR . '.' . PROJECT_VERSION_MINOR;
    if (substr($project, 0, 5) == "1.3.8" || substr($project, 0, 5) == "1.3.9") {
        $db->Execute("INSERT INTO " . TABLE_CONFIGURATION_GROUP . " VALUES (NULL, '快速更新', '快速更新选项', '1', '1')");
        $group_id = mysql_insert_id();
        $db->Execute("UPDATE " . TABLE_CONFIGURATION_GROUP . " SET sort_order = " . $group_id . " WHERE configuration_group_id = " . $group_id);
        $db->Execute("INSERT INTO " . TABLE_CONFIGURATION . "  VALUES \n\t\t(NULL, '商品编号', 'QUICKUPDATES_DISPLAY_ID', 'true', '是否显示商品编号', " . $group_id . ", '1', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'), \n\t\t(NULL, '商品缩略图', 'QUICKUPDATES_DISPLAY_THUMBNAIL', 'true', '是否显示商品缩略图', " . $group_id . ", '2', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, '商品型号', 'QUICKUPDATES_MODIFY_MODEL', 'true', '是否修改商品型号', " . $group_id . ", '3', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, '商品名称', 'QUICKUPDATES_MODIFY_NAME', 'true', '是否修改商品名称', " . $group_id . ", '4', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, '商品简介', 'QUICKUPDATES_MODIFY_DESCRIPTION', 'true', '是否修改商品简介', " . $group_id . ", '5', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, '商品状态', 'QUICKUPDATES_MODIFY_STATUS', 'true', '是否修改商品状态', " . $group_id . ", '6', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, '商品重量', 'QUICKUPDATES_MODIFY_WEIGHT', 'true', '是否修改商品重量', " . $group_id . ", '7', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, '商品数量', 'QUICKUPDATES_MODIFY_QUANTITY', 'true', '是否修改商品数量', " . $group_id . ", '8', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, '商品厂家', 'QUICKUPDATES_MODIFY_MANUFACTURER', 'false', '是否修改商品厂家', " . $group_id . ", '9', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, '商品税类', 'QUICKUPDATES_MODIFY_TAX', 'false', '是否修改商品税类', " . $group_id . ", '10', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, '商品分类', 'QUICKUPDATES_MODIFY_CATEGORY', 'true', '是否修改商品分类', " . $group_id . ", '11', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, '商品价格', 'QUICKUPDATES_DISPLAY_TVA_OVER', 'true', '鼠标指向商品时,是否显示含税价格', " . $group_id . ", '20', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, '前台商品页面的链接', 'QUICKUPDATES_DISPLAY_PREVIEW', 'false', '是否显示到前台商品信息页面的链接', " . $group_id . ", '30', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, '后台商品页面的链接', 'QUICKUPDATES_DISPLAY_EDIT', 'true', '是否显示到后台商品编辑页面的链接', " . $group_id . ", '31', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, '商品利润', 'QUICKUPDATES_ACTIVATE_COMMERCIAL_MARGIN', 'true', '是否显示商品利润'," . $group_id . ", '40', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, '商品排序', 'QUICKUPDATES_MODIFY_SORT_ORDER', 'true', '是否修改商品排序', " . $group_id . ", '12', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, '弹出窗口', 'QUICKUPDATES_MODIFY_DESCRIPTION_POPUP', 'true', '是否使用弹出链接修改商品简介', " . $group_id . ", '13', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),') ");
    } elseif (substr($project, 0, 3) == "1.5") {
        $db->Execute("INSERT INTO " . TABLE_CONFIGURATION_GROUP . " VALUES (NULL, '快速更新', '快速更新选项', '1', '1')");
        $group_id = mysql_insert_id();
        $db->Execute("UPDATE " . TABLE_CONFIGURATION_GROUP . " SET sort_order = " . $group_id . " WHERE configuration_group_id = " . $group_id);
        zen_register_admin_page('quick_updates_config', 'BOX_CATALOG_QUICK_UPDATES', 'FILENAME_CONFIGURATION', 'gID=' . $group_id, 'configuration', 'Y', 103);
        $db->Execute("INSERT INTO " . TABLE_CONFIGURATION . "  VALUES \n\t\t(NULL, '商品编号', 'QUICKUPDATES_DISPLAY_ID', 'true', '是否显示商品编号', " . $group_id . ", '1', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'), \n\t\t(NULL, '商品缩略图', 'QUICKUPDATES_DISPLAY_THUMBNAIL', 'true', '是否显示商品缩略图', " . $group_id . ", '2', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, '商品型号', 'QUICKUPDATES_MODIFY_MODEL', 'true', '是否修改商品型号', " . $group_id . ", '3', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, '商品名称', 'QUICKUPDATES_MODIFY_NAME', 'true', '是否修改商品名称', " . $group_id . ", '4', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, '商品简介', 'QUICKUPDATES_MODIFY_DESCRIPTION', 'true', '是否修改商品简介', " . $group_id . ", '5', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, '商品状态', 'QUICKUPDATES_MODIFY_STATUS', 'true', '是否修改商品状态', " . $group_id . ", '6', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, '商品重量', 'QUICKUPDATES_MODIFY_WEIGHT', 'true', '是否修改商品重量', " . $group_id . ", '7', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, '商品数量', 'QUICKUPDATES_MODIFY_QUANTITY', 'true', '是否修改商品数量', " . $group_id . ", '8', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, '商品厂家', 'QUICKUPDATES_MODIFY_MANUFACTURER', 'false', '是否修改商品厂家', " . $group_id . ", '9', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, '商品税类', 'QUICKUPDATES_MODIFY_TAX', 'false', '是否修改商品税类', " . $group_id . ", '10', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, '商品分类', 'QUICKUPDATES_MODIFY_CATEGORY', 'true', '是否修改商品分类', " . $group_id . ", '11', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, '商品价格', 'QUICKUPDATES_DISPLAY_TVA_OVER', 'true', '鼠标指向商品时,是否显示含税价格', " . $group_id . ", '20', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, '前台商品页面的链接', 'QUICKUPDATES_DISPLAY_PREVIEW', 'false', '是否显示到前台商品信息页面的链接', " . $group_id . ", '30', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, '后台商品页面的链接', 'QUICKUPDATES_DISPLAY_EDIT', 'true', '是否显示到后台商品编辑页面的链接', " . $group_id . ", '31', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, '商品利润', 'QUICKUPDATES_ACTIVATE_COMMERCIAL_MARGIN', 'true', '是否显示商品利润', " . $group_id . ", '40', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, '商品排序', 'QUICKUPDATES_MODIFY_SORT_ORDER', 'true', '是否修改商品排序', " . $group_id . ", '12', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t(NULL, '弹出窗口', 'QUICKUPDATES_MODIFY_DESCRIPTION_POPUP', 'true', '是否使用弹出链接修改商品简介', " . $group_id . ", '13', NULL, NOW(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),') ");
    } else {
        // unsupported version
        // i should do something here!
    }
}
Example #3
0
<?php

/**
 * Slideshow creator
 *
 * @package slideshow
 * @author Vassilios Barzokas <*****@*****.**> 
 * @author website www.vbarzokas.com
 * @copyright Copyright 2011 Vassilios Barzokas
 * @license http://www.gnu.org/copyleft/gpl.html   GNU Public License V2.0
 * @version $Id: slideshow.php 1.1 2012-01-22 11:50:04Z $
 */
if (!defined('IS_ADMIN_FLAG')) {
    die('Illegal Access');
}
if (function_exists('zen_register_admin_page')) {
    if (!zen_page_key_exists('slideshow')) {
        // Add slideshow to Tools menu
        zen_register_admin_page('slideshow', 'BOX_TOOLS_SLIDESHOW', 'FILENAME_SLIDESHOW', '', 'tools', 'Y', 17);
    }
}
Example #4
0
<?php

/*
 $Id: reg_backup_mysql.php, v 1.4 2011/11/24  $																    
                                                     
  By PRO-Webs.net 12.9.2011
                                                      
  Powered by Zen-Cart (www.zen-cart.com)              
  Portions Copyright (c) 2006 The Zen Cart Team       
                                                      
  Released under the GNU General Public License       
  available at www.zen-cart.com/license/2_0.txt       
  or see "license.txt" in the downloaded zip          

  DESCRIPTION: Add Export Orders to Tools Menu
*/
if (!defined('IS_ADMIN_FLAG')) {
    die('Illegal Access');
}
if (function_exists('zen_register_admin_page')) {
    if (!zen_page_key_exists('todopago')) {
        zen_register_admin_page('todopago', 'BOX_TOOLS_TODOPAGO', 'FILENAME_TODOPAGO', '', 'tools', 'Y', 17);
    }
}
    $db->Execute($sql);
}
//check if track_id4 column exists
$sql = "SHOW COLUMNS FROM " . TABLE_ORDERS_STATUS_HISTORY . " LIKE '%track_id4%'";
$result = $db->Execute($sql);
if (!$result->RecordCount()) {
    $sql = "ALTER TABLE " . TABLE_ORDERS_STATUS_HISTORY . " ADD track_id4 TEXT default NULL";
    $db->Execute($sql);
}
//check if track_id5 column exists
$sql = "SHOW COLUMNS FROM " . TABLE_ORDERS_STATUS_HISTORY . " LIKE '%track_id5%'";
$result = $db->Execute($sql);
if (!$result->RecordCount()) {
    $sql = "ALTER TABLE " . TABLE_ORDERS_STATUS_HISTORY . " ADD track_id5 TEXT default NULL";
    $db->Execute($sql);
}
if (file_exists(DIR_FS_ADMIN . DIR_WS_INCLUDES . 'auto_loaders/config.typt.php')) {
    if (!unlink(DIR_FS_ADMIN . DIR_WS_INCLUDES . 'auto_loaders/config.typt.php')) {
        $messageStack->add('The auto-loader ' . DIR_FS_ADMIN . 'includes/auto_loaders/config.typt.php  has not been deleted.  For this module to work you must delete this file manually.', 'error');
    }
}
$messageStack->add('Ty Package Tracker v3.1.4 install completed!', 'success');
// find next sort order in admin_pages table
$sql = "SELECT (MAX(sort_order)+2) as sort FROM " . TABLE_ADMIN_PAGES;
$result = $db->Execute($sql);
$admin_page_sort = $result->fields['sort'];
// now register the admin pages
// Admin Menu for Ty Package Tracker Configuration Menu
zen_deregister_admin_pages('configTyPackageTracker');
zen_register_admin_page('configTyPackageTracker', 'BOX_CONFIGURATION_TY_PACKAGE_TRACKER', 'FILENAME_CONFIGURATION', 'gID=' . $typt_configuration_id, 'configuration', 'Y', $admin_page_sort);
<?php

/**
 * Add entry to Tools menu
 */
if (!defined('IS_ADMIN_FLAG')) {
    die('Illegal Access');
}
if (function_exists('zen_register_admin_page')) {
    if (!zen_page_key_exists('emailArchive')) {
        zen_register_admin_page('emailArchive', 'BOX_TOOLS_EMAIL_ARCHIVE_MANAGER', 'FILENAME_EMAIL_HISTORY', '', 'tools', 'Y', 20);
    }
}
<?php

// use $configuration_group_id where needed
$db->Execute("INSERT INTO " . TABLE_CONFIGURATION . " (configuration_group_id, sort_order, configuration_key, configuration_title, configuration_value, configuration_description, set_function) VALUES (" . (int) $configuration_group_id . ", 1, 'HIPCHAT_ERROR_ENABLE', 'Enabel Module', 'false', 'Should this module be used', 'zen_cfg_select_option(array(\\'true\\', \\'false\\'),');");
$db->Execute("INSERT INTO " . TABLE_CONFIGURATION . " (configuration_group_id, sort_order, configuration_key, configuration_title, configuration_value, configuration_description) VALUES (" . (int) $configuration_group_id . ", 2, 'HIPCHAT_TOKEN', 'HipChat API Auth Token', '', 'This is the token that you will need to get form hipchat');");
$db->Execute("INSERT INTO " . TABLE_CONFIGURATION . " (configuration_group_id, sort_order, configuration_key, configuration_title, configuration_value, configuration_description, set_function) VALUES (" . (int) $configuration_group_id . ", 6, 'HIPCHAT_MESSAGE_FORMAT', 'Message Format', 'text', 'This is the format of message that should be sent, either TEXT or HTML', 'zen_cfg_select_option(array(\\'text\\', \\'html\\'),');");
$db->Execute("INSERT INTO " . TABLE_CONFIGURATION . " (configuration_group_id, sort_order, configuration_key, configuration_title, configuration_value, configuration_description) VALUES (" . (int) $configuration_group_id . ", 4, 'HIPCHAT_NOTIFY_ROOM', 'Notify the room?', '1', 'Should it notify the room, when it sends the message (true = 1)');");
$db->Execute("INSERT INTO " . TABLE_CONFIGURATION . " (configuration_group_id, sort_order, configuration_key, configuration_title, configuration_value, configuration_description) VALUES (" . (int) $configuration_group_id . ", 9, 'HIPCHAT_MESSAGE_COLOR', 'Color of the message', 'red', 'Background color for message. One of yellow, red, green, purple, gray, or random.');");
$db->Execute("INSERT INTO " . TABLE_CONFIGURATION . " (configuration_group_id, sort_order, configuration_key, configuration_title, configuration_value, configuration_description) VALUES (" . (int) $configuration_group_id . ", 2, 'HIPCHAT_ROOM_ID', 'Room ID to post the message to', '', 'This is either the name of the room, but more dependable is to use the room id (it also called API ID)');");
$db->Execute("INSERT INTO " . TABLE_CONFIGURATION . " (configuration_group_id, sort_order, configuration_key, configuration_title, configuration_value, configuration_description) VALUES (" . (int) $configuration_group_id . ", 3, 'HIPCHAT_ERROR_FROM', 'From name on Error messages', 'Error Log', 'This the name that it will appear the message came from');");
$db->Execute("INSERT INTO " . TABLE_CONFIGURATION . " (configuration_group_id, sort_order, configuration_key, configuration_title, configuration_value, configuration_description) VALUES (" . (int) $configuration_group_id . ", 7, 'HIPCHAT_MAX_LENGTH', 'Maximum length of message', '1000', 'This is the maximum length of the message, HipChat max is 10,000 but that is really long.');");
$db->Execute("INSERT INTO " . TABLE_CONFIGURATION . " (configuration_group_id, sort_order, configuration_key, configuration_title, configuration_value, configuration_description) VALUES (" . (int) $configuration_group_id . ", 8, 'HIPCHAT_ERROR_PREFIX', 'Prefix on Error Message', '', 'This will be added the the start of the message, this is useful for when you want to notify a person, like @user');");
$db->Execute("INSERT INTO " . TABLE_CONFIGURATION . " (configuration_group_id, sort_order, configuration_key, configuration_title, configuration_value, configuration_description) VALUES (" . (int) $configuration_group_id . ", 9, 'HIPCHAT_LAST_MESSAGE', 'Last Time Message Sent', '', 'This is the last timestamp a message was sent, set this to zero to send one on the next pageload reguardless');");
$db->Execute("INSERT INTO " . TABLE_CONFIGURATION . " (configuration_group_id, sort_order, configuration_key, configuration_title, configuration_value, configuration_description) VALUES (" . (int) $configuration_group_id . ", 5, 'HIPCHAT_LIMIT_MESSAGE', 'Limit of Message', '300', 'Change how often messages are sent, setting this at 300 will limit the number of messages to no sooner then every 5 minutes');");
$db->Execute("INSERT INTO " . TABLE_CONFIGURATION . " (configuration_group_id, sort_order, configuration_key, configuration_title, configuration_value, configuration_description, set_function) VALUES (" . (int) $configuration_group_id . ", 3, 'HIPCHAT_API_FORMAT', 'Format to send Notify', 'json', 'Desired response format: json or xml. (default: json)', 'zen_cfg_select_option(array(\\'json\\', \\'xml\\'),');");
// For Admin Pages
$zc150 = PROJECT_VERSION_MAJOR > 1 || PROJECT_VERSION_MAJOR == 1 && substr(PROJECT_VERSION_MINOR, 0, 3) >= 5;
if ($zc150) {
    // continue Zen Cart 1.5.0
    // delete configuration menu
    $db->Execute("DELETE FROM " . TABLE_ADMIN_PAGES . " WHERE page_key = 'configHipchat' LIMIT 1;");
    // add configuration menu
    if (!zen_page_key_exists('configHipchat')) {
        if ((int) $configuration_group_id > 0) {
            zen_register_admin_page('configHipchat', 'BOX_HIPCHAT_NOTIFICATION', 'FILENAME_CONFIGURATION', 'gID=' . $configuration_group_id, 'configuration', 'Y', $configuration_group_id);
            $messageStack->add('Enabled HipChat Notification Configuration Menu.', 'success');
        }
    }
}
function install_easypopulate_4()
{
    global $db;
    $project = PROJECT_VERSION_MAJOR . '.' . PROJECT_VERSION_MINOR;
    if (substr($project, 0, 5) == "1.3.8" || substr($project, 0, 5) == "1.3.9") {
        $db->Execute("INSERT INTO " . TABLE_CONFIGURATION_GROUP . " (configuration_group_title, configuration_group_description, sort_order, visible) VALUES ('Easy Populate 4', 'Configuration Options for Easy Populate 4', '1', '1')");
        $group_id = mysql_insert_id();
        $db->Execute("UPDATE " . TABLE_CONFIGURATION_GROUP . " SET sort_order = " . $group_id . " WHERE configuration_group_id = " . $group_id);
        $db->Execute("INSERT INTO " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES \n\t\t\t('Uploads Directory',                  'EASYPOPULATE_4_CONFIG_TEMP_DIR', 'temp/', 'Name of directory for your uploads (default: temp/).', " . $group_id . ", '0', NULL, now(), NULL, NULL),\n\t\t\t('Upload File Date Format',            'EASYPOPULATE_4_CONFIG_FILE_DATE_FORMAT', 'm-d-y', 'Choose order of date values that corresponds to your uploads file, usually generated by MS Excel. Raw dates in your uploads file (Eg 2005-09-26 09:00:00) are not affected, and will upload as they are.', " . $group_id . ", '1', NULL, now(), NULL, 'zen_cfg_select_option(array(\"m-d-y\", \"d-m-y\", \"y-m-d\"),'),\n\t\t\t('Default Raw Time',                   'EASYPOPULATE_4_CONFIG_DEFAULT_RAW_TIME', '09:00:00', 'If no time value stipulated in upload file, use this value. Useful for ensuring specials begin after a specific time of the day (default: 09:00:00)', " . $group_id . ", '2', NULL, now(), NULL, NULL),\n\t\t\t('Upload/Download Prices Include Tax', 'EASYPOPULATE_4_CONFIG_PRICE_INC_TAX', 'false', 'Choose to include or exclude tax, depending on how you manage prices outside of Zen Cart.', " . $group_id . ", '5', NULL, now(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t\t('Verbose Feedback',                   'EASYPOPULATE_4_CONFIG_VERBOSE', 'true', 'When importing, report all messages. Set to false for only warnings and errors. (default: true).', " . $group_id . ", '6', NULL, now(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t\t('Make Zero Qty Products Inactive',    'EASYPOPULATE_4_CONFIG_ZERO_QTY_INACTIVE', 'false', 'When uploading, make the status Inactive for products with zero qty (default: false).', " . $group_id . ", '7', NULL, now(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t\t('Smart Tags Replacement of Newlines', 'EASYPOPULATE_4_CONFIG_SMART_TAGS', 'true', 'Allows your description fields in your uploads file to have carriage returns and/or new-lines converted to HTML line-breaks on uploading, thus preserving some rudimentary formatting - Note: this legacy code is disabled until further review. (default: true).', " . $group_id . ", '8', NULL, now(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t\t('Advanced Smart Tags',                'EASYPOPULATE_4_CONFIG_ADV_SMART_TAGS', 'false', 'Allow the use of complex regular expressions to format descriptions, making headings bold, add bullets, etc. Note: legacy code is disabled until further review. (default: false).', " . $group_id . ", '9', NULL, now(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t\t('Debug Logging',                      'EASYPOPULATE_4_CONFIG_DEBUG_LOGGING', 'true', 'Allow Easy Populate to generate an error log on errors only (default: true)', " . $group_id . ", '10', NULL, now(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t\t('Maximum Quantity Discounts',         'EASYPOPULATE_4_CONFIG_MAX_QTY_DISCOUNTS', '3', 'Maximum number of quantity discounts (price breaks). Is the number of discount columns in downloaded file (default: 3).', " . $group_id . ", '11', NULL, now(), NULL, NULL),\n\t\t\t('Split On Number of Records',         'EASYPOPULATE_4_CONFIG_SPLIT_RECORDS', '2000', 'Number of records to split csv files. Used to break large import files into smaller files. Useful on servers with limited resourses. (default: 2000).', " . $group_id . ", '12', NULL, now(), NULL, NULL),\n\t\t\t('Script Execution Time',              'EASYPOPULATE_4_CONFIG_EXECUTION_TIME', '60', 'Number of seconds for script to run before timeout. May not work on some servers. (default: 60).', " . $group_id . ", '13', NULL, now(), NULL, NULL),\n\t\t\t('Convert Curly Quotes, etc.',         'EASYPOPULATE_4_CONFIG_CURLY_QUOTES', '0', 'Convert Curly Quotes, Em-Dash, En-Dash and Ellipsis characters in Product Names &amp; Descriptions (default 0).<br><br>0=No Change<br>1=Replace with Basic Characters<br>3=Replace with HMTL equivalants', " . $group_id . ", '14', NULL, now(), NULL, 'zen_cfg_select_option(array(\"0\", \"1\", \"2\"),'),\n\t\t\t('Convert Character 0x92',             'EASYPOPULATE_4_CONFIG_CHAR_92', '1', 'Convert Character 0x92 characters in Product Names &amp; Descriptions (default 1).<br><br>0=No Change<br>1=Replace with Standard Single Quote<br>2=Replace with HMTL equivalant', " . $group_id . ", '15', NULL, now(), NULL, 'zen_cfg_select_option(array(\"0\", \"1\", \"2\"),'),\n\t\t\t('Enable Products Meta Data',          'EASYPOPULATE_4_CONFIG_META_DATA', '1', 'Enable Products Meta Data Columns (default 1).<br><br>0=Disable<br>1=Enable', " . $group_id . ", '16', NULL, now(), NULL, 'zen_cfg_select_option(array(\"0\", \"1\"),'), \n\t\t\t('Enable Products Music Data',         'EASYPOPULATE_4_CONFIG_MUSIC_DATA', '0', 'Enable Products Music Data Columns (default 0).<br><br>0=Disable<br>1=Enable', " . $group_id . ", '17', NULL, now(), NULL, 'zen_cfg_select_option(array(\"0\", \"1\"),'),\n\t\t\t('User Defined Products Fields',       'EASYPOPULATE_4_CONFIG_CUSTOM_FIELDS', '', 'User Defined Products Table Fields (comma delimited, no spaces)', " . $group_id . ", '18', NULL, now(), NULL, NULL),\n\t\t\t('Export URI with Prod and or Cat',       'EASYPOPULATE_4_CONFIG_EXPORT_URI', '0', 'Export the current products or categories URI when exporting data? (Yes - 1 or no - 0)', " . $group_id . ", '19', NULL, now(), NULL, 'zen_cfg_select_option(array(\"0\", \"1\"),')\n\t\t");
    } elseif (PROJECT_VERSION_MAJOR > '1' || PROJECT_VERSION_MINOR >= '5.0') {
        $db->Execute("INSERT INTO " . TABLE_CONFIGURATION_GROUP . " (configuration_group_title, configuration_group_description, sort_order, visible) VALUES ('Easy Populate 4', 'Configuration Options for Easy Populate 4', '1', '1')");
        if (PROJECT_VERSION_MAJOR > '1' || PROJECT_VERSION_MINOR >= '5.3') {
            $group_id = mysqli_insert_id($db->link);
        } else {
            $group_id = mysql_insert_id();
        }
        $db->Execute("UPDATE " . TABLE_CONFIGURATION_GROUP . " SET sort_order = " . $group_id . " WHERE configuration_group_id = " . $group_id);
        zen_register_admin_page('easypopulate_4_config', 'BOX_TOOLS_EASYPOPULATE_4', 'FILENAME_CONFIGURATION', 'gID=' . $group_id, 'configuration', 'Y', 97);
        $db->Execute("INSERT INTO " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES \n\t\t\t('Uploads Directory',                  'EASYPOPULATE_4_CONFIG_TEMP_DIR', 'temp/', 'Name of directory for your uploads (default: temp/).', " . $group_id . ", '0', NULL, now(), NULL, NULL),\n\t\t\t('Upload File Date Format',            'EASYPOPULATE_4_CONFIG_FILE_DATE_FORMAT', 'm-d-y', 'Choose order of date values that corresponds to your uploads file, usually generated by MS Excel. Raw dates in your uploads file (Eg 2005-09-26 09:00:00) are not affected, and will upload as they are.', " . $group_id . ", '1', NULL, now(), NULL, 'zen_cfg_select_option(array(\"m-d-y\", \"d-m-y\", \"y-m-d\"),'),\n\t\t\t('Default Raw Time',                   'EASYPOPULATE_4_CONFIG_DEFAULT_RAW_TIME', '09:00:00', 'If no time value stipulated in upload file, use this value. Useful for ensuring specials begin after a specific time of the day (default: 09:00:00)', " . $group_id . ", '2', NULL, now(), NULL, NULL),\n\t\t\t('Upload/Download Prices Include Tax', 'EASYPOPULATE_4_CONFIG_PRICE_INC_TAX', 'false', 'Choose to include or exclude tax, depending on how you manage prices outside of Zen Cart.', " . $group_id . ", '5', NULL, now(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t\t('Verbose Feedback',                   'EASYPOPULATE_4_CONFIG_VERBOSE', 'true', 'When importing, report all messages. Set to false for only warnings and errors. (default: true).', " . $group_id . ", '6', NULL, now(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t\t('Make Zero Qty Products Inactive',    'EASYPOPULATE_4_CONFIG_ZERO_QTY_INACTIVE', 'false', 'When uploading, make the status Inactive for products with zero qty (default: false).', " . $group_id . ", '7', NULL, now(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t\t('Smart Tags Replacement of Newlines', 'EASYPOPULATE_4_CONFIG_SMART_TAGS', 'true', 'Allows your description fields in your uploads file to have carriage returns and/or new-lines converted to HTML line-breaks on uploading, thus preserving some rudimentary formatting - Note: this legacy code is disabled until further review. (default: true).', " . $group_id . ", '8', NULL, now(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t\t('Advanced Smart Tags',                'EASYPOPULATE_4_CONFIG_ADV_SMART_TAGS', 'false', 'Allow the use of complex regular expressions to format descriptions, making headings bold, add bullets, etc. Note: legacy code is disabled until further review. (default: false).', " . $group_id . ", '9', NULL, now(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t\t('Debug Logging',                      'EASYPOPULATE_4_CONFIG_DEBUG_LOGGING', 'true', 'Allow Easy Populate to generate an error log on errors only (default: true)', " . $group_id . ", '10', NULL, now(), NULL, 'zen_cfg_select_option(array(\"true\", \"false\"),'),\n\t\t\t('Maximum Quantity Discounts',         'EASYPOPULATE_4_CONFIG_MAX_QTY_DISCOUNTS', '3', 'Maximum number of quantity discounts (price breaks). Is the number of discount columns in downloaded file (default: 3).', " . $group_id . ", '11', NULL, now(), NULL, NULL),\n\t\t\t('Split On Number of Records',         'EASYPOPULATE_4_CONFIG_SPLIT_RECORDS', '2000', 'Number of records to split csv files. Used to break large import files into smaller files. Useful on servers with limited resourses. (default: 2000).', " . $group_id . ", '12', NULL, now(), NULL, NULL),\n\t\t\t('Script Execution Time',              'EASYPOPULATE_4_CONFIG_EXECUTION_TIME', '60', 'Number of seconds for script to run before timeout. May not work on some servers. (default: 60).', " . $group_id . ", '13', NULL, now(), NULL, NULL),\n\t\t\t('Convert Curly Quotes, etc.',         'EASYPOPULATE_4_CONFIG_CURLY_QUOTES', '0', 'Convert Curly Quotes, Em-Dash, En-Dash and Ellipsis characters in Products Description (default 0).<br><br>0=No Change<br>1=Replace with Basic Characters<br>3=Replace with HMTL equivalants', " . $group_id . ", '14', NULL, now(), NULL, 'zen_cfg_select_option(array(\"0\", \"1\", \"2\"),'),\n\t\t\t('Convert Character 0x92',             'EASYPOPULATE_4_CONFIG_CHAR_92', '1', 'Convert Character 0x92 characters in Product Names &amp; Descriptions (default 1).<br><br>0=No Change<br>1=Replace with Standard Single Quote<br>2=Replace with HMTL equivalant', " . $group_id . ", '15', NULL, now(), NULL, 'zen_cfg_select_option(array(\"0\", \"1\", \"2\"),'),\n\t\t\t('Enable Products Meta Data',          'EASYPOPULATE_4_CONFIG_META_DATA', '1', 'Enable Products Meta Data Columns (default 1).<br><br>0=Disable<br>1=Enable', " . $group_id . ", '16', NULL, now(), NULL, 'zen_cfg_select_option(array(\"0\", \"1\"),'), \n\t\t\t('Enable Products Music Data',         'EASYPOPULATE_4_CONFIG_MUSIC_DATA', '0', 'Enable Products Music Data Columns (default 0).<br><br>0=Disable<br>1=Enable', " . $group_id . ", '17', NULL, now(), NULL, 'zen_cfg_select_option(array(\"0\", \"1\"),'),\n\t\t\t('User Defined Products Fields',       'EASYPOPULATE_4_CONFIG_CUSTOM_FIELDS', '', 'User Defined Products Table Fields (comma delimited, no spaces)', " . $group_id . ", '18', NULL, now(), NULL, NULL),\n\t\t\t('Export URI with Prod and or Cat',       'EASYPOPULATE_4_CONFIG_EXPORT_URI', '0', 'Export the current products or categories URI when exporting data? (Yes - 1 or no - 0)', " . $group_id . ", '19', NULL, now(), NULL, 'zen_cfg_select_option(array(\"0\", \"1\"),')\n\t\t");
    } else {
        // unsupported version
        // i should do something here!
    }
}
Example #9
0
<?php

$db->Execute("REPLACE INTO " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES\n('Fast and Easy Checkout', 'FEC_STATUS', 'false', 'Activate Fast and Easy Checkout? (note: Easy Sign-up and Login must be disabled separately)', " . $configuration_group_id . ", 10, NOW(), NOW(), NULL, 'zen_cfg_select_option(array(\\'true\\', \\'false\\'),'),\n('One Page Checkout', 'FEC_ONE_PAGE', 'true', 'Activate One Page Checkout?<br />Default = false (includes checkout_confirmation page)', " . $configuration_group_id . ", 11, NOW(), NOW(), NULL, 'zen_cfg_select_option(array(\\'true\\', \\'false\\'),'),\n('Checkout Confirmation Alternate Text', 'FEC_CHECKOUT_CONFIRMATION_TEXT', 'Your order is being processed, please wait...', 'Alternate text to be displayed on Checkout Confirmation page:', " . $configuration_group_id . ", 12, NOW(), NOW(), NULL, NULL),\n('Display Checkout in Split Column', 'FEC_SPLIT_CHECKOUT', 'true', 'Display the checkout page in a split column format?', " . $configuration_group_id . ", 13, NOW(), NOW(), NULL, 'zen_cfg_select_option(array(\\'true\\', \\'false\\'),'),\n('Activate Drop Down List', 'FEC_DROP_DOWN', 'false', 'Activate drop down list to appear on checkout page?', " . $configuration_group_id . ", 14, NOW(), NOW(), NULL, 'zen_cfg_select_option(array(\\'true\\', \\'false\\'),'),\n('Gift Wrapping Module Switch', 'FEC_GIFT_WRAPPING_SWITCH', 'false', 'If the gift wrapping module is installed, set to true to activate', " . $configuration_group_id . ", 15, NOW(), NOW(), NULL, 'zen_cfg_select_option(array(\\'true\\', \\'false\\'),'),\n('Activate Gift Message Field', 'FEC_GIFT_MESSAGE', 'false', 'Activate gift message field to appear on checkout page?', " . $configuration_group_id . ", 16, NOW(), NOW(), NULL, 'zen_cfg_select_option(array(\\'true\\', \\'false\\'),'),\n('Drop Down List Options', 'FEC_DROP_DOWN_LIST', 'Option 1,Option 2,Option 3,Option 4,Option 5', 'Enter each option separated by commas:', " . $configuration_group_id . ", 17, NOW(), NOW(), NULL, NULL),\n('Activate Checkbox Field', 'FEC_CHECKBOX', 'false', 'Activate checkbox field to appear on checkout page?', " . $configuration_group_id . ", 18, NOW(), NOW(), NULL, 'zen_cfg_select_option(array(\\'true\\', \\'false\\'),'),\n\n('Easy Sign-Up and Login', 'FEC_EASY_SIGNUP_STATUS', 'false', 'Activate Easy Sign-Up and Login?', " . $configuration_group_id . ", 20, NOW(), NOW(), NULL, 'zen_cfg_select_option(array(\\'true\\', \\'false\\'),'),\n('Display Order Total', 'FEC_ORDER_TOTAL', 'false', 'Display the Order Total sidebox on login?', " . $configuration_group_id . ", 21, NOW(), NOW(), NULL, 'zen_cfg_select_option(array(\\'true\\', \\'false\\'),'),\n('Display Confidence Box', 'FEC_CONFIDENCE', 'false', 'Display the \"Shop With Confidence\" sidebox on login?', " . $configuration_group_id . ", 22, NOW(), NOW(), NULL, 'zen_cfg_select_option(array(\\'true\\', \\'false\\'),'),\n('COWOA Position', 'FEC_NOACCOUNT_POSITION', 'side', 'Display the COWOA fieldset above the registration form (top) or beneath the login (side)?', " . $configuration_group_id . ", 23, NOW(), NOW(), NULL, 'zen_cfg_select_option(array(\\'top\\', \\'side\\'),'),\n('Confirm Email', 'FEC_CONFIRM_EMAIL', 'false', 'Require user to enter email twice for confirmation?', " . $configuration_group_id . ", 24, NOW(), NOW(), NULL, 'zen_cfg_select_option(array(\\'true\\', \\'false\\'),'),\n('Shipping Address', 'FEC_SHIPPING_ADDRESS', 'true', 'Display the shipping address form on the login and COWOA pages?', " . $configuration_group_id . ", 25, NOW(), NOW(), NULL, 'zen_cfg_select_option(array(\\'true\\', \\'false\\'),'),\n('Copy Billing', 'FEC_COPYBILLING', 'true', 'If the shipping address form is enabled, should the copy billing address checkbox be checked by default?', " . $configuration_group_id . ", 26, NOW(), NOW(), NULL, 'zen_cfg_select_option(array(\\'true\\', \\'false\\'),'),\n('Master Password', 'FEC_MASTER_PASSWORD', 'false', 'Allow login to customer account using master password? (Must be using ZenCart v1.5.0 or higher)', " . $configuration_group_id . ", 27, NOW(), NOW(), NULL, 'zen_cfg_select_option(array(\\'true\\', \\'false\\'),'),\n\n('Checkout Without Account', 'FEC_NOACCOUNT_SWITCH', 'true', 'Activate Checkout Without an Account?', " . $configuration_group_id . ", 30, NOW(), NOW(), NULL, 'zen_cfg_select_option(array(\\'true\\', \\'false\\'),'),\n('Checkout Without Account Only', 'FEC_NOACCOUNT_ONLY_SWITCH', 'false', 'Disable regular login/registration and force Checkout Without an Account?', " . $configuration_group_id . ", 31, NOW(), NOW(), NULL, 'zen_cfg_select_option(array(\\'true\\', \\'false\\'),'),\n('Combine COWOA Accounts', 'FEC_NOACCOUNT_COMBINE', 'false', 'Combine COWOA accounts so that COWOA customers can access their orders and other account features (note this will only work on future registrations)?', " . $configuration_group_id . ", 31, NOW(), NOW(), NULL, 'zen_cfg_select_option(array(\\'true\\', \\'false\\'),'),\n('Hide Email Options For No Account', 'FEC_NOACCOUNT_HIDEEMAIL', 'true', 'Hide \"HTML/TEXT-Only\" for checkout without account?', " . $configuration_group_id . ", 32, NOW(), NOW(), NULL, 'zen_cfg_select_option(array(\\'true\\', \\'false\\'),'),\n('Automatic LogOff for No Account', 'FEC_NOACCOUNT_LOGOFF', 'true', 'Automatically logoff customers without accounts?', " . $configuration_group_id . ", 33, NOW(), NOW(), NULL, 'zen_cfg_select_option(array(\\'true\\', \\'false\\'),'),\n('Free/Virtual Checkout', 'FEC_FREE_VIRTUAL_CHECKOUT', 'false', 'Only require name and email address for products that are both free and virtual?', " . $configuration_group_id . ", 34, NOW(), NOW(), NULL, 'zen_cfg_select_option(array(\\'true\\', \\'false\\'),');");
global $sniffer;
if (!$sniffer->field_exists(TABLE_CUSTOMERS, 'COWOA_account')) {
    $db->Execute("ALTER TABLE " . TABLE_CUSTOMERS . " ADD COWOA_account tinyint(1) NOT NULL default 0;");
}
if (!$sniffer->field_exists(TABLE_ORDERS, 'COWOA_order')) {
    $db->Execute("ALTER TABLE " . TABLE_ORDERS . " ADD COWOA_order tinyint(1) NOT NULL default 0;");
}
$db->Execute("INSERT IGNORE INTO " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Telephone Number', 'ACCOUNT_TELEPHONE', 'true', 'Display telephone number field during account creation and with account information', '5', '8', 'zen_cfg_select_option(array(\\'true\\', \\'false\\'), ', now());");
$db->Execute("INSERT IGNORE INTO " . TABLE_QUERY_BUILDER . " (query_id, query_category, query_name, query_description, query_string) VALUES ('', 'email,newsletters', 'Permanent Account Holders Only', 'Send email only to permanent account holders ', 'select customers_email_address, customers_firstname, customers_lastname from TABLE_CUSTOMERS where COWOA_account != 1 order by customers_lastname, customers_firstname, customers_email_address');");
$zc150 = PROJECT_VERSION_MAJOR > 1 || PROJECT_VERSION_MAJOR == 1 && substr(PROJECT_VERSION_MINOR, 0, 3) >= 5;
if ($zc150) {
    // continue Zen Cart 1.5.0
    // delete configuration menu
    $db->Execute("DELETE FROM " . TABLE_ADMIN_PAGES . " WHERE page_key = 'configFastandEasyCheckout' LIMIT 1;");
    // add configuration menu
    if (!zen_page_key_exists('configFastandEasyCheckout')) {
        if ((int) $configuration_group_id > 0) {
            zen_register_admin_page('configFastandEasyCheckout', 'BOX_CONFIGURATION_FEC', 'FILENAME_CONFIGURATION', 'gID=' . $configuration_group_id, 'configuration', 'Y', $configuration_group_id);
            $messageStack->add('Enabled Fast and Easy Checkout Configuration menu.', 'success');
        }
    }
}
Example #10
0
// Admin Menu for Super Orders Configuration Menu
zen_deregister_admin_pages('configSuperOrders');
zen_register_admin_page('configSuperOrders', 'BOX_CONFIGURATION_SUPER_ORDERS', 'FILENAME_CONFIGURATION', 'gID=' . $so_configuration_id, 'configuration', 'Y', $admin_page_sort);
//-- Admin Menu for Batch Status Update
zen_deregister_admin_pages('customersBatchStatusUpdate');
zen_register_admin_page('customersBatchStatusUpdate', 'BOX_CUSTOMERS_SUPER_BATCH_STATUS', 'FILENAME_SUPER_BATCH_STATUS', '', 'customers', 'Y', $admin_page_sort);
//-- Admin Menu for Batch Status Print
zen_deregister_admin_pages('customersBatchFormPrint');
zen_register_admin_page('customersBatchFormPrint', 'BOX_CUSTOMERS_SUPER_BATCH_FORMS', 'FILENAME_SUPER_BATCH_FORMS', '', 'customers', 'Y', $admin_page_sort);
//-- Admin Menu for Batch Print Pages
zen_deregister_admin_pages('customersBatchPages');
zen_register_admin_page('customersBatchPages', 'BOX_CUSTOMERS_SUPER_BATCH_PAGES', 'FILENAME_SUPER_BATCH_PAGES', '', 'customers', 'N', $admin_page_sort);
//-- Admin Menu for Super Data Sheet
zen_deregister_admin_pages('customersSuperDataSheet');
zen_register_admin_page('customersSuperDataSheet', 'BOX_CUSTOMERS_SUPER_DATA_SHEET', 'FILENAME_SUPER_DATA_SHEET', '', 'customers', 'N', $admin_page_sort);
//-- Admin Menu for Super Shipping Label
zen_deregister_admin_pages('customersSuperShippingLabel');
zen_register_admin_page('customersSuperShippingLabel', 'BOX_CUSTOMERS_SUPER_SHIPPING_LABEL', 'FILENAME_SUPER_SHIPPING_LABEL', '', 'customers', 'N', $admin_page_sort);
//-- Admin Menu for Super Orders Edit Pop-Up
zen_deregister_admin_pages('customersSuperPopUp');
zen_register_admin_page('customersSuperPopUp', 'BOX_CUSTOMERS_SUPER_EDIT_POPUP', 'FILENAME_SUPER_EDIT', '', 'customers', 'N', $admin_page_sort);
//-- Admin Menu for Manage Payment Types
zen_deregister_admin_pages('localizationManagePaymentTypes');
zen_register_admin_page('localizationManagePaymentTypes', 'BOX_LOCALIZATION_MANAGE_PAYMENT_TYPES', 'FILENAME_SUPER_PAYMENT_TYPES', '', 'localization', 'Y', $admin_page_sort);
//-- Admin Menu for Orders Awaiting Paymments Report
zen_deregister_admin_pages('reportsOrdersAwaitingPayment');
zen_register_admin_page('reportsOrdersAwaitingPayment', 'BOX_REPORTS_SUPER_REPORT_AWAIT_PAY', 'FILENAME_SUPER_REPORT_AWAIT_PAY', '', 'reports', 'Y', $admin_page_sort);
//-- Admin Menu for Cash Report
zen_deregister_admin_pages('reportsCashReport');
zen_register_admin_page('reportsCashReport', 'BOX_REPORTS_SUPER_REPORT_CASH', 'FILENAME_SUPER_REPORT_CASH', '', 'reports', 'Y', $admin_page_sort);
    if (empty($menu_key)) {
        $error = TRUE;
        $messageStack->add(ERROR_MENU_NOT_CHOSEN, 'error');
    }
    if (isset($_POST['display_on_menu'])) {
        $checked = 'checked="true"';
        $display_on_menu = 'Y';
    } else {
        $display_on_menu = 'N';
    }
    if (isset($_POST['sort_order'])) {
        $sort_order = (int) $_POST['sort_order'];
    }
    if (!$error) {
        // register page
        zen_register_admin_page($page_key, $language_key, $main_page, $page_params, $menu_key, $display_on_menu, $sort_order);
        // prepare success message
        $messageStack->add(SUCCESS_ADMIN_PAGE_REGISTERED, 'success');
        // reset form values
        $page_key = $language_key = $main_page = $page_params = $menu_key = $checked = '';
        $sort_order = 0;
    }
}
// prepare options for menu pulldown
$menu_titles = zen_get_menu_titles();
$menu_options = array();
$menu_options[0] = array('id' => NULL, 'text' => TEXT_SELECT_MENU);
foreach ($menu_titles as $id => $title) {
    $menu_options[] = array('id' => $id, 'text' => $title);
}
?>
    $admin_page = 'toolsMetaTagsController';
    // delete configuration menu
    $db->Execute("DELETE FROM " . TABLE_ADMIN_PAGES . " WHERE page_key = '" . $admin_page . "' LIMIT 1;");
    // add configuration menu
    if (!zen_page_key_exists($admin_page)) {
        if ((int) $configuration_group_id > 0) {
            zen_register_admin_page($admin_page, 'BOX_TOOLS_META_TAGS_CONTROLLER', 'FILENAME_META_TAG_CONTROLLER', '', 'tools', 'Y', $configuration_group_id);
            $messageStack->add('Enabled Meta Tags Controller', 'success');
        }
    }
}
// adding meta tags controller
$zc150 = PROJECT_VERSION_MAJOR > 1 || PROJECT_VERSION_MAJOR == 1 && substr(PROJECT_VERSION_MINOR, 0, 3) >= 5;
if ($zc150) {
    // continue Zen Cart 1.5.0
    $admin_page = 'toolsMetaTagsControllerAjax';
    // delete configuration menu
    $db->Execute("DELETE FROM " . TABLE_ADMIN_PAGES . " WHERE page_key = '" . $admin_page . "' LIMIT 1;");
    // add configuration menu
    if (!zen_page_key_exists($admin_page)) {
        if ((int) $configuration_group_id > 0) {
            zen_register_admin_page($admin_page, 'BOX_TOOLS_META_TAGS_CONTROLLER_AJAX', 'FILENAME_AJAX_META_TAGS_CONTROLLER', '', 'tools', 'N', $configuration_group_id);
            $messageStack->add('Enabled Meta Tags Controller Ajax', 'success');
        }
    }
}
if (!$sniffer->field_exists(TABLE_EZPAGES, 'pages_meta_title')) {
    $db->Execute("ALTER TABLE " . TABLE_EZPAGES . " ADD pages_meta_title VARCHAR(255) NOT NULL DEFAULT '', ADD pages_meta_keywords text, ADD pages_meta_description text");
}
$db->Execute("CREATE TABLE IF NOT EXISTS " . TABLE_META_TAGS . " (\n\t`meta_tags_id` int(11) NOT NULL AUTO_INCREMENT,\n\t`page` varchar(255) NOT NULL DEFAULT '',\n  `language_id` int(11) NOT NULL DEFAULT '1',\n  `metatags_title` varchar(255) NOT NULL DEFAULT '',\n  `metatags_keywords` text,\n  `metatags_description` text,\n  `meta_tag_group` varchar(256),\n  PRIMARY KEY (`meta_tags_id`,`language_id`));");
$db->Execute("INSERT INTO " . TABLE_META_TAGS . " (`page`, `language_id`, `metatags_title`, `metatags_keywords`, `metatags_description`, `meta_tag_group`) VALUES\n('site_wide', 1, 'Zen Cart!', 'The Art of E-commerce', 'ecommerce, open source, shop, online shopping, store', 'site_wide'),\n('home', 1, '', 'Home Meta Description', 'Meta Keywords', 'general'),\n('contact_us', 1, '', NULL, NULL, 'general'),\n('privacy', 1, '', NULL, NULL, 'general'),\n('conditions', 1, '', NULL, NULL, 'general');");
<?php

// $Id: reg_easypopulate_4.php, v4.0.21 06-01-2012 chadderuski $
// NOTE: This is for registering the mod in zencart 1.5+ only
if (!defined('IS_ADMIN_FLAG')) {
    die('Illegal Access');
}
if (function_exists('zen_register_admin_page')) {
    if (!zen_page_key_exists('easypopulate_4')) {
        // Add easypopulate_4 to Tools menu
        zen_register_admin_page('easypopulate_4', 'BOX_TOOLS_EASYPOPULATE_4', 'FILENAME_EASYPOPULATE_4', '', 'tools', 'Y', 97);
    }
}
Example #14
0
    $db->Execute($sql);
    $sql = "INSERT INTO " . DB_PREFIX . "configuration VALUES (NULL, 'Show currency symbols','DPU_SHOW_CURRENCY_SYMBOLS', 'true', '', '" . $dpu_configuration_id . "', 70, NULL, now(), NULL, 'zen_cfg_select_option(array(''true'', ''false''),')";
    $db->Execute($sql);
    $sql = "INSERT INTO " . DB_PREFIX . "configuration VALUES (NULL, 'Show product quantity','DPU_SHOW_QUANTITY', 'false', '', '" . $dpu_configuration_id . "', 80, NULL, now(), NULL, 'zen_cfg_select_option(array(''true'', ''false''),')";
    $db->Execute($sql);
    $sql = "INSERT INTO " . DB_PREFIX . "configuration VALUES (NULL, 'Where to display the second price','DPU_SECOND_PRICE', 'cartAdd', '', '" . $dpu_configuration_id . "', 90, NULL, now(), NULL, NULL)";
    $db->Execute($sql);
} else {
    $messageStack->add('Database Error: Unable to access configuration_group_id in table' . TABLE_CONFIGURATION_GROUP, 'error');
    $failed = true;
}
// Add support for admin profiles to edit configuration and orders
if (function_exists('zen_register_admin_page')) {
    if (!zen_page_key_exists('configDynamicPriceUpdater')) {
        // Get the sort order
        $page_sort_query = "SELECT MAX(sort_order) as max_sort FROM `" . TABLE_ADMIN_PAGES . "` WHERE menu_key='configuration'";
        $page_sort = $db->Execute($page_sort_query);
        $page_sort = $page_sort->fields['max_sort'] + 1;
        // Register the administrative pages
        zen_register_admin_page('configDynamicPriceUpdater', 'BOX_CONFIGURATION_DYNAMIC_PRICE_UPDATER', 'FILENAME_CONFIGURATION', 'gID=' . $dpu_configuration_id, 'configuration', 'Y', $page_sort);
    }
}
if (file_exists(DIR_FS_ADMIN . DIR_WS_INCLUDES . 'auto_loaders/config.dpu.php')) {
    if (!unlink(DIR_FS_ADMIN . DIR_WS_INCLUDES . 'auto_loaders/config.dpu.php')) {
        $messageStack->add('The auto-loader file ' . DIR_FS_ADMIN . 'includes/auto_loaders/config.dpu.php has not been deleted. For this module to work you must delete the ' . DIR_FS_ADMIN . 'includes/auto_loaders/config.dpu.php file manually.  Before you post on the Zen Cart forum to ask, YES you are REALLY supposed to follow these instructions and delete the ' . DIR_FS_ADMIN . 'includes/auto_loaders/config.dpu.php file.', 'error');
        $failed = true;
    }
}
if (!$failed) {
    $messageStack->add('Dynamic Price Updater v3.0 install completed!', 'success');
}
Example #15
0
function ultimate_seo_install($version)
{
    global $db, $messageStack;
    $failed = false;
    // Check to make sure all new files have been uploaded.
    // These are not intended to be perfect checks, just a quick 'hey you'.
    $files = array(DIR_FS_ADMIN . DIR_WS_INCLUDES . 'extra_datafiles/seo.php', DIR_FS_ADMIN . DIR_WS_FUNCTIONS . 'extra_functions/seo.php', DIR_FS_ADMIN . DIR_WS_LANGUAGES . 'english/extra_definitions/seo.php', DIR_FS_CATALOG . DIR_WS_INCLUDES . 'extra_datafiles/seo.php', DIR_FS_CATALOG . DIR_WS_INCLUDES . 'auto_loaders/config.seo.php', DIR_FS_CATALOG . DIR_WS_INCLUDES . 'init_includes/init_seo_config.php', DIR_FS_CATALOG . DIR_WS_CLASSES . 'seo.url.php');
    foreach ($files as $file) {
        if (!file_exists($file)) {
            $messageStack->add(sprintf(SEO_INSTALL_ERROR_FILE_NOT_FOUND, $file), 'error');
            $failed = true;
        }
    }
    // Attempt a database upgrade before doing anything else.
    ultimate_seo_upgrade($version);
    // Now check the required tables if not already present
    $check = $db->Execute('SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES ' . 'WHERE TABLE_SCHEMA = \'' . DB_DATABASE . '\' ' . 'AND TABLE_NAME = \'' . TABLE_SEO_CACHE . '\'');
    if ($check->EOF) {
        $db->Execute('CREATE TABLE `' . TABLE_SEO_CACHE . '` ( ' . '`cache_id` VARCHAR(32) NOT NULL default \'\', ' . '`cache_language_id` TINYINT(1) NOT NULL default \'0\', ' . '`cache_name` VARCHAR(255) NOT NULL default \'\', ' . '`cache_data` MEDIUMTEXT NOT NULL, ' . '`cache_global` TINYINT(1) NOT NULL default \'1\', ' . '`cache_gzip` TINYINT(1) NOT NULL default \'1\', ' . '`cache_method` VARCHAR(20) NOT NULL default \'RETURN\', ' . '`cache_date` DATETIME NOT NULL default \'0000-00-00 00:00:00\', ' . '`cache_expires` DATETIME NOT NULL default \'0000-00-00 00:00:00\', ' . 'PRIMARY KEY (`cache_id`,`cache_language_id`), ' . 'KEY `cache_id` (`cache_id`), ' . 'KEY `cache_language_id` (`cache_language_id`), ' . 'KEY `cache_global` (`cache_global`) ' . ') ENGINE=MyISAM');
    }
    // Now check the configuration group
    $group_id = 0;
    $check = $db->Execute('SELECT `configuration_group_id` FROM `' . TABLE_CONFIGURATION_GROUP . '` ' . 'WHERE `configuration_group_title` = \'' . SEO_CONFIGURATION_GROUP_TITLE . '\'');
    if ($check->EOF) {
        $max_sort = $db->Execute('SELECT MAX(sort_order) AS `max_sort` FROM `' . TABLE_CONFIGURATION_GROUP . '`');
        if (!$max_sort->EOF) {
            $max_sort = $max_sort->fields['max_sort'] + 1;
            // Create configuration group
            $db->Execute('INSERT INTO `' . TABLE_CONFIGURATION_GROUP . '` ' . 'VALUES (\'\', \'' . SEO_CONFIGURATION_GROUP_TITLE . '\', ' . '\'' . SEO_CONFIGURATION_GROUP_DESCRIPTION . '\', \'' . $max_sort . '\', \'1\')');
            $group_id = (int) $db->insert_ID();
        } else {
            $messageStack->add(sprintf(SEO_INSTALL_ERROR_SORT_ORDER, TABLE_CONFIGURATION_GROUP), 'error');
            $failed = true;
        }
    } else {
        $group_id = (int) $check->fields['configuration_group_id'];
    }
    // Install (or update) any needed configuration items
    if ($group_id != 0) {
        $sql_data_array = array('configuration_group_id' => $group_id, 'sort_order' => 0, 'last_modified' => 'null', 'date_added' => 'now()');
        foreach (ultimate_seo_default_settings($version) as $key => $data) {
            $check = $db->Execute('SELECT `configuration_id` FROM `' . TABLE_CONFIGURATION . '` ' . 'WHERE `configuration_key`=\'' . $key . '\'');
            if ($check->EOF) {
                $data['configuration_key'] = $key;
                $data['configuration_title'] = constant($key . '_TITLE');
                $data['configuration_description'] = constant($key . '_DESCRIPTION');
                zen_db_perform(TABLE_CONFIGURATION, array_merge($sql_data_array, $data));
            } else {
                unset($data['configuration_value']);
                ultimate_seo_upgrade_option($key, array_merge($data, array('sort_order' => $sql_data_array['sort_order'])));
            }
            $sql_data_array['sort_order']++;
        }
        // Update the version stored in the database for this plugin
        $sql_data_array = array('last_modified' => 'now()', 'configuration_value' => $version, 'set_function' => 'zen_cfg_select_option(array(\\\'' . $version . '\\\'),');
        zen_db_perform(TABLE_CONFIGURATION, $sql_data_array, 'update', '`configuration_key`=\'USU_VERSION\'');
        unset($sql_data_array);
        // Reset the cache to deal with any stale entries
        usu_reset_cache_data('true');
    }
    unset($defaults);
    // Add support for admin profiles
    if (function_exists('zen_register_admin_page')) {
        if (!zen_page_key_exists('configUltimateSEO')) {
            $max_sort = $db->Execute('SELECT MAX(sort_order) AS `max_sort` FROM `' . TABLE_ADMIN_PAGES . '` WHERE `menu_key`=\'configuration\'');
            if (!$max_sort->EOF) {
                $max_sort = $max_sort->fields['max_sort'] + 1;
                // Register the administrative page
                zen_register_admin_page('configUltimateSEO', 'SEO_CONFIGURATION_GROUP_TITLE', 'FILENAME_CONFIGURATION', 'gID=' . $group_id, 'configuration', 'Y', $max_sort);
            } else {
                $messageStack->add(sprintf(SEO_INSTALL_ERROR_SORT_ORDER, TABLE_ADMIN_PAGES), 'error');
                $failed = true;
            }
        }
    }
    return $failed;
}
                }
                break;
            default:
                $st_version = '1.2';
                // break all the loops
                break 2;
        }
    }
} else {
    // begin update to version 1.1
    // do a new install
    if (file_exists(DIR_WS_INCLUDES . 'installers/supertracker/new_install.php')) {
        include_once DIR_WS_INCLUDES . 'installers/supertracker/new_install.php';
        $messageStack->add('Added Supertracker Configuration', 'success');
    } else {
        $messageStack->add('New installation file missing, please make sure you have uploaded all files in the package.', 'error');
    }
}
if ($zc150) {
    // continue Zen Cart 1.5.0
    // add configuration menu
    if (!zen_page_key_exists('configSuperTracker')) {
        $configuration = $db->Execute("SELECT configuration_group_id FROM " . TABLE_CONFIGURATION . " WHERE configuration_key = 'SUPERTRACKER_MODULE_VERSION' LIMIT 1;");
        $configuration_group_id = $configuration->fields['configuration_group_id'];
        if ((int) $configuration_group_id > 0) {
            zen_register_admin_page('configSuperTracker', 'BOX_CONFIGURATION_SUPERTRACKER', 'FILENAME_CONFIGURATION', 'gID=' . $configuration_group_id, 'configuration', 'Y', $configuration_group_id);
            zen_register_admin_page('reportsSuperTracker', 'BOX_REPORTS_SUPERTRACKER', 'FILENAME_SUPERTRACKER', '', 'reports', 'Y', $configuration_group_id);
            $messageStack->add('Enabled Supertracker Configuration menu.', 'success');
        }
    }
}
Example #17
0
<?php

/*
 $Id: reg_backup_mysql.php, v 1.4 2011/11/24  $																    
                                                     
  By PRO-Webs.net 12.9.2011
                                                      
  Powered by Zen-Cart (www.zen-cart.com)              
  Portions Copyright (c) 2006 The Zen Cart Team       
                                                      
  Released under the GNU General Public License       
  available at www.zen-cart.com/license/2_0.txt       
  or see "license.txt" in the downloaded zip          

  DESCRIPTION: Add Backup SQL to Tools Mneu
*/
if (!defined('IS_ADMIN_FLAG')) {
    die('Illegal Access');
}
if (function_exists('zen_register_admin_page')) {
    if (!zen_page_key_exists('backup_mysql')) {
        // Add backup_mysql to Tools menu
        zen_register_admin_page('backup_mysql', 'BOX_TOOLS_BACKUP_MYSQL', 'FILENAME_BACKUP_MYSQL', '', 'tools', 'Y', 17);
    }
}
 $result = $db->Execute($sql);
 $im_configuration_id = $result->fields['configuration_group_id'];
 if ($im_configuration_id == '') {
     $im_configuration_id = 4;
 }
 foreach ($menu_items_image as $menu_item) {
     xxxx_create_menu_item($menu_item[0], $menu_item[1], $menu_item[2], $im_configuration_id, $menu_item[3]);
 }
 // ======================================================
 //
 // register the IH page in admin pages for Zen 1.5
 //
 // ======================================================
 if (defined('TABLE_ADMIN_PAGES')) {
     zen_deregister_admin_pages('configImageHandler4');
     zen_register_admin_page('configImageHandler4', 'BOX_TOOLS_IMAGE_HANDLER', 'FILENAME_IMAGE_HANDLER', '', 'tools', 'Y', 14);
 }
 // ======================================================
 //
 // version
 //
 // ======================================================
 $over_item = array('IH_VERSION', $version, 10000, false);
 xxxx_overwrite_create_menu_item($over_item[0], $over_item[1], $over_item[2], 0, $over_item[3]);
 // ======================================================
 //
 // core files overwrite
 //
 // ======================================================
 foreach ($core_files as $cf) {
     if (xxxx_install_replace($cf[0], $cf[1])) {
Example #19
0
<?php

/*
 *
 * @package zencart_auto_installer
 * @copyright Copyright 2003-2015 ZenCart.Codes a Pro-Webs Company
 * @copyright Copyright 2003-2015 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 *
 */
// use $configuration_group_id where needed
// For Admin Pages
$zc150 = PROJECT_VERSION_MAJOR > 1 || PROJECT_VERSION_MAJOR == 1 && substr(PROJECT_VERSION_MINOR, 0, 3) >= 5;
if ($zc150) {
    // continue Zen Cart 1.5.0
    $admin_page = 'configAvgProductReviews';
    // delete configuration menu
    $db->Execute("DELETE FROM " . TABLE_ADMIN_PAGES . " WHERE page_key = '" . $admin_page . "' LIMIT 1;");
    // add configuration menu
    if (!zen_page_key_exists($admin_page)) {
        if ((int) $configuration_group_id > 0) {
            zen_register_admin_page($admin_page, 'BOX_CONFIGURATION_AVERAGE_PRODUCT_REVIEWS', 'FILENAME_CONFIGURATION', 'gID=' . $configuration_group_id, 'configuration', 'Y', $configuration_group_id);
            $messageStack->add('Enabled Average Product Reviews Configuration Menu.', 'success');
        }
    }
}
$db->Execute("INSERT INTO " . TABLE_CONFIGURATION . " (configuration_group_id, configuration_key, configuration_title, configuration_value, configuration_description, sort_order, set_function) VALUES (" . (int) $configuration_group_id . ", 'AVG_PRODUCT_REVIEWS_STARS_TYPE', 'Stars Type', 'Font Awesome', 'For the review stars you have the choice of either using Images, Font Awesome, or UTF-8.<br/> if using Font Awesome you will need make sure you are loading it. <br/>Try using this link to get the CDN <a href=\"//www.bootstrapcdn.com/fontawesome/\">http://www.bootstrapcdn.com/fontawesome/</a>', 1, 'zen_cfg_select_option(array(\\'Images\\', \\'Font Awesome\\',\\'UTF-8\\'),');");
<?php

if (!defined('IS_ADMIN_FLAG')) {
    die('Illegal Access');
}
if (function_exists('zen_register_admin_page')) {
    if (!zen_page_key_exists('Quick Updates')) {
        zen_register_admin_page('Quick Updates', 'BOX_CATALOG_QUICK_UPDATES', 'FILENAME_QUICK_UPDATES', '', 'catalog', 'Y', 103);
    }
}
Example #21
0
    $db->Execute("INSERT INTO " . TABLE_CONFIGURATION . " ( configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function, set_function ) VALUES ( 'Split File: Record Count', 'DBIO_SPLIT_RECORD_COUNT', '2000', 'Sometimes, splitting a .csv file into multiple, smaller files can help if your server is timing out on an <em>import</em> operation or if an exported .csv is too large to download in a single chunk.  Enter the number of records (default: 2000) at which to split these files using the <em>Database I/O Manager</em>.', {$cgi}, 25, now(), NULL, NULL)");
    $db->Execute("INSERT INTO " . TABLE_CONFIGURATION . " ( configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function, set_function ) VALUES ( 'Default File Sort Order', 'DBIO_FILE_SORT_DEFAULT', '3d', 'Choose the default sort-order that the <em>Database I/O Manager</em> uses when displaying the I/O files it has discovered, one of:<br /><br /><b>1a</b>: File Name, ascending<br /><b>1d</b>: File Name, descending<br /><b>2a</b>: File Size, ascending<br /><b>2d</b>: File Size, descending<br /><b>3a</b>: File Date, ascending<br /><b>3d</b>: File Date, descending (default)', {$cgi}, 26, now(), NULL, 'zen_cfg_select_option(array(\\'1a\\', \\'1d\\', \\'2a\\', \\'2d\\', \\'3a\\', \\'3d\\'),')");
    $db->Execute("INSERT INTO " . TABLE_CONFIGURATION . " ( configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function, set_function ) VALUES ( 'Enable Debug?', 'DBIO_DEBUG', 'false', 'Identify whether (true) or not (false, the default) the DbIo debug is to be enabled.  When enabled, <b>all</b> I/O status is written to a <em>dbio-*.log</em> file in your store\\'s /YOUR_ADMIN/dbio/logs folder.', {$cgi}, 600, now(), NULL, 'zen_cfg_select_option(array(\\'true\\', \\'false\\'),')");
    $db->Execute("INSERT INTO " . TABLE_CONFIGURATION . " ( configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function, set_function ) VALUES ( 'Debug Date Format', 'DBIO_DEBUG_DATE_FORMAT', 'Y-m-d H:i:s', 'Enter the formatting string used to timestamp all DbIo log entries.', {$cgi}, 601, now(), NULL, NULL)");
    define('DBIO_MODULE_VERSION', $version_release_date);
}
// -----
// Update the configuration table to reflect the current version, if it's not already set.
//
if (DBIO_MODULE_VERSION != $version_release_date) {
    $db->Execute("UPDATE " . TABLE_CONFIGURATION . " SET configuration_value = '" . $version_release_date . "' WHERE configuration_key = 'DBIO_MODULE_VERSION' LIMIT 1");
}
// ----
// Create the database tables for the I/O processing.
//
$sql = "CREATE TABLE IF NOT EXISTS " . TABLE_DBIO_STATS . " (\n    dbio_stats_id int(11) NOT NULL auto_increment,\n    report_name varchar(255) NOT NULL default '',\n    action varchar(128) NOT NULL default '',\n    record_count int(11) NOT NULL default '0',\n    errors int(11) NOT NULL default '0',\n    warnings int(11) NOT NULL default '0',  \n    inserts int(11) NOT NULL default '0',  \n    updates int(11) NOT NULL default '0',\n    parse_time float NOT NULL default '0',\n    memory_usage int(11) NOT NULL default '0',\n    memory_peak_usage int(11) NOT NULL default '0',\n    date_added datetime NOT NULL default '0001-01-01 00:00:00',\n    PRIMARY KEY  (dbio_stats_id)\n) ENGINE=MyISAM";
$db->Execute($sql);
if (!$sniffer->field_exists(TABLE_DBIO_STATS, 'report_name')) {
    $db->Execute("ALTER TABLE " . TABLE_DBIO_STATS . " ADD report_name varchar(255) NOT NULL default '' AFTER dbio_stats_id");
}
// -----
// Register the admin-level pages for use.
//
if (function_exists('zen_page_key_exists')) {
    if (!zen_page_key_exists('toolsDbIo')) {
        zen_register_admin_page('toolsDbIo', 'BOX_TOOLS_DBIO', 'FILENAME_DBIO_MANAGER', '', 'tools', 'Y', init_dbio_next_sort('tools'));
    }
    if (!zen_page_key_exists('configDbIo')) {
        zen_register_admin_page('configDbIo', 'BOX_CONFIGURATION_DBIO', 'FILENAME_CONFIGURATION', "gID={$cgi}", 'configuration', 'Y', init_dbio_next_sort('configuration'));
    }
}
Example #22
0
 $sql = "SELECT sort_order FROM " . TABLE_ADMIN_PAGES . " WHERE page_key ='configFeaturedListing' LIMIT 1";
 $result = $db->Execute($sql);
 $specials_sort_order = $result->fields['sort_order'];
 /*shuffle the other entries down one row*/
 $sql = "UPDATE " . TABLE_ADMIN_PAGES . " SET sort_order = sort_order + 1 WHERE menu_key = 'configuration' AND sort_order >= " . $specials_sort_order;
 $db->Execute($sql);
 /* Create New Specials configuration group */
 $sql = "INSERT INTO " . TABLE_CONFIGURATION_GROUP . " (configuration_group_id, configuration_group_title, configuration_group_description, sort_order, visible) VALUES (NULL, 'Specials Listing-SNAF', 'Set Specials Listing Options', " . $specials_sort_order . ", '1')";
 $db->Execute($sql);
 /* Find Config ID of Specials */
 $sql = "SELECT configuration_group_id FROM " . TABLE_CONFIGURATION_GROUP . " WHERE configuration_group_title='Specials Listing-SNAF' LIMIT 1";
 $result = $db->Execute($sql);
 $specials_configuration_id = $result->fields['configuration_group_id'];
 // Display Specials Page in Admin Menu
 zen_deregister_admin_pages('configSpecialsListing');
 zen_register_admin_page('configSpecialsListing', 'BOX_CONFIGURATION_SPECIALS_LISTING', 'FILENAME_CONFIGURATION', 'gID=' . $specials_configuration_id, 'configuration', 'Y', $specials_sort_order);
 // create Specials Page Entry while keeping previous values
 $c_key = 'INCLUDE_SALEMAKER_IN_SPECIALS';
 $sql = "SELECT configuration_value FROM " . TABLE_CONFIGURATION . " WHERE configuration_key = '" . $c_key . "' LIMIT 1";
 $results = $db->Execute($sql);
 $config_value = $results->fields['configuration_value'] != '' ? $results->fields['configuration_value'] : 'False';
 $sql = "DELETE FROM " . TABLE_CONFIGURATION . " WHERE configuration_key = '" . $c_key . "'";
 $db->Execute($sql);
 $sql = "INSERT INTO " . TABLE_CONFIGURATION . " (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES\n\t(NULL, 'Include Salemaker Items in Specials Listing', '" . $c_key . "', '" . $config_value . "', 'Include Salemaker Items in Specials Listing', " . $specials_configuration_id . ", 900, now(), now(), NULL, 'zen_cfg_select_option(array(''True'',''False''),')";
 $db->Execute($sql);
 // eof page entry
 // create Specials Page Entry while keeping previous values
 $c_key = 'USE_PRODUCT_LISTING_FOR_SPECIALS';
 $sql = "SELECT configuration_value FROM " . TABLE_CONFIGURATION . " WHERE configuration_key = '" . $c_key . "' LIMIT 1";
 $results = $db->Execute($sql);
 $config_value = $results->fields['configuration_value'] != '' ? $results->fields['configuration_value'] : 'False';
Example #23
0
<?php

// use $configuration_group_id where needed
// For Admin Pages
$zc150 = PROJECT_VERSION_MAJOR > 1 || PROJECT_VERSION_MAJOR == 1 && substr(PROJECT_VERSION_MINOR, 0, 3) >= 5;
if ($zc150) {
    // continue Zen Cart 1.5.0
    // delete configuration menu
    $db->Execute("DELETE FROM " . TABLE_ADMIN_PAGES . " WHERE page_key = 'config_product_tare_groups' LIMIT 1;");
    // add configuration menu
    if (!zen_page_key_exists('config_product_tare_groups')) {
        zen_register_admin_page('config_product_tare_groups', 'BOX_PRODUCT_TARE_GROUPS', 'FILENAME_CONFIGURATION', 'gID=' . $configuration_group_id, 'configuration', 'Y', $configuration_group_id);
        $messageStack->add('Enabled Product Tare Groups Configuration Menu.', 'success');
    }
}
$generic_description = "Enter the desired tare as percent and or lbs for this group.<br>Example: 10% + 1lb 10:1<br>10% + 0lbs 10:0<br>0% + 5lbs 0:5<br>0% + 0lbs 0:0<br>";
// add configuration group
$db->Execute("INSERT INTO " . TABLE_CONFIGURATION . "  (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added)  VALUES \n          ('Product Tare Group 1', 'PRODUCT_TARE_GROUP_1', '0:2', '" . $generic_description . "'," . $configuration_group_id . ", '15', NOW(), NOW()),\n          ('Product Tare Group 2', 'PRODUCT_TARE_GROUP_2', '0:4', '" . $generic_description . "'," . $configuration_group_id . ", '20', NOW(), NOW()),\n          ('Product Tare Group 3', 'PRODUCT_TARE_GROUP_3', '0:6', '" . $generic_description . "'," . $configuration_group_id . ", '30', NOW(), NOW()),\n          ('Product Tare Group 4', 'PRODUCT_TARE_GROUP_4', '0:8', '" . $generic_description . "'," . $configuration_group_id . ", '40', NOW(), NOW()),\n          ('Product Tare Group 5', 'PRODUCT_TARE_GROUP_5', '0:10', '" . $generic_description . "'," . $configuration_group_id . ", '50', NOW(), NOW())\n          ");
<?php

$zc150 = PROJECT_VERSION_MAJOR > 1 || PROJECT_VERSION_MAJOR == 1 && substr(PROJECT_VERSION_MINOR, 0, 3) >= 5;
if ($zc150) {
    // continue Zen Cart 1.5.0
    // add configuration menu
    if (!zen_page_key_exists('toolsCouponImportTool')) {
        zen_register_admin_page('toolsCouponImportTool', 'BOX_COUPON_IMPORT_TOOL', 'FILENAME_COUPON_IMPORT_TOOL', '', 'tools', 'Y', '99');
        $messageStack->add('Enabled Coupon Import Tool on Tools menu.', 'success');
    }
}
Example #25
0
<?php

// For Admin Pages
$zc150 = PROJECT_VERSION_MAJOR > 1 || PROJECT_VERSION_MAJOR == 1 && substr(PROJECT_VERSION_MINOR, 0, 3) >= 5;
if ($zc150) {
    // continue Zen Cart 1.5.0
    // delete configuration menu
    $db->Execute("DELETE FROM " . TABLE_ADMIN_PAGES . " WHERE page_key = 'config_product_tare_groups' LIMIT 1;");
    // add configuration menu
    if (!zen_page_key_exists('catalogTareGroupsBulk')) {
        zen_register_admin_page('catalogTareGroupsBulk', 'BOX_PRODUCT_TARE_GROUPS_BULK', 'FILENAME_TARE_GROUPS_BULK', '', 'catalog', 'Y', $configuration_group_id);
        $messageStack->add('Enabled Product Tare Groups Bulk Add Menu Item.', 'success');
    }
}
<?php

// Bug fix in installer name adding config admin page
$zc150 = PROJECT_VERSION_MAJOR > 1 || PROJECT_VERSION_MAJOR == 1 && substr(PROJECT_VERSION_MINOR, 0, 3) >= 5;
if ($zc150) {
    // continue Zen Cart 1.5.0
    $admin_page = 'configCouponImportTool';
    // delete configuration menu
    $db->Execute("DELETE FROM " . TABLE_ADMIN_PAGES . " WHERE page_key = '" . $admin_page . "' LIMIT 1;");
    // add configuration menu
    if (!zen_page_key_exists($admin_page)) {
        if ((int) $configuration_group_id > 0) {
            zen_register_admin_page($admin_page, 'BOX_CONFIGURATION_COUPON_IMPORT_TOOLS', 'FILENAME_CONFIGURATION', 'gID=' . $configuration_group_id, 'configuration', 'Y', $configuration_group_id);
            $messageStack->add('Enabled Coupon Import Tool Configuration Menu.', 'success');
        }
    }
}
Example #27
0
<?php

// create table for back in stock
$db->Execute("CREATE TABLE IF NOT EXISTS " . TABLE_BACK_IN_STOCK . " (\n\t`bis_id` int(11) NOT NULL AUTO_INCREMENT,\n\t`product_id` int(11) NOT NULL default '0',\n        `variant` int(11) NOT NULL default '0',\n\t`sub_date` int(11) NOT NULL default '0',\n        `purch_date` int(11) NOT NULL default '0',\n        `name` varchar(96) NOT NULL,\n        `email` varchar(96) NOT NULL,\n\t`active_til_purch` int(11) NOT NULL DEFAULT '1',\n        `sub_active` int(11) NOT NULL DEFAULT '1',\n        `spam` int(11) NOT NULL DEFAULT '0',\n\t`last_sent` int(11) NOT NULL default '0',\n\tPRIMARY KEY ( `bis_id` ));");
$db->Execute("INSERT INTO " . TABLE_CONFIGURATION . " (configuration_group_id, configuration_key, configuration_title, configuration_value, configuration_description, set_function) VALUES (" . (int) $configuration_group_id . ", 'BACK_IN_STOCK_ENABLE', 'Enabel Module', 'false', 'Should this module be used', 'zen_cfg_select_option(array(\\'true\\', \\'false\\'),');");
$db->Execute("INSERT INTO " . TABLE_CONFIGURATION . " (configuration_group_id, configuration_key, configuration_title, configuration_value, configuration_description) VALUES (" . (int) $configuration_group_id . ", 'BACK_IN_STOCK_LINK', 'Back In Stock Link', 'Email me when back in stock', 'this is the words that someone would click on. HINT - You could also put a img tag here too!');");
$db->Execute("INSERT INTO " . TABLE_CONFIGURATION . " (configuration_group_id, configuration_key, configuration_title, configuration_value, configuration_description) VALUES (" . (int) $configuration_group_id . ", 'BACK_IN_STOCK_POPUP_HEADING', 'Heading for Popup', 'Sorry we ran out!', 'This heading is in the popup');");
$db->Execute("INSERT INTO " . TABLE_CONFIGURATION . " (configuration_group_id, configuration_key, configuration_title, configuration_value, configuration_description) VALUES (" . (int) $configuration_group_id . ", 'BACK_IN_STOCK_POPUP_SUBHEADING', 'Sub Heading for Popup', 'Fill out this form and we will let you know when it comes back in stock', 'This Sub heading is in the popup');");
$db->Execute("INSERT INTO " . TABLE_CONFIGURATION . " (configuration_group_id, configuration_key, configuration_title, configuration_value, configuration_description) VALUES (" . (int) $configuration_group_id . ", 'BACK_IN_STOCK_SEND_TEXT', 'Text of buton', 'Notify Me!', 'This is the text on the button');");
$db->Execute("INSERT INTO " . TABLE_CONFIGURATION . " (configuration_group_id, configuration_key, configuration_title, configuration_value, configuration_description, set_function) VALUES (" . (int) $configuration_group_id . ", 'BACK_IN_STOCK_SHOW_PRODUCT_INFO', 'Show Product Name and Image', 'true', 'Show product name and image on the fancy box on the product_info page', 'zen_cfg_select_option(array(\\'true\\', \\'false\\'),');");
$db->Execute("INSERT INTO " . TABLE_CONFIGURATION . " (configuration_group_id, configuration_key, configuration_title, configuration_value, configuration_description, set_function) VALUES (" . (int) $configuration_group_id . ", 'BACK_IN_STOCK_ACTIVE_TIL_PURCH', 'Notifications are Active Till They Purchase', 'false', 'This is useful if you want to sent your customers multipule reminders, until they Buy or Die', 'zen_cfg_select_option(array(\\'true\\', \\'false\\'),');");
$db->Execute("INSERT INTO " . TABLE_CONFIGURATION . " (configuration_group_id, configuration_key, configuration_title, configuration_value, configuration_description) VALUES (" . (int) $configuration_group_id . ", 'BACK_IN_STOCK_DAYS_WAITING', 'Days of Lag', '5', 'This is the number of days until you should send them again, this is an almost must if leaving Active Till Purch Active, you can also set zero to be notified everytime the cron is run but this will more then likely make you customer want to unsubscribre');");
if (version_compare(PROJECT_VERSION_MAJOR . "." . PROJECT_VERSION_MINOR, "1.5.0") >= 0) {
    // continue Zen Cart 1.5.0
    // add to configuration menus
    if (function_exists('zen_page_key_exists') && function_exists('zen_register_admin_page') && !zen_page_key_exists('configBackInStock')) {
        zen_register_admin_page('configBackInStock', 'BOX_BACK_IN_STOCK', 'FILENAME_CONFIGURATION', 'gID=' . (int) $configuration_group_id, 'configuration', 'Y', 999);
        $messageStack->add('Enabled Back In Stock Configuration menu.', 'success');
    }
    // add to tools menu
    if (function_exists('zen_page_key_exists') && function_exists('zen_register_admin_page') && !zen_page_key_exists('toolsBackInStock')) {
        zen_register_admin_page('toolsBackInStock', 'BOX_BACK_IN_STOCK_TOOLS', 'FILENAME_BACK_IN_STOCK', '', 'tools', 'Y', 999);
        $messageStack->add('Enabled Back In Stock Tools menu.', 'success');
    }
}
Example #28
0
<?php

/**
 * Bohase - Premium Zencart Template
 *
 * @package Boahse Admin File
 * @author PerfectusThemes
 * @author website www.perfectusinc.com
 * @copyright Copyright 2015-2016 Perfectus Inc.
 * @license http://www.gnu.org/copyleft/gpl.html   GNU Public License V2.0
 * @version $Id: template_settings.php 1.0
 */
if (!defined('IS_ADMIN_FLAG')) {
    die('Illegal Access');
}
if (function_exists('zen_register_admin_page')) {
    if (!zen_page_key_exists('template_settings')) {
        // Add Color menu to Tools menu
        zen_register_admin_page('template_settings', 'BOX_TOOLS_TEMPLATE_SETTINGS', 'FILENAME_TEMPLATE_SETTINGS', '', 'tools', 'Y', 21);
    }
}
 /**
  * Processes any changes to the admin pages required by this plugin.
  *
  * Subclasses should generally not override this method.
  * @param boolean $install true if installing / upgrading, false otherwise.
  * @param array $pages an array containing the admin page(s).
  *
  *		The following array keys are understood (+ indicates always required):
  *		+	page_key = The internal unique key for the page in the database.
  *				If more than one page is desired, this can be used as a key
  *				pointing to an array containg the corresponding keys below.
  *
  *				EX: array('configPluginPage1' => array(
  *						'language_key' => 'BOX_CONFIGURATION_PLUGIN_PAGE1'
  *						)
  *				);
  *
  *		+	language_key = The name displayed in the admin menu for the page.
  *				This should be the name of a constant defined in a language file.
  *
  *			main_page = The name of a constant defined to represent the name
  *				of the admin file loaded to display the page. If not defined
  *				'FILENAME_CONFIGURATION' is used.
  *
  *			page_params = Any paramaters to send to the page. If the main page
  *				is 'FILENAME_CONFIGURATION' the paramaters will be overwritten
  *				with the correct paramaters.
  *
  *			menu_key = The name of the menu where this page should be attached.
  *				This key is required unless main_page is 'FILENAME_CONFIGURATION'
  *				or 'FILENAME_MODULES'.
  *
  *			display_on_menu = Indicates if this page should be displayed in
  *				the admin menu. 'Y' for yes, 'N' otherwise. If not specified
  *				this defaults to 'N' unless the main page is
  *				'FILENAME_CONFIGURATION' (defaults to 'Y').
  *
  *			sort_order = The preffered location of the page in the menu. This
  *				should be a non negative number. The lower the number, the
  *				higher up in the menu the page will appear. If two pages on
  *				the same menu have the same sort_order, they are listed in
  *				the order they were added Zen Cart. If not specified, the
  *				maximum sort_order used on the menu is determined and a number
  *				one larger is used.
  *
  * @return boolean true if the changes succeed, false otherwise.
  */
 protected function processAdminPages($install = true, $pages = null)
 {
     global $db, $messageStack;
     if ($pages === null || !is_array($pages)) {
         $pages = $this->getAdminPages();
     }
     if (array_key_exists('page_key', $pages)) {
         $page_key = $pages['page_key'];
         unset($pages['page_key']);
         $pages = array($page_key => $pages);
         unset($page_key);
     }
     $success = true;
     foreach ($pages as $key => $page) {
         // Validate core keys exist
         if (!zen_not_null($key) || !array_key_exists('language_key', $page)) {
             $messageStack->add(sprintf(PLUGIN_INTERNAL_FORMAT_ADMIN_PAGE_KEY, $this->getUniqueName()), 'error');
             return false;
         }
         // Configure defaults
         if (!array_key_exists('main_page', $page)) {
             $page['main_page'] = 'FILENAME_CONFIGURATION';
         }
         switch ($page['main_page']) {
             case 'FILENAME_CONFIGURATION':
                 // Always overwrite with the correct data
                 $page['page_params'] = 'gID=' . $this->getConfigurationGroupId();
                 break;
             default:
                 if (!array_key_exists('page_params', $page)) {
                     $page['page_params'] = '';
                 }
         }
         if (!array_key_exists('menu_key', $page)) {
             switch ($page['main_page']) {
                 case 'FILENAME_CONFIGURATION':
                     $page['menu_key'] = 'configuration';
                     break;
                 case 'FILENAME_MODULES':
                     $page['menu_key'] = 'modules';
                     break;
                 default:
                     $messageStack->add(sprintf(PLUGIN_INTERNAL_FORMAT_ADMIN_PAGE_MENU_KEY, $this->getUniqueName()), 'error');
                     return false;
             }
         }
         // Process / Verify the Admin Page
         if ($install) {
             if (!zen_page_key_exists($key)) {
                 // Validate the menu_key exists in the database.
                 $check = $db->Execute('SELECT `menu_key` FROM `' . TABLE_ADMIN_MENUS . '` ' . 'WHERE `menu_key` = \'' . zen_db_prepare_input($page['menu_key']) . '\'');
                 if ($check->EOF) {
                     $std_menu_keys = array('configuration', 'catalog', 'modules', 'customers', 'taxes', 'localization', 'reports', 'tools', 'gv', 'access', 'extras');
                     $messageStack->add(sprintf(in_array($page['menu_key'], $std_menu_keys) ? PLUGIN_INTERNAL_FORMAT_ADMIN_PAGE_MENU_KEY_BROKEN : PLUGIN_INTERNAL_FORMAT_ADMIN_PAGE_MENU_KEY_MISSING, $this->getUniqueName(), $page['menu_key']), 'error');
                     return false;
                 }
                 if (!array_key_exists('display_on_menu', $page)) {
                     if ($page['main_page'] == 'FILENAME_CONFIGURATION') {
                         $page['display_on_menu'] = 'Y';
                     } else {
                         $page['display_on_menu'] = 'N';
                     }
                 }
                 if (!array_key_exists('sort_order', $page)) {
                     $page_sort = $db->Execute('SELECT MAX(sort_order) as max_sort FROM `' . TABLE_ADMIN_PAGES . '` ' . 'WHERE `menu_key`=\'' . zen_db_prepare_input($page['menu_key']) . '\'');
                     if (!$page_sort->EOF) {
                         $page['sort_order'] = (int) $page_sort->fields['max_sort'] + 1;
                     } else {
                         $messageStack->add(sprintf(PLUGIN_INSTALL_ERROR_SORT_ORDER, TABLE_ADMIN_PAGES), 'warning');
                         $page['sort_order'] = 0;
                     }
                     unset($page_sort);
                 }
                 if ((int) $page['sort_order'] < 0) {
                     $page['sort_order'] = 0;
                 }
                 zen_register_admin_page($key, $page['language_key'], $page['main_page'], $page['page_params'], $page['menu_key'], $page['display_on_menu'], $page['sort_order']);
                 if (!zen_page_key_exists($key)) {
                     $success = false;
                 }
             }
         } else {
             if (zen_page_key_exists($key)) {
                 zen_deregister_admin_pages($key);
                 if (zen_page_key_exists($key)) {
                     $success = false;
                 }
             }
         }
     }
     return $success;
 }
<?php

/**
 *
 * Bitcoin Payment Module
 * 
 * @package paymentMethod
 *
 *  Author: Jalder (https://github.com/jalder/Zen-Cart-Bitcoin-Payment-Module/)
 *  Moddified by:  MasterX1582 (https://github.com/MasterX1582/Zen-Cart-Bitcoin-Payment-Module/)
 *  Donations: 1JBKYhNvF1B8eLEcCUq3jw8wvrzDCPCGiB
 *
 **/
if (!defined('IS_ADMIN_FLAG')) {
    die('Illegal Access');
}
//----
// If the installation supports admin-page registration (i.e. v1.5.0 and later), then
// register the New Tools tool into the admin menu structure.
//
if (function_exists('zen_register_admin_page')) {
    if (!zen_page_key_exists('reportsBitcoinPayment')) {
        zen_register_admin_page('reportsBitcoinPayment', 'BOX_REPORTS_PAYMENT_BITCOIN', 'FILENAME_PAYMENT_BITCOIN', '', 'reports', 'Y', 20);
    }
}