glennie55 Posted December 12, 2004 Posted December 12, 2004 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
Jack_mcs Posted December 12, 2004 Posted December 12, 2004 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
cmbyrne Posted December 12, 2004 Posted December 12, 2004 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 <{POST_SNAPBACK}> it might help if you said what files to find those lines in :blink: Christina
Jack_mcs Posted December 12, 2004 Posted December 12, 2004 it might help if you said what files to find those lines in :blink: Christina <{POST_SNAPBACK}> I did. Second sentence. 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
glennie55 Posted December 12, 2004 Author Posted December 12, 2004 I did. Second sentence. Jack <{POST_SNAPBACK}> 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');
TCwho Posted December 12, 2004 Posted December 12, 2004 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: Drop_Shadow How Did You Hear About Us Email HTML Order Link ---- GMT -5:00
glennie55 Posted December 12, 2004 Author Posted December 12, 2004 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: <{POST_SNAPBACK}> 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
cmbyrne Posted December 12, 2004 Posted December 12, 2004 I did. Second sentence. Jack <{POST_SNAPBACK}> 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
Jack_mcs Posted December 12, 2004 Posted December 12, 2004 ('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
Jack_mcs Posted December 12, 2004 Posted December 12, 2004 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 <{POST_SNAPBACK}> 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
glennie55 Posted December 12, 2004 Author Posted December 12, 2004 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 <{POST_SNAPBACK}> 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
glennie55 Posted December 12, 2004 Author Posted December 12, 2004 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 <{POST_SNAPBACK}> 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
TCwho Posted December 12, 2004 Posted December 12, 2004 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 Drop_Shadow How Did You Hear About Us Email HTML Order Link ---- GMT -5:00
TCwho Posted December 12, 2004 Posted December 12, 2004 or here: http://www.oscommerce.info/kb/osCommerce/C...g_Area/Boxes/66 Drop_Shadow How Did You Hear About Us Email HTML Order Link ---- GMT -5:00
glennie55 Posted December 12, 2004 Author Posted December 12, 2004 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 <{POST_SNAPBACK}> Thougt i would use it for a another pic but the pic wont show
Jack_mcs Posted December 12, 2004 Posted December 12, 2004 Try posting your code. Hard to tell what the problem is without it. 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
glennie55 Posted December 12, 2004 Author Posted December 12, 2004 Try posting your code. Hard to tell what the problem is without it. Jack <{POST_SNAPBACK}> 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
Jack_mcs Posted December 12, 2004 Posted December 12, 2004 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
glennie55 Posted December 13, 2004 Author Posted December 13, 2004 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 <{POST_SNAPBACK}> 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
Jack_mcs Posted December 13, 2004 Posted December 13, 2004 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
glennie55 Posted December 13, 2004 Author Posted December 13, 2004 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 <{POST_SNAPBACK}> :thumbsup: works a treat , thank you so much for all your help . Glenn
Recommended Posts
Archived
This topic is now archived and is closed to further replies.