Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Add Boxes


glennie55

Recommended Posts

Posted

Hi ,

 

I want to add a new box on my front page with a pic in it with a link to another site ,

However the everything i have found out adding info boxes is outa date and the code in the colum_left.php/colum_right .php is different in 2.2ms .

 

Thanks Glenn

Posted

Here's what you do. Make a copy of the includes/boxes/information.php file. Name it whatever you want, let's say mybox.php. Find this line

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

and change it to

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

Then, find this code

$info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_SHIPPING) . '">' . BOX_INFORMATION_SHIPPING . '</a><br>' .
                                        '<a href="' . tep_href_link(FILENAME_PRIVACY) . '">' . BOX_INFORMATION_PRIVACY . '</a><br>' .
                                        '<a href="' . tep_href_link(FILENAME_CONDITIONS) . '">' . BOX_INFORMATION_CONDITIONS . '</a><br>' .
                                        '<a href="' . tep_href_link('FILENAME_CONTACT) . '">' . BOX_INFORMATION_CONTACT . '</a>');

and change it to

   array('text' =>                 '<a href="' . tep_href_link('Some Link') . '">' . .  '<img border="0" src="images/someimage.jpg" alt="Some Text" width="154" height="85"> ' . '</a>');

You should search and replace all instances of the work information in the file with mybox just to make it easier on yourself in the future.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Posted
Here's what you do.  Make a copy of the includes/boxes/information.php file.  Name it whatever you want, let's say mybox.php.  Find this line
$info_box_contents[] = array('text' => BOX_HEADING_INFORMATION);

and change it to

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

Then, find this code

$info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_SHIPPING) . '">' . BOX_INFORMATION_SHIPPING . '</a><br>' .
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? '<a href="' . tep_href_link(FILENAME_PRIVACY) . '">' . BOX_INFORMATION_PRIVACY . '</a><br>' .
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? '<a href="' . tep_href_link(FILENAME_CONDITIONS) . '">' . BOX_INFORMATION_CONDITIONS . '</a><br>' .
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? '<a href="' . tep_href_link('FILENAME_CONTACT) . '">' . BOX_INFORMATION_CONTACT . '</a>');

and change it to

 ? array('text' => ? ? ? ? ? ? ? ? '<a href="' . tep_href_link('Some Link') . '">' . . ?'<img border="0" src="images/someimage.jpg" alt="Some Text" width="154" height="85"> ' . '</a>');

You should search and replace all instances of the work information in the file with mybox just to make it easier on yourself in the future.

 

Jack

 

it might help if you said what files to find those lines in :blink:

 

Christina

Posted
I did.  Second sentence.

 

Jack

 

 

Opps did i do something wrong

 

<tr>

<td>

<?php

$info_box_contents = array();

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

 

new infoBoxHeading($info_box_contents, false, false);

 

$info_box_contents = array();

array('text' => '<a href="' . tep_href_link('http://www.ikobo.com/ref.cgi?r=XXXXXXXXXX') . '">' . . '<img border="0" src="images/imgImage1.jpg" alt="- Send Money with iKobo" width="154" height="90"> ' . '</a>');

?>

</td>

</tr>

 

Parse error: parse error, unexpected '.' in /home/tapestry/public_html/ecommerce/os/catalog/includes/boxes/mybox.php on line 23

 

This is what i added in the includes/column_right

require(DIR_WS_BOXES . 'mybox.php');

Posted

Thanks Jack ... Very simple to follow. Wanted to make sure I had this one in my records for rainy day ... I think this is in KB too...(cant remember)

 

Christina, I dont think you are using a Text Editor are you? I get the impression your not.

 

If your not, there is a recent thread in the General Section about Text Editors.

Text Editors will make it much easier for you to edit files.... and many of them are free :thumbsup:

 

this is what you should have (per Jack's instructions):

<?php
 $info_box_contents = array();
 $info_box_contents[] = array('text' => 'My Box');
 
  array('text' => '<a href="' . tep_href_link('http://www.ikobo.com/ref.cgi?r=XXXXXXXXXX') . '">' . . '<img border="0" src="images/imgImage1.jpg" alt="- Send Money with iKobo" width="154" height="90"> ' . '</a>');
 
 
 new infoBox($info_box_contents);
 ?>
             </td>
           </tr>
<!-- information_eof //-->

 

:::Edited:::

ooops or Glenn not Christina :blush:

Posted
Thanks Jack ... Very simple to follow.  Wanted to make sure I had this one in my records for rainy day ... I think this is in KB too...(cant remember)

 

Christina, I dont think you are using a Text Editor are you?  I get the impression your not.

 

If your not, there is a recent thread in the General Section about Text Editors.

Text Editors will make it much easier for you to edit files.... and many of them are free :thumbsup:

 

this is what you should have (per Jack's instructions):

<?php
 $info_box_contents = array();
 $info_box_contents[] = array('text' => 'My Box');
 
  array('text' => '<a href="' . tep_href_link('http://www.ikobo.com/ref.cgi?r=XXXXXXXXXX') . '">' . . '<img border="0" src="images/imgImage1.jpg" alt="- Send Money with iKobo" width="154" height="90"> ' . '</a>');
 
 
 new infoBox($info_box_contents);
 ?>
             </td>
           </tr>
<!-- information_eof //-->

 

:::Edited:::

ooops or Glenn not Christina :blush:

 

sorry but the new code just made the error show up on line 20 ...

I use HTMLkit with PHP plugin for my text editor

 

Parse error: parse error, unexpected '.' in /home/tapestry/public_html/ecommerce/os/catalog/includes/boxes/mybox.php on line

 

20

 

 

 

Glenn

Posted
I did.  Second sentence.

 

Jack

 

doh, my bad >_<

 

So is that all there is to making a new box? I guess I assumed you'd need to change multiple files... So you just make the new box, then insert it where you want it?

 

Christina

Posted
('http://www.ikobo.com/ref.cgi?r=XXXXXXXXXX') . '">' . .  '<img border="0" src="images/imgImage1.jpg" alt="- Send Money with iKobo" width="154" height="90"> ' . '</a>');
This line has an extra period. It should be
 ('http://www.ikobo.com/ref.cgi?r=XXXXXXXXXX') . '">' .  '<img border="0" src="images/imgImage1.jpg" alt="- Send Money with iKobo" width="154" height="90"> ' . '</a>');

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Posted
doh, my bad  >_<

 

So is that all there is to making a new box? I guess I assumed you'd need to change multiple files... So you just make the new box, then insert it where you want it?

 

Christina

Yes, that's all there is. :) At least for a basic box. If you look at the code for the cateogries box, you will see it is a bit more involved but the principle is the same.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Posted
sorry but the new code just made the error show up on line 20 ...

I use HTMLkit with PHP plugin for my text editor

 

Parse error: parse error, unexpected '.' in /home/tapestry/public_html/ecommerce/os/catalog/includes/boxes/mybox.php on line

 

20

Glenn

 

 

Not to worry as my server is a real pig og a server and i managed to add the pic and link into the index.php file in the includes/languages/english/index.php

thanks alot for your help

 

Glenn

Posted
This line has an extra period.  It should be
 ('http://www.ikobo.com/ref.cgi?r=XXXXXXXXXX') . '">' .  '<img border="0" src="images/imgImage1.jpg" alt="- Send Money with iKobo" width="154" height="90"> ' . '</a>');

 

