Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Info Boxes


ScampNZ

Recommended Posts

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

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

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

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

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

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

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

  • 5 months later...

Archived

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

×
×
  • Create New...