Zen Cart Logo
Forums / Addon Sideboxes / Thanks for an excellent Blank Sidebox

Thanks for an excellent Blank Sidebox

Locked

Views: 4,235

Results 1 to 19 of 19
This thread is locked. New replies are disabled.
9 Aug 2010, 2:34 PM
#1
athens_collectibles avatar

athens_collectibles

Zen Follower

Join Date:
May 2010
Location:
Athens, Greece
Posts:
293
Plugin Contributions:
0

Thanks for an excellent Blank Sidebox

I downloaded, easily installed and customised Kuroi's blank sidebox from http://www.zen-cart.com/index.php?main_page=product_contrib_info&cPath=40_52&products_id=174.

Thanks to its simplicity and very clear instructions, I was able to quickly customise two different boxes in two languages and add my HTML.

It's always great to find nice and easy-to-implement modules. Thanks Kuroi and keep up the good work! :D

10 Aug 2010, 8:41 PM
#2
hello avatar

hello

Zen Follower

Join Date:
Jul 2010
Posts:
100
Plugin Contributions:
0

Re: Thanks for an excellent Blank Sidebox

I'm glad you figure it out! I installed it and don't know what to do..

How about helping me out in plain easy 5th grade language!

I want a new side box with only a picture (I don't know how to do <img stuff>)

and if you don't mind.. I want a another sidebox where people can click on my Icon homepage and be redirected to my homepage in a new window..

10 Aug 2010, 9:01 PM
#3
athens_collectibles avatar

athens_collectibles

Zen Follower

Join Date:
May 2010
Location:
Athens, Greece
Posts:
293
Plugin Contributions:
0

Re: Thanks for an excellent Blank Sidebox

I'll be glad to help as much as I can but ...tomorrow. I don't know where you are located but I'm in Greece and it is nearly midnight now. Actually, one of the two blank sideboxes I mentioned, is on the left side column showing the current time in Athens.

If you don't mind, post your URL and I'll be back tomorrow.

Cheers and have a nice evening (or day) for now. :smile:

11 Aug 2010, 7:56 AM
#4
athens_collectibles avatar

athens_collectibles

Zen Follower

Join Date:
May 2010
Location:
Athens, Greece
Posts:
293
Plugin Contributions:
0

Re: Thanks for an excellent Blank Sidebox

Hi, it's morning now and I'm back.

Before doing anything, please read the whole post. Also, when changing anything in the files, make sure that you don't accidentally delete any apostrophe (single quote) in the code. If you want to include any apostrophes in your header or box text, remember to escape them, i.e. put a backslash, "" before them (for example George's box).

I'll explain what I did and you can easily make the changes you need. If you load my site and switch to English by clicking on the flag in the top navigation bar, you will see one box with a clock on the left sidebar and another with a Live Help icon and some text on the right sidebar.

First of all, I unzipped the module and then copied all files in another folder. Leaving the original files intact, I used the new folder and changed all ocurrences of blank or BLANK to chat and CHAT (for the Live Help box). In another copy of the original files, I changed blank and BLANK to time and TIME (for the clock box). Next time I will need to add another box called "whatever", I will create another copy and change blank and BLANK to whatever and WHATEVER and so on for any additional boxes. If I left blank and BLANK as in the original, every new box would overwrite the previous one since all definitions and file names would be identical. You can of course use other naming conventions like blank2, blank3 etc but I have used this method to help me easily identify which file does what without having to open them and see their contents.

As there are very few files, it's easy to rename the file names as above. But, what is more important, is to open each of them and make the changes to their contents as well.

So far, so good (I hope). You should now have a set of files named xxxx with all their contents changed from blank to xxxx as well.

Now, open the file /includes/templates/template_default/sideboxes/tpl_xxxx_sidebox.php and change the two lines from:

$content .= '<p>' . TEXT_XXXX_SIDEBOX . '</p>';
$content .= '<p>You can include text, links, images, HTML markup and even PHP code</p>';

to:

$content .= '' . TEXT_XXXX_SIDEBOX . '';
$content .= '';

Save it and open the file /includes/languages/english/extra_definitions/xxxx_sidebox_defines.php

Change the two lines from:

define('BOX_HEADING_XXXX_SIDEBOX', 'Blank Sidebox Header');
define('TEXT_XXXX_SIDEBOX', 'Replace this text with your HTML content.');

to:

define('BOX_HEADING_XXXX_SIDEBOX', 'yyyyyyyyyyyyyy');
define('TEXT_XXXX_SIDEBOX', '<img src="the url of your image" height="zzz" width="zzz" border="0" alt="zzzzzzzz" title="zzzzzzzz"><a href="the url of your link" target="_blank" alt="zzzzzzzz" title = "zzzzzzzz"><br />any text you want to have below the icon');

