oscommercenewbie Posted September 19, 2005 Posted September 19, 2005 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 //-->
Guest Posted September 19, 2005 Posted September 19, 2005 Its an array so treat it like one: from this: $info_box_contents = '<p to this: $info_box_contents[] = '<p
oscommercenewbie Posted September 19, 2005 Author Posted September 19, 2005 Its an array so treat it like one:from this: $info_box_contents = '<p to this: $info_box_contents[] = '<p <{POST_SNAPBACK}> Hi Enigma1, That didnt work. it just showed << as the text. Any other ideas? Can someone show me an example of what a box with text looks like?
Guest Posted September 19, 2005 Posted September 19, 2005 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.
oscommercenewbie Posted September 19, 2005 Author Posted September 19, 2005 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 //-->
Guest Posted September 19, 2005 Posted September 19, 2005 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
ryanf Posted September 19, 2005 Posted September 19, 2005 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.
oscommercenewbie Posted September 20, 2005 Author Posted September 20, 2005 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 //-->
Recommended Posts
Archived
This topic is now archived and is closed to further replies.