Jack

 

 

ok that got rid of the error message but the picture wont show either

 

i put full path in for the picture but still no good

 

Glenn

Posted
ooops sorry about that...

 

I see the mistake I made....its obvious now...

 

..but if you ever want to do it in the future ... just follow Jacks instructions

 

Thougt i would use it for a another pic but the pic wont show

Posted
Try posting your code.  Hard to tell what the problem is without it.

 

Jack

 

Sorry about that , not sure why but had major problem accessing this forum , my keyboard went nutso trying to post the code , ,,,

 

<tr>

<td>

<?php

$info_box_contents = array();

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

 

array('text' => '<a href="' . tep_href_link('http://www.ikobo.com/ref.cgi?r=OC153349AU') . '">' . '<img border="0" src="https://st20.startlogic.com/~tapestry/ecommerce/os/catalog/images/imgImage1.jpg" alt="- Send Money with iKobo" width="90" height="90"> ' . '</a>');

 

new infoBox($info_box_contents);

?>

</td>

</tr>

 

thanks : GMT + 11.00

 

glenn

Posted

OK, there are a few parts missing from your code that needs to be there. Try this:

<tr>
<td>
<?php
$info_box_contents = array();
$info_box_contents[] = array('text' => 'My Box');

new infoBoxHeading($info_box_contents, false, false);