where yyyyyyyyyyyyyy is the title you want the box to have and zzz are your preferred values. Save the file and you are done.

Before uploading to your server, backup everything. I always do a full backup of the database and the files.

Then FTP the whole includes folder into your home directory and check your site for the new box. From then on, you can control its position (left or right sidebar, above or below other boxes) from your Administration > Tools > Layout Boxes Controller.

Simple, wasn't it? Good luck and please report back when you have it installed and working.

15 Aug 2010, 11:14 PM
#5
caroleas avatar

caroleas

Totally Zenned

Join Date:
Feb 2009
Posts:
896
Plugin Contributions:
0

Re: Thanks for an excellent Blank Sidebox

I did install that blank sidebox and it seems ok except for the fact that the image is not the clickable element, but a border right underneath it. Could you point me to where i might have made a mistake?

My store is http://creationcassel.com/store

After that, i will have to add to the French language.

16 Aug 2010, 8:41 AM
#6
athens_collectibles avatar

athens_collectibles

Zen Follower

Join Date:
May 2010
Location:
Athens, Greece
Posts:
293
Plugin Contributions:
0

Re: Thanks for an excellent Blank Sidebox

Hi Carole, I've seen your site and, if you are talking about the box titled "PSP Resources", the image is clickable and the box is installed in the French language as well.

I can assume that you either found your way around and there's no pending issue or that I'm looking at the wrong box. :unsure:

If you want, I can send you all the files used to make my "Secure Payments" box in English and Greek and just change the image and text to create your own boxes (that's in case you want to add text below the image like I've done).

19 Aug 2010, 4:37 AM
#7
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Thanks for an excellent Blank Sidebox

In case other people have the same issue as CaroleAs, the define given in post #4 is intended to create a non-clickable image with a clickable text link below it. If you want a clickable image, you need to move the <img> inside the <a>:```php
define('TEXT_XXXX_SIDEBOX', '<a href="the url of your link" target="_blank" alt="zzzzzzzz" title = "zzzzzzzz"><img src="the url of your image" height="zzz" width="zzz" border="0" alt="zzzzzzzz" title="zzzzzzzz"><br />any text you want to have below the icon</a>');

19 Aug 2010, 3:06 PM
#8
hello avatar

hello

Zen Follower

Join Date:
Jul 2010
Posts:
100
Plugin Contributions:
0

Re: Thanks for an excellent Blank Sidebox

Hello! I love greek food! So tasty and favorful and all that Meat!! An older greek guy I just to work with, made me some greek rice and It was the best rice I ever tasted!!! He would cook the rice, then spread it out on a flat sheet pan and coat it with butter and olive oil and salt and just put it in the oven under the broiler. I tried it at home.. nothing close to his rice. He must have done something more!!

I'm still confuse at the instructions.

I unzipped the zip file. Now I have a Includes Folder with three extra folders. Languages, Modules, Templates.. I got that far!!

I used the new folder and changed all ocurrences of blank or BLANK to chat and CHAT (for the Live Help box).

?? Where do I change the blanks? In which folder? Or do I drag the folders first into the Right hand side of the FTP side?

I always get confuse about that.. Do I just take the whole Includes folder and just drag it into the root folder.. Or do I click on each folder (ex. Languages) and keep on clicking and locating the files on the Right (zen cart folders) to find it and then drag the file in?

If so Do I drag it into my Personal Template folder? Instead of finding the Language folder and then the English and then Extra Definitons and then drag the blank_sidebox_defines php in there?

thanks!

Athens Collectibles:

Hi, it's morning now and I'm back.

First of all, I unzipped the module and then copied all files in another folder. Leaving the original files intact, I used the new folder and changed all ocurrences of blank or BLANK to chat and CHAT (for the Live Help box). In another copy of the original files, I changed blank and BLANK to time and TIME (for the clock box). Next time I will need to add another box called "whatever", I will create another copy and change blank and BLANK to whatever and WHATEVER and so on for any additional boxes. If I left blank and BLANK as in the original, every new box would overwrite the previous one since all definitions and file names would be identical. You can of course use other naming conventions like blank2, blank3 etc but I have used this method to help me easily identify which file does what without having to open them and see their contents.

As there are very few files, it's easy to rename the file names as above. But, what is more important, is to open each of them and make the changes to their contents as well.

So far, so good (I hope). You should now have a set of files named xxxx with all their contents changed from blank to xxxx as well.

Now, open the file /includes/templates/template_default/sideboxes/tpl_xxxx_sidebox.php and change the two lines from:

$content .= '<p>' . TEXT_XXXX_SIDEBOX . '</p>';
$content .= '<p>You can include text, links, images, HTML markup and even PHP code</p>';

