Guest Posted April 18, 2008 Posted April 18, 2008 Hi all this is a problem i cant seem to fix i have included a php page into my home page partsforallcars.com my oscommerce cat and all files are in partsforallcars.com/spares i have work out how to include the file fine however the image will not show. I'm using a version of random product cant seem to get my head round this i have loaded my work in progress for you to look at i hope you make sense of it. http://partsforallcars.com/index_m.php
germ Posted April 18, 2008 Posted April 18, 2008 The path to the image is incorrect. It is this: http://partsforallcars.com/spares/spares/images/fuelparts/fpp/MAFS001.jpg It SHOULD BE this: http://partsforallcars.com/spares/images/fuelparts/fpp/MAFS001.jpg If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there >
Guest Posted April 19, 2008 Posted April 19, 2008 Hi Jim thanks for the reply this is a strange one for me the code i'm using is: $info_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="smallText" valign="top"', 'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . tep_image( 'spares/' . DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'] , 100) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a><br>' . $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])) . '<br> '); The 'spares/' that i have in the code is where i think my problem lies if i remove this or change it to anything other than that i dont even get a red x. also when i view source in explorer i see <table border="0" width="100%" cellspacing="0" cellpadding="1" class="infoBox"> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="4" class="infoBoxContents"> <tr> <td align="center" class="smallText" valign="top"><a href="http://partsforallcars.com/spares/product_info.php?products_id=18476"><img src="spares/images/fuelparts/fpp/MAFS001.jpg" border="0" alt="FORD FIESTA 1.3i 10/1995 - 12/1998 Air Mass Sensor" title=" FORD FIESTA 1.3i 10/1995 - 12/1998 Air Mass Sensor " width="100" height="87"></a><br><a href="http://partsforallcars.com/spares/product_info.php?products_id=18476">FORD FIESTA 1.3i 10/1995 - 12/1998 Air Mass Sensor</a><br>£66.52<br> </td> </tr> </table> </td> </tr> </table> See what i mean Jim im just not getting were im goin wrong i never see what your seeing.
Guest Posted April 19, 2008 Posted April 19, 2008 Hi Jim thanks for the reply this is a strange one for me the code i'm using is: See what i mean Jim im just not getting were im goin wrong i never see what your seeing. Did you right click on the lack of image and look at its properties?
Guest Posted April 19, 2008 Posted April 19, 2008 cheers Leslie didn't think to do that but it still does not solve my problem and that's if i remove the 'spares/' that i have put in at the start of that image link it all goes i don't even see a red x box or anything. any ideas?
Guest Posted April 19, 2008 Posted April 19, 2008 I notice you have a refresh redirect on your root home page. This is not a good idea. I don't think the search engines will index you very good. In your above code remove 'spares/' . right before DIR_WS_IMAGES.
Guest Posted April 19, 2008 Posted April 19, 2008 cheers Leslie didn't think to do that but it still does not solve my problem and that's if i remove the 'spares/' that i have put in at the start of that image link it all goes i don't even see a red x box or anything. any ideas? My guess is that you have the extra spare in your random products module.
Guest Posted April 19, 2008 Posted April 19, 2008 I notice you have a refresh redirect on your root home page. This is not a good idea. I don't think the search engines will index you very good.In your above code remove 'spares/' . right before DIR_WS_IMAGES. this is just until i sort out my new home page as it never really had one hence why I'm stressing so much at this ahhhh.
Guest Posted April 19, 2008 Posted April 19, 2008 if i remove that code nothing shows not even a red x that's whats so strange here is the full code for that page see what you make of it. ?php $new_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.Special_marker = '1' order by rand() limit " . MAX_DISPLAY_NEW_PRODUCTS); ?> <?php //$info_box_contents = array(); //$info_box_contents[] = array('text' => sprintf('Products', strftime('%B'))); //new contentBoxHeading($info_box_contents); $info_box_contents = array(); $row = 0; $col = 0; $info_box_contents = array(); while ($new_products = tep_db_fetch_array($new_products_query)) { $new_products['products_name'] = tep_get_products_name($new_products['products_id']); $info_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="smallText" valign="top"', 'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . tep_image("spares/" . DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'] , 100) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a><br>' . $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])) . '<br> '); } new contentBox($info_box_contents); ?> <!-- random_products_eof //--> I have no idea why this happens i know i need to remove the extra 'spares' but if i do i loose the image! why!
Guest Posted April 19, 2008 Posted April 19, 2008 if i remove that code nothing shows not even a red x that's whats so strange here is the full code for that page see what you make of it. ?php $new_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.Special_marker = '1' order by rand() limit " . MAX_DISPLAY_NEW_PRODUCTS); ?> <?php //$info_box_contents = array(); //$info_box_contents[] = array('text' => sprintf('Products', strftime('%B'))); //new contentBoxHeading($info_box_contents); $info_box_contents = array(); $row = 0; $col = 0; $info_box_contents = array(); while ($new_products = tep_db_fetch_array($new_products_query)) { $new_products['products_name'] = tep_get_products_name($new_products['products_id']); $info_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="smallText" valign="top"', 'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . tep_image("spares/" . DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'] , 100) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a><br>' . $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])) . '<br> '); } new contentBox($info_box_contents); ?> <!-- random_products_eof //--> I have no idea why this happens i know i need to remove the extra 'spares' but if i do i loose the image! why! Well the image is there. Does tep_image("spares/images/ . $new_products do anything
Guest Posted April 19, 2008 Posted April 19, 2008 All that seems to happen is that the image box goes and i loose the red x again.
Guest Posted April 19, 2008 Posted April 19, 2008 All that seems to happen is that the image box goes and i loose the red x again. No idea. Sorry.
Guest Posted April 19, 2008 Posted April 19, 2008 No worries thanks for trying. As you can see nothing makes any sense here.
Guest Posted April 19, 2008 Posted April 19, 2008 No worries thanks for trying. As you can see nothing makes any sense here. Maybe recheck the installation of the random products module?
Guest Posted April 19, 2008 Posted April 19, 2008 What i don't understand is that when i remove the 'spares/' from the code it removes the red x i cant see were in the code i have gone wrong. i use the same code on my cat index page at the mo http://partsforallcars.com/spares/index.php and that works great. So why when i go up a level does it not? All my includes are right as far as i can see i must be missing something.
Guest Posted April 19, 2008 Posted April 19, 2008 this is across the hole of my home page i have changed my config.php file to include the 'spares/images' rather than images/. this has solved the problem of gettin all images into the page however they all come up with the red x error and the page says spares/spares does anyone have any idea where it could be getting the extra spares from?
germ Posted April 19, 2008 Posted April 19, 2008 The "extra 'spares'" comes into play via this: The HTML for the image is: <img src="spares/images/HEATER-VALVE.jpg" border="0" alt="COV603 FORD FIESTA/KA/PUMA HEATER CONTROL VALVE" title=" COV603 FORD FIESTA/KA/PUMA HEATER CONTROL VALVE " width="100" height="75"></a> Note the image path: spares/images/HEATER-VALVE.jpg At the top of the HTML source you see this: <base href="http://partsforallcars.com/spares/"> So, your browser takes the <base href=...> value (http://partsforallcars.com/spares/), and adds it to the rest of the image path (spares/images/HEATER-VALVE.jpg) , and your final path is : http://partsforallcars.com/spares/spares/images/HEATER-VALVE.jpg osC makes use of the <base href=...> to switch from HTTP to HTTPS. Looking through the code, I didn't see a solution, but I can explain how you're getting the path you see. :blush: If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there >
Guest Posted April 20, 2008 Posted April 20, 2008 thanks Jim its a start knowing why the problem is being caused what i don't get is why i even need to add the extra 'spares/' in the first place it should just work without it why does oscommerce seem to only work with it?
germ Posted April 20, 2008 Posted April 20, 2008 Close to the top of this page, there should be a line that looks about like this: <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> Alter it to this: <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER); ?>"> And see if things improve. If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there >
Guest Posted April 20, 2008 Posted April 20, 2008 Jim i think we are getting somewhere here! removing the 'spares/' form the base ref works great but then as expected creates another problem see for yourself http://partsforallcars.com/index_m.php
germ Posted April 20, 2008 Posted April 20, 2008 The crux of the problem is this: The osC functions are designed to work within the confines of your catalog. In your case, your catalog is in your /spares folder. Now you've taken some of these functions, and you're trying to use them in your / (root) folder. If you post the contents if this index_m.php (BETWEEN "CODE" TAGS TO PRESERVE FORMATTING!!), maybe we can work around this. I can't promise anything. Sometimes the "cure" is worse than the "disease".... :blush: If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there >
Guest Posted April 20, 2008 Posted April 20, 2008 By all means Jim have a look see what you think. <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html dir="LTR" lang="en"> <head> <meta name="description" content="Supplying car parts for all makes and models to the trade and public for over 25 years. Free shipping to the UK mainland on orders over £75. Full range of tools and equipment available form axel stands to wrenches if you need it we’ve got it!!"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta name="keywords" content="car parts, parts for cars, cheap car parts, uk, supplier, citroen, volkswagen, bmw, mercedes, porsche, renault, saab, ford, audi, volkswagen, spares, new, used, original equipment, online shopping, replacement, car accessories, cheap car parts, car part, auto part, kyb shockers, motaquip, sealey, febi, blueprint, adl, cars, car, vehicle, vehicles, belts, belt, pump, starter, motor, platform, shared, oe, catalogue, cataloguing, products, high, quality, opportunties, gasket, glow, plugs, plug, spark, valve, tension, tensioners, tappet, tappets, injector, head, conditioning, spool, turbo, charger, radiator, thermostat, thermo, fan, viscous, kits, kit, abs, antilock, systems, system, drum, drums, caliper, calipers, hose, hoses, condensor, distributor, ECU, HT, leads, power, reverse, speed, throttle, crank, shaft, pressure, cv, prop, axle, gearbox, box, gears, gear, anti, roll, king, pin, mount, mounts, links, link, grey, import, chevrolet, daewoo, daihatsu, honda, hyundai, isuzu, kia, lexus, mazda, mistubishi, nissan, perodua, proton, ssangyong, subaru, suzuki, toyota," /> <meta name="revisit-after" content="1 days" /> <meta name="ROBOTS" content="index all" /> <meta name="ROBOTS" content="index/follow" /> <title>Parts For All Cars - Car Parts - Tools and more</title> <base href="http://partsforallcars.com/"> <link rel="stylesheet" type="text/css" href="stylesheet.css"> <link href="spares/stylesheet.css" rel="stylesheet" type="text/css"> </head> <?php require('spares/includes/application_top.php'); include_once('spares/includes/modules/analyticstracking.php'); ?> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" > <!-- header //--> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr class="header"> <td width="25%" valign="middle"><a href="http://partsforallcars.com"><img src="spares/images/pfac_logo1.jpg" border="0" alt="PartsForAllCars" title=" PartsForAllCars " width="416" height="80"></a></td> <td width="25%" valign="middle"> <?php include('spares/js/add_to_fav.js'); ?></td> <td width="50%" align="right" valign="bottom"><a href="http://partsforallcars.com/spares/contact_us.php"><img src="spares/images/mail2.jpg" border="0" alt="Contact Us" title=" Contact Us " width="78" height="39"></a> <a href="http://partsforallcars.com/spares/account.php"><img src="spares/images/header_account.gif" border="0" alt="My Account" title=" My Account " width="78" height="39"></a> <a href="http://partsforallcars.com/spares/shopping_cart.php"><img src="spares/images/header_cart.gif" border="0" alt="Cart Contents" title=" Cart Contents " width="78" height="39"></a> <a href="http://partsforallcars.com/spares/checkout_shipping.php"><img src="spares/images/header_checkout.gif" border="0" alt="Checkout" title=" Checkout " width="40" height="31"></a> </td> </tr> </table> <table border="0" width="100%" cellspacing="0" cellpadding="1"> <tr class="headerNavigation"> <td class="headerNavigation"><a href="http://partsforallcars.com"class="headerNavigation">Home</a></td> <td align="right" class="headerNavigation"> <a href="http://partsforallcars.com/spares/contact_us.php" class="headerNavigation">Contact Us</a> | <a href="http://partsforallcars.com/spares/account.php" class="headerNavigation">My Account</a> | <a href="http://partsforallcars.com/spares/shopping_cart.php" class="headerNavigation">Cart Contents</a> | <a href="http://partsforallcars.com/spares/checkout_shipping.php" class="headerNavigation">Checkout</a> </td> </tr> </tr> </table> <!-- header_eof //--> <!-- body//--> <table width="100%" border="0"> <tr> <td width="11%"><table width="100%" height="100%" border="0"> <tr> <td><table width="100%" height="100%" border="0"> <tr> <td><?php include('spares/' . DIR_WS_INCLUDES . 'boxes/new_offers.php'); ?></td> </tr> </table></td> </tr> <tr> <td><?php include('spares/' . DIR_WS_INCLUDES . 'boxes/paymentmethods.php'); ?></td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> </table></td> <td width="77%"><table width="100%" height="100%" border="0"> <tr> <td><table width="100%" border="0"> <tr> <td align="right" valign="bottom" class="inputRequirement style1" > <div align="right"> <?php include('spares/' . DIR_WS_MODULES . FILENAME_SEARCH); ?> </div></td> </tr> </table></td> </tr> <tr> <td><?php include('spares/' . DIR_WS_MODULES . FILENAME_SCROLL_TEXT); ?></td> </tr> <tr> <td><?php include('spares/' . DIR_WS_INCLUDES . FILENAME_MAIN_TEXT); ?></td> </tr> <tr> <td> </td> </tr> <tr> <td><?php include('spares/includes/home_page/hp_new_products.php'); ?></td> </tr> <tr> <td> </td> </tr> </table></td> <td width="12%"><table width="100%" height="100%" border="0"> <tr> <td><table width="100%" border="0"> <tr> <td><?php include('spares/' . DIR_WS_INCLUDES . 'boxes/loginbox.php'); ?></td> </tr> </table></td> </tr> <tr> <td><?php include('spares/' . DIR_WS_INCLUDES . 'boxes/deals_coupons.php'); ?></td> </tr> <tr> <td><?php include('spares/' . DIR_WS_INCLUDES . 'boxes/information.php'); ?></td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> </table></td> </tr> </table> <?php require('spares/' . DIR_WS_INCLUDES . 'footer.php'); ?> </body> </html> <?php require('spares/' . DIR_WS_INCLUDES . 'application_bottom.php'); ?> You will have to excuse any bad code being a novice to all this my skills are limited.
Guest Posted April 20, 2008 Posted April 20, 2008 Jim what i really don't understand is that now some images have lost the 'spares' all together it like one rule for some but not for others
germ Posted April 20, 2008 Posted April 20, 2008 Have you considered making your root folder your catalog? :unsure: I think you installed osC into the /spares folder. Then you found out that people don't get to your catalog by going to http://yoursite.com, they have to go to http://yoursite.com/spares, and now you're making a workaround. Moving your shop to the root folder isn't too difficult. Basically, you'd COPY all the files and folders from your /spares folder into the / (root) folder, then edit your configure.php files to match the new location. Have you considered doing that? :unsure: If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there >
Recommended Posts
Archived
This topic is now archived and is closed to further replies.