Zen Cart Logo
Forums / General Questions / blank pages. Not redirecting.

blank pages. Not redirecting.

Locked

Views: 11,276

Results 1 to 11 of 11
This thread is locked. New replies are disabled.
23 Sep 2008, 10:11 PM
#1
brekke00 avatar

brekke00

New Zenner

Join Date:
Aug 2007
Posts:
57
Plugin Contributions:
0

blank pages. Not redirecting.

Can anyone help me with this problem. 
the problem is that when i log in to a normal customer account i get a blank page. but i get logged in.
it just does not redirrevt back to the site.

the same happends when trying to add a product to cart.
it get added but i am not redirected.


i am grateful for any help i can get.


[23-Sep-2008 13:53:33] PHP Warning:  

Cannot modify header information - headers already sent by (output started at includes/languages/english.php:1401)
 in includes/init_includes/init_templates.php on line 78



here is init_templates.php  


 I have found that if line 143 is like this: 
//include_once(DIR_WS_LANGUAGES .  $_SESSION['language'] . '.php'); it works with redirecting. but now it states define_xxxxx_xxx infront of everything.  

when this is done i get a new error [23-Sep-2008 14:23:17] PHP Warning:  session_regenerate_id() [<a href='function.session-regenerate-id'>function.session-regenerate-id</a>]: Cannot regenerate session id - headers already sent in 
includes/functions/sessions.php on line 167


any advice?

*





<?php

/**

 * initialise template system variables

 * see {@link  http://www.zen-cart.com/wiki/index.php/Developers_API_Tutorials#InitSystem wikitutorials} for more details.

 *

 * Determines current template name for current language, from database<br />

 * Then loads template-specific language file, followed by master/default language file<br />

 * ie: includes/languages/classic/english.php followed by includes/languages/english.php

 *

 * @package initSystem

 * @copyright Copyright 2003-2006 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 $Id: init_templates.php 3123 2006-03-06 23:36:46Z drbyte $

 */

  if (!defined('IS_ADMIN_FLAG')) {

   die('Illegal Access');

  }



/*

 * Determine the active template name

 */

  $template_dir = "";

  $sql = "select template_dir

            from " . TABLE_TEMPLATE_SELECT . "

            where template_language = 0";

  $template_query = $db->Execute($sql);

  $template_dir = $template_query->fields['template_dir'];



  $sql = "select template_dir

            from " . TABLE_TEMPLATE_SELECT . "

            where template_language = '" . $_SESSION['languages_id'] . "'";

  $template_query = $db->Execute($sql);

  if ($template_query->RecordCount() > 0) {

    $template_dir = $template_query->fields['template_dir'];

  }



/**

 * The actual template directory to use

 */

  define('DIR_WS_TEMPLATE', DIR_WS_TEMPLATES . $template_dir . '/');

/**

 * The actual template images directory to use

 */

  define('DIR_WS_TEMPLATE_IMAGES', DIR_WS_TEMPLATE . 'images/');

/**

 * The actual template icons directory to use

 */

  define('DIR_WS_TEMPLATE_ICONS', DIR_WS_TEMPLATE_IMAGES . 'icons/');



/**

 * Load the appropriate Language files, based on the currently-selected template

 */



  if (file_exists(DIR_WS_LANGUAGES . $template_dir . '/' . $_SESSION['language'] . '.php')) {

    $template_dir_select = $template_dir . '/';

  /**

   * include the template language overrides

   */

      include_once(DIR_WS_LANGUAGES . $template_dir_select . $_SESSION['language'] . '.php');

  } else {

    $template_dir_select = '';

      //  include_once(DIR_WS_LANGUAGES . $template_dir_select . $_SESSION['language'] . '.php');

  }

/**

 * include the template language master (to catch all items not defined in the override file).

 * The intent here is to: load the override version to catch preferencial changes; 

 * then load the original/master version to catch any defines that didn't get set into the override version during upgrades, etc.

 */

// THE FOLLOWING MIGHT NEED TO BE DISABLED DUE TO THE EXISTENCE OF function() DECLARATIONS IN MASTER ENGLISH.PHP FILE

// THE FOLLOWING MAY ALSO SEND NUMEROUS ERRORS IF YOU HAVE ERROR_REPORTING ENABLED, DUE TO REPETITION OF SEVERAL DEFINE STATEMENTS

  include_once(DIR_WS_LANGUAGES .  $_SESSION['language'] . '.php');





/**

 * send the content charset "now" so that all content is impacted by it

 */

  header("Content-Type: text/html; charset=" . CHARSET);



/**

 * include the extra language definitions

 */

  include(DIR_WS_MODULES . 'extra_definitions.php');

?>




PHP Warning:  

Cannot modify header information - headers already sent by (output started at includes/languages/english.php:1401) 
in includes/functions/functions_general.php on line 44
23 Sep 2008, 10:16 PM
#2
brekke00 avatar

brekke00

New Zenner

Join Date:
Aug 2007
Posts:
57
Plugin Contributions:
0

Re: blank pages. Not redirecting.

Here is functions_general.php

*

<?php

/**

 * functions_general.php

 * General functions used throughout Zen Cart

 *

 * @package functions

 * @copyright Copyright 2003-2007 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 $Id: functions_general.php 7125 2007-09-29 00:03:01Z ajeh $

 */

if (!defined('IS_ADMIN_FLAG')) {

  die('Illegal Access');

}

/**

 * Stop from parsing any further PHP code

*/

  function zen_exit() {

   session_write_close();

   exit();

  }



/**

 * Redirect to another page or site

 * @param string The url to redirect to

*/

  function zen_redirect($url) {

    global $request_type;

    // Are we loading an SSL page?

    if ( (ENABLE_SSL == true) && ($request_type == 'SSL') ) {

      // yes, but a NONSSL url was supplied

      if (substr($url, 0, strlen(HTTP_SERVER . DIR_WS_CATALOG)) == HTTP_SERVER . DIR_WS_CATALOG) {

        // So, change it to SSL, based on site's configuration for SSL

        $url = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG . substr($url, strlen(HTTP_SERVER . DIR_WS_CATALOG));

      }

    }



  // clean up URL before executing it

    while (strstr($url, '&&')) $url = str_replace('&&', '&', $url);

    while (strstr($url, '&&')) $url = str_replace('&&', '&', $url);

    // header locates should not have the & in the address it breaks things

    while (strstr($url, '&')) $url = str_replace('&', '&', $url);



    header('Location: ' . $url);



    zen_exit();

  }



/**

 * Parse the data used in the html tags to ensure the tags will not break.

 * Basically just an extension to the php strstr function

 * @param string The string to be parsed

 * @param string The needle to find

*/

// Parse the data used in the html tags to ensure the tags will not break

  function zen_parse_input_field_data($data, $parse) {

    return strtr(trim($data), $parse);

  }



/**

 * Returns a string with conversions for security.

 * @param string The string to be parsed

 * @param string contains a string to be translated, otherwise just quote is translated

 * @param boolean Do we run htmlspecialchars over the string

*/

  function zen_output_string($string, $translate = false, $protected = false) {

    if ($protected == true) {

      return htmlspecialchars($string);

    } else {

      if ($translate == false) {

        return zen_parse_input_field_data($string, array('"' => '"'));

      } else {

        return zen_parse_input_field_data($string, $translate);

      }

    }

  }



/**

 * Returns a string with conversions for security.

 *

 * Simply calls the zen_ouput_string function

 * with parameters that run htmlspecialchars over the string

 * and converts quotes to html entities

 *

 * @param string The string to be parsed

*/

  function zen_output_string_protected($string) {

    return zen_output_string($string, false, true);

  }



/**

 * Returns a string with conversions for security.

 *

 * @param string The string to be parsed

*/



  function zen_sanitize_string($string) {

    $string = ereg_replace(' +', ' ', $string);

    return preg_replace("/[<>]/", '_', $string);

  }





/**

 * Break a word in a string if it is longer than a specified length ($len)

 *

 * @param string The string to be broken up

 * @param int The maximum length allowed

 * @param string The character to use at the end of the broken line

*/

  function zen_break_string($string, $len, $break_char = '-') {

    $l = 0;

    $output = '';

    for ($i=0, $n=strlen($string); $i<$n; $i++) {

      $char = substr($string, $i, 1);

      if ($char != ' ') {

        $l++;

      } else {

        $l = 0;

      }

      if ($l > $len) {

        $l = 1;

        $output .= $break_char;

      }

      $output .= $char;

    }



    return $output;

  }



/**

 * Return all HTTP GET variables, except those passed as a parameter

 *

 * The return is a urlencoded string

 *

 * @param mixed either a single or array of parameter names to be excluded from output

*/

// Return all HTTP GET variables, except those passed as a parameter

  function zen_get_all_get_params($exclude_array = '', $search_engine_safe = true) {



    if (!is_array($exclude_array)) $exclude_array = array();



    $get_url = '';

    if (is_array($_GET) && (sizeof($_GET) > 0)) {

      reset($_GET);

      while (list($key, $value) = each($_GET)) {

        if ( (strlen($value) > 0) && ($key != 'main_page') && ($key != zen_session_name()) && ($key != 'error') && (!in_array($key, $exclude_array)) && ($key != 'x') && ($key != 'y') ) {

          if ( (SEARCH_ENGINE_FRIENDLY_URLS == 'true') && ($search_engine_safe == true) ) {

//    die ('here');

            $get_url .= $key . '/' . rawurlencode(stripslashes($value)) . '/';

          } else {

            $get_url .= $key . '=' . rawurlencode(stripslashes($value)) . '&';

          }

        }

      }

    }

    while (strstr($get_url, '&&')) $get_url = str_replace('&&', '&', $get_url);

    while (strstr($get_url, '&&')) $get_url = str_replace('&&', '&', $get_url);



    return $get_url;

  }





////

// Returns the clients browser

  function zen_browser_detect($component) {

    global $HTTP_USER_AGENT;



    return stristr($HTTP_USER_AGENT, $component);

  }





////

// Wrapper function for round()

  function zen_round($number, $precision) {

/// fix rounding error on GVs etc.

    $number = round($number, $precision);



    return $number;

  }





////

// default filler is a 0 or pass filler to be used

  function zen_row_number_format($number, $filler='0') {

    if ( ($number < 10) && (substr($number, 0, 1) != '0') ) $number = $filler . $number;



    return $number;

  }





// Output a raw date string in the selected locale date format

// $raw_date needs to be in this format: YYYY-MM-DD HH:MM:SS

  function zen_date_long($raw_date) {

    if ( ($raw_date == '0001-01-01 00:00:00') || ($raw_date == '') ) return false;



    $year = (int)substr($raw_date, 0, 4);

    $month = (int)substr($raw_date, 5, 2);

    $day = (int)substr($raw_date, 8, 2);

    $hour = (int)substr($raw_date, 11, 2);

    $minute = (int)substr($raw_date, 14, 2);

    $second = (int)substr($raw_date, 17, 2);



    return strftime(DATE_FORMAT_LONG, mktime($hour,$minute,$second,$month,$day,$year));

  }





////

// Output a raw date string in the selected locale date format

// $raw_date needs to be in this format: YYYY-MM-DD HH:MM:SS

// NOTE: Includes a workaround for dates before 01/01/1970 that fail on windows servers

  function zen_date_short($raw_date) {

    if ( ($raw_date == '0001-01-01 00:00:00') || empty($raw_date) ) return false;



    $year = substr($raw_date, 0, 4);

    $month = (int)substr($raw_date, 5, 2);

    $day = (int)substr($raw_date, 8, 2);

    $hour = (int)substr($raw_date, 11, 2);

    $minute = (int)substr($raw_date, 14, 2);

    $second = (int)substr($raw_date, 17, 2);



// error on 1969 only allows for leap year

    if ($year != 1969 && @date('Y', mktime($hour, $minute, $second, $month, $day, $year)) == $year) {

      return date(DATE_FORMAT, mktime($hour, $minute, $second, $month, $day, $year));

    } else {

      return ereg_replace('2037' . '$', $year, date(DATE_FORMAT, mktime($hour, $minute, $second, $month, $day, 2037)));

    }

  }



////