> 
> to:
> 
> ```
$content .= '' . TEXT_XXXX_SIDEBOX . '';
$content .= '';

Save it and open the file /includes/languages/english/extra_definitions/xxxx_sidebox_defines.php

Change the two lines from:

define('BOX_HEADING_XXXX_SIDEBOX', 'Blank Sidebox Header');
define('TEXT_XXXX_SIDEBOX', 'Replace this text with your HTML content.');

> 
> to:
> 
> ```
define('BOX_HEADING_XXXX_SIDEBOX', 'yyyyyyyyyyyyyy');
define('TEXT_XXXX_SIDEBOX', '<img src="the url of your image" height="zzz" width="zzz" border="0" alt="zzzzzzzz" title="zzzzzzzz"><a href="the url of your link" target="_blank" alt="zzzzzzzz" title = "zzzzzzzz"><br />any text you want to have below the icon');

where yyyyyyyyyyyyyy is the title you want the box to have and zzz are your preferred values. Save the file and you are done.

Before uploading to your server, backup everything. I always do a full backup of the database and the files.

Then FTP the whole includes folder into your home directory and check your site for the new box. From then on, you can control its position (left or right sidebar, above or below other boxes) from your Administration > Tools > Layout Boxes Controller.

Simple, wasn't it? Good luck and please report back when you have it installed and working.

19 Aug 2010, 3:13 PM
#9
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Thanks for an excellent Blank Sidebox

Before you get into FTP, as AthensCollectibles says, just unzip the mod and copy the whole thing to a temporary folder on your computer. In that temporary folder, change file/folder names, constant names, etc. as he described. Once that is all done, FTP the whole /includes/ folder from your temporary folder to your server.
"Do I just take the whole Includes folder and just drag it into the root folder."
Yes.

19 Aug 2010, 4:28 PM
#10
athens_collectibles avatar

athens_collectibles

Zen Follower

Join Date:
May 2010
Location:
Athens, Greece
Posts:
293
Plugin Contributions:
0

Re: Thanks for an excellent Blank Sidebox

He would cook the rice, then spread it out on a flat sheet pan and coat it with butter and olive oil and salt and just put it in the oven under the broiler.This sounds like a hybrid recipe, I've never heard of rice cooked that way (at least, not in Greece). But, since it was tasty, I'll ask my wife to try it!

As Glenn explained: copy all unzipped folders and files to a temporary directory. There are only 4 files in total, or 3 if you only have one language. Assuming that you want to create a new blank box called "Personal", change the name of each file by replacing "blank" with "personal". For example, rename the file tpl_blank_sidebox.php to tpl_personal_sidebox.php, then open the file with Notepad, or Notepad++ or another text editor.

You will see the line of code:

$content .= '<p>' . TEXT_CHAT_SIDEBOX . '</p>';

Change it to:

$content .= '<p>' . TEXT_PERSONAL_SIDEBOX . '</p>';

and proceed like this with the remaining file names and their contents.

Once you are through, FTP the whole "includes" folder to your home directory. That's all.

It is really very simple, but one of those things that are easier to do than to describe.

Wishes for good luck. The effort will make you to enjoy the rice!

19 Aug 2010, 5:15 PM
#11
athens_collectibles avatar

athens_collectibles

Zen Follower

Join Date:
May 2010
Location:
Athens, Greece
Posts:
293
Plugin Contributions:
0

Re: Thanks for an excellent Blank Sidebox

Hi Glenn,

Since you have been involved in this thread, first let me thank you for the corrected code in post #7. My intention was to have a clickable image and text and I have since corrected my own box.

I have another problem that troubles me. If you look at my site, I have two boxes in the left side column, one is titled "Secure payments" and the other "The time in Athens is". They both look fine as long as the "time" box is the last in the column. If I move it above the "Secure payments" box, it doesn't end but extends to the back of the box underneath it and it ends a few pixels below the "Secure payments" box!

You can see the two positions in the attached screenshots. The same happens if I move it to the right side column above any other box.

I have tried to identify and correct the problem with the use of web developer tools of Firefox but have not been successful. I suspect that it may have to do with the contents which is a flash object. If it means anything to you, the file includes/templates/template_default/sideboxes/tpl_time_sidebox.php contains the following:

$content .= '' . TEXT_TIME_SIDEBOX . '';
$content .= '<div align="center"><embed width="90" height="90" src="http://www.worldtimeserver.com/clocks/wtsclock001.swf?color=000080&wtsid=gr" type="application/x-shockwave-flash" wmode="transparent"></ div>';
$content .= '';

Could the type of contents (flash) be the cause of this anomaly, or do you see anything else in the code that could be responsible?

