Beispiel #1
0
function phpwcms_revision_r538()
{
    $status = true;
    // do former revision check – fallback to r537
    if (phpwcms_revision_check_temp('537') !== true) {
        $status = phpwcms_revision_check('537');
    }
    $result = _dbQuery("SHOW COLUMNS FROM `" . DB_PREPEND . "phpwcms_articlecat` WHERE Field='acat_public'");
    if (isset($result[0]['Default']) && $result[0]['Default'] == 0) {
        $update = _dbQuery("ALTER TABLE `" . DB_PREPEND . "phpwcms_articlecat` CHANGE `acat_public` `acat_public` INT(1) NOT NULL DEFAULT '1'", 'ALTER');
        if (!$update) {
            $status = false;
        }
    }
    $result = _dbQuery("SHOW COLUMNS FROM `" . DB_PREPEND . "phpwcms_articlecat` WHERE Field='acat_alias'");
    if (isset($result[0]['Type']) && strpos($result[0]['Type'], '255') === false) {
        $update = _dbQuery("ALTER TABLE `" . DB_PREPEND . "phpwcms_articlecat` CHANGE `acat_alias` `acat_alias` VARCHAR(255) NOT NULL DEFAULT ''", 'ALTER');
        if (!$update) {
            $status = false;
        }
    }
    // Reset cache values
    _setConfig('structure_array_vmode_all', false, 'frontend_render', 1);
    _setConfig('structure_array_vmode_editor', false, 'frontend_render', 1);
    _setConfig('structure_array_vmode_admin', false, 'frontend_render', 1);
    return $status;
}
Beispiel #2
0
function phpwcms_revision_r540()
{
    $status = true;
    // do former revision check – fallback to r539
    if (phpwcms_revision_check_temp('539') !== true) {
        $status = phpwcms_revision_check('539');
    }
    $result = _dbQuery("SHOW COLUMNS FROM `" . DB_PREPEND . "phpwcms_article` WHERE Field='article_canonical'");
    if (!isset($result[0])) {
        $insert = _dbQuery("ALTER TABLE `" . DB_PREPEND . "phpwcms_article` ADD `article_canonical` VARCHAR(2000) NOT NULL DEFAULT ''", 'ALTER');
        if (!$insert) {
            $status = false;
        }
    }
    $result = _dbQuery("SHOW COLUMNS FROM `" . DB_PREPEND . "phpwcms_articlecat` WHERE Field='acat_canonical'");
    if (!isset($result[0])) {
        $insert = _dbQuery("ALTER TABLE `" . DB_PREPEND . "phpwcms_articlecat` ADD `acat_canonical` VARCHAR(2000) NOT NULL DEFAULT ''", 'ALTER');
        if (!$insert) {
            $status = false;
        }
        // Reset cache values
        _setConfig('structure_array_vmode_all', false, 'frontend_render', 1);
        _setConfig('structure_array_vmode_editor', false, 'frontend_render', 1);
        _setConfig('structure_array_vmode_admin', false, 'frontend_render', 1);
    }
    return $status;
}
Beispiel #3
0
function phpwcms_revision_r541()
{
    $status = true;
    // do former revision check – fallback to r540
    if (phpwcms_revision_check_temp('540') !== true) {
        $status = phpwcms_revision_check('540');
    }
    $result = _dbQuery("SHOW COLUMNS FROM `" . DB_PREPEND . "phpwcms_articlecat` WHERE Field='acat_breadcrumb'");
    if (!isset($result[0])) {
        $insert = _dbQuery("ALTER TABLE `" . DB_PREPEND . "phpwcms_articlecat` ADD `acat_breadcrumb` INT(1) NOT NULL DEFAULT '0'", 'ALTER');
        if (!$insert) {
            $status = false;
        }
        // Reset cache values
        _setConfig('structure_array_vmode_all', false, 'frontend_render', 1);
        _setConfig('structure_array_vmode_editor', false, 'frontend_render', 1);
        _setConfig('structure_array_vmode_admin', false, 'frontend_render', 1);
    }
    $result = _dbQuery("SHOW COLUMNS FROM `" . DB_PREPEND . "phpwcms_shop_products` WHERE Field='shopprod_unit'");
    if (!isset($result[0])) {
        if (!($insert = _dbQuery("ALTER TABLE `" . DB_PREPEND . "phpwcms_shop_products` ADD `shopprod_unit` VARCHAR(100) NOT NULL DEFAULT ''", 'ALTER'))) {
            $status = false;
        }
    }
    return $status;
}
Beispiel #4
0
function phpwcms_revision_r537()
{
    $status = true;
    // do former revision check – fallback to r536
    if (phpwcms_revision_check_temp('536') !== true) {
        $status = phpwcms_revision_check('536');
    }
    $result = _dbQuery("SHOW COLUMNS FROM `" . DB_PREPEND . "phpwcms_articlecat` WHERE Field='acat_public'");
    if (isset($result[0]['Default']) && $result[0]['Default'] == 0) {
        $update = _dbQuery("ALTER TABLE `" . DB_PREPEND . "phpwcms_articlecat` CHANGE `acat_public` `acat_public` INT(1) NOT NULL DEFAULT '1'", 'ALTER');
        if (!$update) {
            $status = false;
        }
    }
    $result = _dbQuery("SHOW COLUMNS FROM `" . DB_PREPEND . "phpwcms_articlecat` WHERE Field='acat_opengraph'");
    if (!isset($result[0])) {
        $insert = _dbQuery("ALTER TABLE `" . DB_PREPEND . "phpwcms_articlecat` ADD `acat_opengraph` INT(1) UNSIGNED NOT NULL DEFAULT '1', ADD INDEX (`acat_opengraph`)", 'ALTER');
        if (!$insert) {
            $status = false;
        }
        // Reset cache values
        _setConfig('structure_array_vmode_all', false, 'frontend_render', 1);
        _setConfig('structure_array_vmode_editor', false, 'frontend_render', 1);
        _setConfig('structure_array_vmode_admin', false, 'frontend_render', 1);
    }
    $result = _dbQuery("SHOW COLUMNS FROM `" . DB_PREPEND . "phpwcms_content` WHERE Field='cnt_opengraph'");
    if (!isset($result[0])) {
        $insert = _dbQuery("ALTER TABLE `" . DB_PREPEND . "phpwcms_content` ADD `cnt_opengraph` INT(1) UNSIGNED NOT NULL DEFAULT '1', ADD INDEX (`cnt_opengraph`)", 'ALTER');
        if (!$insert) {
            $status = false;
        }
    }
    $result = _dbQuery("SHOW COLUMNS FROM `" . DB_PREPEND . "phpwcms_categories` WHERE Field='cat_opengraph'");
    if (!isset($result[0])) {
        $insert = _dbQuery("ALTER TABLE `" . DB_PREPEND . "phpwcms_categories` ADD `cat_opengraph` INT(1) UNSIGNED NOT NULL DEFAULT '1', ADD INDEX (`cat_opengraph`)", 'ALTER');
        if (!$insert) {
            $status = false;
        }
    }
    $result = _dbQuery("SHOW COLUMNS FROM `" . DB_PREPEND . "phpwcms_shop_products` WHERE Field='shopprod_opengraph'");
    if (!isset($result[0])) {
        $insert = _dbQuery("ALTER TABLE `" . DB_PREPEND . "phpwcms_shop_products` ADD `shopprod_opengraph` INT(1) UNSIGNED NOT NULL DEFAULT '1', ADD INDEX (`shopprod_opengraph`)", 'ALTER');
        if (!$insert) {
            $status = false;
        }
    }
    return $status;
}
Beispiel #5
0
function get_struct_data($root_name = '', $root_info = '')
{
    //returns the complete active and public struct data as array
    //so it is reusable by many menu functions -> lower db access
    // first check pre-rendered structure for current user mode
    $sysvalue_key = 'structure_array_vmode_' . get_user_vmode();
    $data = _getConfig($sysvalue_key);
    if (is_array($data)) {
        return $data;
    }
    global $db;
    global $indexpage;
    $data = array();
    $data[0] = array("acat_id" => 0, "acat_name" => $indexpage['acat_name'], "acat_info" => $indexpage['acat_info'], "acat_struct" => 0, "acat_sort" => 0, "acat_hidden" => intval($indexpage['acat_hidden']), "acat_regonly" => intval($indexpage['acat_regonly']), "acat_ssl" => intval($indexpage['acat_ssl']), "acat_template" => intval($indexpage['acat_template']), "acat_alias" => $indexpage['acat_alias'], "acat_topcount" => intval($indexpage['acat_topcount']), "acat_maxlist" => intval($indexpage['acat_maxlist']), "acat_redirect" => $indexpage['acat_redirect'], "acat_order" => intval($indexpage['acat_order']), "acat_timeout" => $indexpage['acat_timeout'], "acat_nosearch" => $indexpage['acat_nosearch'], "acat_nositemap" => $indexpage['acat_nositemap'], "acat_permit" => !empty($indexpage['acat_permit']) && is_array($indexpage['acat_permit']) ? $indexpage['acat_permit'] : array(), "acat_pagetitle" => empty($indexpage['acat_pagetitle']) ? '' : $indexpage['acat_pagetitle'], "acat_paginate" => empty($indexpage['acat_paginate']) ? 0 : 1, "acat_overwrite" => empty($indexpage['acat_overwrite']) ? '' : $indexpage['acat_overwrite'], "acat_archive" => empty($indexpage['acat_archive']) ? 0 : 1, "acat_class" => empty($indexpage['acat_class']) ? '' : $indexpage['acat_class'], "acat_keywords" => empty($indexpage['acat_keywords']) ? '' : $indexpage['acat_keywords'], "acat_disable301" => empty($indexpage['acat_disable301']) ? 0 : 1, "acat_opengraph" => isset($indexpage['acat_opengraph']) ? $indexpage['acat_opengraph'] : 1, "acat_canonical" => empty($indexpage['acat_canonical']) ? '' : $indexpage['acat_canonical']);
    $sql = "SELECT * FROM " . DB_PREPEND . "phpwcms_articlecat WHERE ";
    // VISIBLE_MODE: 0 = frontend (all) mode, 1 = article user mode, 2 = admin user mode
    if (VISIBLE_MODE != 2) {
        // for 0 AND 1
        $sql .= "acat_aktiv=1 AND ";
    }
    $sql .= "acat_trash=0 ORDER BY acat_struct, acat_sort";
    if ($result = mysql_query($sql, $db)) {
        while ($row = mysql_fetch_assoc($result)) {
            $data[$row["acat_id"]] = array("acat_id" => $row["acat_id"], "acat_name" => $row["acat_name"], "acat_info" => $row["acat_info"], "acat_struct" => $row["acat_struct"], "acat_sort" => $row["acat_sort"], "acat_hidden" => $row["acat_hidden"], "acat_regonly" => $row["acat_regonly"], "acat_ssl" => $row["acat_ssl"], "acat_template" => $row["acat_template"], "acat_alias" => $row["acat_alias"], "acat_topcount" => $row["acat_topcount"], "acat_maxlist" => $row["acat_maxlist"], "acat_redirect" => $row["acat_redirect"], "acat_order" => $row["acat_order"], "acat_timeout" => $row["acat_cache"], "acat_nosearch" => $row["acat_nosearch"], "acat_nositemap" => $row["acat_nositemap"], "acat_permit" => empty($row["acat_permit"]) ? array() : explode(',', $row["acat_permit"]), "acat_pagetitle" => $row["acat_pagetitle"], "acat_paginate" => $row["acat_paginate"], "acat_overwrite" => $row["acat_overwrite"], "acat_archive" => $row["acat_archive"], "acat_class" => $row["acat_class"], "acat_keywords" => $row["acat_keywords"], "acat_disable301" => $row["acat_disable301"], "acat_opengraph" => $row["acat_opengraph"], "acat_canonical" => $row["acat_canonical"]);
        }
        mysql_free_result($result);
    }
    // set max_allowed_package to bigger value
    _dbSetVar('max_allowed_packet', 16 * 1024 * 1024, '<');
    // store pre-rendered serialized array in database
    _setConfig($sysvalue_key, $data, 'frontend_render', 1);
    return $data;
}
                    if ($s_del) {
                        $sql = "UPDATE " . DB_PREPEND . "phpwcms_articlecat SET acat_trash=9, acat_alias=CONCAT(acat_alias,'_del-','" . date('YmdHis') . "') WHERE (" . $s_del . ")";
                        mysql_query($sql, $db) or die("error while deleting structures");
                    }
                }
            }
            break;
    }
}
//Ende Abarbeiten Aktion
update_cache();
// empty pre-rendered frontend structure for all visible modes
// VISIBLE_MODE: 0 = frontend (all) mode, 1 = article user mode, 2 = admin user mode
_setConfig('structure_array_vmode_all', false, 'frontend_render', 1);
_setConfig('structure_array_vmode_editor', false, 'frontend_render', 1);
_setConfig('structure_array_vmode_admin', false, 'frontend_render', 1);
if (isset($_POST['SubmitClose'])) {
    headerRedirect(PHPWCMS_URL . 'phpwcms.php?' . get_token_get_string('csrftoken') . '&do=admin&p=6&' . get_token_get_string('csrftoken'));
} else {
    headerRedirect($ref);
}
function get_struct_del_id($s_id = 0, $dbcon)
{
    $s_id = intval($s_id);
    //retrieve article ID list that should be deleted
    $sql = "SELECT article_id FROM " . DB_PREPEND . "phpwcms_article WHERE article_deleted=0 AND article_cid=" . $s_id;
    if ($result = mysql_query($sql, $dbcon)) {
        while ($row = mysql_fetch_row($result)) {
            $GLOBALS["article_del"][] = $row[0];
        }
        mysql_free_result($result);
	<?php 
if (!($plugin['data']['shop_pref_vat'] = _getConfig('shop_pref_vat'))) {
    $plugin['data']['shop_pref_vat'] = array('0.00');
    _setConfig('shop_pref_vat', $plugin['data']['shop_pref_vat'], 'module_shop');
}
$add_option = '';
$add_vat = array();
foreach ($plugin['data']['shop_pref_vat'] as $value) {
    echo '<option value="' . $value . '"';
    if ($plugin['data']['shopprod_vat'] == $value) {
        echo ' selected="selected"';
    } elseif (!empty($plugin['data']['shopprod_vat']) && !in_array($plugin['data']['shopprod_vat'], $plugin['data']['shop_pref_vat'])) {
        $plugin['data']['shop_pref_vat'][] = $plugin['data']['shopprod_vat'];
        natsort($plugin['data']['shop_pref_vat']);
        _setConfig('shop_pref_vat', $plugin['data']['shop_pref_vat'], 'module_shop');
        $add_option .= LF . '<option value="' . $plugin['data']['shopprod_vat'] . '" selected="selected">';
        $add_option .= number_format($plugin['data']['shopprod_vat'], 2, $BLM['dec_point'], $BLM['thousands_sep']);
        $add_option .= '</option>';
    }
    echo '>';
    echo number_format($value, 2, $BLM['dec_point'], $BLM['thousands_sep']);
    echo '</option>' . LF;
}
echo $add_option;
?>

			</select></td>

			<td>&nbsp;%</td>
            _setConfig('shop_pref_vat', $plugin['data']['shop_pref_vat'], 'module_shop');
            _setConfig('shop_pref_email_to', $plugin['data']['shop_pref_email_to'], 'module_shop');
            _setConfig('shop_pref_email_from', $plugin['data']['shop_pref_email_from'], 'module_shop');
            _setConfig('shop_pref_email_paypal', $plugin['data']['shop_pref_email_paypal'], 'module_shop');
            _setConfig('shop_pref_shipping_calc', $plugin['data']['shop_pref_shipping_calc'], 'module_shop');
            _setConfig('shop_pref_shipping', $plugin['data']['shop_pref_shipping'], 'module_shop');
            _setConfig('shop_pref_payment', $plugin['data']['shop_pref_payment'], 'module_shop');
            _setConfig('shop_pref_terms', $plugin['data']['shop_pref_terms'], 'module_shop');
            _setConfig('shop_pref_terms_format', $plugin['data']['shop_pref_terms_format'], 'module_shop');
            _setConfig('shop_pref_id_shop', $plugin['data']['shop_pref_id_shop'], 'module_shop');
            _setConfig('shop_pref_id_cart', $plugin['data']['shop_pref_id_cart'], 'module_shop');
            _setConfig('shop_pref_discount', $plugin['data']['shop_pref_discount'], 'module_shop');
            _setConfig('shop_pref_loworder', $plugin['data']['shop_pref_loworder'], 'module_shop');
            _setConfig('shop_pref_felang', $plugin['data']['shop_pref_felang'], 'module_shop');
            _setConfig('shop_pref_zone_base', $plugin['data']['shop_pref_zone_base'], 'module_shop');
            _setConfig('shop_pref_api_access', $plugin['data']['shop_pref_api_access'], 'module_shop');
            _setConfig('shop_pref_api_key', $plugin['data']['shop_pref_api_key'], 'module_shop');
            // save and back to listing mode
            headerRedirect(shop_url('controller=pref', ''));
        }
    }
    $_checkPref_shipping_default = array('weight' => '', 'net' => 0, 'vat' => 0, 'price' => '', 'price_net' => 0, 'price_vat' => 0, 'zone' => '', 'zone_net' => 0, 'zone_vat' => 0, 'zone_label' => '');
    $_checkPref = array('shop_pref_currency' => '', 'shop_pref_unit_weight' => 'kg', 'shop_pref_vat' => array('0.00', '7.00', '19.00'), 'shop_pref_email_to' => '', 'shop_pref_email_from' => '', 'shop_pref_email_paypal' => '', 'shop_pref_id_shop' => 0, 'shop_pref_id_cart' => 0, 'shop_pref_felang' => 0, 'shop_pref_shipping_calc' => 0, 'shop_pref_shipping' => array(0 => $_checkPref_shipping_default, 1 => $_checkPref_shipping_default, 2 => $_checkPref_shipping_default, 3 => $_checkPref_shipping_default, 4 => $_checkPref_shipping_default), 'shop_pref_zone_base' => '', 'shop_pref_payment' => array('paypal' => 1, 'prepay' => 1, 'pod' => 1, 'onbill' => 1, 'ccard' => 1, 'accepted_ccard' => array('americanexpress', 'mastercard', 'visa')), 'shop_pref_terms' => '', 'shop_pref_terms_format' => 0, 'shop_pref_discount' => array('discount' => 0, 'percent' => 0, 'amount' => 0, 'freeshipping' => 0, 'discount_1' => 0, 'percent_1' => 0, 'amount_1' => 0, 'freeshipping_1' => 0, 'discount_2' => 0, 'percent_2' => 0, 'amount_2' => 0, 'freeshipping_2' => 0), 'shop_pref_loworder' => array('loworder' => 0, 'under' => 0, 'charge' => 0, 'vat' => 0), 'shop_pref_api_access' => 0, 'shop_pref_api_key' => '');
    // retrieve all settings
    foreach ($_checkPref as $key => $value) {
        if (false === ($plugin['data'][$key] = _getConfig($key))) {
            $plugin['data'][$key] = $value;
            _setConfig($key, $plugin['data'][$key], 'module_shop');
        }
    }
}