Re: Hiding Sidebox content
Billy I really appreciate your help/support, but I'm a bit lost with your solution. What will exactly do? And you posted this is for v1.5? I only asked for a modification to make the login page to direct the customer to the account page or mainpage without the https since it was giving the warning of non-encrypted items being displayed.
I'm not a coder and I'm not sure what to do with your "script" does it go in the module file or on the template file?
I really don't know if this is what I want, I don't want the box to be available only for logged customer, neither to non-logged customers; I just don't want the SSL non-encrypted items warning popping up all over the place.
Re: Hiding Sidebox content
Sure sorry for the confusion.
If you give me a mo I'll explain...
What the code above would do is check in the side-box you are using,
If the customer is logged in and the customer is on a SSL connection.
If yes you can choose to show them content in the particular side-box that does not throw up a SSL non-encrypted items warning. i.e. a nice graphic for instance.
Alternatively if the customer is not logged in and hence not on a SSL connection the same box would show the normal content i.e. the content giving the problem.
I have the same issue with SSL content, if you want to see similar use of the code pop over to my site and go to About Us page. (although not content in a side-box)
In the address bar change the http: to https: and you can see what I mean.
The AddThis buttons disappear and are replaced with text...
I got stuck at work today, but had good intentions of re-building the box you mentioned in the other thread to include the coding for you and others to use. Oh well the road to hell and all that.
Apologies for assuming you could follow what I was intending. I thought you may have been able to make use of it so far.
If you can wait out a couple of days till I have some time off , work permitting, I will download the message me box and rework it so it does what you need.
Re: Hiding Sidebox content
Ok, I see better your intentions now. I will try to understand how to incorporate your script into action tonight, if I can't then I will wait for you. I still not knowing WHERE I'm going to insert it.
Your site is beautiful. You may want to fix a typo on your about us page: "Your are on a secure SSL connection!" it's supposed to be: "You are on a secure SSL connection!"
Thanks for your great help!
1 Attachment(s)
Re: Hiding Sidebox content
Hi thanks for the heads up on the typo and compliment on my site.
I tried looking for the message me sidebox, but could not find it in the plugins area.
So I made a little SSL box to try and show you where the content would need to go.
As it says in the files comments you can add just about anything to the box, including other php code.
Perhaps the easiest way would be to take a copy of the code that controls the show - no show function and add it to the origional sodebox.
The code would go in your /includes/modules/sideboxes/your_template/name_of_sidebox.php file. (although you, your client may not have an overrides folder for modules):lookaroun
You may see a line of code like: swap out the word secure for whatever your box is called.
Code:
$show_secure_sidebox = true;
the code staement would go in after that.
To look like this
Code:
$show_secure_sidebox = true;
if ($_SERVER['HTTPS']== 'on' ){
$show_secure_sidebox = false;
}
if ($show_secure_sidebox == true) {
require($template->get_template_dir('tpl_secure_sidebox.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_secure_sidebox.php');
$title = BOX_HEADING_SECURE_SIDEBOX;
$title_link = false;
require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
}
Anyway here is a little add-on box I put together to show you.
Re: Hiding Sidebox content
Quote:
I tried looking for the message me sidebox, but could not find it in the plugins area.
No, that's because I just use the blank sidebox for this and didn't uploaded because I don't think people would be interested. I did this for my own site and only few customers have been interested to have it on their store.
It worked like a charm. :smartalec: THANKS! Now, if you could tell me how to insert the a custom message (like the one on your site) to appear when the box doesn't show up so people know how to make it appear for them to use (like, click on the logo for chat box).
Re: Hiding Sidebox content
Yepee! :-D Glad that works for you.
Posting at work again, can't give a full answer. When I'm at home tomorrow I'll write the code for you and some details of what and where to change stuff.
Re: Hiding Sidebox content
Hi only had a little while to work on this today, so not quite there yet. Well I'm not happy with it yet.
Got the box doing an auto page reload and changing to http://, so no issues with it not showing on the general cart pages after logging in. Just need to have it do a further check for pages that are secured with SSL and there is a need to show the box with some content ( even if that's a graphic or text stating the user is on SSL). Anyway a few hours tomorrow and it should be good to go. Might even release it as a mod.
1 Attachment(s)
Re: Hiding Sidebox content
Okay managed to get this working just how I would like it.
1. site visitor arrives on home page "the box" is showing with content. (for you that would be message me)
2. site visitor logs in and is returned to home page. "the box" checks foe SSL and reloads page for NONSSL version. i.e. content is shown.
3. site visitor is logged in and goes to account page or adds to cart and goes to checkout, any page with SSL and side boxes showing. "the box" checks for current page base and hides the box along with content. Not throwing up a SSL content warning.
Think that's all there needs to be done? except testing it on other sites, like yours :D.
Here is where and how to change the included content:
1. Use as many or as few lines using this model as you need for your custom content. from tpl_secure_sidebox.php
2. if you only need the one line delete line 9. or
3. If you have a multilingual site, add a defines (secure_sidebox_defines.php) your set up in the languages/YOUR_LANGUAGE/extra_definitions/ folder this includes it as shown in line 8.
4. If your site is monolingual, you can put the text right here as shown on line 9 (and nobody will know!) remember if not using line 8 just remove it all together.
5. Replace the text and HTML tags between the apostophes on lines 8 and 9.
6. To add a header to the box use languages/english/extra_definitions/secure_sidebox_defines.php add it on line 6 (BOX_HEADING_SECURE_SIDEBOX)
Hope this explains it well, if not just give me a shout. Always happy to help. :cool:
For what it looks like on site just pop over to AML Candles look for "the box" SOCIALISE.
then either log in as UserName: [email protected] - Password: likeitnow
or
change the address to
Code:
https://amlcandles.co.uk
You should notice no difference at all "the box" will still be there, with content and the address will change back to
Hope you like it. :D
Oh and by the way you asked why it was tagged as V1.5
Don't know really it was a tick box on the new post screen and either I didn't unticked or ticked it along with others :blush: :blink:
Replace the last SSL_SIDEBOX files with these and you're good to go.
Re: Hiding Sidebox content
Submitted to the Plugins and Addons section.
My First Addon.
Awaiting approval.
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...