Any help will be appreciated. It looks fine now that I have it as the last box in the column, but it's a matter of principle to find out what's going wrong and probably prevent a future box to behave like this.

Cheers and have a nice evening.

19 Aug 2010, 7:02 PM
#12
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Thanks for an excellent Blank Sidebox

I don't know if it makes a difference, but you have </ div> instead of </div> in your code. This may be what is failing to close the content div correctly (which is obviously what is happening).

19 Aug 2010, 7:41 PM
#13
athens_collectibles avatar

athens_collectibles

Zen Follower

Join Date:
May 2010
Location:
Athens, Greece
Posts:
293
Plugin Contributions:
0

Re: Thanks for an excellent Blank Sidebox

I don't know if it makes a difference, but you have </ div> instead of </div> in your code.

It did make a difference, thank you for the hint! The space is gone and everything is back to normal. One item less in the to-do list. :bigups:

22 Aug 2010, 8:23 PM
#14
loxly avatar

loxly

New Zenner

Join Date:
Apr 2004
Location:
Las Vegas and NYC
Posts:
40
Plugin Contributions:
0

Re: Thanks for an excellent Blank Sidebox

Just installed this blank box with Craft Syntax and it worked perfectly. Thanks for this thread!!!

29 Sep 2010, 11:48 PM
#15
inestine avatar

inestine

New Zenner

Join Date:
Aug 2010
Posts:
51
Plugin Contributions:
0

Re: Thanks for an excellent Blank Sidebox

Can't seem to get my php code to work. Any ideas?
This is straight from my tpl_blank_sidebox.php:

<?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 $ */ $content = ''; $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">'; // Replace the text and HTML tags between the apostophes on lines 19 and 20. // Use as many or as few lines using this model as you need for your custom content. // If you have a multilingual site define your text in the languages/YOUR_LANGUAGE/extra_definitions/blank_sidebox_defines.php and include it as shown in line 19. // If your site is monolingual, you can put the text right here as shown on line 20 (and nobody will know!) $content .= '<p>' . TEXT_BLANK_SIDEBOX . '</p>'; $content .= '<div id="form"> <?PHP if(isset($_POST['Submit'])) { $user="user"; $pass="pass"; $url = "http://mydigitalpublication.com/publication?i=43543"; echo '<META http-equiv="refresh" content="0;URL='.$url.'">'; } ?> <form id="form1" name="form1" method="post" action=""> <input name="method" type="hidden" value="insert" /> <table width="100%" border="0" cellpadding="5" cellspacing="0"> <tr> <td width="19%">Email Address<span class="style2">*</span></td> <td><input type="text" name="login" id="user" /></td> </tr> <tr> <td>Password<span class="style2">*</span></td> <td><input type="password" name="password" id="password" /></td> </tr> </table> <p align="center" class="style1"><span class="style2">*</span>Required fields</p> <p align="center"><input type="image" src="images/login.png" value="Submit" name="Submit"/></p> </form>';

$content .= '</div>';
?>

30 Sep 2010, 1:51 AM
#16
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Thanks for an excellent Blank Sidebox

$content .= '<div id="form">

<?PHP if(isset($_POST['Submit'])) { You are putting PHP code straight into a string variable, which will become HTML output. You need to evaluate the PHP and put its result into the variable. I don't know exactly how you would rework this, as I have not used PHP handling of forms.
30 Sep 2010, 2:02 PM
#17
acedweb avatar

acedweb

New Zenner

Join Date:
Sep 2010
Posts:
19
Plugin Contributions:
0

Re: Thanks for an excellent Blank Sidebox

remember, you are adding all the code to the $content variable:)

This means that the first ' you use is going to close the $content=' and the rest is not even put into it.

You need to avoid the ' and you will be just fine:)

30 Sep 2010, 4:31 PM
#18
inestine avatar

inestine

New Zenner

Join Date:
Aug 2010
Posts:
51
Plugin Contributions:
0

Re: Thanks for an excellent Blank Sidebox

Thanks acedweb,

but are you saying:

$content = 'MycodeHere';

is wrong because of the ''

but

$content = MycodeHere;

should work?

I tried this way and nothing. Did I misunderstand?

very frustrating, but thank you for your help...

Matt

30 Sep 2010, 5:55 PM
#19
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Thanks for an excellent Blank Sidebox

No, you need the ' ' around strings of text to go into $content. The point was that a second ' will be seen as ending the string, even if you didn't mean it to. So if you want to use
'Isn't my string cool?'
you have to escape the internal ', or else use double quotes " " around the string instead:
'Isn't my string cool?'
"Isn't my string cool?"

Single and double quotes won't interfere with each other, but they will interfere with others of their own kind unless escaped with a backslash