Re: Hiding Sidebox content
Hi BillyBoyle,
Sorry for the delay but has been busy...
I tried this tonight and it breaks my cart (I believe the only change was on the module file?). Here's my copy as my sidebox parameters:
PHP Code:
<?php
/**
* blank sidebox - allows a blank sidebox to be added to your site
*
* @package templateSystem
* @copyright 2007 Kuroi Web Design
* @copyright Portions Copyright 2003-2007 Zen Cart Development Team
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: blank_sidebox.php 2007-05-26 kuroi $
*/
// test if box should display
$show_messageme_sidebox = true;
if ($_SERVER['HTTPS']== 'on' ){
$show_messageme_sidebox = false;
}
if ($show_messageme_sidebox == true) {
require($template->get_template_dir('tpl_messageme.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_messageme.php');
$title = BOX_HEADING_MESSAGEME_SIDEBOX;
$title_link = false;
require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
}
?>
Here's what happens: http://img39.imageshack.us/img39/1736/aquatic.jpg
Let me know if I have to make changes in any other of the files or if there's something wrong on this one.
Re: Hiding Sidebox content
Quote:
Originally Posted by
ideasgirl
Hi BillyBoyle,
Sorry for the delay but has been busy...
I tried this tonight and it breaks my cart (I believe the only change was on the module file?). Here's my copy as my sidebox parameters:
PHP Code:
<?php
/**
* blank sidebox - allows a blank sidebox to be added to your site
*
* @package templateSystem
* @copyright 2007 Kuroi Web Design
* @copyright Portions Copyright 2003-2007 Zen Cart Development Team
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: blank_sidebox.php 2007-05-26 kuroi $
*/
// test if box should display
$show_messageme_sidebox = true;
if ($_SERVER['HTTPS']== 'on' ){
$show_messageme_sidebox = false;
}
if ($show_messageme_sidebox == true) {
require($template->get_template_dir('tpl_messageme.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_messageme.php');
$title = BOX_HEADING_MESSAGEME_SIDEBOX;
$title_link = false;
require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
}
?>
Here's what happens:
http://img39.imageshack.us/img39/1736/aquatic.jpg
Let me know if I have to make changes in any other of the files or if there's something wrong on this one.
Oooo that's not good.
But just like the blank you are using you need to work between 3 files. The contents I show is in the defines file. Tell you what, send me your 3 files for blank sidebox and the message me files, if you don't mind. I'll build the mod and send it back to you.
Re: Hiding Sidebox content
Hi, okay at home now and can take a closer look on proper screen. Done a little compare and contrast on your file contents and YES there are some difference I think you need altered.
Here is the contents of my module file with calls and pointer changed to suit your messageme box.
Code:
<?php
/**
* secure sidebox - allows a secure sidebox to be added to your site
* with secure connection check
*/
// test if box should display
$show_messageme_sidebox = true;
if (($_SERVER['HTTPS']== 'on' ) || (in_array($current_page_base,explode(",",'login,logoff,account,create_account,shopping_cart,checkout_shipping,checkout_payment,checkout_confirmation,checkout_success,checkout,fec_confirmation,login,no_account')) )) {
$show_messageme_sidebox = false; // this line makes the whole box not show on certain pages, not just the contents. just like in the file tpl_main_page.php
// the above comma seperated list needs to match any pages you list there. tpl_main_page.php about line #41
}
elseif ($show_messageme_sidebox == true) { //shows the box everywhere else.
require($template->get_template_dir('tpl_messageme.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_messageme.php');
$title = BOX_HEADING_MESSAGEME_SIDEBOX;
$title_link = false;
require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
}
else{ // refreshes the page only if the box shows and the page is on SSL connection
echo '<script type="text/javascript">
//<![CDATA[
if (window.location.protocol != "http:")
window.location.href = "http:" + window.location.href.substring(window.location.protocol.length);
//]]>
</script>'; }
?>
Don't know if the rest of your files are okay? as I suggested last night if you send the rest I can check.
This should be how your /includes/templates/YOUR_TEMPLATE/sideboxes/tpl_messageme.php could look (without seeing it I can't be sure)
(guessing on the 3nd contents .= calls)
Code:
<?php
$content = '';
$content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">';
$content .= '<div>' . TEXT_MESSAGEME_SIDEBOX . '</div>';
$content .= '';
$content .= '</div>';
?>
And your /includes/languages/english/extra_definitions/YOUR_TEMPLATE/your_sidebox_defines.php file
Don't know unless I see it. the one for this mod looks like this.
Code:
<?php
/**
* secure sidebox definitions - text or code for inclusion in a new secure sidebox
* with secure connection check
*/
define('BOX_HEADING_SECURE_SIDEBOX', 'Socialise');
define('TEXT_SECURE_SIDEBOX', '<div class="addthis_toolbox addthis_default_style addthis_32x32_style">
<a class="addthis_button_preferred_1"></a>
<a class="addthis_button_preferred_2"></a>
<a class="addthis_button_preferred_3"></a>
<a class="addthis_button_preferred_4"></a>
<a class="addthis_button_compact"></a>
<a class="addthis_counter addthis_bubble_style"></a>
</div>
<script type="text/javascript">var addthis_config = {"data_track_addressbar":true};</script>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-****************"></script>
// All of this gets changed to whatever you want to have showing when the box shows. Text, javascript, php
');
?>
Hope this helps, but if not keep the questions coming. :cool:
Re: Hiding Sidebox content
Yes, that made the trick BUT... (of course there's a BUT)...
I know you changed the code to make a "redirection" to a non-ssl after login (instead of having the text telling people to somehow click to a non-ssl link and make the switch). But my login is not doing that... After the login, it goes to index BUT DOESN'T change the page to http:, it leaves it https instead. Which bring us back to almost same issue because even though I don't have an SSL warning the sidebox doesn't show up immediately on home, and then I don't know how to add the text (like the one you used to have on your site) to explaint it. :unsure:
Does that make sense to you? Do you understand what I mean?
2 Attachment(s)
Re: Hiding Sidebox content
Hi, Yes I removed the text info part altogether when I made to page reload automatic.
It could be added back in, but it really did nothing where I had it. Except made the customer look for a link to reload the page manually.
When I thought about it I didn't really want to give the "stupid" visitors more to get wrong.
Will not have the time to anything about it for a few days, Sunday the earliest. It will take a little time to re-write the code that stops auto refresh and work out where to safely put an on-click command.
Do you have it running on your site just now? I had a look and can't tell if it's there or there and not working.
You do seem to have it kind of half implemented, as when I change the protocol to https some of the contents of the box don't show.
Your Sidebox goes from this
Attachment 10716
To this
Attachment 10715
So there is something going on with it, but without access to your pagecode I just don't know sorry.
You did back-up didn't you? load the page from before the mod, apply the same changing to secure sidebox as you did to blank sidebox (they are just the same basic sidebox template) and see how that goes.
Wish I could be of more help at this time. Billy
Re: Hiding Sidebox content
Hi Billy! No, I haven't done it on my site (I will though). I just used it on my customer's store.
You are right, no need to confuse "stupid" visitors :D
It's not a biggy since the customer is happy without the SSL warning issue; it just would be nice...