// Parse search string into indivual objects

  function zen_parse_search_string($search_str = '', &$objects) {

    $search_str = trim(strtolower($search_str));



// Break up $search_str on whitespace; quoted string will be reconstructed later

    $pieces = split('[[:space:]]+', $search_str);

    $objects = array();

    $tmpstring = '';

    $flag = '';



    for ($k=0; $k<count($pieces); $k++) {

      while (substr($pieces[$k], 0, 1) == '(') {

        $objects[] = '(';

        if (strlen($pieces[$k]) > 1) {

          $pieces[$k] = substr($pieces[$k], 1);

        } else {

          $pieces[$k] = '';

        }

      }



      $post_objects = array();



      while (substr($pieces[$k], -1) == ')')  {

        $post_objects[] = ')';

        if (strlen($pieces[$k]) > 1) {

          $pieces[$k] = substr($pieces[$k], 0, -1);

        } else {

          $pieces[$k] = '';

        }

      }



// Check individual words



      if ( (substr($pieces[$k], -1) != '"') && (substr($pieces[$k], 0, 1) != '"') ) {

        $objects[] = trim($pieces[$k]);



        for ($j=0; $j<count($post_objects); $j++) {

          $objects[] = $post_objects[$j];

        }

      } else {

/* This means that the $piece is either the beginning or the end of a string.

   So, we'll slurp up the $pieces and stick them together until we get to the

   end of the string or run out of pieces.

*/



// Add this word to the $tmpstring, starting the $tmpstring

        $tmpstring = trim(ereg_replace('"', ' ', $pieces[$k]));



// Check for one possible exception to the rule. That there is a single quoted word.

        if (substr($pieces[$k], -1 ) == '"') {

// Turn the flag off for future iterations

          $flag = 'off';



          $objects[] = trim($pieces[$k]);



          for ($j=0; $j<count($post_objects); $j++) {

            $objects[] = $post_objects[$j];

          }



          unset($tmpstring);



// Stop looking for the end of the string and move onto the next word.

          continue;

        }



// Otherwise, turn on the flag to indicate no quotes have been found attached to this word in the string.

        $flag = 'on';



// Move on to the next word

        $k++;



// Keep reading until the end of the string as long as the $flag is on



        while ( ($flag == 'on') && ($k < count($pieces)) ) {

          while (substr($pieces[$k], -1) == ')') {

            $post_objects[] = ')';

            if (strlen($pieces[$k]) > 1) {

              $pieces[$k] = substr($pieces[$k], 0, -1);

            } else {

              $pieces[$k] = '';

            }

          }



// If the word doesn't end in double quotes, append it to the $tmpstring.

          if (substr($pieces[$k], -1) != '"') {

// Tack this word onto the current string entity

            $tmpstring .= ' ' . $pieces[$k];



// Move on to the next word

            $k++;

            continue;

          } else {

/* If the $piece ends in double quotes, strip the double quotes, tack the

   $piece onto the tail of the string, push the $tmpstring onto the $haves,

   kill the $tmpstring, turn the $flag "off", and return.

*/

            $tmpstring .= ' ' . trim(ereg_replace('"', ' ', $pieces[$k]));



// Push the $tmpstring onto the array of stuff to search for

            $objects[] = trim($tmpstring);



            for ($j=0; $j<count($post_objects); $j++) {

              $objects[] = $post_objects[$j];

            }



            unset($tmpstring);



// Turn off the flag to exit the loop

            $flag = 'off';

          }

        }

      }

    }



// add default logical operators if needed

    $temp = array();

    for($i=0; $i<(count($objects)-1); $i++) {

      $temp[] = $objects[$i];

      if ( ($objects[$i] != 'and') &&

           ($objects[$i] != 'or') &&

           ($objects[$i] != '(') &&

           ($objects[$i+1] != 'and') &&

           ($objects[$i+1] != 'or') &&

           ($objects[$i+1] != ')') ) {

        $temp[] = ADVANCED_SEARCH_DEFAULT_OPERATOR;

      }

    }

    $temp[] = $objects[$i];

    $objects = $temp;



    $keyword_count = 0;

    $operator_count = 0;

    $balance = 0;

    for($i=0; $i<count($objects); $i++) {

      if ($objects[$i] == '(') $balance --;

      if ($objects[$i] == ')') $balance ++;

      if ( ($objects[$i] == 'and') || ($objects[$i] == 'or') ) {

        $operator_count ++;

      } elseif ( ($objects[$i]) && ($objects[$i] != '(') && ($objects[$i] != ')') ) {

        $keyword_count ++;

      }

    }



    if ( ($operator_count < $keyword_count) && ($balance == 0) ) {

      return true;

    } else {

      return false;

    }

  }





////

// Check date

  function zen_checkdate($date_to_check, $format_string, &$date_array) {

    $separator_idx = -1;



    $separators = array('-', ' ', '/', '.');

    $month_abbr = array('jan','feb','mar','apr','may','jun','jul','aug','sep','oct','nov','dec');

    $no_of_days = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);



    $format_string = strtolower($format_string);



    if (strlen($date_to_check) != strlen($format_string)) {

      return false;

    }



    $size = sizeof($separators);

    for ($i=0; $i<$size; $i++) {

      $pos_separator = strpos($date_to_check, $separators[$i]);

      if ($pos_separator != false) {

        $date_separator_idx = $i;

        break;

      }

    }



    for ($i=0; $i<$size; $i++) {

      $pos_separator = strpos($format_string, $separators[$i]);

      if ($pos_separator != false) {

        $format_separator_idx = $i;

        break;

      }

    }



    if ($date_separator_idx != $format_separator_idx) {

      return false;

    }



    if ($date_separator_idx != -1) {

      $format_string_array = explode( $separators[$date_separator_idx], $format_string );

      if (sizeof($format_string_array) != 3) {

        return false;

      }



      $date_to_check_array = explode( $separators[$date_separator_idx], $date_to_check );

      if (sizeof($date_to_check_array) != 3) {

        return false;

      }



      $size = sizeof($format_string_array);

      for ($i=0; $i<$size; $i++) {

        if ($format_string_array[$i] == 'mm' || $format_string_array[$i] == 'mmm') $month = $date_to_check_array[$i];

        if ($format_string_array[$i] == 'dd') $day = $date_to_check_array[$i];

        if ( ($format_string_array[$i] == 'yyyy') || ($format_string_array[$i] == 'aaaa') ) $year = $date_to_check_array[$i];

      }

    } else {

      if (strlen($format_string) == 8 || strlen($format_string) == 9) {

        $pos_month = strpos($format_string, 'mmm');

        if ($pos_month != false) {

          $month = substr( $date_to_check, $pos_month, 3 );

          $size = sizeof($month_abbr);

          for ($i=0; $i<$size; $i++) {

            if ($month == $month_abbr[$i]) {

              $month = $i;

              break;

            }

          }

        } else {

          $month = substr($date_to_check, strpos($format_string, 'mm'), 2);

        }

      } else {

        return false;

      }



      $day = substr($date_to_check, strpos($format_string, 'dd'), 2);

      $year = substr($date_to_check, strpos($format_string, 'yyyy'), 4);

    }



    if (strlen($year) != 4) {

      return false;

    }



    if (!settype($year, 'integer') || !settype($month, 'integer') || !settype($day, 'integer')) {

      return false;

    }



    if ($month > 12 || $month < 1) {

      return false;

    }



    if ($day < 1) {

      return false;

    }



    if (zen_is_leap_year($year)) {

      $no_of_days[1] = 29;

    }



    if ($day > $no_of_days[$month - 1]) {

      return false;

    }



    $date_array = array($year, $month, $day);



    return true;

  }





////

// Check if year is a leap year

  function zen_is_leap_year($year) {

    if ($year % 100 == 0) {

      if ($year % 400 == 0) return true;

    } else {

      if (($year % 4) == 0) return true;

    }



    return false;

  }



////

// Return table heading with sorting capabilities

  function zen_create_sort_heading($sortby, $colnum, $heading) {

    global $PHP_SELF;



    $sort_prefix = '';

    $sort_suffix = '';



    if ($sortby) {

      $sort_prefix = '<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('page', 'info', 'sort')) . 'page=1&sort=' . $colnum . ($sortby == $colnum . 'a' ? 'd' : 'a')) . '" title="' . zen_output_string(TEXT_SORT_PRODUCTS . ($sortby == $colnum . 'd' || substr($sortby, 0, 1) != $colnum ? TEXT_ASCENDINGLY : TEXT_DESCENDINGLY) . TEXT_BY . $heading) . '" class="productListing-heading">' ;

      $sort_suffix = (substr($sortby, 0, 1) == $colnum ? (substr($sortby, 1, 1) == 'a' ? PRODUCT_LIST_SORT_ORDER_ASCENDING : PRODUCT_LIST_SORT_ORDER_DESCENDING) : '') . '</a>';

    }



    return $sort_prefix . $heading . $sort_suffix;

  }





////

// Return a product ID with attributes

/*

  function zen_get_uprid_OLD($prid, $params) {

    $uprid = $prid;

    if ( (is_array($params)) && (!strstr($prid, '{')) ) {

      while (list($option, $value) = each($params)) {

        $uprid = $uprid . '{' . $option . '}' . $value;

      }

    }



    return $uprid;

  }

*/





////

// Return a product ID with attributes

  function zen_get_uprid($prid, $params) {

//print_r($params);

    $uprid = $prid;

    if ( (is_array($params)) && (!strstr($prid, ':')) ) {

      while (list($option, $value) = each($params)) {

        if (is_array($value)) {

          while (list($opt, $val) = each($value)) {

            $uprid = $uprid . '{' . $option . '}' . trim($opt);

          }

          break;

        }

        //CLR 030714 Add processing around $value. This is needed for text attributes.

        $uprid = $uprid . '{' . $option . '}' . trim($value);

      }

    //CLR 030228 Add else stmt to process product ids passed in by other routines.

      $md_uprid = '';



      $md_uprid = md5($uprid);

      return $prid . ':' . $md_uprid;

    } else {

      return $prid;

    }

  }





////

// Return a product ID from a product ID with attributes

  function zen_get_prid($uprid) {

    $pieces = explode(':', $uprid);



    return $pieces[0];

  }







////

// Get the number of times a word/character is present in a string

  function zen_word_count($string, $needle) {

    $temp_array = split($needle, $string);



    return sizeof($temp_array);

  }





////

  function zen_count_modules($modules = '') {

    $count = 0;



    if (empty($modules)) return $count;



    $modules_array = split(';', $modules);



    for ($i=0, $n=sizeof($modules_array); $i<$n; $i++) {

      $class = substr($modules_array[$i], 0, strrpos($modules_array[$i], '.'));



      if (is_object($GLOBALS[$class])) {

        if ($GLOBALS[$class]->enabled) {

          $count++;

        }

      }

    }



    return $count;

  }



////

  function zen_count_payment_modules() {

    return zen_count_modules(MODULE_PAYMENT_INSTALLED);

  }



////

  function zen_count_shipping_modules() {

    return zen_count_modules(MODULE_SHIPPING_INSTALLED);

  }
23 Sep 2008, 10:18 PM
#3
brekke00 avatar

brekke00

New Zenner

Join Date:
Aug 2007
Posts:
57
Plugin Contributions:
0

Re: blank pages. Not redirecting.

////

  function zen_create_random_value($length, $type = 'mixed') {

    if ( ($type != 'mixed') && ($type != 'chars') && ($type != 'digits')) return false;



    $rand_value = '';

    while (strlen($rand_value) < $length) {

      if ($type == 'digits') {

        $char = zen_rand(0,9);

      } else {

        $char = chr(zen_rand(0,255));

      }

      if ($type == 'mixed') {

        if (eregi('^[a-z0-9]$', $char)) $rand_value .= $char;

      } elseif ($type == 'chars') {

        if (eregi('^[a-z]$', $char)) $rand_value .= $char;

      } elseif ($type == 'digits') {

        if (ereg('^[0-9]$', $char)) $rand_value .= $char;

      }

    }



    return $rand_value;

  }



////

  function zen_array_to_string($array, $exclude = '', $equals = '=', $separator = '&') {

    if (!is_array($exclude)) $exclude = array();

    if (!is_array($array)) $array = array();



    $get_string = '';

    if (sizeof($array) > 0) {

      while (list($key, $value) = each($array)) {

        if ( (!in_array($key, $exclude)) && ($key != 'x') && ($key != 'y') ) {

          $get_string .= $key . $equals . $value . $separator;

        }

      }

      $remove_chars = strlen($separator);

      $get_string = substr($get_string, 0, -$remove_chars);

    }



    return $get_string;

  }



////

  function zen_not_null($value) {

    if (is_array($value)) {

      if (sizeof($value) > 0) {

        return true;

      } else {

        return false;

      }

    } elseif( is_a( $value, 'queryFactoryResult' ) ) {

      if (sizeof($value->result) > 0) {

        return true;

      } else {

        return false;

      }

    } else {

      if (($value != '') && (strtolower($value) != 'null') && (strlen(trim($value)) > 0)) {

        return true;

      } else {

        return false;

      }

    }

  }





////

// Checks to see if the currency code exists as a currency

// TABLES: currencies

  function zen_currency_exists($code, $getFirstDefault = false) {

    global $db;

    $code = zen_db_prepare_input($code);



    $currency_code = "select code

                      from " . TABLE_CURRENCIES . "

                      where code = '" . zen_db_input($code) . "' LIMIT 1";



    $currency_first = "select code

                      from " . TABLE_CURRENCIES . "

                      order by value ASC LIMIT 1";



    $currency = $db->Execute(($getFirstDefault == false) ? $currency_code : $currency_first);



    if ($currency->RecordCount()) {

      return strtoupper($currency->fields['code']);

    } else {

      return false;

    }

  }



////

  function zen_string_to_int($string) {

    return (int)$string;

  }



////

// Return a random value

  function zen_rand($min = null, $max = null) {

    static $seeded;



    if (!isset($seeded)) {

      mt_srand((double)microtime()*1000000);

      $seeded = true;

    }



    if (isset($min) && isset($max)) {

      if ($min >= $max) {

        return $min;

      } else {

        return mt_rand($min, $max);

      }

    } else {

      return mt_rand();

    }

  }



////

  function zen_get_top_level_domain($url) {

    if (strpos($url, '://')) {

      $url = parse_url($url);

      $url = $url['host'];

    }

//echo $url;



    $domain_array = explode('.', $url);

    $domain_size = sizeof($domain_array);

    if ($domain_size > 1) {

      if (SESSION_USE_FQDN == 'True') return $url;

      if (is_numeric($domain_array[$domain_size-2]) && is_numeric($domain_array[$domain_size-1])) {

        return false;

      } else {

        if ($domain_size > 3) {

          return $domain_array[$domain_size-3] . '.' . $domain_array[$domain_size-2] . '.' . $domain_array[$domain_size-1];

        } else {

          return $domain_array[$domain_size-2] . '.' . $domain_array[$domain_size-1];

        }

      }

    } else {

      return false;

    }

  }



////

  function zen_setcookie($name, $value = '', $expire = 0, $path = '/', $domain = '', $secure = 0) {

    setcookie($name, $value, $expire, $path, $domain, $secure);

  }



////

  function zen_get_ip_address() {

    if (isset($_SERVER)) {

      if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {

        $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];

      } elseif (isset($_SERVER['HTTP_CLIENT_IP'])) {

        $ip = $_SERVER['HTTP_CLIENT_IP'];

      } else {

        $ip = $_SERVER['REMOTE_ADDR'];

      }

    } else {

      if (getenv('HTTP_X_FORWARDED_FOR')) {

        $ip = getenv('HTTP_X_FORWARDED_FOR');

      } elseif (getenv('HTTP_CLIENT_IP')) {

        $ip = getenv('HTTP_CLIENT_IP');

      } else {

        $ip = getenv('REMOTE_ADDR');

      }

    }



    return $ip;

  }





// nl2br() prior PHP 4.2.0 did not convert linefeeds on all OSs (it only converted \n)

  function zen_convert_linefeeds($from, $to, $string) {

    if ((PHP_VERSION < "4.0.5") && is_array($from)) {

      return ereg_replace('(' . implode('|', $from) . ')', $to, $string);

    } else {

      return str_replace($from, $to, $string);

    }

  }





