Zen Cart Logo
Forums / All Other Contributions/Addons / Ultimate SEO v3 (and v2.200) [Support Thread]

Ultimate SEO v3 (and v2.200) [Support Thread]

Views: 427,463

Results 621 to 640 of 1,706
5 Mar 2014, 10:48 PM
#621
numinix avatar

numinix

Totally Zenned

Join Date:
Apr 2007
Location:
Vancouver, Canada
Posts:
1,566
Plugin Contributions:
58

Ultimate SEO v3 (and v2.200) [Support Thread]

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..

<?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.

5 Mar 2014, 11:34 PM
#622
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

lhungil:

Around line 200, try adding an explicit $_sid = null;

    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
    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
        case (zen_not_null($_sid)):

Gonna make this change report back if the error goes away..
5 Mar 2014, 11:59 PM
#623
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

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:

Here's the modified code I used (what I posted earlier was WRONG WRONG WRONG -- it was the original 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'); ?>
11 Mar 2014, 7:00 PM
#624
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

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.

11 Mar 2014, 9:03 PM
#625
lhungil avatar

lhungil

Totally Zenned

Join Date:
Feb 2012
Location:
mostly harmless
Posts:
1,818
Plugin Contributions:
4

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

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:

			// 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:

			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.

11 Mar 2014, 9:09 PM
#626
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

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!

11 Mar 2014, 9:38 PM
#627
rmfuk avatar

rmfuk

New Zenner

Join Date:
Mar 2014
Location:
United Kingdom
Posts:
1
Plugin Contributions:
0

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

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.

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).

12 Mar 2014, 1:56 PM
#628
100asa avatar

100asa

Totally Zenned

Join Date:
Oct 2006
Location:
Italy
Posts:
636
Plugin Contributions:
0

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

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:

					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!
12 Mar 2014, 4:02 PM
#629
lhungil avatar

lhungil

Totally Zenned

Join Date:
Feb 2012
Location:
mostly harmless
Posts:
1,818
Plugin Contributions:
4

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

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).

12 Mar 2014, 4:22 PM
#630
lhungil avatar

lhungil

Totally Zenned

Join Date:
Feb 2012
Location:
mostly harmless
Posts:
1,818
Plugin Contributions:
4

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

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.

22 Mar 2014, 3:18 PM
#631
kevinmc3 avatar

kevinmc3

Totally Zenned

Join Date:
Jun 2006
Posts:
786
Plugin Contributions:
0

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

currently upgrading form 1.39 to 1.5.1

SIMPLE SEO URL is not supported in 1.5.1. However, as most other Zenners know the BIG problem with installing the ULTIMATE SEO URL mod is we will lose all the page URLs currently indexed by Google. a BIG problem . Is there anyway around this, i.e. to maintain current URLs set by SIMPLE SEO URL ? I know there is a paid mod that supposedly redirects the old Simple SEO URLs

22 Mar 2014, 3:28 PM
#632
jeking avatar

jeking

Totally Zenned

Join Date:
Oct 2005
Location:
Chicago, IL USA
Posts:
1,592
Plugin Contributions:
0

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

