2 Attachment(s)
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:
Code:
$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.
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).
Re: Thanks for an excellent Blank Sidebox
Quote:
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:
Re: Thanks for an excellent Blank Sidebox
Just installed this blank box with Craft Syntax and it worked perfectly. Thanks for this thread!!!
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>';
?>
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.
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:)
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
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 \