////

  function is_product_valid($product_id, $coupon_id) {

    global $db;

    $coupons_query = "SELECT * FROM " . TABLE_COUPON_RESTRICT . "

                      WHERE coupon_id = '" . (int)$coupon_id . "'

                      ORDER BY coupon_restrict ASC";



    $coupons = $db->Execute($coupons_query);



    $product_query = "SELECT products_model FROM " . TABLE_PRODUCTS . "

                      WHERE products_id = '" . (int)$product_id . "'";



    $product = $db->Execute($product_query);



    if (ereg('^GIFT', $product->fields['products_model'])) {

      return false;

    }



// modified to manage restrictions better - leave commented for now

    if ($coupons->RecordCount() == 0) return true;

    if ($coupons->RecordCount() == 1) {

// If product is restricted(deny) and is same as tested prodcut deny

      if (($coupons->fields['product_id'] != 0) && $coupons->fields['product_id'] == (int)$product_id && $coupons->fields['coupon_restrict']=='Y') return false;

// If product is not restricted(allow) and is not same as tested prodcut deny

      if (($coupons->fields['product_id'] != 0) && $coupons->fields['product_id'] != (int)$product_id && $coupons->fields['coupon_restrict']=='N') return false;

// if category is restricted(deny) and product in category deny

      if (($coupons->fields['category_id'] !=0) && (zen_product_in_category($product_id, $coupons->fields['category_id'])) && ($coupons->fields['coupon_restrict']=='Y')) return false;

// if category is not restricted(allow) and product not in category deny

      if (($coupons->fields['category_id'] !=0) && (!zen_product_in_category($product_id, $coupons->fields['category_id'])) && ($coupons->fields['coupon_restrict']=='N')) return false;

      return true;

    }

    $allow_for_category = validate_for_category($product_id, $coupon_id);

    $allow_for_product = validate_for_product($product_id, $coupon_id);

//    echo '#'.$product_id . '#' . $allow_for_category;

//    echo '#'.$product_id . '#' . $allow_for_product;

    if ($allow_for_category == 'none') {

      if ($allow_for_product === 'none') return true;

      if ($allow_for_product === true) return true;

      if ($allow_for_product === false) return false;

    }

    if ($allow_for_category === true) {

      if ($allow_for_product === 'none') return true;

      if ($allow_for_product === true) return true;

      if ($allow_for_product === false) return false;

    }

    if ($allow_for_category === false) {

      if ($allow_for_product === 'none') return false;

      if ($allow_for_product === true) return true;

      if ($allow_for_product === false) return false;

    }

    return false; //should never get here

  }

  function validate_for_category($product_id, $coupon_id) {

    global $db;

    $retVal = 'none';

    $productCatPath = zen_get_product_path($product_id);

    $catPathArray = array_reverse(explode('_', $productCatPath));

    $sql = "SELECT count(*) AS total

            FROM " . TABLE_COUPON_RESTRICT . "

            WHERE category_id = -1

            AND coupon_restrict = 'Y'";

    $checkQuery = $db->execute($sql);

    foreach ($catPathArray as $catPath) {

      $sql = "SELECT * FROM " . TABLE_COUPON_RESTRICT . "

              WHERE category_id = " . (int)$catPath . "

              AND coupon_id = " . (int)$coupon_id;

      $result = $db->execute($sql);

      if ($result->recordCount() > 0 && $result->fields['coupon_restrict'] == 'N') return true;

      if ($result->recordCount() > 0 && $result->fields['coupon_restrict'] == 'Y') return false;

    }

    if ($checkQuery->fields['total'] > 0) {

      return false;

    } else {

      return 'none';

    }

  }

  function validate_for_product($product_id, $coupon_id) {

    global $db;

    $sql = "SELECT * FROM " . TABLE_COUPON_RESTRICT . "

            WHERE product_id = " . (int)$product_id . "

            AND coupon_id = " . (int)$coupon_id . " LIMIT 1";

    $result = $db->execute($sql);

    if ($result->recordCount() > 0) {

      if ($result->fields['coupon_restrict'] == 'N') return true;

      if ($result->fields['coupon_restrict'] == 'Y') return false;

    } else {

      return 'none';

    }

  }



////

  function zen_db_input($string) {

    return addslashes($string);

  }



////

  function zen_db_prepare_input($string) {

    if (is_string($string)) {

      return trim(zen_sanitize_string(stripslashes($string)));

    } elseif (is_array($string)) {

      reset($string);

      while (list($key, $value) = each($string)) {

        $string[$key] = zen_db_prepare_input($value);

      }

      return $string;

    } else {

      return $string;

    }

  }



////

  function zen_db_perform($table, $data, $action = 'insert', $parameters = '', $link = 'db_link') {

    global $db;

    reset($data);

    if (strtolower($action) == 'insert') {

      $query = 'INSERT INTO ' . $table . ' (';

      while (list($columns, ) = each($data)) {

        $query .= $columns . ', ';

      }

      $query = substr($query, 0, -2) . ') VALUES (';

      reset($data);

      while (list(, $value) = each($data)) {

        switch ((string)$value) {

          case 'now()':

            $query .= 'now(), ';

            break;

          case 'null':

            $query .= 'null, ';

            break;

          default:

            $query .= '\'' . zen_db_input($value) . '\', ';

            break;

        }

      }

      $query = substr($query, 0, -2) . ')';

    } elseif (strtolower($action) == 'update') {

      $query = 'UPDATE ' . $table . ' SET ';

      while (list($columns, $value) = each($data)) {

        switch ((string)$value) {

          case 'now()':

            $query .= $columns . ' = now(), ';

            break;

          case 'null':

            $query .= $columns .= ' = null, ';

            break;

          default:

            $query .= $columns . ' = \'' . zen_db_input($value) . '\', ';

            break;

        }

      }

      $query = substr($query, 0, -2) . ' WHERE ' . $parameters;

    }



    return $db->Execute($query);

  }



////

  function zen_db_output($string) {

    return htmlspecialchars($string);

  }





// function to return field type

// uses $tbl = table name, $fld = field name



  function zen_field_type($tbl, $fld) {

    global $db;

    $rs = $db->MetaColumns($tbl);

    $type = $rs[strtoupper($fld)]->type;

    return $type;

  }



// function to return field length

// uses $tbl = table name, $fld = field name

  function zen_field_length($tbl, $fld) {

    global $db;

    $rs = $db->MetaColumns($tbl);

    $length = $rs[strtoupper($fld)]->max_length;

    return $length;

  }



////

// return the size and maxlength settings in the form size="blah" maxlength="blah" based on maximum size being 70

// uses $tbl = table name, $fld = field name

// example: zen_set_field_length(TABLE_CATEGORIES_DESCRIPTION, 'categories_name')

  function zen_set_field_length($tbl, $fld, $max=70) {

    $field_length= zen_field_length($tbl, $fld);

    switch (true) {

      case ($field_length > $max):

        $length= 'size = "' . ($max+1) . '" maxlength= "' . $field_length . '"';

        break;

      default:

        $length= 'size = "' . ($field_length+1) . '" maxlength = "' . $field_length . '"';

        break;

    }

    return $length;

  }





////

// Set back button

  function zen_back_link() {

    if (sizeof($_SESSION['navigation']->path)-2 > 0) {

      $back = sizeof($_SESSION['navigation']->path)-2;

      $link = '<a href="' . zen_href_link($_SESSION['navigation']->path[$back]['page'], zen_array_to_string($_SESSION['navigation']->path[$back]['get'], array('action')), $_SESSION['navigation']->path[$back]['mode']) . '">';

    } else {

      if (isset($_SERVER['HTTP_REFERER']) && strstr(HTTP_SERVER, $_SERVER['HTTP_REFERER'])) {

        $link= $_SERVER['HTTP_REFERER'];

      } else {

        $link = '<a href="' . zen_href_link(FILENAME_DEFAULT) . '">';

      }

      $_SESSION['navigation'] = new navigationHistory;

    }

    return $link;

  }





////

// Set back link only

  function zen_back_link_only($link_only = false) {

    if (sizeof($_SESSION['navigation']->path)-2 > 0) {

      $back = sizeof($_SESSION['navigation']->path)-2;

      $link = zen_href_link($_SESSION['navigation']->path[$back]['page'], zen_array_to_string($_SESSION['navigation']->path[$back]['get'], array('action')), $_SESSION['navigation']->path[$back]['mode']);

    } else {

      if (strstr(HTTP_SERVER, $_SERVER['HTTP_REFERER'])) {

        $link= $_SERVER['HTTP_REFERER'];

      } else {

        $link = zen_href_link(FILENAME_DEFAULT);

      }

      $_SESSION['navigation'] = new navigationHistory;

    }



    if ($link_only == true) {

      return $link;

    } else {

      return '<a href="' . $link . '">';

    }

  }



////

// Return a random row from a database query

  function zen_random_select($query) {

    global $db;

    $random_product = '';

    $random_query = $db->Execute($query);

    $num_rows = $random_query->RecordCount();

    if ($num_rows > 1) {

      $random_row = zen_rand(0, ($num_rows - 1));

      $random_query->Move($random_row);

    }

    return $random_query;

  }





////

// Truncate a string

  function zen_trunc_string($str = "", $len = 150, $more = 'true') {

    if ($str == "") return $str;

    if (is_array($str)) return $str;

    $str = trim($str);

    // if it's les than the size given, then return it

    if (strlen($str) <= $len) return $str;

    // else get that size of text

    $str = substr($str, 0, $len);

    // backtrack to the end of a word

    if ($str != "") {

      // check to see if there are any spaces left

      if (!substr_count($str , " ")) {

        if ($more == 'true') $str .= "...";

        return $str;

      }

      // backtrack

      while(strlen($str) && ($str[strlen($str)-1] != " ")) {

        $str = substr($str, 0, -1);

      }

      $str = substr($str, 0, -1);

      if ($more == 'true') $str .= "...";

      if ($more != 'true' and $more != 'false') $str .= $more;

    }

    return $str;

  }







////

// set current box id

  function zen_get_box_id($box_id) {

    while (strstr($box_id, '_')) $box_id = str_replace('_', '', $box_id);

    $box_id = str_replace('.php', '', $box_id);

    return $box_id;

  }





////

