Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Help with New Infobox


oscommercenewbie

Recommended Posts

Posted

Hello!

I have created a new infobox. The box displays perfectly on the site. However, the contents display as blank. Nada, nothing. I am fairly certain it has to do with the array which should be text but I am unsure of how it is supposed to be written to work correctly.

 

Can someone revise the code of this box so it works - so I can use it as a sample to go by later?

 

 

<?php

/*

$Id: STORES.php,v 1.22 2003/02/10 22:31:05 hpdl Exp $

 

 

 

Released under the GNU General Public License

*/

?>

 

 

<!-- STORES //-->

<tr>

<td class="infoBox_left"><?php

$info_box_contents = array();

$info_box_contents[] = array('text' => BOX_HEADING_STORES);

 

 

 

new infoBoxHeading($info_box_contents, false, false);

 

$info_box_contents = '<p align="left" style="margin-top: 0; margin-bottom: 0">

<img alt=" " src="http://www.abcefg.com/images/pointer_clear.gif" border="0" width="8" height="7"><font face="Tahoma" size="2"><a target="_blank" href="http://www.yahoo.com"><font color="#000000">Yahoo</font></a></font></p></a></p>';

new infoBox($info_box_contents);

?>

 

</td>

</tr>

<!-- STORES_eof //-->

Posted

Its an array so treat it like one:

from this:

$info_box_contents = '<p

 

to this:

$info_box_contents[] = '<p

Posted

well I was refering using the info_box_contents as an array. The html has errors. There is a 2nd paragraph terminator but just one paragraph and maybe other things. Replace the html with a simple string so at least you know it works then add your html code and work on it.

Posted

Okay, Enigma. I changed the link.

 

What else should I change?

 

<?php

/*

$Id: STORES.php,v 1.22 2003/02/10 22:31:05 hpdl Exp $

 

 

 

Released under the GNU General Public License

*/

?>

 

 

<!-- STORES //-->

<tr>

<td class="infoBox_left"><?php

$info_box_contents = array();

$info_box_contents[] = array('text' => BOX_HEADING_STORES);

 

 

 

new infoBoxHeading($info_box_contents, false, false);

 

$info_box_contents = '<p><a href="http://www.yahoo.com">Yahoo</a></p>

';

new infoBox($info_box_contents);

?>

 

</td>

</tr>

<!-- STORES_eof //-->

Posted

instead of this:

$info_box_contents = '<p><a href="http://www.yahoo.com">Yahoo</a></p>

 

try these lines

    $info_box_contents[] = array('align' => 'center',
                                'text' => 'Box Line-1<br>Box Line-2<br>Box Line-3<br>');

then correct your html code and replace the contents of field 'text' of the arrray

Posted

you may also want to clear the info box contents before you add the yahoo text with

$info_box_contents = array();

For reference I would look in the includes\boxes directory any of those files create boxes. Just compare and see whats missing.

If I was crafty, this would be a funny signature.

Posted

Hey Guys,

Worked like a dream! Thank you, Thank you.

 

If anyone else is looking for the solution... this is what it looks like.

Again thank you. I love the support here on the forums.

 

<?php

/*

$Id: STORES.php,v 1.22 2003/02/10 22:31:05 hpdl Exp $

 

 

 

Released under the GNU General Public License

*/

?>

 

 

<!-- STORES //-->

<tr>

<td class="infoBox_left"><?php

$info_box_contents = array();

$info_box_contents[] = array('text' => BOX_HEADING_STORES);

 

 

new infoBoxHeading($info_box_contents, false, false);

 

$info_box_contents[] = array('align' => 'left',

'text' => '<p><a href="http://www.yahoo.com">Yahoo</a></p><br>Box Line-2<br>Box Line-3<br>');

 

 

new infoBox($info_box_contents);

?>

 

</td>

</tr>

<!-- STORES_eof //-->

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...