ScampNZ Posted October 21, 2007 Share Posted October 21, 2007 Hi, I need help quick. What I am trying to do is get an image inside a info box (which I have called Sponsors) and have it linked to the website that it needs to. I was able to create the box but now I am getting nothing but errors everytime I attempt to get the image working. View the website for the current error to the code below (www.scamps.co.nz) <!-- sponsors //--> <tr> <td> <?php $info_box_contents = array(); $info_box_contents[] = array('text' => Sponsors); new infoBoxHeading($info_box_contents, false, false); $info_box_contents = array (); $info_box_contents[] = array('align' => 'left', 'text' => $fourm_string ); $info_box_contents[] = array('align' => 'left', 'text' => '<a href="http://tagyourbaby.co.nz" target="blank">')' . tep_image(DIR_WS_IMAGES . '10-discount-tag-ad.gif', 'Sponsor Advert') . '</a>'; ); new infoBox($info_box_contents); ?> </td> </tr> <!-- sponsors_eof //--> I am new to coding and really have no idea what I am doing and it probably shows in the above code :( Please help....thanks Link to comment Share on other sites More sharing options...
Guest Posted October 21, 2007 Share Posted October 21, 2007 The error is this: Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/scamp/public_html/includes/boxes/sponsors.php on line 27 This typically has to do with quotes not being in the right place. Compare where the quotes are in your code with the quotes in some of the other infobox files. You didn't post the entire file, but I'm guessing it's this line: $info_box_contents[] = array('align' => 'left', 'text' => '<a href="http://tagyourbaby.co.nz" target="blank">')' . tep_image(DIR_WS_IMAGES . '10-discount-tag-ad.gif', 'Sponsor Advert') . '</a>'; -jared Link to comment Share on other sites More sharing options...
ScampNZ Posted October 21, 2007 Author Share Posted October 21, 2007 Yes the problem is in the that line. I have tried comparing to different files but I can't make sense of them (such as Whats new or Specials - the only other boxes with images). I have spent most of the day trying different things but I just keep getting errors. :unsure: Link to comment Share on other sites More sharing options...
Guest Posted October 21, 2007 Share Posted October 21, 2007 Hi, I need help quick. What I am trying to do is get an image inside a info box (which I have called Sponsors) and have it linked to the website that it needs to. I was able to create the box but now I am getting nothing but errors everytime I attempt to get the image working. View the website for the current error to the code below (www.scamps.co.nz) <!-- sponsors //--> <tr> <td> <?php $info_box_contents = array(); $info_box_contents[] = array('text' => Sponsors); new infoBoxHeading($info_box_contents, false, false); $info_box_contents = array (); $info_box_contents[] = array('align' => 'left', 'text' => $fourm_string ); $info_box_contents[] = array('align' => 'left', 'text' => '<a href="http://tagyourbaby.co.nz" target="blank">')' . tep_image(DIR_WS_IMAGES . '10-discount-tag-ad.gif', 'Sponsor Advert') . '</a>'; ); new infoBox($info_box_contents); ?> </td> </tr> <!-- sponsors_eof //--> I am new to coding and really have no idea what I am doing and it probably shows in the above code :( Please help....thanks 'text' => $fourm_string or 'text' => $form_string anyway try it without $info_box_contents = array (); $info_box_contents[] = array('align' => 'left', 'text' => $fourm_string ); Link to comment Share on other sites More sharing options...
ScampNZ Posted October 21, 2007 Author Share Posted October 21, 2007 Now i am getting this error Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/****/*****/includes/boxes/sponsors.php on line 23 The I am using is this <?php /* $Id: forum.php,v 1.6 2003/02/10 22:31:00 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ ?> <!-- sponsors //--> <tr> <td> <?php $info_box_contents = array(); $info_box_contents[] = array('text' => Sponsors); new infoBoxHeading($info_box_contents, false, false); $info_box_contents[] = array('align' => 'left', 'text' => '<a href="http://tagyourbaby.co.nz" target="blank">')' . tep_image(DIR_WS_IMAGES . '10-discount-tag-ad.gif', 'Sponsor Advert') . '</a>'; new infoBox($info_box_contents); ?> </td> </tr> <!-- sponsors_eof //--> The bold code is the where the problem is happening. Link to comment Share on other sites More sharing options...
ScampNZ Posted October 22, 2007 Author Share Posted October 22, 2007 Can anyone help? I really need to get this fixed ASAP and I just can't get it too work. Link to comment Share on other sites More sharing options...
ScampNZ Posted October 23, 2007 Author Share Posted October 23, 2007 I have got it all working so problem is all fixed but I just have to say....I am so clever so figuring it out when I don't even understand code!!! Link to comment Share on other sites More sharing options...
Guest Posted October 23, 2007 Share Posted October 23, 2007 Great! It's always gratifying to figure something out. It would be good if you'd post the fixed code here so that someone else can learn from your experience. -jared Link to comment Share on other sites More sharing options...
ScampNZ Posted October 23, 2007 Author Share Posted October 23, 2007 Here is the fully functional working code :) <?php /* $Id: forum.php,v 1.6 2003/02/10 22:31:00 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ ?> <!-- sponsors //--> <tr> <td> <?php $info_box_contents = array(); $info_box_contents[] = array('text' => Sponsors); new infoBoxHeading($info_box_contents, false, false); $info_box_contents = array (); $info_box_contents[] = array('align' => 'left', 'text' => $sponsors_string ); // start of code to place link inside forum box $info_box_contents[] = array('align' => 'left', 'text' => '<a href="http://tagyourbaby.co.nz" target=" blank"><img src="images/10-discount-tag-ad.gif" border="0" alt="Tag! Youre It!" title=" Tag! Youre It! " width="150" height="340"></a>' ); // end of code to place link inside sponsor box new infoBox($info_box_contents); ?> </td> </tr> <!-- sponsors_eof //--> Link to comment Share on other sites More sharing options...
FrancineNJ Posted April 16, 2008 Share Posted April 16, 2008 Thank you, Thank you and Thank you for posting your fix....I've been looking to see how to do this for a long time. :thumbsup: kudos to you! Francine Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.