// Switch buy now button based on call for price sold out etc.

  function zen_get_buy_now_button($product_id, $link, $additional_link = false) {

    global $db;



// show case only superceeds all other settings

    if (STORE_STATUS != '0') {

      return '<a href="' . zen_href_link(FILENAME_CONTACT_US) . '">' .  TEXT_SHOWCASE_ONLY . '</a>';

    }



// 0 = normal shopping

// 1 = Login to shop

// 2 = Can browse but no prices

    // verify display of prices

      switch (true) {

        case (CUSTOMERS_APPROVAL == '1' and $_SESSION['customer_id'] == ''):

        // customer must be logged in to browse

        $login_for_price = '<a href="' . zen_href_link(FILENAME_LOGIN, '', 'SSL') . '">' .  TEXT_LOGIN_FOR_PRICE_BUTTON_REPLACE . '</a>';

        return $login_for_price;

        break;

        case (CUSTOMERS_APPROVAL == '2' and $_SESSION['customer_id'] == ''):

        if (TEXT_LOGIN_FOR_PRICE_PRICE == '') {

          // show room only

          return TEXT_LOGIN_FOR_PRICE_BUTTON_REPLACE;

        } else {

          // customer may browse but no prices

          $login_for_price = '<a href="' . zen_href_link(FILENAME_LOGIN, '', 'SSL') . '">' .  TEXT_LOGIN_FOR_PRICE_BUTTON_REPLACE . '</a>';

        }

        return $login_for_price;

        break;

        // show room only

        case (CUSTOMERS_APPROVAL == '3'):

          $login_for_price = TEXT_LOGIN_FOR_PRICE_BUTTON_REPLACE_SHOWROOM;

          return $login_for_price;

        break;

        case ((CUSTOMERS_APPROVAL_AUTHORIZATION != '0' and CUSTOMERS_APPROVAL_AUTHORIZATION != '3') and $_SESSION['customer_id'] == ''):

        // customer must be logged in to browse

        $login_for_price = TEXT_AUTHORIZATION_PENDING_BUTTON_REPLACE;

        return $login_for_price;

        break;

        case ((CUSTOMERS_APPROVAL_AUTHORIZATION == '3') and $_SESSION['customer_id'] == ''):

        // customer must be logged in and approved to add to cart

        $login_for_price = '<a href="' . zen_href_link(FILENAME_LOGIN, '', 'SSL') . '">' .  TEXT_LOGIN_TO_SHOP_BUTTON_REPLACE . '</a>';

        return $login_for_price;

        break;

        case (CUSTOMERS_APPROVAL_AUTHORIZATION != '0' and $_SESSION['customers_authorization'] > '0'):

        // customer must be logged in to browse

        $login_for_price = TEXT_AUTHORIZATION_PENDING_BUTTON_REPLACE;

        return $login_for_price;

        break;

        default:

        // proceed normally

        break;

      }



    $button_check = $db->Execute("select product_is_call, products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . (int)$product_id . "'");

    switch (true) {

// cannot be added to the cart

    case (zen_get_products_allow_add_to_cart($product_id) == 'N'):

  
?>
23 Sep 2008, 10:19 PM
#4
brekke00 avatar

brekke00

New Zenner

Join Date:
Aug 2007
Posts:
57
Plugin Contributions:
0

Re: blank pages. Not redirecting.

     return $additional_link;

      break;

    case ($button_check->fields['product_is_call'] == '1'):

      $return_button = '<a href="' . zen_href_link(FILENAME_CONTACT_US) . '">' . TEXT_CALL_FOR_PRICE . '</a>';

      break;

    case ($button_check->fields['products_quantity'] <= 0 and SHOW_PRODUCTS_SOLD_OUT_IMAGE == '1'):

      if ($_GET['main_page'] == zen_get_info_page($product_id)) {

        $return_button = zen_image_button(BUTTON_IMAGE_SOLD_OUT, BUTTON_SOLD_OUT_ALT);

      } else {

        $return_button = zen_image_button(BUTTON_IMAGE_SOLD_OUT_SMALL, BUTTON_SOLD_OUT_SMALL_ALT);

      }

      break;

    default:

      $return_button = $link;

      break;

    }

    if ($return_button != $link and $additional_link != false) {

      return $additional_link . '<br />' . $return_button;

    } else {

      return $return_button;

    }

  }





////

// enable shipping

  function zen_get_shipping_enabled($shipping_module) {

    global $PHP_SELF, $cart, $order;



    // for admin always true if installed

    if (strstr($PHP_SELF, FILENAME_MODULES)) {

      return true;

    }



    $check_cart_free = $_SESSION['cart']->in_cart_check('product_is_always_free_shipping','1');

    $check_cart_cnt = $_SESSION['cart']->count_contents();

    $check_cart_weight = $_SESSION['cart']->show_weight();



    switch(true) {

      // for admin always true if installed

      case (strstr($PHP_SELF, FILENAME_MODULES)):

        return true;

        break;

      // Free Shipping when 0 weight - enable freeshipper - ORDER_WEIGHT_ZERO_STATUS must be on

      case (ORDER_WEIGHT_ZERO_STATUS == '1' and ($check_cart_weight == 0 and $shipping_module == 'freeshipper')):

        return true;

        break;

      // Free Shipping when 0 weight - disable everyone - ORDER_WEIGHT_ZERO_STATUS must be on

      case (ORDER_WEIGHT_ZERO_STATUS == '1' and ($check_cart_weight == 0 and $shipping_module != 'freeshipper')):

        return false;

        break;

      case (($_SESSION['cart']->free_shipping_items() == $check_cart_cnt) and $shipping_module == 'freeshipper'):

        return true;

        break;

      case (($_SESSION['cart']->free_shipping_items() == $check_cart_cnt) and $shipping_module != 'freeshipper'):

        return false;

        break;

      // Always free shipping only true - enable freeshipper

      case (($check_cart_free == $check_cart_cnt) and $shipping_module == 'freeshipper'):

        return true;

        break;

      // Always free shipping only true - disable everyone

      case (($check_cart_free == $check_cart_cnt) and $shipping_module != 'freeshipper'):

        return false;

        break;

      // Always free shipping only is false - disable freeshipper

      case (($check_cart_free != $check_cart_cnt) and $shipping_module == 'freeshipper'):

        return false;

        break;

      default:

        return true;

        break;

    }

  }





////

  function zen_html_entity_decode($given_html, $quote_style = ENT_QUOTES) {

    $trans_table = array_flip(get_html_translation_table( HTML_SPECIALCHARS, $quote_style ));

    $trans_table['''] = "'";

    return ( strtr( $given_html, $trans_table ) );

  }



////

//CLR 030228 Add function zen_decode_specialchars

// Decode string encoded with htmlspecialchars()

  function zen_decode_specialchars($string){

    $string=str_replace('>', '>', $string);

    $string=str_replace('<', '<', $string);

    $string=str_replace(''', "'", $string);

    $string=str_replace('"', "\"", $string);

    $string=str_replace('&', '&', $string);



    return $string;

  }



////

// remove common HTML from text for display as paragraph

  function zen_clean_html($clean_it, $extraTags = '') {

    if (!is_array($extraTags)) $extraTags = array($extraTags);



    $clean_it = preg_replace('/\r/', ' ', $clean_it);

    $clean_it = preg_replace('/\t/', ' ', $clean_it);

    $clean_it = preg_replace('/\n/', ' ', $clean_it);



    $clean_it= nl2br($clean_it);



// update breaks with a space for text displays in all listings with descriptions

    while (strstr($clean_it, '<br>'))   $clean_it = str_replace('<br>',   ' ', $clean_it);

    while (strstr($clean_it, '<br />')) $clean_it = str_replace('<br />', ' ', $clean_it);

    while (strstr($clean_it, '<br/>'))  $clean_it = str_replace('<br/>',  ' ', $clean_it);

    while (strstr($clean_it, '<p>'))    $clean_it = str_replace('<p>',    ' ', $clean_it);

    while (strstr($clean_it, '</p>'))   $clean_it = str_replace('</p>',   ' ', $clean_it);



// temporary fix more for reviews than anything else

    while (strstr($clean_it, '<span class="smallText">')) $clean_it = str_replace('<span class="smallText">', ' ', $clean_it);

    while (strstr($clean_it, '</span>')) $clean_it = str_replace('</span>', ' ', $clean_it);



// clean general and specific tags:

    $taglist = array('strong','b','u','i','em');

    $taglist = array_merge($taglist, (is_array($extraTags) ? $extraTags : array($extraTags)));

    foreach ($taglist as $tofind) {

      if ($tofind != '') $clean_it = preg_replace("/<[\/\!]*?" . $tofind . "[^<>]*?>/si", ' ', $clean_it);

    }



// remove any double-spaces created by cleanups:

    while (strstr($clean_it, '  ')) $clean_it = str_replace('  ', ' ', $clean_it);



// remove other html code to prevent problems on display of text

    $clean_it = strip_tags($clean_it);

    return $clean_it;

  }





////

// find module directory

// include template specific immediate /modules files

// new_products, products_new_listing, featured_products, featured_products_listing, product_listing, specials_index, upcoming,

// products_all_listing, products_discount_prices, also_purchased_products

  function zen_get_module_directory($check_file, $dir_only = 'false') {

    global $template_dir;



    $zv_filename = $check_file;

    if (!strstr($zv_filename, '.php')) $zv_filename .= '.php';



    if (file_exists(DIR_WS_MODULES . $template_dir . '/' . $zv_filename)) {

      $template_dir_select = $template_dir . '/';

    } else {

      $template_dir_select = '';

    }



    if ($dir_only == 'true') {

      return $template_dir_select;

    } else {

      return $template_dir_select . $zv_filename;

    }

  }





////

// find template or default file

  function zen_get_file_directory($check_directory, $check_file, $dir_only = 'false') {

    global $template_dir;



    $zv_filename = $check_file;

    if (!strstr($zv_filename, '.php')) $zv_filename .= '.php';



    if (file_exists($check_directory . $template_dir . '/' . $zv_filename)) {

      $zv_directory = $check_directory . $template_dir . '/';

    } else {

      $zv_directory = $check_directory;

    }



    if ($dir_only == 'true') {

      return $zv_directory;

    } else {

      return $zv_directory . $zv_filename;

    }

  }



// check to see if database stored GET terms are in the URL as $_GET parameters

  function zen_check_url_get_terms() {

    global $db;

    $zp_sql = "select * from " . TABLE_GET_TERMS_TO_FILTER;

    $zp_filter_terms = $db->Execute($zp_sql);

    $zp_result = false;

    while (!$zp_filter_terms->EOF) {

      if (isset($_GET[$zp_filter_terms->fields['get_term_name']]) && zen_not_null($_GET[$zp_filter_terms->fields['get_term_name']])) $zp_result = true;

      $zp_filter_terms->MoveNext();

    }

    return $zp_result;

  }



// replacement for fmod to manage values < 1

  function fmod_round($x, $y) {

    $x = strval($x);

    $y = strval($y);

    $zc_round = ($x*1000)/($y*1000);

    $zc_round_ceil = (int)($zc_round);

    $multiplier = $zc_round_ceil * $y;

    $results = abs(round($x - $multiplier, 6));

     return $results;

  }



////

// return truncated paragraph

  function zen_truncate_paragraph($paragraph, $size = 100, $word = ' ') {

    $zv_paragraph = "";

    $word = explode(" ", $paragraph);

    $zv_total = count($word);

    if ($zv_total > $size) {

      for ($x=0; $x < $size; $x++) {

        $zv_paragraph = $zv_paragraph . $word[$x] . " ";

      }

      $zv_paragraph = trim($zv_paragraph);

    } else {

      $zv_paragraph = trim($paragraph);

    }

    return $zv_paragraph;

  }







/**

 * return an array with zones defined for the specified country

 */

  function zen_get_country_zones($country_id) {

    global $db;

    $zones_array = array();

    $zones = $db->Execute("select zone_id, zone_name

                           from " . TABLE_ZONES . "

                           where zone_country_id = '" . (int)$country_id . "'

                           order by zone_name");

    while (!$zones->EOF) {

      $zones_array[] = array('id' => $zones->fields['zone_id'],

                             'text' => $zones->fields['zone_name']);

      $zones->MoveNext();

    }



    return $zones_array;

  }



/**

 * return an array with country names and matching zones to be used in pulldown menus

 */

  function zen_prepare_country_zones_pull_down($country_id = '') {

// preset the width of the drop-down for Netscape

    $pre = '';

    if ( (!zen_browser_detect('MSIE')) && (zen_browser_detect('Mozilla/4')) ) {

      for ($i=0; $i<45; $i++) $pre .= ' ';

    }



    $zones = zen_get_country_zones($country_id);



    if (sizeof($zones) > 0) {

      $zones_select = array(array('id' => '', 'text' => PLEASE_SELECT));

      $zones = array_merge($zones_select, $zones);

    } else {

      $zones = array(array('id' => '', 'text' => TYPE_BELOW));

// create dummy options for Netscape to preset the height of the drop-down

      if ( (!zen_browser_detect('MSIE')) && (zen_browser_detect('Mozilla/4')) ) {

        for ($i=0; $i<9; $i++) {

          $zones[] = array('id' => '', 'text' => $pre);

        }

      }

    }



    return $zones;

  }



/**

 * supplies javascript to dynamically update the states/provinces list when the country is changed

 * TABLES: zones

 *

 * return string

 */

  function zen_js_zone_list($country, $form, $field) {

    global $db;

    $countries = $db->Execute("select distinct zone_country_id

                               from " . TABLE_ZONES . "

                               order by zone_country_id");

    $num_country = 1;

    $output_string = '';

    while (!$countries->EOF) {

      if ($num_country == 1) {

        $output_string .= '  if (' . $country . ' == "' . $countries->fields['zone_country_id'] . '") {' . "\n";

      } else {

        $output_string .= '  } else if (' . $country . ' == "' . $countries->fields['zone_country_id'] . '") {' . "\n";

      }



      $states = $db->Execute("select zone_name, zone_id

                              from " . TABLE_ZONES . "

                              where zone_country_id = '" . $countries->fields['zone_country_id'] . "'

                              order by zone_name");

      $num_state = 1;

      while (!$states->EOF) {

        if ($num_state == '1') $output_string .= '    ' . $form . '.' . $field . '.options[0] = new Option("' . PLEASE_SELECT . '", "");' . "\n";

        $output_string .= '    ' . $form . '.' . $field . '.options[' . $num_state . '] = new Option("' . $states->fields['zone_name'] . '", "' . $states->fields['zone_id'] . '");' . "\n";

        $num_state++;

        $states->MoveNext();

      }

      $num_country++;

      $countries->MoveNext();

      $output_string .= '    hideStateField(' . $form . ');' . "\n" ;

    }

    $output_string .= '  } else {' . "\n" .

                      '    ' . $form . '.' . $field . '.options[0] = new Option("' . TYPE_BELOW . '", "");' . "\n" .

                      '    showStateField(' . $form . ');' . "\n" .

                      '  }' . "\n";

    return $output_string;

  }







////

// compute the days between two dates

  function date_diff($date1, $date2) {

  //$date1  today, or any other day

  //$date2  date to check against



    $d1 = explode("-", $date1);

    $y1 = $d1[0];

    $m1 = $d1[1];

    $d1 = $d1[2];



    $d2 = explode("-", $date2);

    $y2 = $d2[0];

    $m2 = $d2[1];

    $d2 = $d2[2];



    $date1_set = mktime(0,0,0, $m1, $d1, $y1);

    $date2_set = mktime(0,0,0, $m2, $d2, $y2);



    return(round(($date2_set-$date1_set)/(60*60*24)));

  }





/**

 * strip out accented characters to reasonable approximations of english equivalents

 */

  function replace_accents($s) {

    $s = htmlentities($s);

    $s = preg_replace ('/&([a-zA-Z])(uml|acute|elig|grave|circ|tilde|cedil|ring|quest|slash|caron);/', '$1', $s);

    $s = html_entity_decode($s);

    return $s;

  }



/**

 * function to override PHP's is_writable() which can occasionally be unreliable due to O/S and F/S differences

 * attempts to open the specified file for writing. Returns true if successful, false if not.

 * if a directory is specified, uses PHP's is_writable() anyway

 *

 * @var string

 * @return boolean

 */

  function is__writeable($filepath) {

    if (is_dir($filepath)) return is_writable($filepath);

    $fp = @fopen($filepath, 'a');

    if ($fp) {

      @fclose($fp);

      return true;

    }

    return false;

  }





/////////////////////////////////////////////

////

// call additional function files

// prices and quantities

  require(DIR_WS_FUNCTIONS . 'functions_prices.php');

// taxes

  require(DIR_WS_FUNCTIONS . 'functions_taxes.php');

// gv and coupons

  require(DIR_WS_FUNCTIONS . 'functions_gvcoupons.php');

// categories, paths, pulldowns

  require(DIR_WS_FUNCTIONS . 'functions_categories.php');

// customers and addresses

  require(DIR_WS_FUNCTIONS . 'functions_customers.php');

// lookup information

  require(DIR_WS_FUNCTIONS . 'functions_lookups.php');

////

/////////////////////////////////////////////
23 Sep 2008, 10:22 PM
#5
brekke00 avatar

brekke00

New Zenner

Join Date:
Aug 2007
Posts:
57
Plugin Contributions:
0

Re: blank pages. Not redirecting.

And here is english.php

*

<?php

/**

 * @package languageDefines

 * @copyright Copyright 2003-2007 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 $Id: english.php 7440 2007-11-17 21:51:35Z drbyte $

 */



// FOLLOWING WERE moved to meta_tags.php

//define('TITLE', 'Zen Cart!');

//define('SITE_TAGLINE', 'The Art of E-commerce');

//define('CUSTOM_KEYWORDS', 'ecommerce, open source, shop, online shopping');

// END: moved to meta_tags.php



  define('FOOTER_TEXT_BODY', 'Copyright © ' . date('Y') . ' <a href="' . zen_href_link(FILENAME_DEFAULT) . '" target="_blank">' . STORE_NAME . '</a>. Buy Domain Names <a href="http://www.brekkemedia.com" target="_blank">Want your own domain name</a>');



// look in your $PATH_LOCALE/locale directory for available locales..

// on RedHat try 'en_US'

// on FreeBSD try 'en_US.ISO_8859-1'

// on Windows try 'en', or 'English'

  @setlocale(LC_TIME, 'en_US.ISO_8859-1');

  define('DATE_FORMAT_SHORT', '%m/%d/%Y');  // this is used for strftime()

  define('DATE_FORMAT_LONG', '%A %d %B, %Y'); // this is used for strftime()

  define('DATE_FORMAT', 'm/d/Y'); // this is used for date()

  define('DATE_TIME_FORMAT', DATE_FORMAT_SHORT . ' %H:%M:%S');



////

// Return date in raw format

// $date should be in format mm/dd/yyyy

// raw date is in format YYYYMMDD, or DDMMYYYY

  if (!function_exists('zen_date_raw')) {

    function zen_date_raw($date, $reverse = false) {

      if ($reverse) {

        return substr($date, 3, 2) . substr($date, 0, 2) . substr($date, 6, 4);

      } else {

        return substr($date, 6, 4) . substr($date, 0, 2) . substr($date, 3, 2);

      }

    }

  }



// if USE_DEFAULT_LANGUAGE_CURRENCY is true, use the following currency, instead of the applications default currency (used when changing language)

  define('LANGUAGE_CURRENCY', 'USD');



// Global entries for the <html> tag

  define('HTML_PARAMS','dir="ltr" lang="en"');



// charset for web pages and emails

  define('CHARSET', 'iso-8859-1');



// footer text in includes/footer.php

  define('FOOTER_TEXT_REQUESTS_SINCE', 'requests since');



// Define the name of your Gift Certificate as Gift Voucher, Gift Certificate, Zen Cart Dollars, etc. here for use through out the shop

  define('TEXT_GV_NAME','Gift Certificate');

  define('TEXT_GV_NAMES','Gift Certificates');



// used for redeem code, redemption code, or redemption id

  define('TEXT_GV_REDEEM','Redemption Code');



// used for redeem code sidebox

  define('BOX_HEADING_GV_REDEEM', TEXT_GV_NAME);

  define('BOX_GV_REDEEM_INFO', 'Redemption code: ');



// text for gender

  define('MALE', 'Mr.');

  define('FEMALE', 'Ms.');

  define('MALE_ADDRESS', 'Mr.');

  define('FEMALE_ADDRESS', 'Ms.');



// text for date of birth example

  define('DOB_FORMAT_STRING', 'mm/dd/yyyy');



//text for sidebox heading links

  define('BOX_HEADING_LINKS', '  [more]');



// categories box text in sideboxes/categories.php

  define('BOX_HEADING_CATEGORIES', 'Categories');



// manufacturers box text in sideboxes/manufacturers.php

  define('BOX_HEADING_MANUFACTURERS', 'Manufacturers');



// whats_new box text in sideboxes/whats_new.php

  define('BOX_HEADING_WHATS_NEW', 'New Products');

  define('CATEGORIES_BOX_HEADING_WHATS_NEW', 'New Products ...');



  define('BOX_HEADING_FEATURED_PRODUCTS', 'Featured');

  define('CATEGORIES_BOX_HEADING_FEATURED_PRODUCTS', 'Featured Products ...');

  define('TEXT_NO_FEATURED_PRODUCTS', 'More featured products will be added soon. Please check back later.');



  define('TEXT_NO_ALL_PRODUCTS', 'More products will be added soon. Please check back later.');

  define('CATEGORIES_BOX_HEADING_PRODUCTS_ALL', 'All Products ...');



// quick_find box text in sideboxes/quick_find.php

  define('BOX_HEADING_SEARCH', 'Search');

  define('BOX_SEARCH_ADVANCED_SEARCH', 'Advanced Search');



// specials box text in sideboxes/specials.php

  define('BOX_HEADING_SPECIALS', 'Specials');

  define('CATEGORIES_BOX_HEADING_SPECIALS','Specials ...');



// reviews box text in sideboxes/reviews.php

  define('BOX_HEADING_REVIEWS', 'Reviews');

  define('BOX_REVIEWS_WRITE_REVIEW', 'Write a review on this product.');

  define('BOX_REVIEWS_NO_REVIEWS', 'There are currently no product reviews.');

  define('BOX_REVIEWS_TEXT_OF_5_STARS', '%s of 5 Stars!');



// shopping_cart box text in sideboxes/shopping_cart.php

  define('BOX_HEADING_SHOPPING_CART', 'Shopping Cart');

  define('BOX_SHOPPING_CART_EMPTY', 'Your cart is empty.');

  define('BOX_SHOPPING_CART_DIVIDER', 'ea.- ');



// order_history box text in sideboxes/order_history.php

  define('BOX_HEADING_CUSTOMER_ORDERS', 'Quick Re-Order');



// best_sellers box text in sideboxes/best_sellers.php

  define('BOX_HEADING_BESTSELLERS', 'Bestsellers');

  define('BOX_HEADING_BESTSELLERS_IN', 'Bestsellers in<br />  ');



// notifications box text in sideboxes/products_notifications.php

  define('BOX_HEADING_NOTIFICATIONS', 'Notifications');

  define('BOX_NOTIFICATIONS_NOTIFY', 'Notify me of updates to <strong>%s</strong>');

  define('BOX_NOTIFICATIONS_NOTIFY_REMOVE', 'Do not notify me of updates to <strong>%s</strong>');



// manufacturer box text

  define('BOX_HEADING_MANUFACTURER_INFO', 'Manufacturer Info');

  define('BOX_MANUFACTURER_INFO_HOMEPAGE', '%s Homepage');

  define('BOX_MANUFACTURER_INFO_OTHER_PRODUCTS', 'Other products');



// languages box text in sideboxes/languages.php

  define('BOX_HEADING_LANGUAGES', 'Languages');



// currencies box text in sideboxes/currencies.php

  define('BOX_HEADING_CURRENCIES', 'Currencies');



// information box text in sideboxes/information.php

  define('BOX_HEADING_INFORMATION', 'Information');

  define('BOX_INFORMATION_PRIVACY', 'Privacy Notice');

  define('BOX_INFORMATION_CONDITIONS', 'Conditions of Use');

  define('BOX_INFORMATION_SHIPPING', 'Shipping & Returns');

  define('BOX_INFORMATION_CONTACT', 'Contact Us');

  define('BOX_BBINDEX', 'Forum');

  define('BOX_INFORMATION_UNSUBSCRIBE', 'Newsletter Unsubscribe');



  define('BOX_INFORMATION_SITE_MAP', 'Site Map');



// information box text in sideboxes/more_information.php - were TUTORIAL_

  define('BOX_HEADING_MORE_INFORMATION', 'More Information');

  define('BOX_INFORMATION_PAGE_2', 'Page 2');

  define('BOX_INFORMATION_PAGE_3', 'Page 3');

  define('BOX_INFORMATION_PAGE_4', 'Page 4');



// tell a friend box text in sideboxes/tell_a_friend.php

  define('BOX_HEADING_TELL_A_FRIEND', 'Tell A Friend');

  define('BOX_TELL_A_FRIEND_TEXT', 'Tell someone you know about this product.');



// wishlist box text in includes/boxes/wishlist.php

  define('BOX_HEADING_CUSTOMER_WISHLIST', 'My Wishlist');

  define('BOX_WISHLIST_EMPTY', 'You have no items on your Wishlist');

  define('IMAGE_BUTTON_ADD_WISHLIST', 'Add to Wishlist');

  define('TEXT_WISHLIST_COUNT', 'Currently %s items are on your Wishlist.');

  define('TEXT_DISPLAY_NUMBER_OF_WISHLIST', 'Displaying <strong>%d</strong> to <strong>%d</strong> (of <strong>%d</strong> items on your wishlist)');



//New billing address text

  define('SET_AS_PRIMARY' , 'Set as Primary Address');

  define('NEW_ADDRESS_TITLE', 'Billing Address');



// javascript messages

  define('JS_ERROR', 'Errors have occurred during the processing of your form.\n\nPlease make the following corrections:\n\n');



  define('JS_REVIEW_TEXT', '* Please add a few more words to your comments. The review needs to have at least ' . REVIEW_TEXT_MIN_LENGTH . ' characters.');

  define('JS_REVIEW_RATING', '* Please choose a rating for this item.');



  define('JS_ERROR_NO_PAYMENT_MODULE_SELECTED', '* Please select a payment method for your order.');



  define('JS_ERROR_SUBMITTED', 'This form has already been submitted. Please press OK and wait for this process to be completed.');



  define('ERROR_NO_PAYMENT_MODULE_SELECTED', 'Please select a payment method for your order.');

  define('ERROR_CONDITIONS_NOT_ACCEPTED', 'Please confirm the terms and conditions bound to this order by ticking the box below.');

  define('ERROR_PRIVACY_STATEMENT_NOT_ACCEPTED', 'Please confirm the privacy statement by ticking the box below.');



  define('CATEGORY_COMPANY', 'Company Details');

  define('CATEGORY_PERSONAL', 'Your Personal Details');

  define('CATEGORY_ADDRESS', 'Your Address');

  define('CATEGORY_CONTACT', 'Your Contact Information');

  define('CATEGORY_OPTIONS', 'Options');

  define('CATEGORY_PASSWORD', 'Your Password');

  define('CATEGORY_LOGIN', 'Login');

  define('PULL_DOWN_DEFAULT', 'Please Choose Your Country');

  define('PLEASE_SELECT', 'Please select ...');

  define('TYPE_BELOW', 'Type a choice below ...');



  define('ENTRY_COMPANY', 'Company Name:');

  define('ENTRY_COMPANY_ERROR', 'Please enter a company name.');

  define('ENTRY_COMPANY_TEXT', '');

  define('ENTRY_GENDER', 'Salutation:');

  define('ENTRY_GENDER_ERROR', 'Please choose a salutation.');

  define('ENTRY_GENDER_TEXT', '*');

  define('ENTRY_FIRST_NAME', 'First Name:');

  define('ENTRY_FIRST_NAME_ERROR', 'Is your first name correct? Our system requires a minimum of ' . ENTRY_FIRST_NAME_MIN_LENGTH . ' characters. Please try again.');

  define('ENTRY_FIRST_NAME_TEXT', '*');

  define('ENTRY_LAST_NAME', 'Last Name:');

  define('ENTRY_LAST_NAME_ERROR', 'Is your last name correct? Our system requires a minimum of ' . ENTRY_LAST_NAME_MIN_LENGTH . ' characters. Please try again.');

  define('ENTRY_LAST_NAME_TEXT', '*');

  define('ENTRY_DATE_OF_BIRTH', 'Date of Birth:');

  define('ENTRY_DATE_OF_BIRTH_ERROR', 'Is your birth date correct? Our system requires the date in this format: MM/DD/YYYY (eg 05/21/1970)');

  define('ENTRY_DATE_OF_BIRTH_TEXT', '* (eg. 05/21/1970)');

  define('ENTRY_EMAIL_ADDRESS', 'Email Address:');

  define('ENTRY_EMAIL_ADDRESS_ERROR', 'Is your email address correct? It should contain at least ' . ENTRY_EMAIL_ADDRESS_MIN_LENGTH . ' characters. Please try again.');

  define('ENTRY_EMAIL_ADDRESS_CHECK_ERROR', 'Sorry, my system does not understand your email address. Please try again.');

  define('ENTRY_EMAIL_ADDRESS_ERROR_EXISTS', 'Our system already has a record of that email address - please try logging in with that email address. If you do not use that address any longer you can correct it in the My Account area.');

  define('ENTRY_EMAIL_ADDRESS_TEXT', '*');

  define('ENTRY_NICK', 'Forum Nick Name:');

  define('ENTRY_NICK_TEXT', '*'); // note to display beside nickname input field

  define('ENTRY_NICK_DUPLICATE_ERROR', 'That Nick Name is already being used. Please try another.');

  define('ENTRY_NICK_LENGTH_ERROR', 'Please try again. Your Nick Name must contain at least ' . ENTRY_NICK_MIN_LENGTH . ' characters.');

  define('ENTRY_STREET_ADDRESS', 'Street Address:');

  define('ENTRY_STREET_ADDRESS_ERROR', 'Your Street Address must contain a minimum of ' . ENTRY_STREET_ADDRESS_MIN_LENGTH . ' characters.');

  define('ENTRY_STREET_ADDRESS_TEXT', '*');

  define('ENTRY_SUBURB', 'Address Line 2:');

  define('ENTRY_SUBURB_ERROR', '');

  define('ENTRY_SUBURB_TEXT', '');

  define('ENTRY_POST_CODE', 'Post/Zip Code:');

  define('ENTRY_POST_CODE_ERROR', 'Your Post/ZIP Code must contain a minimum of ' . ENTRY_POSTCODE_MIN_LENGTH . ' characters.');

  define('ENTRY_POST_CODE_TEXT', '*');

  define('ENTRY_CITY', 'City:');

  define('ENTRY_CUSTOMERS_REFERRAL', 'Referral Code:');



  define('ENTRY_CITY_ERROR', 'Your City must contain a minimum of ' . ENTRY_CITY_MIN_LENGTH . ' characters.');

  define('ENTRY_CITY_TEXT', '*');

  define('ENTRY_STATE', 'State/Province:');

  define('ENTRY_STATE_ERROR', 'Your State must contain a minimum of ' . ENTRY_STATE_MIN_LENGTH . ' characters.');

  define('ENTRY_STATE_ERROR_SELECT', 'Please select a state from the States pull down menu.');

  define('ENTRY_STATE_TEXT', '*');

  define('JS_STATE_SELECT', '-- Please Choose --');

  define('ENTRY_COUNTRY', 'Country:');

  define('ENTRY_COUNTRY_ERROR', 'You must select a country from the Countries pull down menu.');

  define('ENTRY_COUNTRY_TEXT', '*');

  define('ENTRY_TELEPHONE_NUMBER', 'Telephone:');

  define('ENTRY_TELEPHONE_NUMBER_ERROR', 'Your Telephone Number must contain a minimum of ' . ENTRY_TELEPHONE_MIN_LENGTH . ' characters.');

  define('ENTRY_TELEPHONE_NUMBER_TEXT', '*');

  define('ENTRY_FAX_NUMBER', 'Fax Number:');

  define('ENTRY_FAX_NUMBER_ERROR', '');

  define('ENTRY_FAX_NUMBER_TEXT', '');

  define('ENTRY_NEWSLETTER', 'Subscribe to Our Newsletter.');

  define('ENTRY_NEWSLETTER_TEXT', '');

  define('ENTRY_NEWSLETTER_YES', 'Subscribed');

  define('ENTRY_NEWSLETTER_NO', 'Unsubscribed');

  define('ENTRY_NEWSLETTER_ERROR', '');

  define('ENTRY_PASSWORD', 'Password:');

  define('ENTRY_PASSWORD_ERROR', 'Your Password must contain a minimum of ' . ENTRY_PASSWORD_MIN_LENGTH . ' characters.');

  define('ENTRY_PASSWORD_ERROR_NOT_MATCHING', 'The Password Confirmation must match your Password.');

  define('ENTRY_PASSWORD_TEXT', '* (at least ' . ENTRY_PASSWORD_MIN_LENGTH . ' characters)');

  define('ENTRY_PASSWORD_CONFIRMATION', 'Confirm Password:');

  define('ENTRY_PASSWORD_CONFIRMATION_TEXT', '*');

  define('ENTRY_PASSWORD_CURRENT', 'Current Password:');

  define('ENTRY_PASSWORD_CURRENT_TEXT', '*');

  define('ENTRY_PASSWORD_CURRENT_ERROR', 'Your Password must contain a minimum of ' . ENTRY_PASSWORD_MIN_LENGTH . ' characters.');

  define('ENTRY_PASSWORD_NEW', 'New Password:');

  define('ENTRY_PASSWORD_NEW_TEXT', '*');

  define('ENTRY_PASSWORD_NEW_ERROR', 'Your new Password must contain a minimum of ' . ENTRY_PASSWORD_MIN_LENGTH . ' characters.');

  define('ENTRY_PASSWORD_NEW_ERROR_NOT_MATCHING', 'The Password Confirmation must match your new Password.');

  define('PASSWORD_HIDDEN', '--HIDDEN--');



  define('FORM_REQUIRED_INFORMATION', '* Required information');

  define('ENTRY_REQUIRED_SYMBOL', '*');



  // constants for use in zen_prev_next_display function

  define('TEXT_RESULT_PAGE', '');

  define('TEXT_DISPLAY_NUMBER_OF_PRODUCTS', 'Displaying <strong>%d</strong> to <strong>%d</strong> (of <strong>%d</strong> products)');

  define('TEXT_DISPLAY_NUMBER_OF_ORDERS', 'Displaying <strong>%d</strong> to <strong>%d</strong> (of <strong>%d</strong> orders)');

  define('TEXT_DISPLAY_NUMBER_OF_REVIEWS', 'Displaying <strong>%d</strong> to <strong>%d</strong> (of <strong>%d</strong> reviews)');

  define('TEXT_DISPLAY_NUMBER_OF_PRODUCTS_NEW', 'Displaying <strong>%d</strong> to <strong>%d</strong> (of <strong>%d</strong> new products)');

  define('TEXT_DISPLAY_NUMBER_OF_SPECIALS', 'Displaying <strong>%d</strong> to <strong>%d</strong> (of <strong>%d</strong> specials)');

  define('TEXT_DISPLAY_NUMBER_OF_PRODUCTS_FEATURED_PRODUCTS', 'Displaying <strong>%d</strong> to <strong>%d</strong> (of <strong>%d</strong> featured products)');

  define('TEXT_DISPLAY_NUMBER_OF_PRODUCTS_ALL', 'Displaying <strong>%d</strong> to <strong>%d</strong> (of <strong>%d</strong> products)');



  define('PREVNEXT_TITLE_FIRST_PAGE', 'First Page');

  define('PREVNEXT_TITLE_PREVIOUS_PAGE', 'Previous Page');

  define('PREVNEXT_TITLE_NEXT_PAGE', 'Next Page');

  define('PREVNEXT_TITLE_LAST_PAGE', 'Last Page');

  define('PREVNEXT_TITLE_PAGE_NO', 'Page %d');

  define('PREVNEXT_TITLE_PREV_SET_OF_NO_PAGE', 'Previous Set of %d Pages');

  define('PREVNEXT_TITLE_NEXT_SET_OF_NO_PAGE', 'Next Set of %d Pages');

  define('PREVNEXT_BUTTON_FIRST', '<<FIRST');

  define('PREVNEXT_BUTTON_PREV', '[<< Prev]');

  define('PREVNEXT_BUTTON_NEXT', '[Next >>]');

  define('PREVNEXT_BUTTON_LAST', 'LAST>>');
23 Sep 2008, 10:25 PM
#6
brekke00 avatar

brekke00

New Zenner

Join Date:
Aug 2007
Posts:
57
Plugin Contributions:
0

Re: blank pages. Not redirecting.

  define('TEXT_BASE_PRICE','Starting at: ');



  define('TEXT_CLICK_TO_ENLARGE', 'larger image');



  define('TEXT_SORT_PRODUCTS', 'Sort products ');

  define('TEXT_DESCENDINGLY', 'descendingly');

  define('TEXT_ASCENDINGLY', 'ascendingly');

  define('TEXT_BY', ' by ');



  define('TEXT_REVIEW_BY', 'by %s');

  define('TEXT_REVIEW_WORD_COUNT', '%s words');

  define('TEXT_REVIEW_RATING', 'Rating: %s [%s]');

  define('TEXT_REVIEW_DATE_ADDED', 'Date Added: %s');

  define('TEXT_NO_REVIEWS', 'There are currently no product reviews.');



  define('TEXT_NO_NEW_PRODUCTS', 'More new products will be added soon. Please check back later.');



  define('TEXT_UNKNOWN_TAX_RATE', 'Sales Tax');



  define('TEXT_REQUIRED', '<span class="errorText">Required</span>');



  define('WARNING_INSTALL_DIRECTORY_EXISTS', 'Warning: Installation directory exists at: %s. Please remove this directory for security reasons.');

  define('WARNING_CONFIG_FILE_WRITEABLE', 'Warning: I am able to write to the configuration file: %s. This is a potential security risk - please set the right user permissions on this file (read-only, CHMOD 644 or 444 are typical). You may need to use your webhost control panel/file-manager to change the permissions effectively. Contact your webhost for assistance. <a href="https://www.zen-cart.com/tutorials/index.php?article=90" target="_blank">See this FAQ</a>');

  define('ERROR_FILE_NOT_REMOVEABLE', 'Error: Could not remove the file specified. You may have to use FTP to remove the file, due to a server-permissions configuration limitation.');

  define('WARNING_SESSION_DIRECTORY_NON_EXISTENT', 'Warning: The sessions directory does not exist: ' . zen_session_save_path() . '. Sessions will not work until this directory is created.');

  define('WARNING_SESSION_DIRECTORY_NOT_WRITEABLE', 'Warning: I am not able to write to the sessions directory: ' . zen_session_save_path() . '. Sessions will not work until the right user permissions are set.');

  define('WARNING_SESSION_AUTO_START', 'Warning: session.auto_start is enabled - please disable this PHP feature in php.ini and restart the web server.');

  define('WARNING_DOWNLOAD_DIRECTORY_NON_EXISTENT', 'Warning: The downloadable products directory does not exist: ' . DIR_FS_DOWNLOAD . '. Downloadable products will not work until this directory is valid.');

  define('WARNING_SQL_CACHE_DIRECTORY_NON_EXISTENT', 'Warning: The SQL cache directory does not exist: ' . DIR_FS_SQL_CACHE . '. SQL caching will not work until this directory is created.');

  define('WARNING_SQL_CACHE_DIRECTORY_NOT_WRITEABLE', 'Warning: I am not able to write to the SQL cache directory: ' . DIR_FS_SQL_CACHE . '. SQL caching will not work until the right user permissions are set.');

  define('WARNING_DATABASE_VERSION_OUT_OF_DATE', 'Your database appears to need patching to a higher level. See Admin->Tools->Server Information to review patch levels.');

  define('WARNING_COULD_NOT_LOCATE_LANG_FILE', 'WARNING: Could not locate language file: ');



  define('TEXT_CCVAL_ERROR_INVALID_DATE', 'The expiration date entered for the credit card is invalid. Please check the date and try again.');

  define('TEXT_CCVAL_ERROR_INVALID_NUMBER', 'The credit card number entered is invalid. Please check the number and try again.');

  define('TEXT_CCVAL_ERROR_UNKNOWN_CARD', 'The credit card number starting with %s was not entered correctly, or we do not accept that kind of card. Please try again or use another credit card.');



  define('BOX_INFORMATION_DISCOUNT_COUPONS', 'Discount Coupons');

  define('BOX_INFORMATION_GV', TEXT_GV_NAME . ' FAQ');

  define('VOUCHER_BALANCE', TEXT_GV_NAME . ' Balance ');

  define('BOX_HEADING_GIFT_VOUCHER', TEXT_GV_NAME . ' Account');

  define('GV_FAQ', TEXT_GV_NAME . ' FAQ');

  define('ERROR_REDEEMED_AMOUNT', 'Congratulations, you have redeemed ');

  define('ERROR_NO_REDEEM_CODE', 'You did not enter a ' . TEXT_GV_REDEEM . '.');

  define('ERROR_NO_INVALID_REDEEM_GV', 'Invalid ' . TEXT_GV_NAME . ' ' . TEXT_GV_REDEEM);

  define('TABLE_HEADING_CREDIT', 'Credits Available');

  define('GV_HAS_VOUCHERA', 'You have funds in your ' . TEXT_GV_NAME . ' Account. If you want <br />

                           you can send those funds by <a class="pageResults" href="');



  define('GV_HAS_VOUCHERB', '"><strong>email</strong></a> to someone');

  define('ENTRY_AMOUNT_CHECK_ERROR', 'You do not have enough funds to send this amount.');

  define('BOX_SEND_TO_FRIEND', 'Send ' . TEXT_GV_NAME . ' ');



  define('VOUCHER_REDEEMED',  TEXT_GV_NAME . ' Redeemed');

  define('CART_COUPON', 'Coupon :');

  define('CART_COUPON_INFO', 'more info');

  define('TEXT_SEND_OR_SPEND','You have a balance available in your ' . TEXT_GV_NAME . ' account. You may spend it or send it to someone else. To send click the button below.');

  define('TEXT_BALANCE_IS', 'Your ' . TEXT_GV_NAME . ' balance is: ');

  define('TEXT_AVAILABLE_BALANCE', 'Your ' . TEXT_GV_NAME . ' Account');



// payment method is GV/Discount

  define('PAYMENT_METHOD_GV', 'Gift Certificate/Coupon');

  define('PAYMENT_MODULE_GV', 'GV/DC');



  define('TABLE_HEADING_CREDIT_PAYMENT', 'Credits Available');



  define('TEXT_INVALID_REDEEM_COUPON', 'Invalid Coupon Code');

  define('TEXT_INVALID_REDEEM_COUPON_MINIMUM', 'You must spend at least %s to redeem this coupon');

  define('TEXT_INVALID_STARTDATE_COUPON', 'This coupon is not available yet');

  define('TEXT_INVALID_FINISHDATE_COUPON', 'This coupon has expired');

  define('TEXT_INVALID_USES_COUPON', 'This coupon could only be used ');

  define('TIMES', ' times.');

  define('TIME', ' time.');

  define('TEXT_INVALID_USES_USER_COUPON', 'You have used coupon code: %s the maximum number of times allowed per customer. ');

  define('REDEEMED_COUPON', 'a coupon worth ');

  define('REDEEMED_MIN_ORDER', 'on orders over ');

  define('REDEEMED_RESTRICTIONS', ' [Product-Category restrictions apply]');

  define('TEXT_ERROR', 'An error has occurred');

  define('TEXT_INVALID_COUPON_PRODUCT', 'This coupon code is not valid for any product currently in your cart.');

  define('TEXT_VALID_COUPON', 'Congratulations you have redeemed the Discount Coupon');

  define('TEXT_REMOVE_REDEEM_COUPON_ZONE', 'The coupon code you entered is not valid for the address you have selected.');



// more info in place of buy now

  define('MORE_INFO_TEXT','... more info');



// IP Address

  define('TEXT_YOUR_IP_ADDRESS','Your IP Address is: ');



//Generic Address Heading

  define('HEADING_ADDRESS_INFORMATION','Address Information');



// cart contents

  define('PRODUCTS_ORDER_QTY_TEXT_IN_CART','Quantity in Cart: ');

  define('PRODUCTS_ORDER_QTY_TEXT','Add to Cart: ');



// success messages for added to cart when display cart is off

// set to blank for no messages

// for all pages except where multiple add to cart is used:

  define('SUCCESS_ADDED_TO_CART_PRODUCT', 'Successfully added Product to the cart ...');

// only for where multiple add to cart is used:

  define('SUCCESS_ADDED_TO_CART_PRODUCTS', 'Successfully added selected Product(s) to the cart ...');



  define('TEXT_PRODUCT_WEIGHT_UNIT','lbs');



// Shipping

  define('TEXT_SHIPPING_WEIGHT','lbs');

  define('TEXT_SHIPPING_BOXES', 'Boxes');



// Discount Savings

  define('PRODUCT_PRICE_DISCOUNT_PREFIX','Save: ');

  define('PRODUCT_PRICE_DISCOUNT_PERCENTAGE','% off');

  define('PRODUCT_PRICE_DISCOUNT_AMOUNT',' off');



// Sale Maker Sale Price

  define('PRODUCT_PRICE_SALE','Sale: ');



//universal symbols

  define('TEXT_NUMBER_SYMBOL', '# ');



// banner_box

  define('BOX_HEADING_BANNER_BOX','Sponsors');

  define('TEXT_BANNER_BOX','Please Visit Our Sponsors ...');



// banner box 2

  define('BOX_HEADING_BANNER_BOX2','Have you seen ...');

  define('TEXT_BANNER_BOX2','Check this out today!');



// banner_box - all

  define('BOX_HEADING_BANNER_BOX_ALL','Sponsors');

  define('TEXT_BANNER_BOX_ALL','Please Visit Our Sponsors ...');



// boxes defines

  define('PULL_DOWN_ALL','Please Select');

  define('PULL_DOWN_MANUFACTURERS','- Reset -');

// shipping estimator

  define('PULL_DOWN_SHIPPING_ESTIMATOR_SELECT', 'Please Select');



// general Sort By

  define('TEXT_INFO_SORT_BY','Sort by: ');



// close window image popups

  define('TEXT_CLOSE_WINDOW',' - Click Image to Close');

// close popups

  define('TEXT_CURRENT_CLOSE_WINDOW','[ Close Window ]');



// iii 031104 added:  File upload error strings

  define('ERROR_FILETYPE_NOT_ALLOWED', 'Error:  File type not allowed.');

  define('WARNING_NO_FILE_UPLOADED', 'Warning:  no file uploaded.');

  define('SUCCESS_FILE_SAVED_SUCCESSFULLY', 'Success:  file saved successfully.');

  define('ERROR_FILE_NOT_SAVED', 'Error:  File not saved.');

  define('ERROR_DESTINATION_NOT_WRITEABLE', 'Error:  destination not writeable.');

  define('ERROR_DESTINATION_DOES_NOT_EXIST', 'Error: destination does not exist.');

  define('ERROR_FILE_TOO_BIG', 'Warning: File was too large to upload!<br />Order can be placed but please contact the site for help with upload');

// End iii added



  define('TEXT_BEFORE_DOWN_FOR_MAINTENANCE', 'NOTICE: This website is scheduled to be down for maintenance on: ');

  define('TEXT_ADMIN_DOWN_FOR_MAINTENANCE', 'NOTICE: The website is currently Down For Maintenance to the public');



  define('PRODUCTS_PRICE_IS_FREE_TEXT','It\'s Free!');

  define('PRODUCTS_PRICE_IS_CALL_FOR_PRICE_TEXT','Call for Price');

  define('TEXT_CALL_FOR_PRICE','Call for price');



  define('TEXT_INVALID_SELECTION',' You picked an Invalid Selection: ');

  define('TEXT_ERROR_OPTION_FOR',' On the Option for: ');

  define('TEXT_INVALID_USER_INPUT', 'User Input Required<br />');



// product_listing

  define('PRODUCTS_QUANTITY_MIN_TEXT_LISTING','Min: ');

  define('PRODUCTS_QUANTITY_UNIT_TEXT_LISTING','Units: ');

  define('PRODUCTS_QUANTITY_IN_CART_LISTING','In cart:');

  define('PRODUCTS_QUANTITY_ADD_ADDITIONAL_LISTING','Add Additional:');



  define('PRODUCTS_QUANTITY_MAX_TEXT_LISTING','Max:');



  define('TEXT_PRODUCTS_MIX_OFF','*Mixed OFF');

  define('TEXT_PRODUCTS_MIX_ON','*Mixed ON');



  define('TEXT_PRODUCTS_MIX_OFF_SHOPPING_CART','<br />*You can not mix the options on this item to meet the minimum quantity requirement.*<br />');

  define('TEXT_PRODUCTS_MIX_ON_SHOPPING_CART','*Mixed Option Values is ON<br />');



  define('ERROR_MAXIMUM_QTY','The quantity added to your cart has been adjusted because of a restriction on maximum you are allowed. See this item: ');
 
   define('ERROR_CORRECTIONS_HEADING','Please correct the following: <br />');
 
   define('ERROR_QUANTITY_ADJUSTED', 'The quantity added to your cart has been adjusted. The item you wanted is not available in fractional quantities. The quantity of item: ');
 
   define('ERROR_QUANTITY_CHANGED_FROM', ', has been changed from: ');
 
   define('ERROR_QUANTITY_CHANGED_TO', ' to ');
 
 
 
 // Downloads Controller
 
   define('DOWNLOADS_CONTROLLER_ON_HOLD_MSG','NOTE: Downloads are not available until payment has been confirmed');
 
   define('TEXT_FILESIZE_BYTES', ' bytes');
 
   define('TEXT_FILESIZE_MEGS', ' MB');
 
 
 
 // shopping cart errors
 
   define('ERROR_PRODUCT','The item: ');
 
   define('ERROR_PRODUCT_STATUS_SHOPPING_CART','<br />We are sorry but this product has been removed from our inventory at this time.<br />This item has been removed from your shopping cart.');
 
   define('ERROR_PRODUCT_QUANTITY_MIN',',  ... Minimum Quantity errors - ');
 
   define('ERROR_PRODUCT_QUANTITY_UNITS',' ... Quantity Units errors - ');
 
   define('ERROR_PRODUCT_OPTION_SELECTION','<br /> ... Invalid Option Values Selected ');
 
   define('ERROR_PRODUCT_QUANTITY_ORDERED','<br /> You ordered a total of: ');
 
   define('ERROR_PRODUCT_QUANTITY_MAX',' ... Maximum Quantity errors - ');
 
   define('ERROR_PRODUCT_QUANTITY_MIN_SHOPPING_CART',', has a minimum quantity restriction. ');
 
   define('ERROR_PRODUCT_QUANTITY_UNITS_SHOPPING_CART',' ... Quantity Units errors - ');
 
   define('ERROR_PRODUCT_QUANTITY_MAX_SHOPPING_CART',' ... Maximum Quantity errors - ');
 
 
 
   define('WARNING_SHOPPING_CART_COMBINED', 'NOTICE: For your convenience, your current shopping cart has been combined with your shopping cart from your last visit. Please review your shopping cart before checking out.');
 
 
 
 // error on checkout when $_SESSION['customers_id' does not exist in customers table
 
   define('ERROR_CUSTOMERS_ID_INVALID', 'Customer information cannot be validated!<br />Please login or recreate your account ...');
 
 
 
   define('TABLE_HEADING_FEATURED_PRODUCTS','Featured Products');
 
 
 
   define('TABLE_HEADING_NEW_PRODUCTS', 'New Products For %s');
 
   define('TABLE_HEADING_UPCOMING_PRODUCTS', 'Upcoming Products');
 
   define('TABLE_HEADING_DATE_EXPECTED', 'Date Expected');
 
   define('TABLE_HEADING_SPECIALS_INDEX', 'Monthly Specials For %s');
 
 
 
   define('CAPTION_UPCOMING_PRODUCTS','These items will be in stock soon');
 
   define('SUMMARY_TABLE_UPCOMING_PRODUCTS','table contains a list of products that are due to be in stock soon and the dates the items are expected');
 
 
 
 // meta tags special defines
 
   define('META_TAG_PRODUCTS_PRICE_IS_FREE_TEXT','It\'s Free!');
 
 
 
 // customer login
 
   define('TEXT_SHOWCASE_ONLY','Contact Us');
 
 // set for login for prices
 
   define('TEXT_LOGIN_FOR_PRICE_PRICE','Price Unavailable');
 
   define('TEXT_LOGIN_FOR_PRICE_BUTTON_REPLACE','Login for price');
 
 // set for show room only
 
   define('TEXT_LOGIN_FOR_PRICE_PRICE_SHOWROOM', ''); // blank for prices or enter your own text
 
   define('TEXT_LOGIN_FOR_PRICE_BUTTON_REPLACE_SHOWROOM','Show Room Only');
 
 
 
 // authorization pending
 
   define('TEXT_AUTHORIZATION_PENDING_PRICE', 'Price Unavailable');
 
   define('TEXT_AUTHORIZATION_PENDING_BUTTON_REPLACE', 'APPROVAL PENDING');
 
   define('TEXT_LOGIN_TO_SHOP_BUTTON_REPLACE','Login to Shop');
 
 
 
 // text pricing
 
   define('TEXT_CHARGES_WORD','Calculated Charge:');
 
   define('TEXT_PER_WORD','<br />Price per word: ');
 
   define('TEXT_WORDS_FREE',' Word(s) free ');
 
   define('TEXT_CHARGES_LETTERS','Calculated Charge:');
 
   define('TEXT_PER_LETTER','<br />Price per letter: ');
 
   define('TEXT_LETTERS_FREE',' Letter(s) free ');
 
   define('TEXT_ONETIME_CHARGES','*onetime charges = ');
 
   define('TEXT_ONETIME_CHARGES_EMAIL',"\t" . '*onetime charges = ');
 
   define('TEXT_ATTRIBUTES_QTY_PRICES_HELP', 'Option Quantity Discounts');
 
   define('TABLE_ATTRIBUTES_QTY_PRICE_QTY','QTY');
 
   define('TABLE_ATTRIBUTES_QTY_PRICE_PRICE','PRICE');
 
   define('TEXT_ATTRIBUTES_QTY_PRICES_ONETIME_HELP', 'Option Quantity Discounts Onetime Charges');
 
 
 
 // textarea attribute input fields
 
   define('TEXT_MAXIMUM_CHARACTERS_ALLOWED',' maximum characters allowed');
 
   define('TEXT_REMAINING','remaining');
 
 
 
 // Shipping Estimator
 
   define('CART_SHIPPING_OPTIONS', 'Estimate Shipping Costs');
 
   define('CART_SHIPPING_OPTIONS_LOGIN', 'Please <a href="' . zen_href_link(FILENAME_LOGIN, '', 'SSL') . '"><span class="pseudolink">Log In</span></a>, to display your personal shipping costs.');
 
   define('CART_SHIPPING_METHOD_TEXT', 'Available Shipping Methods');
 
   define('CART_SHIPPING_METHOD_RATES', 'Rates');
 
   define('CART_SHIPPING_METHOD_TO','Ship to: ');
 
   define('CART_SHIPPING_METHOD_TO_NOLOGIN', 'Ship to: <a href="' . zen_href_link(FILENAME_LOGIN, '', 'SSL') . '"><span class="pseudolink">Log In</span></a>');
 
   define('CART_SHIPPING_METHOD_FREE_TEXT','Free Shipping');
 
   define('CART_SHIPPING_METHOD_ALL_DOWNLOADS','- Downloads');
 
   define('CART_SHIPPING_METHOD_RECALCULATE','Recalculate');
 
   define('CART_SHIPPING_METHOD_ZIP_REQUIRED','true');
 
   define('CART_SHIPPING_METHOD_ADDRESS','Address:');
 
   define('CART_OT','Total Cost Estimate:');
 
   define('CART_OT_SHOW','true'); // set to false if you don't want order totals
 
   define('CART_ITEMS','Items in Cart: ');
 
   define('CART_SELECT','Select');
 
   define('ERROR_CART_UPDATE', '<strong>Please update your order.</strong> ');
 
   define('IMAGE_BUTTON_UPDATE_CART', 'Update');
 
   define('EMPTY_CART_TEXT_NO_QUOTE', 'Whoops! Your session has expired ... Please update your shopping cart for Shipping Quote ...');
 
   define('CART_SHIPPING_QUOTE_CRITERIA', 'Shipping quotes are based on the address information you selected:');
 
 
 
 // multiple product add to cart
 
   define('TEXT_PRODUCT_LISTING_MULTIPLE_ADD_TO_CART', 'Add: ');
 
   define('TEXT_PRODUCT_ALL_LISTING_MULTIPLE_ADD_TO_CART', 'Add: ');
 
   define('TEXT_PRODUCT_FEATURED_LISTING_MULTIPLE_ADD_TO_CART', 'Add: ');
 
   define('TEXT_PRODUCT_NEW_LISTING_MULTIPLE_ADD_TO_CART', 'Add: ');
 
   //moved SUBMIT_BUTTON_ADD_PRODUCTS_TO_CART to button_names.php as BUTTON_ADD_PRODUCTS_TO_CART_ALT
 
 
 
 // discount qty table
 
   define('TEXT_HEADER_DISCOUNT_PRICES_PERCENTAGE', 'Qty Discounts Off Price');
 
   define('TEXT_HEADER_DISCOUNT_PRICES_ACTUAL_PRICE', 'Qty Discounts New Price');
 
   define('TEXT_HEADER_DISCOUNT_PRICES_AMOUNT_OFF', 'Qty Discounts Off Price');
 
   define('TEXT_FOOTER_DISCOUNT_QUANTITIES', '* Discounts may vary based on options above');
 
   define('TEXT_HEADER_DISCOUNTS_OFF', 'Qty Discounts Unavailable ...');
 
 
 
 // sort order titles for dropdowns
 
   define('PULL_DOWN_ALL_RESET','- RESET - ');
 
   define('TEXT_INFO_SORT_BY_PRODUCTS_NAME', 'Product Name');
 
   define('TEXT_INFO_SORT_BY_PRODUCTS_NAME_DESC', 'Product Name - desc');
 
   define('TEXT_INFO_SORT_BY_PRODUCTS_PRICE', 'Price - low to high');
 
   define('TEXT_INFO_SORT_BY_PRODUCTS_PRICE_DESC', 'Price - high to low');
 
   define('TEXT_INFO_SORT_BY_PRODUCTS_MODEL', 'Model');
 
   define('TEXT_INFO_SORT_BY_PRODUCTS_DATE_DESC', 'Date Added - New to Old');
 
   define('TEXT_INFO_SORT_BY_PRODUCTS_DATE', 'Date Added - Old to New');
 
   define('TEXT_INFO_SORT_BY_PRODUCTS_SORT_ORDER', 'Default Display');
 
 
 
 // downloads module defines
 
   define('TABLE_HEADING_DOWNLOAD_DATE', 'Link Expires');
 
   define('TABLE_HEADING_DOWNLOAD_COUNT', 'Remaining');
 
   define('HEADING_DOWNLOAD', 'To download your files click the download button and choose "Save to Disk" from the popup menu.');
 
   define('TABLE_HEADING_DOWNLOAD_FILENAME','Filename');
 
   define('TABLE_HEADING_PRODUCT_NAME','Item Name');
 
   define('TABLE_HEADING_BYTE_SIZE','File Size');
 
   define('TEXT_DOWNLOADS_UNLIMITED', 'Unlimited');
 
   define('TEXT_DOWNLOADS_UNLIMITED_COUNT', '--- *** ---');
 
 
 
 // misc
 
   define('COLON_SPACER', ':  ');
 
 
 
 // table headings for cart display and upcoming products
 
   define('TABLE_HEADING_QUANTITY', 'Qty.');
 
   define('TABLE_HEADING_PRODUCTS', 'Item Name');
 
   define('TABLE_HEADING_TOTAL', 'Total');
 
 
 
 // create account - login shared
 
   define('TABLE_HEADING_PRIVACY_CONDITIONS', 'Privacy Statement');
 
   define('TEXT_PRIVACY_CONDITIONS_DESCRIPTION', 'Please acknowledge you agree with our privacy statement by ticking the following box. The privacy statement can be read <a href="' . zen_href_link(FILENAME_PRIVACY, '', 'SSL') . '"><span class="pseudolink">here</span></a>.');
 
   define('TEXT_PRIVACY_CONDITIONS_CONFIRM', 'I have read and agreed to your privacy statement.');
 
   define('TABLE_HEADING_ADDRESS_DETAILS', 'Address Details');
 
   define('TABLE_HEADING_PHONE_FAX_DETAILS', 'Additional Contact Details');
 
   define('TABLE_HEADING_DATE_OF_BIRTH', 'Verify Your Age');
 
   define('TABLE_HEADING_LOGIN_DETAILS', 'Login Details');
 
   define('TABLE_HEADING_REFERRAL_DETAILS', 'Were You Referred to Us?');
 
 
 
   define('ENTRY_EMAIL_PREFERENCE','Newsletter and Email Details');
 
   define('ENTRY_EMAIL_HTML_DISPLAY','HTML');
 
   define('ENTRY_EMAIL_TEXT_DISPLAY','TEXT-Only');
 
   define('EMAIL_SEND_FAILED','ERROR: Failed sending email to: "%s" <%s> with subject: "%s"');
 
 
 
   define('DB_ERROR_NOT_CONNECTED', 'Error - Could not connect to Database');
 
 
 
 // EZ-PAGES Alerts
 
   define('TEXT_EZPAGES_STATUS_HEADER_ADMIN', 'WARNING: EZ-PAGES HEADER - On for Admin IP Only');
 
   define('TEXT_EZPAGES_STATUS_FOOTER_ADMIN', 'WARNING: EZ-PAGES FOOTER - On for Admin IP Only');
 
   define('TEXT_EZPAGES_STATUS_SIDEBOX_ADMIN', 'WARNING: EZ-PAGES SIDEBOX - On for Admin IP Only');
 
 
 
 // extra product listing sorter
 
   define('TEXT_PRODUCTS_LISTING_ALPHA_SORTER', '');
 
   define('TEXT_PRODUCTS_LISTING_ALPHA_SORTER_NAMES', 'Items starting with ...');
 
   define('TEXT_PRODUCTS_LISTING_ALPHA_SORTER_NAMES_RESET', '-- Reset --');
 
 
 
 ///////////////////////////////////////////////////////////
 
 // include email extras
 
   if (file_exists(DIR_WS_LANGUAGES . $_SESSION['language'] . '/' . $template_dir . '/' . FILENAME_EMAIL_EXTRAS)) {
 
     $template_dir_select = $template_dir . '/';
 
   } else {
 
     $template_dir_select = '';
 
   }
 
   require_once(DIR_WS_LANGUAGES . $_SESSION['language'] . '/' . $template_dir_select . FILENAME_EMAIL_EXTRAS);
 
 
 
 // include template specific header defines
 
   if (file_exists(DIR_WS_LANGUAGES . $_SESSION['language'] . '/' . $template_dir . '/' . FILENAME_HEADER)) {
 
     $template_dir_select = $template_dir . '/';
 
   } else {
 
     $template_dir_select = '';
 
   }
 
   require_once(DIR_WS_LANGUAGES . $_SESSION['language'] . '/' . $template_dir_select . FILENAME_HEADER);
 
 
 
 // include template specific button name defines
 
   if (file_exists(DIR_WS_LANGUAGES . $_SESSION['language'] . '/' . $template_dir . '/' . FILENAME_BUTTON_NAMES)) {
 
     $template_dir_select = $template_dir . '/';
 
   } else {
 
     $template_dir_select = '';
 
   }
 
   require_once(DIR_WS_LANGUAGES . $_SESSION['language'] . '/' . $template_dir_select . FILENAME_BUTTON_NAMES);
 
 
 
  
 ?>  
23 Sep 2008, 10:25 PM
#7
brekke00 avatar

brekke00

New Zenner

Join Date:
Aug 2007
Posts:
57
Plugin Contributions:
0

Re: blank pages. Not redirecting.

// include template specific icon name defines
 
   if (file_exists(DIR_WS_LANGUAGES . $_SESSION['language'] . '/' . $template_dir . '/' . FILENAME_ICON_NAMES)) {
 
     $template_dir_select = $template_dir . '/';
 
   } else {
 
     $template_dir_select = '';
 
   }
 
   require_once(DIR_WS_LANGUAGES . $_SESSION['language'] . '/' . $template_dir_select . FILENAME_ICON_NAMES);
 
 
 
 // include template specific other image name defines
 
   if (file_exists(DIR_WS_LANGUAGES . $_SESSION['language'] . '/' . $template_dir . '/' . FILENAME_OTHER_IMAGES_NAMES)) {
 
     $template_dir_select = $template_dir . '/';
 
   } else {
 
     $template_dir_select = '';
 
   }
 
   require_once(DIR_WS_LANGUAGES . $_SESSION['language'] . '/' . $template_dir_select . FILENAME_OTHER_IMAGES_NAMES);
 
 
 
 // credit cards
 
   if (file_exists(DIR_WS_LANGUAGES . $_SESSION['language'] . '/' . $template_dir . '/' . FILENAME_CREDIT_CARDS)) {
 
     $template_dir_select = $template_dir . '/';
 
   } else {
 
     $template_dir_select = '';
 
   }
 
   require_once(DIR_WS_LANGUAGES . $_SESSION['language'] . '/' . $template_dir_select. FILENAME_CREDIT_CARDS);
 
 
 
 // include template specific whos_online sidebox defines
 
   if (file_exists(DIR_WS_LANGUAGES . $_SESSION['language'] . '/' . $template_dir . '/' . FILENAME_WHOS_ONLINE . '.php')) {
 
     $template_dir_select = $template_dir . '/';
 
   } else {
 
     $template_dir_select = '';
 
   }
 
   require_once(DIR_WS_LANGUAGES . $_SESSION['language'] . '/' . $template_dir_select . FILENAME_WHOS_ONLINE . '.php');
 
 
 
 // include template specific meta tags defines
 
   if (file_exists(DIR_WS_LANGUAGES . $_SESSION['language'] . '/' . $template_dir . '/meta_tags.php')) {
 
     $template_dir_select = $template_dir . '/';
 
   } else {
 
     $template_dir_select = '';
 
   }
 
   require_once(DIR_WS_LANGUAGES . $_SESSION['language'] . '/' . $template_dir_select . 'meta_tags.php');
 
 
 
 // END OF EXTERNAL LANGUAGE LINKS
  
23 Sep 2008, 10:27 PM
#8
brekke00 avatar

brekke00

New Zenner

Join Date:
Aug 2007
Posts:
57
Plugin Contributions:
0

Re: blank pages. Not redirecting.

Here is the sessions.php from includes/functions


<?php
/**
 * functions/sessions.php
 * Session functions
 *
 * @package functions
 * @copyright Copyright 2003-2007 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 $Id: sessions.php 6662 2007-08-12 21:37:17Z wilt $
 */
if (!defined('IS_ADMIN_FLAG')) {
  die('Illegal Access');
}
  if (STORE_SESSIONS == 'db') {
    if (defined('DIR_WS_ADMIN')) {
      if (!$SESS_LIFE = (SESSION_TIMEOUT_ADMIN + 900)) {
        $SESS_LIFE = (SESSION_TIMEOUT_ADMIN + 900);
      }
    } else {
      if (!$SESS_LIFE = get_cfg_var('session.gc_maxlifetime')) {
        $SESS_LIFE = 1440;
      }
    }

    function _sess_open($save_path, $session_name) {
      return true;
    }

    function _sess_close() {
      return true;
    }

    function _sess_read($key) {
      global $db;
      $qid = "select value
              from " . TABLE_SESSIONS . "
              where sesskey = '" . zen_db_input($key) . "'
              and expiry > '" . time() . "'";

      $value = $db->Execute($qid);

      if (isset($value->fields['value']) && $value->fields['value']) {
        return $value->fields['value'];
      }

      return ("");
    }

    function _sess_write($key, $val) {
      global $db;
      if (!is_object($db)) {
        //PHP 5.2.0 bug workaround ... 
        $db = new queryFactory();
        $db->connect(DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD, DB_DATABASE, USE_PCONNECT, false);
      }

      global $SESS_LIFE;

      $expiry = time() + $SESS_LIFE;
      $value = $val;

      $qid = "select count(*) as total
              from " . TABLE_SESSIONS . "
              where sesskey = '" . zen_db_input($key) . "'";

      $total = $db->Execute($qid);

      if ($total->fields['total'] > 0) {
        $sql = "update " . TABLE_SESSIONS . "
                set expiry = '" . zen_db_input($expiry) . "', value = '" . zen_db_input($value) . "'
                where sesskey = '" . zen_db_input($key) . "'";

        return $db->Execute($sql);

      } else {
        $sql = "insert into " . TABLE_SESSIONS . "
                values ('" . zen_db_input($key) . "', '" . zen_db_input($expiry) . "', '" .
                         zen_db_input($value) . "')";

        return $db->Execute($sql);

      }
    }

    function _sess_destroy($key) {
      global $db;
      $sql = "delete from " . TABLE_SESSIONS . " where sesskey = '" . zen_db_input($key) . "'";
      return $db->Execute($sql);
    }

    function _sess_gc($maxlifetime) {
      global $db;
      $sql = "delete from " . TABLE_SESSIONS . " where expiry < " . time();
      $db->Execute($sql);
      return true;
    }

    session_set_save_handler('_sess_open', '_sess_close', '_sess_read', '_sess_write', '_sess_destroy', '_sess_gc');
  }

  function zen_session_start() {
    @ini_set('session.gc_probability', 1);
    @ini_set('session.gc_divisor', 2);
    if (defined('DIR_WS_ADMIN')) {
      @ini_set('session.gc_maxlifetime', (SESSION_TIMEOUT_ADMIN < 900 ? (SESSION_TIMEOUT_ADMIN + 900) : SESSION_TIMEOUT_ADMIN));
    }
    $temp = session_start();
    if (!isset($_SESSION['securityToken'])) {
      $_SESSION['securityToken'] = md5(uniqid(rand(), true));
    }
      if (ereg_replace('[a-zA-Z0-9]', '', session_id()) != '') session_regenerate_id();
    return $temp;
  }

  function zen_session_register($variable) {
    die('This function has been deprecated. Please use Register Globals Off compatible code');
  }

  function zen_session_is_registered($variable) {
    die('This function has been deprecated. Please use Register Globals Off compatible code');
  }

  function zen_session_unregister($variable) {
    die('This function has been deprecated. Please use Register Globals Off compatible code');
  }

  function zen_session_id($sessid = '') {
    if (!empty($sessid)) {
      return session_id($sessid);
    } else {
      return session_id();
    }
  }

  function zen_session_name($name = '') {
    if (!empty($name)) {
      return session_name($name);
    } else {
      return session_name();
    }
  }

  function zen_session_close() {
    if (function_exists('session_close')) {
      return session_close();
    }
  }

  function zen_session_destroy() {
    return session_destroy();
  }

  function zen_session_save_path($path = '') {
    if (!empty($path)) {
      return session_save_path($path);
    } else {
      return session_save_path();
    }
  }

  function zen_session_recreate() {
    global $http_domain, $https_domain, $current_domain;
      if ($http_domain == $https_domain) {
      $saveSession = $_SESSION;
      $oldSessID = session_id();
      session_regenerate_id();
      $newSessID = session_id();
      session_id($oldSessID);
      session_id($newSessID);
      if (STORE_SESSIONS == 'db') {
        session_set_save_handler('_sess_open', '_sess_close', '_sess_read', '_sess_write', '_sess_destroy', '_sess_gc');
      }
      session_start();
      $_SESSION = $saveSession;
      if (IS_ADMIN_FLAG !== true) {
        whos_online_session_recreate($oldSessID, $newSessID);
      }
    } else {
    /*
      $saveSession = $_SESSION;
      $oldSessID = session_id();
      session_regenerate_id();
      $newSessID = session_id();
      session_id($oldSessID);
      session_destroy();
      session_id($newSessID);
      session_set_cookie_params(0, '/', (zen_not_null($http_domain) ? $http_domain : ''));
      session_id($newSessID);
      if (STORE_SESSIONS == 'db') {
        session_set_save_handler('_sess_open', '_sess_close', '_sess_read', '_sess_write', '_sess_destroy', '_sess_gc');
      }
      session_start();
      session_set_cookie_params(0, '/', (zen_not_null($current_domain) ? $current_domain : ''));
      session_start();
      $_SESSION = $saveSession;
      */
    }
  }
?>

:frusty::frusty::frusty: realy banging my head against the wall here.

thanks for anny help or tips.

25 Mar 2009, 3:36 PM
#9
agelec avatar

agelec

New Zenner

Join Date:
Mar 2009
Posts:
13
Plugin Contributions:
1

Re: blank pages. Not redirecting.

Im not sure if this will help but trying getting hold of a fresh unmodified english.php file and delete the current one you have or rename it to english.php1 and upload the new english.php via your hosting Cpanel dont use anything else other than the Cpanel Upload utility.

9 Apr 2009, 3:21 PM
#10
brekke00 avatar

brekke00

New Zenner

Join Date:
Aug 2007
Posts:
57
Plugin Contributions:
0

Re: blank pages. Not redirecting.

i have tried with a new file. but no help. and i would never use cpanel for anything. even if i had it on my server. :) i am on a vps server and i use plesk unlimited pro pack. and i use a good ftp client. i would recommend using a ftp client. it does not make any difference what you use to uppload your files.

anyway. solution to this issue was a reinstall of ZenCart. only thing that helped. everything was working fine after the reinstall. all my custom files was working corectly.

thanks for trying to help anyway. cheers for that.

17 Dec 2009, 9:45 AM
#11
hkazem09 avatar

hkazem09

New Zenner

Join Date:
Dec 2009
Posts:
5
Plugin Contributions:
0

Re: blank pages. Not redirecting.

hi,
make sure there are no data before <%PHP OR AFTER %>
A SPACE CAN MAKE THE PROBLEM
AND TRY THE MOD CALLED
debug_error_logging_utility_1-0
IN ADD-ONS