Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Adding a new block or two...


MattMallory

Recommended Posts

Posted

I would like to add a block to the bottom of both the right & left columns. One will have an advertisment banner linking off site & the other will just have 1 graphic (an award). How do I do this?

Knowledge is Power!

Posted

Here is a down and dirty way that is sure to get the "php purists" screaming. I am just jealous that I am not one.

 

 $info_box_contents = array();
?$info_box_contents[] = array('text' => '<a href="http://gogogrocery.com/articles.php?tPath=1">' . 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_US) . '">' . BOX_INFORMATION_CONTACT . '</a><br>' .
? ? ?	'<a href="http://gogogrocery.com/cms/modules.php?name=News&new_topic=2" target="blank">Employment</a><br>' .
? ? ?	'<a href="http://gogogrocery.com/cms/modules.php?name=News&new_topic=4" target="blank">Press Room</a><br>' .
? ? ?	'<a href="http://gogogrocery.com/cms/modules.php?name=News&new_topic=3" target="blank">Investor Information</a><br>' .
? ? ?	'<a href="http://gogogrocery.com/cms/" target="blank">Company Website</a><br>' .


? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? '<a href="' . tep_href_link(FILENAME_GV_FAQ, '', 'NONSSL') . '">' . BOX_INFORMATION_GV . '</a><br><br>' .

'<a href="http://gogogrocery.com/article_info.php?articles_id=15"><img src="images/cpp/cpp.jpg"></a>');

?new infoBox($info_box_contents);
?>

 

DO NOT COPY AND PASTE THE CODE ABOVE...FOR DEMO PURPOSES ONLY!!

Always BACKUP your file BEFORE making changes.

 

We just added a graphic to the bottom of the catalog/includes/boxes/information.php file with a link ....3rd line from the bottom. You could add a pre-made html "BOX" is a similar fashion. Just be sure to use the proper syntax.

 

If the "BOX" you add is the last element in the info box, end the code with );

 

If it is not the last element, end the line of code with a .

 

My apologies in advance for "BFP" (Brute Force Programming).

 

Se it at http://www.gogogrocery.com

"Aliiiiive, it's alive, it's ALIIIIIIIIIIIIIVE!!!"

Posted

That worked great for the award in the left column! Thank you. Now I need to know how to add a new block to the right column at the very bottom. Any takers out there?

Knowledge is Power!

Posted

Again you can use BFP to accomplish this. You would just build the box you want and insert the code in the column_right.php like you did your link in the column_left. Here is an example of code that you can use:

 

flag_box.jpg

 

This box is created with the code below. You can insert whatever hardcoded banner you want or even use a banner rotator script.

 

<HTML> 
 <HEAD> 
 <TITLE></TITLE> 
 </HEAD> 
 <BODY> 
 <TABLE WIDTH="150" CELLPADDING="3" CELLSPACING="3"> 
 <TR> 
   <TD ALIGN="CENTER" BGCOLOR="#000066"><FONT FACE="Arial"
   SIZE="-1"><B><FONT COLOR="#FFFFFF">Your Box</FONT></B></FONT></TD> 
 </TR> 
 <TR> 
   <TD ALIGN="CENTER" BGCOLOR="efefef"><A
   HREF="http://www.yourwebsite.com"><IMG
   SRC="http://s91348361.onlinehome.us/store/images/flag_bg.jpg" WIDTH="108"
   HEIGHT="72" BORDER="0"></A><BR><FONT FACE="Arial" SIZE="-1"><I>Enjoy a great
   lifestyle</I></FONT><BR><FONT FACE="Arial" SIZE="-1"><I> in the
   USA.</I></FONT></TD> 
 </TR> 
 </TABLE> </BODY>
</HTML>

 

enjoy!

"Aliiiiive, it's alive, it's ALIIIIIIIIIIIIIVE!!!"

Posted

Need to clarify previous post.....because I didn't disclaim the previous example as a DEMO only, it appears as if it can be used "out of the box"... when it can't.

 

The best way to put the code in your column_right.php is to save it as an html file, save it to your includes directory and call it like so from the column_right.php :

 

require('my_banner_box.html');

 

BACKUP FILE FIRST

 

whew!

"Aliiiiive, it's alive, it's ALIIIIIIIIIIIIIVE!!!"

Posted

Ok, thanks. I have a blue/gray box showing up between the header Information & the default navigation in the table/block. Any ideas on how to fix this? Below is the php code in the block & in the page after it is parsed...

 

PHP code in information.php

<!-- information //-->
         <tr>
           <td>
<?php
 $info_box_contents = array();
 $info_box_contents[] = array('text' => BOX_HEADING_INFORMATION);
 new infoBoxHeading($info_box_contents, false, false);
 $info_box_contents = array();
 $info_box_contents[] = array('text' => '<font size="1" color="black"><a href="' . tep_href_link(FILENAME_SHIPPING) . '">' . BOX_INFORMATION_SHIPPING . '</a><br>' .
                                        '<a href="' . tep_href_link(FILENAME_REWARDS) . '">' . BOX_INFORMATION_REWARDS . '</a><br>' .
                                        '<a href="' . tep_href_link(FILENAME_SUPPORT) . '">' . BOX_INFORMATION_SUPPORT . '</a><br>' .
                                        '<a href="' . tep_href_link(FILENAME_CONTACT_US) . '">' . BOX_INFORMATION_CONTACT . '</a></font></td></tr><br><br>' .
          '<tr><td bgcolor="black"><center><b><font size="2" color="white">DIRECTV #1 Again!</font></b></td></tr><br>' .
          '<tr><td><img src="images/jd_award.gif" width="155" alt="DIRECTV Ranked #1 by JD Power and Associates 2 years in a row!"></center>' );
 new infoBox($info_box_contents);
?>
           </td>
         </tr>
<!-- information_eof //-->

 

 

After page is parsed:

<!-- information //-->
         <tr>
           <td>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr>
   <td width="100%" height="14" class="infoBoxHeading">Information</td>
   <td height="14" class="infoBoxHeading" nowrap><img src="images/pixel_trans.gif" border="0" alt="" width="11" height="14"></td>
 </tr>
</table>
<table border="0" width="100%" cellspacing="0" cellpadding="1" class="infoBox">
 <tr>
   <td><table border="0" width="100%" cellspacing="0" cellpadding="3" class="infoBoxContents">
 <tr>
   <td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="1"></td>
 </tr>
 <tr>
   <td class="boxText"><font size="1" color="black"><a href="http://www.trixsatellite.com/programming.php">Programming</a><br><a href="http://www.trixsatellite.com/rewards.php">Rewards & Certificates</a><br><a href="http://www.trixsatellite.com/support.php">Technical Support</a><br><a href="http://www.trixsatellite.com/contact_us.php">Contact Us</a></font></td></tr><br><br><tr><td bgcolor="black"><center><b><font size="2" color="white">DIRECTV #1 Again!</font></b></td></tr><br><tr><td><img src="images/jd_award.gif" width="155" alt="DIRECTV Ranked #1 by JD Power and Associates 2 years in a row!"></center></td>
 </tr>
 <tr>
   <td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="1"></td>
 </tr>
</table>
</td>
 </tr>
</table>
           </td>
         </tr>
<!-- information_eof //-->

Knowledge is Power!

Posted

you'll always get a faster response if you post a link ao that we can see the problem

"Aliiiiive, it's alive, it's ALIIIIIIIIIIIIIVE!!!"

Archived

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

×
×
  • Create New...