Vesper Posted April 9, 2005 Share Posted April 9, 2005 I want to add a link to my forums at the top of the "Information" box in the left column, but I'm terrible at using PHP and don't know how to do this. My website is: www.showrides.tk My forum is: http://s10.invisionfree.com/Show_Rides/index.php?act=idx I tried using HTML to do the link, but it didn't work. It might be because I had a typo, but I'm pretty sure my code was correct, it just won't work on a PHP site. Thanks in advance for the help :D Link to comment Share on other sites More sharing options...
Jeremy at oddly enough Posted April 9, 2005 Share Posted April 9, 2005 Do you want a link in the info box, or above it? Link to comment Share on other sites More sharing options...
Vesper Posted April 9, 2005 Author Share Posted April 9, 2005 I would like the link to be inside the info box, above all of the other links. Link to comment Share on other sites More sharing options...
Jeremy at oddly enough Posted April 9, 2005 Share Posted April 9, 2005 Ok, there are four files involved, we'll just replicate what's already there. While I get my post made up, what page do you want to link to? Be specific and descriptive about it. Jeremy Link to comment Share on other sites More sharing options...
Vesper Posted April 9, 2005 Author Share Posted April 9, 2005 i want to link to: http://s10.invisionfree.com/Show_Rides/index.php?act=idx its one of those InvisionFree forums that anybody can setup. I can add forums and categories, and I have admin privileges if necessary. Link to comment Share on other sites More sharing options...
Jeremy at oddly enough Posted April 9, 2005 Share Posted April 9, 2005 Ok you need to open catalog/includes/boxes/information.php Find this code: '<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_US) . '">' . BOX_INFORMATION_CONTACT . '</a>'); You need to make another line like them, and put it at the top. You want to refer to the file you want to link to in the new line: Just copy the shipping line, paste it in, and change both SHIPPING s to YOUR_NEW_FILENAME Next you need to a a define in catalog/includes/languages/english.php. Find this: // information box text in includes/boxes/information.php define('BOX_HEADING_INFORMATION', 'Information'); define('BOX_INFORMATION_PRIVACY', 'Privacy Notice'); define('BOX_INFORMATION_CONDITIONS', 'Conditions of Use'); define('BOX_INFORMATION_SHIPPING', 'Shipping & Returns'); define('BOX_INFORMATION_CONTACT', 'Contact Us'); copy one of the lines, paste it in (order isn't important, but if you care put it just after the 'BOX_HEADING_INFORMATION'. It should be: define('BOX_INFORMATION_YOUR_NEW_FILENAME', 'Your New Filename'); Assuming the file to be linked to is another info page, it should be in the root directory (catalog in default). If you want it to be in line with the other pages, copy one of their root directory files, and change the name and instances of the filename within to your new file name. Next go to the catalog/includes/languages/english/one of the info page files.php. Again change the filename, and all the references to the filename within, just like the other one. Edit the text definitions to add the information you want. That's it, generally speaking, I'll see if you need anything else when you post the answer to what file you are linking to. Jeremy Link to comment Share on other sites More sharing options...
Jeremy at oddly enough Posted April 9, 2005 Share Posted April 9, 2005 Ha, silly me, you said that and I failed to fully read your post, sorry! In that case you can get away with just the first two files. Add this to the top of the list in boxes.php: '<a href="' . tep_href_link(http://s10.invisionfree.com/Show_Rides/index.php) . '">' . BOX_INFORMATION_FORUM . '</a><br>' . In the english.php file add: define('BOX_INFORMATION_FORUM', 'Forum'); That should do it! Jeremy Link to comment Share on other sites More sharing options...
Vesper Posted April 9, 2005 Author Share Posted April 9, 2005 I get an error on line 23 in my file: $info_box_contents[] = array('text' => '<a href="' . tep_href_link(http://s10.invisionfree.com/Show_Rides/index.php) . '">' . BOX_INFORMATION_FORUM . '</a><br>' . which is that line. check it out for yourself at my site, www.showrides.tk maybe i missed something? Link to comment Share on other sites More sharing options...
Jeremy at oddly enough Posted April 9, 2005 Share Posted April 9, 2005 Try switching to this for now: '<a href="http://s10.invisionfree.com/Show_Rides/index.php">' . BOX_INFORMATION_FORUM . '</a><br>' . I'm messing up the tep a href syntax, and need to work that out. This will screw with the session when the customer leaves the site, but I think it would anyways, since the forum is not within your osc store. Jeremy Link to comment Share on other sites More sharing options...
Vesper Posted April 9, 2005 Author Share Posted April 9, 2005 Nicely Done :D Thanks for the help, it works great. Is there anyway I can make it open up in a new window though, adding something such as link[target=window] or something like that? Link to comment Share on other sites More sharing options...
Jeremy at oddly enough Posted April 9, 2005 Share Posted April 9, 2005 '<a href="http://s10.invisionfree.com/Show_Rides/index.php" title="Opens new window"target="_blank">' . BOX_INFORMATION_FORUM . '</a><br>' . When the customer hovers on the link, it will show the little pop up and say that it opens a new window. Jeremy Link to comment Share on other sites More sharing options...
Vesper Posted April 9, 2005 Author Share Posted April 9, 2005 Perfect, exactly what I'm looking for :D Thanks for helping me out, there's no way i would've figured this out on my own :P Link to comment Share on other sites More sharing options...
Guest Posted April 9, 2005 Share Posted April 9, 2005 I think Jeremy at oddly enough assumed your link resided in catalog/ if not ----Replace "YOUR_LINK" with the desired name---- 1- First identify the file name in catalog>includes>filenames.php add this code define('CONTENT_YOUR_LINK', 'your_link'); 2- in catalog>includes>boxes>information.php find $boxContent = '<a href="' . tep_href_link(FILENAME_YOUR_LINK) . '"> ' . BOX_INFORMATION_YOUR_LINK . '</a><br>' . '<a href="' . tep_href_link(FILENAME_YOUR_LINK2) . '"> ' . BOX_INFORMATION_YOUR_LINK2 . '</a><br>' . '<a href="' . tep_href_link(FILENAME_YOUR_LINK3) . '"> ' . BOX_INFORMATION_YOUR_LINK3 . '</a>'; and insert '<a href="' . tep_href_link(YOUR_LINK) . '"> ' . BOX_INFORMATION_YOUR_LINK . '</a><br>' . at the position you want it to show 3- Now copy this code and name it "your_link.php" <?php /* $Id: privacy.php,v 1.4 2002/11/19 01:48:08 dgw_ Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2002 osCommerce Released under the GNU General Public License */ define('NAVBAR_TITLE', 'Your Link'); define('HEADING_TITLE', 'Your Link'); define('TEXT_INFORMATION', '<a href="http://s10.invisionfree.com/Show_Rides/index.php?act=idx"><u>your link</u></a>'); ?> 4- then FTP to catalog>includes>langues>english You can also use a redirect if you want to open a new page. My apologies if I misunderstood the situation, or stepped on any toes . :thumbsup: wazu Link to comment Share on other sites More sharing options...
Guest Posted April 9, 2005 Share Posted April 9, 2005 Sorry guys, I see it's under control :blush: wazu Link to comment Share on other sites More sharing options...
Jeremy at oddly enough Posted April 9, 2005 Share Posted April 9, 2005 No problem wazu, actually I was searching for how to do that myself, and it would have been days before I figured out how to do that as cleverly! I only heard about tep_href_link and saw its importance for preserving session info yesterday. My sitemap link page is all html hrefs, and I have some in my nav bar that I'll need to fix too. Got a good project for tomorrow! I need to get chemo's ultimate seo urls going, then fix my links up! Thanks, Jeremy By the way, vesper you ought to take a few minutes and fix up the link to use the tep_href_link, instaed of the straight html link I gave you. Link to comment Share on other sites More sharing options...
Vesper Posted April 9, 2005 Author Share Posted April 9, 2005 what's wrong with using the html link? I figured as long as it works there's no problem :D Link to comment Share on other sites More sharing options...
Jeremy at oddly enough Posted April 9, 2005 Share Posted April 9, 2005 It has to do with passing along, and preserving information specific to each vistor. If they start adding things to their cart, if they switch languages, etc., the info might get dropped using regular links, but the tep links will preserve the session info, as the customer navigates through the site. That's the impression I got, if I'm incorrect, can someone who knows for sure set the record straight? Jeremy Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.