Re: Numinex Compatibility
Quote:
Originally Posted by
DivaVocals
Right.. and apparently use_function can be used for MORE than this.. wouldn't you guys be interested in some "spirit" of collaboration in making sure that your module plays nice with others.. Thank goodness lhungil was nice enough to help me fix an issue with the Google Product Search module otherwise I'd still be spitting in the wind..
And this was the exact discovery that we made as well.. my apologies for not posting an update to this.. The Numinix modified
configuration.php file does NOT work with USU.. The fix posted earlier helped, but wasn't quite the right fix.. Turns out that it required a bit of a BIGGER fix.. I have included my entire modified
configuration.php file with the NEW code that I have working on my development site.. It allows BOTH USU and the Numinix modified
configuration.php file to co-exist peacefully.. You all don't HAVE to update your products with these changes, but I'm sure as heck gonna suggest folks use it if they are using your Google Product Search product since it's working on my dev site with NO ISSUES whatsoever..
I'll leave it to your code jockey's to hash out the whys and hows.. I only care that I have a WORKING site..
Code:
<?php
/**
* @package admin
* @copyright Copyright 2003-2012 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version GIT: $Id: Author: Ian Wilson Thu Aug 16 12:36:12 2012 +0100 Modified in v1.5.1 $
*/
require('includes/application_top.php');
$action = (isset($_GET['action']) ? $_GET['action'] : '');
if (zen_not_null($action)) {
switch ($action) {
case 'save':
// demo active test
if (zen_admin_demo()) {
$_GET['action']= '';
$messageStack->add_session(ERROR_ADMIN_DEMO, 'caution');
zen_redirect(zen_href_link(FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . $cID));
}
$configuration_value = zen_db_prepare_input($_POST['configuration_value']);
$cID = zen_db_prepare_input($_GET['cID']);
$db->Execute("update " . TABLE_CONFIGURATION . "
set configuration_value = '" . zen_db_input($configuration_value) . "',
last_modified = now() where configuration_id = '" . (int)$cID . "'");
$configuration_query = 'select configuration_key as cfgkey, configuration_value as cfgvalue
from ' . TABLE_CONFIGURATION;
$configuration = $db->Execute($configuration_query);
// set the WARN_BEFORE_DOWN_FOR_MAINTENANCE to false if DOWN_FOR_MAINTENANCE = true
if ( (WARN_BEFORE_DOWN_FOR_MAINTENANCE == 'true') && (DOWN_FOR_MAINTENANCE == 'true') ) {
$db->Execute("update " . TABLE_CONFIGURATION . "
set configuration_value = 'false', last_modified = '" . NOW . "'
where configuration_key = 'WARN_BEFORE_DOWN_FOR_MAINTENANCE'"); }
$configuration_query = 'select configuration_key as cfgkey, configuration_value as cfgvalue
from ' . TABLE_CONFIGURATION;
$configuration = $db->Execute($configuration_query);
zen_redirect(zen_href_link(FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . $cID));
break;
}
}
$gID = (isset($_GET['gID'])) ? $_GET['gID'] : 1;
$_GET['gID'] = $gID;
$cfg_group = $db->Execute("select configuration_group_title
from " . TABLE_CONFIGURATION_GROUP . "
where configuration_group_id = '" . (int)$gID . "'");
if ($gID == 7) {
$shipping_errors = '';
if (zen_get_configuration_key_value('SHIPPING_ORIGIN_ZIP') == 'NONE' or zen_get_configuration_key_value('SHIPPING_ORIGIN_ZIP') == '') {
$shipping_errors .= '<br />' . ERROR_SHIPPING_ORIGIN_ZIP;
}
if (zen_get_configuration_key_value('ORDER_WEIGHT_ZERO_STATUS') == '1' and !defined('MODULE_SHIPPING_FREESHIPPER_STATUS')) {
$shipping_errors .= '<br />' . ERROR_ORDER_WEIGHT_ZERO_STATUS;
}
if (defined('MODULE_SHIPPING_USPS_STATUS') and (MODULE_SHIPPING_USPS_USERID=='NONE' or MODULE_SHIPPING_USPS_SERVER == 'test')) {
$shipping_errors .= '<br />' . ERROR_USPS_STATUS;
}
if ($shipping_errors != '') {
$messageStack->add(ERROR_SHIPPING_CONFIGURATION . $shipping_errors, 'caution');
}
}
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
<script language="javascript" src="includes/menu.js"></script>
<script language="javascript" src="includes/general.js"></script>
<script type="text/javascript">
<!--
function init()
{
cssjsmenu('navbar');
if (document.getElementById)
{
var kill = document.getElementById('hoverJS');
kill.disabled = true;
}
}
// -->
</script>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onLoad="init()">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->
<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
<tr>
<!-- body_text //-->
<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td class="pageHeading"><?php echo $cfg_group->fields['configuration_group_title']; ?></td>
<td class="pageHeading" align="right"><?php echo zen_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
</tr>
</table></td>
</tr>
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr class="dataTableHeadingRow">
<td class="dataTableHeadingContent" width="55%"><?php echo TABLE_HEADING_CONFIGURATION_TITLE; ?></td>
<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CONFIGURATION_VALUE; ?></td>
<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?> </td>
</tr>
<?php
$configuration = $db->Execute("select configuration_id, configuration_title, configuration_value, configuration_key,
use_function from " . TABLE_CONFIGURATION . "
where configuration_group_id = '" . (int)$gID . "'
order by sort_order");
while (!$configuration->EOF) {
if (zen_not_null($configuration->fields['use_function'])) {
$use_function = $configuration->fields['use_function'];
if (preg_match('/->/', $use_function)) {
$class_method = explode('->', $use_function);
if (!is_object(${$class_method[0]})) {
include(DIR_WS_CLASSES . $class_method[0] . '.php');
${$class_method[0]} = new $class_method[0]();
}
$cfgValue = zen_call_function($class_method[1], $configuration->fields['configuration_value'], ${$class_method[0]});
} else {
$cfgValue = zen_call_function($use_function, $configuration->fields['configuration_value']);
}
} else {
$cfgValue = $configuration->fields['configuration_value'];
}
if ((!isset($_GET['cID']) || (isset($_GET['cID']) && ($_GET['cID'] == $configuration->fields['configuration_id']))) && !isset($cInfo) && (substr($action, 0, 3) != 'new')) {
$cfg_extra = $db->Execute("select configuration_key, configuration_description, date_added,
last_modified, use_function, set_function
from " . TABLE_CONFIGURATION . "
where configuration_id = '" . (int)$configuration->fields['configuration_id'] . "'");
$cInfo_array = array_merge($configuration->fields, $cfg_extra->fields);
$cInfo = new objectInfo($cInfo_array);
}
if ( (isset($cInfo) && is_object($cInfo)) && ($configuration->fields['configuration_id'] == $cInfo->configuration_id) ) {
echo ' <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . zen_href_link(FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . $cInfo->configuration_id . '&action=edit') . '\'">' . "\n";
} else {
echo ' <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . zen_href_link(FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . $configuration->fields['configuration_id'] . '&action=edit') . '\'">' . "\n";
}
?>
<td class="dataTableContent"><?php echo $configuration->fields['configuration_title']; ?></td>
<td class="dataTableContent"><?php echo htmlspecialchars($cfgValue, ENT_COMPAT, CHARSET, TRUE); ?></td>
<td class="dataTableContent" align="right"><?php if ( (isset($cInfo) && is_object($cInfo)) && ($configuration->fields['configuration_id'] == $cInfo->configuration_id) ) { echo zen_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . zen_href_link(FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . $configuration->fields['configuration_id']) . '" name="link_' . $configuration->fields['configuration_key'] . '">' . zen_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?> </td>
</tr>
<?php
$configuration->MoveNext();
}
?>
</table></td>
<?php
$heading = array();
$contents = array();
switch ($action) {
case 'edit':
$heading[] = array('text' => '<b>' . $cInfo->configuration_title . '</b>');
if ($cInfo->set_function) {
eval('$value_field = ' . $cInfo->set_function . '"' . htmlspecialchars($cInfo->configuration_value, ENT_COMPAT, CHARSET, TRUE) . '");');
} else {
$value_field = zen_draw_input_field('configuration_value', htmlspecialchars($cInfo->configuration_value, ENT_COMPAT, CHARSET, TRUE), 'size="60"');
}
$contents = array('form' => zen_draw_form('configuration', FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . $cInfo->configuration_id . '&action=save'));
if (ADMIN_CONFIGURATION_KEY_ON == 1) {
$contents[] = array('text' => '<strong>Key: ' . $cInfo->configuration_key . '</strong><br />');
}
$contents[] = array('text' => TEXT_INFO_EDIT_INTRO);
$contents[] = array('text' => '<br><b>' . $cInfo->configuration_title . '</b><br>' . $cInfo->configuration_description . '<br>' . $value_field);
$contents[] = array('align' => 'center', 'text' => '<br>' . zen_image_submit('button_update.gif', IMAGE_UPDATE, 'name="submit' . $cInfo->configuration_key . '"') . ' <a href="' . zen_href_link(FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . $cInfo->configuration_id) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
break;
default:
if (isset($cInfo) && is_object($cInfo)) {
$heading[] = array('text' => '<b>' . $cInfo->configuration_title . '</b>');
if (ADMIN_CONFIGURATION_KEY_ON == 1) {
$contents[] = array('text' => '<strong>Key: ' . $cInfo->configuration_key . '</strong><br />');
}
$contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . $cInfo->configuration_id . '&action=edit') . '">' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '</a>');
$contents[] = array('text' => '<br>' . $cInfo->configuration_description);
$contents[] = array('text' => '<br>' . TEXT_INFO_DATE_ADDED . ' ' . zen_date_short($cInfo->date_added));
if (zen_not_null($cInfo->last_modified)) $contents[] = array('text' => TEXT_INFO_LAST_MODIFIED . ' ' . zen_date_short($cInfo->last_modified));
}
break;
}
if ( (zen_not_null($heading)) && (zen_not_null($contents)) ) {
echo ' <td width="25%" valign="top">' . "\n";
$box = new box;
echo $box->infoBox($heading, $contents);
echo ' </td>' . "\n";
}
?>
</tr>
</table></td>
</tr>
</table></td>
<!-- body_text_eof //-->
</tr>
</table>
<!-- body_eof //-->
<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
Can you try going to CONFIGURATION > CUSTOMER DETAILS and try changing the default country ID? Because use_function shouldn't be used inside the field, but only for the preview, it will cause the dropdown to display "none" as selected, even though if you verify in your database, it will be set to the correct country ID that you had selected.
Re: Ultimate SEO 2.200 (new features) [Support Thread]
Quote:
Originally Posted by
lhungil
Around line 200, try adding an explicit $_sid = null;
Code:
global $request_type, $http_domain, $https_domain, $session_started;
$_sid = null;
if(($add_session_id == true) && ($session_started) && (SESSION_FORCE_COOKIE_USE == 'False')) {
Can you verify line 215 is "case (zen_not_null($_sid)):" for me? What version of PHP is the host running? Any other messages? Just curious because I have not seen this one before!
PHP version 5.3.24
Lines 200-209
Code:
if(($add_session_id == true) && ($session_started) && (SESSION_FORCE_COOKIE_USE == 'False')) {
if(defined('SID') && zen_not_null(SID)) {
$_sid = SID;
}
else if((($request_type == 'NONSSL') && ($connection == 'SSL') && (ENABLE_SSL == 'true')) || (($request_type == 'SSL') && ($connection == 'NONSSL'))) {
if($http_domain != $https_domain) {
$_sid = zen_session_name() . '=' . zen_session_id();
}
}
}
Line 215
Code:
case (zen_not_null($_sid)):
Gonna make this change report back if the error goes away..
Re: Numinex Compatibility
Quote:
Originally Posted by
numinix
Can you try going to CONFIGURATION > CUSTOMER DETAILS and try changing the default country ID? Because use_function shouldn't be used inside the field, but only for the preview, it will cause the dropdown to display "none" as selected, even though if you verify in your database, it will be set to the correct country ID that you had selected.
Here's what I see:
http://i60.tinypic.com/1rf7l2.png
Here's the modified code I used (what I posted earlier was WRONG WRONG WRONG -- it was the original code)
Code:
<?php
/**
* @package admin
* @copyright Copyright 2003-2012 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version GIT: $Id: Author: Ian Wilson Thu Aug 16 12:36:12 2012 +0100 Modified in v1.5.1 $
*/
// configuration
//if (!defined('NUMINIX_DEMO')) define('NUMINIX_DEMO', 'true'); // set to true or false
// end
require('includes/application_top.php');
$action = (isset($_GET['action']) ? $_GET['action'] : '');
// modified demo ability of Zen Cart to store demo configuration on an IP basis if user is not a superuser
$demo_config = false;
$configuration_table = TABLE_CONFIGURATION;
if (NUMINIX_DEMO == 'true') {
// get the admin profile level
$admin_profile = $db->Execute("SELECT admin_profile FROM " . TABLE_ADMIN . " WHERE admin_id = " . (int)$_SESSION['admin_id'] . " AND admin_profile = 1 LIMIT 1;");
// proceed if user is not a superuser
if ($admin_profile->RecordCount() == 0) {
$demo_config = true;
$configuration_table = TABLE_DEMO_CONFIGURATION;
$demo_where_and = ' AND ip_address = "' . $_SERVER["REMOTE_ADDR"] . '"';
$demo_where = ' WHERE ip_address = "' . $_SERVER["REMOTE_ADDR"] . '"';
// build configuration table
$all_configuration = $db->Execute("SELECT * FROM " . TABLE_CONFIGURATION . " ORDER BY configuration_id ASC");
if ($all_configuration->RecordCount() > 0) {
while (!$all_configuration->EOF) {
// check if configuration exists in demo
$all_demo_configuration = $db->Execute("SELECT * FROM " . TABLE_DEMO_CONFIGURATION . " WHERE configuration_key = '" . $all_configuration->fields['configuration_key'] . "' AND ip_address = '" . $_SERVER["REMOTE_ADDR"] . "' LIMIT 1;");
if (!($all_demo_configuration->RecordCount() > 0)) {
// add the configuration setting
$db->Execute("INSERT INTO " . TABLE_DEMO_CONFIGURATION . " (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function, configuration_tab, ip_address)
VALUES (
" . (int)$all_configuration->fields['configuration_id'] . ",
'" . addslashes(zen_db_prepare_input($all_configuration->fields['configuration_title'])) . "',
'" . addslashes(zen_db_prepare_input($all_configuration->fields['configuration_key'])) . "',
'" . addslashes(zen_db_prepare_input($all_configuration->fields['configuration_value'])) . "',
'" . addslashes(zen_db_prepare_input($all_configuration->fields['configuration_description'])) . "',
" . (int)$all_configuration->fields['configuration_group_id'] . ",
" . (int)$all_configuration->fields['sort_order'] . ",
'" . addslashes(zen_db_prepare_input($all_configuration->fields['last_modified'])) . "',
'" . addslashes(zen_db_prepare_input($all_configuration->fields['date_added'])) . "',
'" . addslashes(zen_db_prepare_input($all_configuration->fields['use_function'])) . "',
'" . addslashes(zen_db_prepare_input($all_configuration->fields['set_function'])) . "',
'" . addslashes(zen_db_prepare_input($all_configuration->fields['configuration_tab'])) . "',
'" . addslashes(zen_db_prepare_input($_SERVER["REMOTE_ADDR"])) . "'
);");
}
$all_configuration->MoveNext();
}
}
}
}
if (zen_not_null($action)) {
switch ($action) {
case 'save':
// demo active test
if (zen_admin_demo()) {
$_GET['action']= '';
$messageStack->add_session(ERROR_ADMIN_DEMO, 'caution');
zen_redirect(zen_href_link(FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . $cID));
}
if (NUMINIX_DEMO == 'true') {
// get the admin profile level
$admin_profile = $db->Execute("SELECT admin_profile FROM " . TABLE_ADMIN . " WHERE admin_id = " . (int)$_SESSION['admin_id'] . " AND admin_profile = 1 LIMIT 1;");
if ($admin_profile->RecordCount() == 1) {
$demo_admin_superuser = true;
}
}
foreach($_POST as $cfgID => $cfgValue) {
$strpos = strpos($cfgID, 'cfg_');
if ($strpos !== FALSE) {
$cID = zen_db_prepare_input(substr($cfgID, $strpos + 4));
$configuration_value = zen_db_prepare_input($cfgValue);
$db->Execute("update " . $configuration_table . "
set configuration_value = '" . zen_db_input($configuration_value) . "',
last_modified = now() where configuration_id = '" . (int)$cID . "'" . $demo_where_and);
if ($demo_admin_superuser) {
$db->Execute("update " . TABLE_DEMO_CONFIGURATION . "
set configuration_value = '" . zen_db_input($configuration_value) . "',
last_modified = now() where configuration_id = '" . (int)$cID . "';");
}
}
}
$configuration_query = 'select configuration_key as cfgkey, configuration_value as cfgvalue
from ' . $configuration_table . $demo_where;
$configuration = $db->Execute($configuration_query);
// set the WARN_BEFORE_DOWN_FOR_MAINTENANCE to false if DOWN_FOR_MAINTENANCE = true
if ( (WARN_BEFORE_DOWN_FOR_MAINTENANCE == 'true') && (DOWN_FOR_MAINTENANCE == 'true') ) {
$db->Execute("update " . $configuration_table . "
set configuration_value = 'false', last_modified = '" . NOW . "'
where configuration_key = 'WARN_BEFORE_DOWN_FOR_MAINTENANCE'" . $demo_where_and);
}
zen_redirect(zen_href_link(FILENAME_CONFIGURATION, 'gID=' . $_GET['gID']));
break;
}
}
$gID = (isset($_GET['gID'])) ? $_GET['gID'] : 1;
$_GET['gID'] = $gID;
$cfg_group = $db->Execute("select configuration_group_title
from " . TABLE_CONFIGURATION_GROUP . "
where configuration_group_id = '" . (int)$gID . "'");
if ($gID == 7) {
$shipping_errors = '';
if (zen_get_configuration_key_value('SHIPPING_ORIGIN_ZIP') == 'NONE' or zen_get_configuration_key_value('SHIPPING_ORIGIN_ZIP') == '') {
$shipping_errors .= '<br />' . ERROR_SHIPPING_ORIGIN_ZIP;
}
if (zen_get_configuration_key_value('ORDER_WEIGHT_ZERO_STATUS') == '1' and !defined('MODULE_SHIPPING_FREESHIPPER_STATUS')) {
$shipping_errors .= '<br />' . ERROR_ORDER_WEIGHT_ZERO_STATUS;
}
if (defined('MODULE_SHIPPING_USPS_STATUS') and (MODULE_SHIPPING_USPS_USERID=='NONE' or MODULE_SHIPPING_USPS_SERVER == 'test')) {
$shipping_errors .= '<br />' . ERROR_USPS_STATUS;
}
if ($shipping_errors != '') {
$messageStack->add(ERROR_SHIPPING_CONFIGURATION . $shipping_errors, 'caution');
}
}
// START fix code to utilize the use_function (1 / 3)
// Basically we moved this code inside the HTML generation
// END fix code to utilize the use_function (1 / 3)
function cleanConfigurationTab($str) {
return strtolower(ereg_replace("[^A-Za-z0-9]", "", $str));
}
?>
<!doctype html>
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
<link rel="stylesheet" href="includes/modules/tabbed_configuration/css/tabbed_configuration.css">
<script language="javascript" src="includes/menu.js"></script>
<script language="javascript" src="includes/general.js"></script>
<script type="text/javascript">
<!--
function init()
{
cssjsmenu('navbar');
if (document.getElementById)
{
var kill = document.getElementById('hoverJS');
kill.disabled = true;
}
}
// -->
</script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script src="includes/modules/tabbed_configuration/js/jquery-main.js"></script>
<script src="includes/modules/tabbed_configuration/js/jquery-easyResponsiveTabs.js"></script>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onLoad="init()">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->
<div class="wrap">
<div class="mod-header">
<h1><?php echo $cfg_group->fields['configuration_group_title']; ?></h1>
</div>
<?php // START fix code to utilize the use_function (2 / 3)
$configuration_query =
'SELECT configuration_id, configuration_title, ' .
'configuration_value, configuration_description, ' .
'configuration_key, use_function, set_function, ' .
'configuration_tab ' .
'FROM ' . $configuration_table . ' ' .
'WHERE configuration_group_id = \'' . (int)$gID . '\'' . $demo_where_and . ' ' .
'ORDER BY sort_order, configuration_tab ASC';
$configuration = $db->Execute($configuration_query);
while (!$configuration->EOF) {
if(zen_not_null($configuration->fields['use_function'])) {
if (preg_match('/->/', $configuration->fields['use_function'])) {
$class_method = explode('->', $configuration->fields['use_function']);
if (!is_object(${$class_method[0]})) {
include(DIR_WS_CLASSES . $class_method[0] . '.php');
${$class_method[0]} = new $class_method[0]();
}
zen_call_function($class_method[1], $configuration->fields['configuration_value'], ${$class_method[0]});
} else {
zen_call_function($configuration->fields['use_function'], $configuration->fields['configuration_value']);
}
}
$configuration->MoveNext();
}
// The stock Zen Cart configuration file "reloads" the
// page between displaying configuration settings and
// editing a configuration setting. This "extra" query
// is needed to "replicate" the default Zen Cart behavior.
$configuration = $db->Execute($configuration_query);
$tabs = array();
while (!$configuration->EOF) {
if (!array_key_exists($configuration->fields['configuration_tab'], $tabs) && $configuration->fields['configuration_tab'] != '') {
$tabs[$configuration->fields['configuration_tab']] = array('options' => array());
}
if ($configuration->fields['configuration_tab'] == '') $configuration->fields['configuration_tab'] = 'General';
$tabs[$configuration->fields['configuration_tab']]['options'][] = array(
'configuration_id' => $configuration->fields['configuration_id'],
'configuration_title' => $configuration->fields['configuration_title'],
'configuration_description' => $configuration->fields['configuration_description'],
'configuration_value' => $configuration->fields['configuration_value'],
'configuration_key' => $configuration->fields['configuration_key'],
'use_function' => $configuration->fields['use_function'],
'set_function' => $configuration->fields['set_function']
);
$configuration->MoveNext();
}
// END fix code to utilize the use_function (2 / 3) ?>
<div class="mod-content">
<?php
echo zen_draw_form('configuration', FILENAME_CONFIGURATION, 'gID=' . (int)$_GET['gID'] . '&action=save');
?>
<div id="tabs">
<?php
foreach($tabs as $tab => $tab_vals) {
// build the tab
?>
<ul class="mod-tabs resp-tabs-list">
<li><?php echo $tab; ?></li>
</ul>
<div class="mod-tabs-content resp-tabs-container">
<div>
<table class="mod-table">
<tbody>
<?php
foreach($tab_vals['options'] as $configuration_option) {
echo '<tr>' . "\n";
// START fix code to utilize the use_function (3 / 3)
echo ' <td class="cl">' . $configuration_option['configuration_title'] . '<br />';
$configuration_value = $configuration_option['configuration_value'];
if(zen_not_null($configuration_option['use_function'])) {
// Run the use_function for display purposes
if (preg_match('/->/', $configuration_option['use_function'])) {
$class_method = explode('->', $configuration_option['use_function']);
if (!is_object(${$class_method[0]})) {
include(DIR_WS_CLASSES . $class_method[0] . '.php');
${$class_method[0]} = new $class_method[0]();
}
$configuration_value = zen_call_function($class_method[1], $configuration_option['configuration_value'], ${$class_method[0]});
} else {
$configuration_value = zen_call_function($configuration_option['use_function'], $configuration_option['configuration_value']);
}
}
echo '<small><i>Current Value: ' . $configuration_value . '</i></small></td>' . "\n";
// END fix code to utilize the use_function (3 / 3)
echo ' <td class="cl is-details"><em>' . $configuration_option['configuration_description'] . '</em></td>' . "\n";
echo ' <td class="cl">' . "\n";
if ($configuration_option['set_function']) {
eval('$value_field = ' . $configuration_option['set_function'] . '"' . htmlspecialchars($configuration_option['configuration_value'], ENT_COMPAT, CHARSET, TRUE) . '");');
} else {
$value_field = zen_draw_input_field('cfg_' . $configuration_option['configuration_id'], htmlspecialchars($configuration_option['configuration_value'], ENT_COMPAT, CHARSET, TRUE), 'size="60"');
}
echo ' ' . preg_replace('/<br>/', '', str_replace('configuration_value', 'cfg_' . $configuration_option['configuration_id'], $value_field), 1) . "\n";
echo ' </td>' . "\n";
echo '</tr>' . "\n";
}
?>
</tbody>
</table>
</div>
</div>
<?php
}
?>
<div class="mod-buttons">
<button class="mod-buttons-call"><?php echo TEXT_BUTTON_SAVE_CHANGES; ?></button>
<a href="<?php echo zen_href_link(FILENAME_CONFIGURATION, 'gID=' . $_GET['gID']); ?>" class="mod-buttons-second"><?php echo TEXT_BUTTON_CANCEL; ?></a>
</div>
</div>
</form>
</div>
<div class="mod-footer">
<div class="mod-copyright">
<span>© <?php echo date('Y'); ?> <a href="http://www.numinix.com" target="_blank">Numinix.com</a></span>
<a href="http://www.numinix.com" target="_blank"><img src="includes/modules/tabbed_configuration/images/logo_numinix.png" alt="Numinix" /></a>
</div>
</div>
</div>
<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
Re: Numinex Compatibility
I truly haven't done this in a long time on a 1.3.9h cart but I'm stumped at this point. If I upload the file for installation then of course I get the TABLE_ADMIN_PAGES' doesn't exist message. I read in this thread that this was supposed to be taken care of last year and it still seems to be in the code. Did or did not this get fixed for 1.3.9h? I'll be glad to comment out lines if I need but why isn't the if statement working? if(function_exists('zen_register_admin_page')) says if it exists to go forward - well it doesn't exist. This is a clean version of 1.3.9h with no mods installed.
Re: Ultimate SEO upgrade Zen Cart 1.3.9h
Quote:
Originally Posted by
delia
I truly haven't done this in a long time on a 1.3.9h cart but I'm stumped at this point. If I upload the file for installation then of course I get the TABLE_ADMIN_PAGES' doesn't exist message. ... This is a clean version of 1.3.9h with no mods installed.
This was corrected for "clean" installations of Ultimate (seo) URLs in version 2.212.
If you are getting this message a previous version was detected. I would suspect the database was not "clean" (did the database table "seo_cache" already exist? Where all configuration options from previous versions removed?).
There is a known bug in versions <= 2.212 under Zen Cart 1.3.9h when upgrading from versions <= 2.210. If one does not want to simply remove the old version (files and database) and re-install... One could try making the following change to "/admin/includes/init_includes/init_seo_config.php" around line 387 replacing:
Code:
// Update the admin page language key
$check = $db->Execute(
'SELECT `page_key` FROM `' . TABLE_ADMIN_PAGES . '` ' .
'WHERE `page_key` = \'configUltimateSEO\''
);
if(!$check->EOF) {
zen_db_perform(TABLE_ADMIN_PAGES, array('language_key' => 'SEO_CONFIGURATION_GROUP_TITLE'), 'update', '`page_key`=\'' . $check->fields['page_key'] .'\'');
}
// Remove the old admin page if present
if(function_exists('zen_deregister_admin_pages')) {
if(zen_page_key_exists('UltimateSEO')) zen_deregister_admin_pages('UltimateSEO');
}
with:
Code:
if(function_exists('zen_deregister_admin_pages')) {
// Update the admin page language key
$check = $db->Execute(
'SELECT `page_key` FROM `' . TABLE_ADMIN_PAGES . '` ' .
'WHERE `page_key` = \'configUltimateSEO\''
);
if(!$check->EOF) {
zen_db_perform(TABLE_ADMIN_PAGES, array('language_key' => 'SEO_CONFIGURATION_GROUP_TITLE'), 'update', '`page_key`=\'' . $check->fields['page_key'] .'\'');
}
// Remove the old admin page if present
if(zen_page_key_exists('UltimateSEO')) zen_deregister_admin_pages('UltimateSEO');
}
Note: The next release of this module will include a massive rewrite (the anchor text is about the only remaining portion of the original code). As this project is currently not being funded (and only worked on in my spare time), dates for BETA and FINAL releases are not set.
Re: Ultimate SEO upgrade Zen Cart 1.3.9h
Aha, yes, the files were new but there had been a previous installation in the database and the table was still there. I had removed the config settings and didn't think the table would matter. I commented out the lines and finished the installation.
Thanks for the nugget of info. Shall hopefully stick in my head somewhere so it doesn't get lost!
Re: Ultimate SEO 2.200+ (new features)
After looking through this forum I have not been able to find the previous thread relating to the fix for the ceon sage pay server payment I frame issue, we have the same issue and have also turned off automatic rewriting but would like to fix the issue and turn the rewriting back on. A link to the thread would be appreciated.
Quote:
Originally Posted by
lhungil
The 3rd party module installed (sage pay) probably does not use a zen cart page, yet calls application_top. You will probably need to exempt the 3rd party module's call back file manually or turn off automatic redirects.
If you choose to exempt by editing, there was a post earlier in this thread on the subject. The post included which file and where in the file to edit.
Otherwise just turn off automatic redirects (they are only needed if you constantly change you product / category titles - or are migrating an existing store with well established URLs).
The next version will have better support for scripts calling application_top which are not coded as zen cart pages. Not really sure of the logic behind not coding these as zen cart pages (yet calling application_top)... Permanent work around will probably be optional.. Adding an addition file lookup (minor performance hit).
Re: Ultimate SEO 2.200 (new features) [Support Thread]
Quote:
Originally Posted by
lhungil
Having a hard time wrapping my head around exactly what is not working fine... Can you provide a detailed response include what you expect to happen and what is happening?
I should note there is a known bug in 2.212 with the "write a review" button when the "Enter pages to allow rewrite" option is blank. This can be fixed by editing "/includes/classes/seo.url.php". Around line 270 add the line in red:
Code:
case ($page == FILENAME_PRODUCT_REVIEWS_INFO):
$url = $this->make_url($page, $this->get_product_name($p2[1], $cID), 'products_id_review_info', $p2[1], SEO_URL_END, $separator);
break;
case ($page == FILENAME_PRODUCT_REVIEWS_WRITE):
case ($page == FILENAME_DEFAULT):
$container[$p2[0]] = $p2[1];
break;
case ($page == FILENAME_PRODUCT_INFO):
Great! NOw all works fine! Thank you so much!
Re: Ultimate SEO 2.200 (new features) [Support Thread]
Quote:
Originally Posted by
100asa
Great! NOw all works fine! Thank you so much!
No problem. Glad you were able to get things working!
Thank You for the reminder I had not mentioned this specific bug or the fix previously in this thread (and confirming it works).
Re: Ultimate SEO 2.200+ (new features)
Quote:
Originally Posted by
rmfuk
After looking through this forum I have not been able to find the previous thread relating to the fix for the ceon sage pay server payment I frame issue, we have the same issue and have also turned off automatic rewriting but would like to fix the issue and turn the rewriting back on. A link to the thread would be appreciated.
As stated the cause is your 3rd party module is not coded as a Zen Cart page ("pages" on a Zen Cart site which use application_top.php should be coded as a Zen Cart page 98% of the time).
While not specific to "CEON Sage Pay", the options listed in this post about 3rd party modules not integrating as a Zen Cart page (but loading application_top) apply. Not my favorite workaround, but it works.