If you use Ceon URI [http://www.zen-cart.com/downloads.php?do=file&id=889] you can set the url for each product manually to the same url it is now.

23 Mar 2014, 5:38 PM
#633
kevinmc3 avatar

kevinmc3

Totally Zenned

Join Date:
Jun 2006
Posts:
786
Plugin Contributions:
0

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

UPDATE: My web guy just installed Ultimate SEO as part of the 1.5.1 upgrade. Replacing my old Zen Simple SEO. Surprisingly after he installed Ultimate SEO, the URL redirects from Simple SEO appear to have maintained, they are exactly the same..?? I thought Ultimate SEO would not have the same URL redirects created from Simple SEO ?? Per what Ive read in this forum.. Am I missing something?

24 Mar 2014, 3:06 PM
#634
lhungil avatar

lhungil

Totally Zenned

Join Date:
Feb 2012
Location:
mostly harmless
Posts:
1,818
Plugin Contributions:
4

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

This thread is specifically for SUPPORT of Ultimate URLs. Any problems caused by other modules, questions about other modules, or discussion of other modules are best done in either the other module's support thread or by creating a new thread.

> jeking:

If you use Ceon URI [http://www.zen-cart.com/downloads.php?do=file&id=889] you can set the url for each product manually to the same url it is now.
Yes, and there is a support thread for CEON URI.

kevinmc3:

currently upgrading form 1.39 to 1.5.1

SIMPLE SEO URL is not supported in 1.5.1.
...
There is a new re-incarnation of "Simple SEO" for Zen Cart 1.5.x. Have not tried the latest release, so cannot comment on if it is just a rework for Zen Cart 1.5.x or if it also includes much needed bugfixes for "Simple SEO".

kevinmc3:

... However, as most other Zenners know the BIG problem with installing the ULTIMATE SEO URL mod is we will lose all the page URLs currently indexed by Google. ...
This is not a problem caused by Ultimate URLs. The default URLs from Zen Cart AND the alternative ones generated by Ultimate URLs work. Further, Ultimate URLs does not remove Zen Cart parameters from the URL (it just makes them shorter). This allows Ultimate URLs to be completely removed (except for the .htaccess file) without breaking links (especially those from search engines).

I'm not sure the same can be said for the other major alternate URL tools. You would need to check their readme and support threads.

24 Mar 2014, 3:11 PM
#635
lhungil avatar

lhungil

Totally Zenned

Join Date:
Feb 2012
Location:
mostly harmless
Posts:
1,818
Plugin Contributions:
4

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

kevinmc3:

... My web guy just installed Ultimate SEO as part of the 1.5.1 upgrade. Replacing my old Zen Simple SEO. Surprisingly after he installed Ultimate SEO, the URL redirects from Simple SEO appear to have maintained, they are exactly the same. ...
I'd "guess" your "web guy" did not completely remove "Simple SEO"... Possibly portions were left installed to allow the old URLs to continue working... Or manual 301 redirects were added... Or Ultimate URLs is not completely installed (or installed correctly)...

With a link to your site, some example URLs, and some more information (what is listed in admin -> configure)... We may be able to provide more insight... Although your "web guy" may also be able to answer the question for you...

Note: This is a good question (and one I'd investigate further if I was in your shoes). Don't mind these sort of questions, as they may be useful to people who use either module. If you find the cause / effect, I'd suggest posting the the answer to both threads. Adding to the readme of Simple SEO what to do when installing to not lose links would be helpful for people who use that modules... And I'd not be opposed to adding a section "migrating from XXX" to the readme of Ultimate URLs...

24 Mar 2014, 3:17 PM
#636
kevinmc3 avatar

kevinmc3

Totally Zenned

Join Date:
Jun 2006
Posts:
786
Plugin Contributions:
0

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

lhungil:

I'd "guess" your "web guy" did not completely remove "Simple SEO"... Possibly portions were left installed to allow the old URLs to continue working... Or manual 301 redirects were added... Or Ultimate URLs is not completely installed (or installed correctly)...

With a link to your site, some example URLs, and some more information (what is listed in admin -> configure)... We may be able to provide more insight... Although your "web guy" may also be able to answer the question for you...

Note: This is a good question (and one I'd investigate further if I was in your shoes). Don't mind these sort of questions, as they may be useful to people who use either module. If you find the cause / effect, I'd suggest posting the the answer to both threads. Adding to the readme of Simple SEO what to do when installing to not lose links would be helpful for people who use that modules... And I'd not be opposed to adding a section "migrating from XXX" to the readme of Ultimate URLs...

Website ver 1.3.9 is:
https://www.cvtreasures.com

Upgraded 1.5.1 version currently in testing mode is:
http://dipinfotech.co.in/cvtreasures/

Here is an example of product URL :
http://dipinfotech.co.in/cvtreasures/vintage-circus-posters-for-sale-c-84/old-circus-poster-barnum-bailey-vintage-1912-japenese-strongmen-p-2515

24 Mar 2014, 4:21 PM
#637
lhungil avatar

lhungil

Totally Zenned

Join Date:
Feb 2012
Location:
mostly harmless
Posts:
1,818
Plugin Contributions:
4

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

kevinmc3:

Website ver 1.3.9 is:
https://www.cvtreasures.com

Upgraded 1.5.1 version currently in testing mode is:
http://dipinfotech.co.in/cvtreasures/

Here is an example of product URL :
http://dipinfotech.co.in/cvtreasures/vintage-circus-posters-for-sale-c-84/old-circus-poster-barnum-bailey-vintage-1912-japenese-strongmen-p-2515
It appears as though your original 1.3.9h store is actually using Ultimate URLs (not Simple SEO). :smile:

You may want to revisit the "settings" for Ultimate URLs on the new site and tweak them to fit your needs. Not saying there is a "need", but it may be a good time to revisit the settings after an upgrade.

Note: Upgrading to a new version of Zen Cart (following the upgrade documentation) should not cause any problems if both the old and new store are both using Ultimate URLs. Ultimate URLs will automatically handle URLs generated: with different settings (for Ultimate URLs), older versions of Ultimate URLs, and by the native Zen Cart code.

24 Mar 2014, 4:33 PM
#638
kevinmc3 avatar

kevinmc3

Totally Zenned

Join Date:
Jun 2006
Posts:
786
Plugin Contributions:
0

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

lhungil:

It appears as though your original 1.3.9h store is actually using Ultimate URLs (not Simple SEO). :smile:

You may want to revisit the "settings" for Ultimate URLs on the new site and tweak them to fit your needs. Not saying there is a "need", but it may be a good time to revisit the settings after an upgrade.

Note: Upgrading to a new version of Zen Cart (following the upgrade documentation) should not cause any problems if both the old and new store are both using Ultimate URLs. Ultimate URLs will automatically handle URLs generated: with different settings (for Ultimate URLs), older versions of Ultimate URLs, and by the native Zen Cart code.

Old store is definitely using Simple SEO, confirmed in Admin>config

24 Mar 2014, 6:06 PM
#639
lhungil avatar

lhungil

Totally Zenned

Join Date:
Feb 2012
Location:
mostly harmless
Posts:
1,818
Plugin Contributions:
4

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

Simple SEO does not usually add any anchor at the end such as "-p-123" on every link... Are you 100% sure files from both are not installed?

24 Mar 2014, 6:20 PM
#640
lhungil avatar

lhungil

Totally Zenned

Join Date:
Feb 2012
Location:
mostly harmless
Posts:
1,818
Plugin Contributions:
4

Re: Ultimate SEO v3 (and v2.200) [Support Thread]

Hmmm, it appears I may be wrong... Looks like older versions of Simple SEO did use anchors for every link... As they use the same anchors, should be few (if any) problems converting from the older versions of Simple SEO to Ultimate URLs...

If one of the newer versions of Simple SEO (which omit anchors whenever possible) was installed, then additional coding / changes would be necessary.

**Note: **Support for the "news and article manager" add-on was removed from current versions of Ultimate URLs as the 3rd party module does not appear to be actively maintained - or fully compatible with Zen Cart 1.5.x.