Jump to content


  • Content count

  • Joined

  • Last visited

Profile Information

  • Real Name
    Kathy du Buisson
  1. Thanks for the prompt response - I'll try this out when I have finished something else that someone else has decided that I should do first kdb
  2. Hi.. I have had my development OSC installed on my XP for a year or so and my production one on a *nix server and I could do most testing ok. However, my XP machine has fallen in a heap and so I now have a Win 7 x64 box that I have been setting up. I found that I had to install different versions of PHP (5.3) and MySQL to work with the Win7 IIS. I also had to re-create my database from an export from my production site. I have Ultimate SEO URLs 2.1 installed and as I know they don't work under Windows I turned them off in Admin. However, although the site works in production, my new beaut development site won't work and comes up with the following error Class 'SEO_URL' not found in C:\inetpub\wwwroot\includes\functions\html_output.php on line 23 I definitely have seo.class.php in my /includes directory and I also have SEO URLs turned off in the database. This worked on my XP machine with PHP 5.2 so is there an incompatibility here? Is there a tweak I should make elsewhere? Should I take the plunge and install Apache? Should I install something else? I really want my development and production sites to match and for both to work. I would also like to minimise the time devoted to maintaining the site so that I can actually get on and create more products with which to populate them? Any advice anyone? Tks - all help appreciated kdb
  3. kdb

    Header Tags SEO

    I had that problem too - I think the installation instructions were not quite clear enough on this point - you may have had the tep_hide_session function defined in html_output.php either from another contribution or whatever. It only needs to be defined once so take it out of general.php (i.e. ignore that step) if you already have the function defined elsewhere. cheers Kdb
  4. kdb

    New Google Sitemap Generator

    I'm sorry but I can't help you there - I am not even sure what STS Template is as I have only been working with Oscommerce for a couple of months. Maybe someone else can be of more help. Regards KdB
  5. Thanks for your response. Unfortunately at the moment my php skills are not yet up to scratch and I have no idea how to create a cron job yet!! Guess I have some more research to do. Meanwhile I will just change the wording of the status with the value of 11. Thanks KdB
  6. Hi... I have installed the Super Downloads contrib and Paypal IPN and of course a whole host of others. When testing in the sandbox (going live in Feb) the status gets changed (as it should) to 11 Download Now Available and they turn up on the checkout success and account_history_info pages ok and the link is in the order email. All looks very good so far, I can even download the items. However, there are a couple of things which I don't know how to do: 1 How can I get the status to be changed to 5 Delivered once the number of downloads have been exhausted (currently set to 2) and/or the number of days has expired (also set to 2) I don't really want to have to do this manually. 2 I also noticed that when I 'purchased' a physical item only its status was also set to 11 Download Now Available when it should have been either Paid or Despatched or something. Any help would be appreciated. KdB
  7. kdb

    New Google Sitemap Generator

    I know - what I have managed to do is rewrite it completely - basically I went back to the Products one which actually worked and started from there. Then in the SQL query I only had one query and selected review id, products id, date added, last modified and review rating and restricted it to those with approved = 1 as I have the approvals mod in place which interestingly doesn't put a date in the last modified field. then, as I figured it was more important to index positive reviews I calculated the ratio by dividing the reviews rating by 5 (the top rating value). At least that has given me some valid priority tags. The version I downloaded also used the products_id in the max statement which I didn't understand the reason for and I couldn't work out how to convert datetime fields to an integer so it would calculate things properly (my PHP is a bit primitive). Also SEO_URLs was defined as false which gave me a problem with valid location tags as I have Ultimate SEO URls in place. As an additional enhancement, I have also put a button link to product_info on each of reviews pages so that if a review actually gets indexed someone can click through directly to the product. Here is my code for googleSitemapReviews.php below If you want to check the site it is at www.fundigital.co.uk (it is still in test mode) Cheers - KdB <?php /** * Google Sitemap Generator * * Script to generate a Google sitemap for osCommerce based stores * * @license [url="http://opensource.org/licenses/gpl-license.php"]http://opensource.org/licenses/gpl-license.php[/url] GNU Public License * @version 1.2 * @link [url="http://www.oscommerce-freelancers.com/"]http://www.oscommerce-freelancers.com/[/url] osCommerce-Freelancers * @copyright Copyright 2006, Bobby Easland * @author Bobby Easland * @filesource */ /* * Include the application_top.php script */ include_once('includes/application_top.php'); /* * Send the XML content header */ header('Content-Type: text/xml'); /* * Echo the XML out tag */ echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n"; ?> <urlset xmlns="http://www.google.com/schemas/sitemap/0.84"> <?php /* * Define the uniform node function */ function GenerateNode($data){ $content = ''; $content .= "\t" . '<url>' . "\n"; $content .= "\t\t" . '<loc>'.trim($data['loc']).'</loc>' . "\n"; $content .= "\t\t" . '<lastmod>'.trim($data['lastmod']).'</lastmod>' . "\n"; $content .= "\t\t" . '<changefreq>'.trim($data['changefreq']).'</changefreq>' . "\n"; $content .= "\t\t" . '<priority>'.trim($data['priority']).'</priority>' . "\n"; $content .= "\t" . '</url>' . "\n"; return $content; } # end function /* * Define the SQL for the products query */ $sql = "SELECT reviews_id as rID, date_added as date_added, last_modified as last_mod, products_id as pID, reviews_rating FROM " . TABLE_REVIEWS . " WHERE approved = '1' ORDER BY reviews_rating "; /* * Execute the query */ $query = tep_db_query($sql); /* * If there are returned rows... * Basic sanity check */ if ( tep_db_num_rows($query) > 0 ){ /* * Initialize the variable containers */ $container = array(); $number = 0; $top_rating = 5; /* * Loop the query result set */ while( $result = tep_db_fetch_array($query) ){ //$top = max($top, $result['reviews_rating ']); $location = tep_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $result['pID'] . '&'. 'reviews_id=' . $result['rID'], 'NONSSL', false); // $location = tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $result['pID'], 'NONSSL', false); if ( tep_not_null($result['last_mod']) ){ $lastmod = $result['last_mod']; } else { $lastmod = $result['date_added']; } $changefreq = 'weekly'; $ratio = ($top_rating > 0) ? ($result['reviews_rating']/$top_rating) : 0; $priority = $ratio < .1 ? .1 : number_format($ratio, 1, '.', ''); /* * Initialize the content container array */ $container = array('loc' => htmlspecialchars(utf8_encode($location)), 'lastmod' => date ("Y-m-d", strtotime($lastmod)), 'changefreq' => $changefreq, 'priority' => $priority ); /* * Echo the generated node */ echo generateNode($container); } # end while } # end if /* * Close the urlset */ echo '</urlset>'; /* * Include the application_bottom.php script */ include_once('includes/application_bottom.php'); ?>
  8. kdb

    New Google Sitemap Generator

    I have just submitted the googleSitemaps for Categories, Products and Reviews. The Categories and Products ones seemed to work ok but Google told me I had several invalid tags. The reviews one installed is the one dated 18 dec 2008. When I run it in my browser it generates links like <loc>http://fundigital.co.uk/-pri-74.html?reviews_id=5</loc> which would seem to indicate that it is not compatible with the ultimate SEO URLS which is also installed. How do I fix it please. Tks in advance KdB
  9. kdb

    Dynamic SiteMap

    Just to note that I have finally got this working on the real site - The xml generator problem was probably because of a protection problem and I couldn't fix that on the Windows side. The other 500 errors were caused by my dyslexic/ancient fingers. However, now that it works I would like a way to order the page links. I tried a $sort($files['name']); but although this did sort by names it then misaligned the links with the names. I also tried asort but that didn't work either. I am new to PHP so I am a bit wonky on syntax (and a few other things as well). My preferred option would be to assign an order for each line and also maybe have artificial groups as for the boxes. For instance I would like my Home page to be on top, not halfway down. I also have OSC Affiliate installed and the box listing doesn't quite work for the sitemap but I would like to create a sort of artificial box listing - does this make sense? KdB
  10. kdb

    Dynamic SiteMap

    Hi.. I have just tried to install the Dynamic sitemap v 3.5.10. I installed it on my test server on Windows/IIS before uploading changes to my soon to be live *nux version. I get the admin page which allows me to include/exclude the various pages but I get an HTTP 500 error when I click on the generate XML site map button (also btw I would prefer to set the time zone only once 'cos I know I will forget to do it in the future). It is very frustrating as I get no error messages or progress messages so I can't diagnose anything. Can anyone help please, pretty please.. KdB PS: I also get the HTTP 500 error on my index page when I try the catalog side.
  11. Well... I have finally managed to fix it myself and am posting my solution after much deconstructing and trawling around in case anyone else is having the problem catalog/affiliate_show_banner.php First the Post and Get variables need to have (isset.... ) added thus: // Register needed Post / Get Variables if (isset($HTTP_GET_VARS['ref'])) $affiliate_id=$HTTP_GET_VARS['ref']; if (isset($HTTP_POST_VARS['ref'])) $affiliate_id=$HTTP_POST_VARS['ref']; if (isset($HTTP_GET_VARS['affiliate_banner_id'])) $banner_id = $HTTP_GET_VARS['affiliate_banner_id']; if (isset($HTTP_POST_VARS['affiliate_banner_id'])) $banner_id = $HTTP_POST_VARS['affiliate_banner_id']; if (isset($HTTP_GET_VARS['affiliate_pbanner_id'])) $prod_banner_id = $HTTP_GET_VARS['affiliate_pbanner_id']; if (isset($HTTP_POST_VARS['affiliate_pbanner_id'])) $prod_banner_id = $HTTP_POST_VARS['affiliate_pbanner_id']; Second: $banner_id and $prod_banner_id need to be defined for some reason so put these lines just before the code above so it looks like this: $banner_id = ''; $prod_banner_id = ''; // Register needed Post / Get Variables if (isset($HTTP_GET_VARS['ref'])) $affiliate_id=$HTTP_GET_VARS['ref']; if (isset($HTTP_POST_VARS['ref'])) $affiliate_id=$HTTP_POST_VARS['ref']; if (isset($HTTP_GET_VARS['affiliate_banner_id'])) $banner_id = $HTTP_GET_VARS['affiliate_banner_id']; if (isset($HTTP_POST_VARS['affiliate_banner_id'])) $banner_id = $HTTP_POST_VARS['affiliate_banner_id']; if (isset($HTTP_GET_VARS['affiliate_pbanner_id'])) $prod_banner_id = $HTTP_GET_VARS['affiliate_pbanner_id']; if (isset($HTTP_POST_VARS['affiliate_pbanner_id'])) $prod_banner_id = $HTTP_POST_VARS['affiliate_pbanner_id']; Third. In the function affiliate_show_banner nearer the top of the file you need to send an additional content header so I got the length of the file and sent the header with the length just before the content-disposition header. The function now looks like this: function affiliate_show_banner($pic) { //Read Pic and send it to browser $fp = fopen($pic, "rb"); if (!$fp) exit(); // Get Image type $img_type = substr($pic, strrpos($pic, ".") + 1); // Get Imagename $pos = strrpos($pic, "/"); if ($pos) { $img_name = substr($pic, strrpos($pic, "/" ) + 1); } else { $img_name=$pic; } $len = filesize($pic); header ("Content-type: image/$img_type"); header ("Content-Length: $len"); header ("Content-Disposition: inline; filename=$img_name"); fpassthru($fp); // The file is closed when fpassthru() is done reading it (leaving handle useless). fclose ($fp); exit(); } and the images all show up!!!!
  12. Can anyone tell me how to get the banner images to show up in OSC Affiliate. I am using OSC 2.2rc2a/PHP 5 and have done all the messy fixes. I have changed the reference to DIR_WS_CATALOG to DIR_WS_HTTP_CATALOG as I found a fix for that If I set debug to true it doesn't give me the debug information If I try http://localhost/affiliate_show_banner.php...nner_id=4" in another browser window I get: PHP Notice: Undefined index: ref in C:\Inetpub\wwwroot\affiliate_show_banner.php on line 96 PHP Notice: Undefined index: affiliate_banner_id in C:\Inetpub\wwwroot\affiliate_show_banner.php on line 98 PHP Notice: Undefined index: affiliate_pbanner_id in C:\Inetpub\wwwroot\affiliate_show_banner.php on line 99 PHP Notice: Undefined index: affiliate_pbanner_id in C:\Inetpub\wwwroot\affiliate_show_banner.php on line 100 PHP Notice: Undefined variable: prod_banner_id in C:\Inetpub\wwwroot\affiliate_show_banner.php on line 114 If I just change if ($HTTP_GET_VARS['affiliate_banner_id']) $banner_id = $HTTP_GET_VARS['affiliate_banner_id']; to if (isset($HTTP_GET_VARS['affiliate_banner_id'])) $banner_id = $HTTP_GET_VARS['affiliate_banner_id']; I get the same as above but if I change only if ($HTTP_POST_VARS['affiliate_banner_id']) $banner_id = $HTTP_POST_VARS['affiliate_banner_id']; to if (isset($HTTP_POST_VARS['affiliate_banner_id'])) $banner_id = $HTTP_POST_VARS['affiliate_banner_id']; I get an HTTP 500 error Can someone tell me what the right code should be - it seems from trawling all the forums that lots of people had these sort of problems a while ago - but no real solutions seem to be offered, or at least that I can make work. Please help - this is urgent My affiliate_show_banner.php code is below Kdb <?php /* $Id: affiliate_show_banner.php,v 2.00 2003/10/12 OSC-Affiliate Contribution based on: osCommerce, Open Source E-Commerce Solutions [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url] Copyright © 2002 - 2003 osCommerce Released under the GNU General Public License */ // CHECKIT // -> optimize code -> double parts // require of application_top not possible // cause then whois online registers it also as visitor // define('TABLE_AFFILIATE_BANNERS_HISTORY', 'affiliate_banners_history'); define('TABLE_AFFILIATE_BANNERS', 'affiliate_banners'); define('TABLE_PRODUCTS', 'products'); // Set the local configuration parameters - mainly for developers if (file_exists('includes/local/configure.php')) include('includes/local/configure.php'); require('includes/configure.php'); if (file_exists('includes/local/affiliate_configure.php')) include('includes/local/affiliate_configure.php'); require('includes/affiliate_configure.php'); // include the database functions require(DIR_WS_FUNCTIONS . 'database.php'); // make a connection to the database... now tep_db_connect() or die('Unable to connect to database server!'); function affiliate_show_banner($pic) { //Read Pic and send it to browser $fp = fopen($pic, "rb"); if (!$fp) exit(); // Get Image type $img_type = substr($pic, strrpos($pic, ".") + 1); // Get Imagename $pos = strrpos($pic, "/"); if ($pos) { $img_name = substr($pic, strrpos($pic, "/" ) + 1); } else { $img_name=$pic; } header ("Content-type: image/$img_type"); header ("Content-Disposition: inline; filename=$img_name"); fpassthru($fp); // The file is closed when fpassthru() is done reading it (leaving handle useless). // fclose ($fp); exit(); } function affiliate_debug($banner,$sql) { ?> <table border=1 cellpadding=2 cellspacing=2> <tr><td colspan=2>Check the pathes! (catalog/includes/configure.php)</td></tr> <tr><td>absolute path to picture:</td><td><?php echo DIR_FS_CATALOG . DIR_WS_IMAGES . $banner; ?></td></tr> <tr><td>build with:</td><td>DIR_FS_CATALOG . DIR_WS_IMAGES . $banner</td></tr> <tr><td>DIR_FS_CATALOG</td><td><?php echo DIR_FS_CATALOG; ?></td></tr> <tr><td>DIR_WS_HTTP_CATALOG</td><td><?php echo DIR_WS_HTTP_CATALOG; ?></td></tr> <tr><td>DIR_WS_IMAGES</td><td><?php echo DIR_WS_IMAGES; ?></td></tr> <tr><td>DIR_WS_IMAGES</td><td><?php echo DIR_WS_IMAGES; ?></td></tr> <tr><td>$banner</td><td><?php echo $banner; ?></td></tr> <tr><td>SQL-Query used:</td><td><?php echo $sql; ?></td></tr> <tr><th>Try to find error:</td><td> </th></tr> <tr><td>SQL-Query:</td><td><?php if ($banner) echo "Got Result"; else echo "No result"; ?></td></tr> <tr><td>Locating Pic</td><td> <?php $pic = DIR_FS_CATALOG . DIR_WS_IMAGES . $banner; echo $pic . "<br>"; if (!is_file($pic)) { echo "failed<br>"; } else { echo "success<br>"; } ?> </td></tr> </table> <?php exit(); } // Register needed Post / Get Variables if ($HTTP_GET_VARS['ref']) $affiliate_id=$HTTP_GET_VARS['ref']; if ($HTTP_POST_VARS['ref']) $affiliate_id=$HTTP_POST_VARS['ref']; if ($HTTP_GET_VARS['affiliate_banner_id']) $banner_id = $HTTP_GET_VARS['affiliate_banner_id']; if (isset($HTTP_POST_VARS['affiliate_banner_id'])) $banner_id = $HTTP_POST_VARS['affiliate_banner_id']; if ($HTTP_GET_VARS['affiliate_pbanner_id']) $prod_banner_id = $HTTP_GET_VARS['affiliate_pbanner_id']; if ($HTTP_POST_VARS['affiliate_pbanner_id']) $prod_banner_id = $HTTP_POST_VARS['affiliate_pbanner_id']; $banner = ''; $products_id = ''; if ($banner_id) { $sql = "select affiliate_banners_image, affiliate_products_id from " . TABLE_AFFILIATE_BANNERS . " where affiliate_banners_id = '" . $banner_id . "' and affiliate_status = 1"; $banner_values = tep_db_query($sql); if ($banner_array = tep_db_fetch_array($banner_values)) { $banner = $banner_array['affiliate_banners_image']; $products_id = $banner_array['affiliate_products_id']; } } if ($prod_banner_id) { $banner_id = 1; // Banner ID for these Banners is one $sql = "select products_image from " . TABLE_PRODUCTS . " where products_id = '" . $prod_banner_id . "' and products_status = 1"; $banner_values = tep_db_query($sql); if ($banner_array = tep_db_fetch_array($banner_values)) { $banner = $banner_array['products_image']; $products_id = $prod_banner_id; } } // DebugModus if (AFFILIATE_SHOW_BANNERS_DEBUG == 'true') affiliate_debug($banner,$sql); if ($banner) { $pic = DIR_FS_CATALOG . DIR_WS_IMAGES . $banner; // Show Banner only if it exists: if (is_file($pic)) { $today = date('Y-m-d'); // Update stats: if ($affiliate_id) { $banner_stats_query = tep_db_query("select * from " . TABLE_AFFILIATE_BANNERS_HISTORY . " where affiliate_banners_id = '" . $banner_id . "' and affiliate_banners_products_id = '" . $products_id ."' and affiliate_banners_affiliate_id = '" . $affiliate_id. "' and affiliate_banners_history_date = '" . $today . "'"); // Banner has been shown today if ($banner_stats_array = tep_db_fetch_array($banner_stats_query)) { tep_db_query("update " . TABLE_AFFILIATE_BANNERS_HISTORY . " set affiliate_banners_shown = affiliate_banners_shown + 1 where affiliate_banners_id = '" . $banner_id . "' and affiliate_banners_affiliate_id = '" . $affiliate_id. "' and affiliate_banners_products_id = '" . $products_id ."' and affiliate_banners_history_date = '" . $today . "'"); } else { // First view of Banner today tep_db_query("insert into " . TABLE_AFFILIATE_BANNERS_HISTORY . " (affiliate_banners_id, affiliate_banners_products_id, affiliate_banners_affiliate_id, affiliate_banners_shown, affiliate_banners_history_date) VALUES ('" . $banner_id . "', '" . $products_id ."', '" . $affiliate_id. "', '1', '" . $today . "')"); } } // Show Banner affiliate_show_banner($pic); } } // Show default Banner if none is found if (is_file(AFFILIATE_SHOW_BANNERS_DEFAULT_PIC)) { affiliate_show_banner(AFFILIATE_SHOW_BANNERS_DEFAULT_PIC); } else { echo "<br>"; // Output something to prevent endless loading } exit(); ?>
  13. kdb

    osc Affiliate and paypal_ipn

    Hi .. I am trying to install the OSC Affiliate module and in the install instructions it said to modify /includes/modules/payment/paypal_ipn.php However, I didn't have a paypal_ipn.php in my fairly new install on localhost. So, I downloaded and installed the Paypal_IPn v2.3.4.5 and installed that. Then when it tells me to do this: Find this code around line 250: $cart_PayPal_IPN_ID = $cartID . '-' . $insert_id; tep_session_register('cart_PayPal_IPN_ID'); } } return false; } and change to: $cart_PayPal_IPN_ID = $cartID . '-' . $insert_id; tep_session_register('cart_PayPal_IPN_ID'); } } // Include OSC-AFFILIATE require(DIR_WS_INCLUDES . 'affiliate_checkout_process.php'); return false; } The most likely equivalent piece of code is this: tep_session_register('cart_PayPal_IPN_ID'); // Terra register globals fix $_SESSION['cart_PayPal_IPN_ID'] = $cartID . '-' . $insert_id; } } // BOF Confirmation Info added by AlexStudio $confirmation = array('title' => MODULE_PAYMENT_PAYPAL_IPN_TEXT_LAST_CONFIRM, 'fields' => array()); return $confirmation; // EOF Confirmation Info added by AlexStudio } so I did this: tep_session_register('cart_PayPal_IPN_ID'); // Terra register globals fix $_SESSION['cart_PayPal_IPN_ID'] = $cartID . '-' . $insert_id; } } // Include OSC-AFFILIATE require(DIR_WS_INCLUDES . 'affiliate_checkout_process.php'); // end Include OSC_Affiliate // BOF Confirmation Info added by AlexStudio $confirmation = array('title' => MODULE_PAYMENT_PAYPAL_IPN_TEXT_LAST_CONFIRM, 'fields' => array()); return $confirmation; // EOF Confirmation Info added by AlexStudio } Can anyone tell me if this is correct?