$info_box_contents = array();
$info_box_contents[]  = array('text' => '<a href="' . tep_href_link('http://www.ikobo.com/ref.cgi?r=OC153349AU') . '">' . '<img border="0" src="https://st20.startlogic.com/~tapestry/ecommerce/os/catalog/images/imgImage1.jpg" alt="- Send Money with iKobo" width="90" height="90"> ' . '</a>');

new infoBox($info_box_contents);
?>
</td>
</tr>

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Posted
OK, there are a few parts missing from your code that needs to be there.  Try this:
<tr>
<td>
<?php
$info_box_contents = array();
$info_box_contents[] = array('text' => 'My Box');

new infoBoxHeading($info_box_contents, false, false);

$info_box_contents = array();
$info_box_contents[]  = array('text' => '<a href="' . tep_href_link('http://www.ikobo.com/ref.cgi?r=OC153349AU') . '">' . '<img border="0" src="https://st20.startlogic.com/~tapestry/ecommerce/os/catalog/images/imgImage1.jpg" alt="- Send Money with iKobo" width="90" height="90"> ' . '</a>');

new infoBox($info_box_contents);
?>
</td>
</tr>

 

Jack

 

Thanks jack

 

Looking real good , no errors , picks up the picture , however the link will not work , tried it with and without the target="_blank" so thats not the problem and removed /ref.cgi?r=OC153349AU but no luck ,

 

<tr>

<td>

<?php

$info_box_contents = array();

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

 

new infoBoxHeading($info_box_contents, false, false);

 

$info_box_contents = array();

$info_box_contents[] = array('text' => '<a href="' . tep_href_link('http://www.ikobo.com/ref.cgi?r=OC153349AU') . 'target="_blank"">' . '<img border="0" src="images/imgImage1.jpg" alt="- Send Money with iKobo" width="150" height="150"> ' . '</a>');

 

new infoBox($info_box_contents);

?>

</td>

</tr>

 

Glenn

Posted

OK, I didn't pay attention to the link. The tep_href_link function is only intended for links to pages on your site. When you are linking to another site it should be

$info_box_contents[] = array('text' => '<a href="http://www.ikobo.com/ref.cgi?r=OC153349AU" target="_blank">' . '<img border="0" src="images/imgImage1.jpg" alt="- Send Money with iKobo" width="150" height="150"> ' . '</a>');

Use the above line to replace the one in your box and you should be all set.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Posted
OK, I didn't pay attention to the link. The tep_href_link function is only intended for links to pages on your site.  When you are linking to another site it should be
$info_box_contents[] = array('text' => '<a href="http://www.ikobo.com/ref.cgi?r=OC153349AU" target="_blank">' . '<img border="0" src="images/imgImage1.jpg" alt="- Send Money with iKobo" width="150" height="150"> ' . '</a>');

Use the above line to replace the one in your box and you should be all set.

 

Jack

:thumbsup: works a treat ,

 

thank you so much for all your help .

 

Glenn

Archived

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

×
×
  • Create New...