Zen Cart Logo
Forums / Basic Configuration / Blank side box & SSL Unauthenticated content

Blank side box & SSL Unauthenticated content

Locked

Views: 2,672

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
1 Feb 2010, 10:38 PM
#1
green333 avatar

green333

Zen Follower

Join Date:
Mar 2008
Location:
QLD - Aussie
Posts:
190
Plugin Contributions:
0

Blank side box & SSL Unauthenticated content

Hi
I have a new Blank side box with facebook/twitter links, and since installing, have a dreaded SSL Unauthenticated content problem on my checkout page

Have been looking through the posts and 'assume' that my problem is due to these new links? (but I may be wrong)

Would the best remedy be to 'switch off' the sideboxes at the check out phase? If this is what I need to do, could someone please guide me? Or any other advice would be great.

site is http://www.partykitnkaboodle.com.au

Many thanks:smile:

2 Feb 2010, 12:30 AM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Blank side box & SSL Unauthenticated content

You could setup the sidebox to not display on secure pages by testing for the value of:
$request_type

where the values are either:
SSL
NONSSL

Look at the various sidebox modules and see how many of them have both a $show_boxsomethingname variable and an IF statement that uses that variable ...

You could setup your own for your sidebox in a similar fashion ... :smile:

2 Feb 2010, 6:01 AM
#3
green333 avatar

green333

Zen Follower

Join Date:
Mar 2008
Location:
QLD - Aussie
Posts:
190
Plugin Contributions:
0

Re: Blank side box & SSL Unauthenticated content

Ajeh,
Thanks for your reply :)

I'm afraid that I'm a bit lost (sorry)

Would you mind very much explaining in a little more detail?

(BTW the sidebox is the 'editable sidebox mod' by Kuroi)

thank you so much...still learning:shocking:

2 Feb 2010, 6:09 AM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Blank side box & SSL Unauthenticated content

Change the code to include:

  // test if box should display
  $show_editable_sidebox = true;
  
[B]  // bof: do not show on secure pages
  if ($request_type == 'SSL') {
    $show_editable_sidebox = false;
  }
  // eof: do not show on secure pages
[/B]  
  $define_sidebox = zen_get_file_directory(DIR_WS_LANGUAGES . $_SESSION['language'] . '/html_includes/', DEFINE_EDITABLE_SIDEBOX_NAME, 'false');
2 Feb 2010, 6:27 AM
#5
green333 avatar

green333

Zen Follower

Join Date:
Mar 2008
Location:
QLD - Aussie
Posts:
190
Plugin Contributions:
0

Re: Blank side box & SSL Unauthenticated content

:clap:you are brilliant!!! It worked, it worked

Many thanks :hug:

You guys are the best!!!

12 Feb 2010, 6:48 PM
#6
litepockets avatar

litepockets

Zen Follower

Join Date:
Apr 2008
Location:
Covington, Washington, United States
Posts:
206
Plugin Contributions:
0

Re: Blank side box & SSL Unauthenticated content

Same problem, different sidebox.. I am using another custom sidebox (help center live sidebox) and can't seem to figure out how to implement the above. I looked at kuroi's contribution and files to see if I could edit the code accordingly but unfortunately I am not great with php... Any guidance? Files for this module include:

/includes/templates/TEMPLATE_NAME/sideboxes/tpl_livehelp.php :

<?php

  $content = '<!-- BEGIN Help Center Live Code, Copyright (c) 2005 Help Center Live. All Rights Reserved -->
<div id="div_initiate" style="position:absolute; z-index:1; top: 40%; left:40%; visibility: hidden;"><a href="javascript:Live.initiate_accept();"><img src="/support/livechat/templates/Bliss/images/initiate.gif" border="0"></a><br><a href="javascript:Live.initiate_decline();"><img src=/support/livechat/templates/Bliss/images/initiate_close.gif" border="0"></a></div>
<script type="text/javascript" language="javascript" src="/support/livechat/class/js/include.php?live&cobrowse"></script>
<!-- END Help Center Live Code, Copyright (c) 2005 Help Center Live. All Rights Reserved -->
';

?>

/includes/modules/sideboxes/livehelp.php :

<?php

require($template->get_template_dir('tpl_livehelp.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_livehelp.php');
      $title =  '<label>' . BOX_HEADING_LIVEHELP . '</label>';
      $title_link = false;
      require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
?>

Added the following to /includes/languages/english.php :

// Live Help Center
define('BOX_HEADING_LIVEHELP', 'Support Center');

I am using ZC 1.3.8a

11 Aug 2010, 10:16 PM
#7
khopek avatar

khopek

Totally Zenned

Join Date:
Aug 2006
Location:
portlandish, oregon
Posts:
795
Plugin Contributions:
0

Re: Blank side box & SSL Unauthenticated content

Ajeh:

Change the code to include:

// test if box should display
$show_editable_sidebox = true;

[B] // bof: do not show on secure pages
if ($request_type == 'SSL') {
$show_editable_sidebox = false;
}
// eof: do not show on secure pages
[/B]
$define_sidebox = zen_get_file_directory(DIR_WS_LANGUAGES . $_SESSION['language'] . '/html_includes/', DEFINE_EDITABLE_SIDEBOX_NAME, 'false');


What file should this be added to? I need to prevent the facebook fan thing from showing on SSL pages..
12 Aug 2010, 12:54 AM
#8
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Blank side box & SSL Unauthenticated content

Let's use an existing sidebox as an example ...

Look at the currencies sidebox ... it is designed to not show on pages that start with:
checkout

Look at the file:
/includes/modules/sideboxes/currencies.php

And you see the code:

  // don't display on checkout page:
  if (substr($current_page, 0, 8) != 'checkout') {
    $show_currencies= true;
  }

If we wanted that to be controlled based on secure pages, we would change that IF to read:

  // don't display on checkout page:
  if (substr($current_page, 0, 8) != 'checkout') {

to read:

  if ($request_type == 'SSL') {
    $show_currencies= false;
  }

So on secure pages, the variable $show_currencies is set to false ...

Then, if you look at the rest of the code, it is surrounded by an IF that reads:

  if ($show_currencies == true) {
// bunch of code goes here

  }

The idea is to follow a pattern to determine when to show the sidebox code based on some type of condition ...

Now if I wanted to do this in a template and override file, I would copy the two files:
/includes/modules/sideboxes/currencies.php
/includes/templates/template_dir/sideboxes/tpl_currencies.php

to my templates and overrides directories:
/includes/modules/sideboxes/your_template_dir/currencies.php
/includes/templates/your_template_dir/sideboxes/tpl_currencies.php

The reason I copy both files is that sometimes I need to change both and sometimes I just need to change one of the file pair ... but since it is a pair of files and I don't want to confuse myself or have updates come in later that might "overwrite" a working pair of files, I copy both files as if they were both changed ...

This is a safety I like to use, so whether you follow it or not is up to you ...

But for understanding the sideboxes better, study the different sideboxes ...

Most all of them have some kind of condition on them for when they should or should not show ...

Those that do not have a condition set on them for controlling when they should or should not show, can be customized ...

Again, the variable used for the:
$show_something

was used with the same name as the sidebox for keeping the code "more understandable" and it made more sense for the variable to be, for example:
$show_currencies

in the currencies sidebox currencies.php than to call it:
$xyzabc

Remember, you are looking for "patterns" when it comes to coding as most code, and Zen Cart is a good example of it, uses patterns to make things much more logical and clearer both to you as well as to us, the developers of the code ... :smile: