♥FWR Media Posted October 30, 2009 Author Share Posted October 30, 2009 It was an extra ")" in the new fuction. However, once I removed it I noticed it did not work :/ New Link: http://www.13thgreen.com/-slider-shorts-black-p-502.html You can see the manufacturers name is missing. there is no extra brace in the function the function is fine. Quote Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work. Link to comment Share on other sites More sharing options...
♥FWR Media Posted October 30, 2009 Author Share Posted October 30, 2009 (edited) It was an extra ")" in the new fuction. However, once I removed it I noticed it did not work :/ New Link: http://www.13thgreen.com/-slider-shorts-black-p-502.html You can see the manufacturers name is missing. You have to reset the cache in admin to see new results. Aaaah there was an extra parenthesis .. private function getManufacturersName( $mid )) { Edited October 30, 2009 by FWR Media Quote Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work. Link to comment Share on other sites More sharing options...
Guest Posted October 30, 2009 Share Posted October 30, 2009 Robert, private function getManufacturersName( $mid [b])[/b]) { $query = "SELECT manufacturers_name FROM " . TABLE_MANUFACTURERS . " WHERE manufacturers_id = '" . (int)$mid . "'"; $result = usu::query( $query ); $row = tep_db_fetch_array( $result ); tep_db_free_result( $result ); return $row['manufacturers_name']; } // end method When I removed this parenthesis the syntax error disappeared. $url = $this->linkCreate(FILENAME_PRODUCT_INFO, $reg_item['manufacturers_name'] . '-' . $reg_item['link_text'], '-p-', $valuepair[1]); I think the original post you posted "$reg_item['manufacturers_id']", when I went back to verify I realized it should have been _name so I re copied it and pasted. Now everything works. Your the MAN! I really think others could benefit from this. Your modification is for SEO, maybe there are other people who feel the brand name would help greatly! Quote Link to comment Share on other sites More sharing options...
♥FWR Media Posted October 30, 2009 Author Share Posted October 30, 2009 Robert, private function getManufacturersName( $mid [b])[/b]) { $query = "SELECT manufacturers_name FROM " . TABLE_MANUFACTURERS . " WHERE manufacturers_id = '" . (int)$mid . "'"; $result = usu::query( $query ); $row = tep_db_fetch_array( $result ); tep_db_free_result( $result ); return $row['manufacturers_name']; } // end method When I removed this parenthesis the syntax error disappeared. $url = $this->linkCreate(FILENAME_PRODUCT_INFO, $reg_item['manufacturers_name'] . '-' . $reg_item['link_text'], '-p-', $valuepair[1]); I think the original post you posted "$reg_item['manufacturers_id']", when I went back to verify I realized it should have been _name so I re copied it and pasted. Now everything works. Your the MAN! I really think others could benefit from this. Your modification is for SEO, maybe there are other people who feel the brand name would help greatly! and I probably will Quote Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work. Link to comment Share on other sites More sharing options...
♥FWR Media Posted October 30, 2009 Author Share Posted October 30, 2009 Update on 1.1 progress With the addition of manufacturers name there are now 49 different ways to write seo uri products text p = products name (always included ) c = categories name ( optional ) m = product model (optional ) b = (brand) manufacturers name ( optional ) Any combination can be used in any order e.g. to give a ridiculous example: - Choosing bmcp ( brand, model, category, product ) Would give ( using the path_standard uri module ) .. www.mysite.com/product_info.php/hewlett-packard/hplj1100xi/printers/hewlett-packard-laserjet-1100xi/-p-/27 Of course no-one should use all options but as an example it shows the flexibility. Quote Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work. Link to comment Share on other sites More sharing options...
mayo23 Posted November 2, 2009 Share Posted November 2, 2009 I would prefer to have a rewritten URL look like www.mystore.com/one-of-my-products-238.html where the 238 is the product id. Is there anyway of removing the -p- and -c- in the rewritten URL (can't seem to find where the URL rewrite rule is in the scripts)? I realise that the URL requires the id number, but does it need the p and c to preceed it? Quote My latest osCommerce work in progress no outside links in signatures allowed, see PM Link to comment Share on other sites More sharing options...
♥FWR Media Posted November 2, 2009 Author Share Posted November 2, 2009 I would prefer to have a rewritten URL look like www.mystore.com/one-of-my-products-238.html where the 238 is the product id. Is there anyway of removing the -p- and -c- in the rewritten URL (can't seem to find where the URL rewrite rule is in the scripts)? I realise that the URL requires the id number, but does it need the p and c to preceed it? There needs to be something in the uri to tell the script which type of _GET variable we are dealing with. Without the -p-/-c-/-m- etc the script would not know whether we are dealing with a cPath/producs_id or manufacturers_id. Also because osCommerce is not monolithic it also needs to be told which page to load. Quote Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work. Link to comment Share on other sites More sharing options...
jhande Posted November 2, 2009 Share Posted November 2, 2009 Hi Robert, Before I take the plunge I'm curious... I have 2.1d updated installed. Just downloaded your revision 96. If I follow the directions in the Upgrade.html, will I be up-to-date and current with your contribution? Or will I need to browse the topic discussion for any recent edits? I already saved the info you posted regarding how to fix Google XML Sitemap SEO. I believe I read there should be no problems with = More Category Boxes or Header Tags SEO contributions. Quote - :: Jim :: - - My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 - Link to comment Share on other sites More sharing options...
♥FWR Media Posted November 2, 2009 Author Share Posted November 2, 2009 (edited) Hi Robert, Before I take the plunge I'm curious... I have 2.1d updated installed. Just downloaded your revision 96. If I follow the directions in the Upgrade.html, will I be up-to-date and current with your contribution? Or will I need to browse the topic discussion for any recent edits? I already saved the info you posted regarding how to fix Google XML Sitemap SEO. I believe I read there should be no problems with = More Category Boxes or Header Tags SEO contributions. Header tags seo (and other contributions) use PHP_SELF incorrectly which creates issues with standard seo urls, look back a few pages in this thread where I created a patch. Other than that all is current. Well except for the new version 1.1 which is in development. Edited November 2, 2009 by FWR Media Quote Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work. Link to comment Share on other sites More sharing options...
grannysantiques Posted November 3, 2009 Share Posted November 3, 2009 I could not figure out how to post this question under this topic so just hit reply and here is my question.... I get the following error on my admin sign in page Parse error: syntax error, unexpected '{' in /home/mygra3/public_html/antiqueshop/admin/includes/functions/general.php on line 1308 My Os Commerce site is www.mygrannysatticantiques.com/antiqueforum I am not sure what to do as I am not familiar with php coding so I have changed nothing so far. I did follow all directions and the database updated without any errors. Thank you, Michelle Quote Link to comment Share on other sites More sharing options...
♥FWR Media Posted November 3, 2009 Author Share Posted November 3, 2009 I could not figure out how to post this question under this topic so just hit reply and here is my question.... I get the following error on my admin sign in page Parse error: syntax error, unexpected '{' in /home/mygra3/public_html/antiqueshop/admin/includes/functions/general.php on line 1308 My Os Commerce site is www.mygrannysatticantiques.com/antiqueforum I am not sure what to do as I am not familiar with php coding so I have changed nothing so far. I did follow all directions and the database updated without any errors. Thank you, Michelle Hi Michelle If you get a parse error adding this contribution then you have simply added code incorrectly when copying and pasting. there is only one modification to admin/includes/functions/general.php which is to add a single function to the very bottom so it is actually rather difficult to make a mistake here .. have a look at the code you added against the instructions, I would bet you left off the final } at the bottom. Quote Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work. Link to comment Share on other sites More sharing options...
Guest Posted November 3, 2009 Share Posted November 3, 2009 (edited) Hello, I installed this great contribution today. Unfortunately I am not able to get it working. My shop is a quite uptodate oscommerce 2.2rc. Everytime I enable the module the frontend tells me that (categorie- or product-) site cannot be found. The file .htaccess is edited properly (I´m quite sure about that) The rest of the mods are also correct installed as I do not get any errors. I followed the instructions step by step. mod_rewrite is enabled (phpinfo tells me so) The cache is deleted. Is there anything else I have to take a look at. I´m stuck right now. I installed in my (older) oscommerce shop chemos contrib for SEO and there it works (so no need to change something) But now... Any help is greatly appreciated. here my .htaccess : Options +FollowSymLinks RewriteEngine On RewriteBase / RewriteRule ^(.*)-p-([0-9]+).html$ product_info.php?products_id=$2&%{QUERY_STRING} RewriteRule ^(.*)-c-([0-9_]+).html$ index.php?cPath=$2&%{QUERY_STRING} RewriteRule ^(.*)-m-([0-9]+).html$ index.php?manufacturers_id=$2&%{QUERY_STRING} RewriteRule ^(.*)-pi-([0-9]+).html$ popup_image.php?pID=$2&%{QUERY_STRING} RewriteRule ^(.*)-pr-([0-9]+).html$ product_reviews.php?products_id=$2&%{QUERY_STRING} RewriteRule ^(.*)-pri-([0-9]+).html$ product_reviews_info.php?products_id=$2&%{QUERY_STRING} # Articles contribution RewriteRule ^(.*)-t-([0-9_]+).html$ articles.php?tPath=$2&%{QUERY_STRING} RewriteRule ^(.*)-a-([0-9]+).html$ article_info.php?articles_id=$2&%{QUERY_STRING} # Information pages RewriteRule ^(.*)-i-([0-9]+).html$ information.php?info_id=$2&%{QUERY_STRING} # Links contribution RewriteRule ^(.*)-links-([0-9_]+).html$ links.php?lPath=$2&%{QUERY_STRING} # Newsdesk contribution RewriteRule ^(.*)-n-([0-9]+).html$ newsdesk_info.php?newsdesk_id=$2&%{QUERY_STRING} RewriteRule ^(.*)-nc-([0-9]+).html$ newsdesk_index.php?newsPath=$2&%{QUERY_STRING} RewriteRule ^(.*)-nri-([0-9]+).html$ newsdesk_reviews_info.php?newsdesk_id=$2&%{QUERY_STRING} RewriteRule ^(.*)-nra-([0-9]+).html$ newsdesk_reviews_article.php?newsdesk_id=$2&%{QUERY_STRING} Edited November 3, 2009 by tosam Quote Link to comment Share on other sites More sharing options...
♥FWR Media Posted November 3, 2009 Author Share Posted November 3, 2009 Hello, I installed this great contribution today. Unfortunately I am not able to get it working. My shop is a quite uptodate oscommerce 2.2rc. Everytime I enable the module the frontend tells me that (categorie- or product-) site cannot be found. The file .htaccess is edited properly (I´m quite sure about that) The rest of the mods are also correct installed as I do not get any errors. I followed the instructions step by step. mod_rewrite is enabled (phpinfo tells me so) The cache is deleted. Is there anything else I have to take a look at. I´m stuck right now. I installed in my (older) oscommerce shop chemos contrib for SEO and there it works (so no need to change something) But now... Any help is greatly appreciated. Ok let's take this step by step as it will be simple. You mentioned the old series 2 seo urls is this currently installed on the same server? and working? Can I see a link to the shop in question? Is the shop installed in the root? e.g. www.mysite.com/ not www.mysite.com/catalog/? Quote Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work. Link to comment Share on other sites More sharing options...
Guest Posted November 3, 2009 Share Posted November 3, 2009 Robert, Again I want to thank-you for your help with the manufacturer's update. You really know your stuff when it comes to search engine optimization. Although loosely related I had some ideas I wanted to shoot by you that really could improve the community. Because of the success, and ease of use of USU5 I really think on you free time developing a bundle would be appropriate and would help the community a lot. Here's what I was thinking. 1. A site modification that adheres to Sitemap Protocol 0.9 (the universal sitemap) . Currently you support chemo's mod which only supports Google using sitemap 0.84. A site map with universal acceptance would be key to improving rankings for everyone that uses USU5 2. Google Shopping contribution. With this users of USU5 would be able to submit there products to Google with the updated URLS. Again this would dramatically help. Currently if someone uses USU5 and they have a google feed all the google feed products get a 301 to the new url. However, each time they are submitted they are re-submitted with the old link. Just something to think about. What do you think? Ryan Quote Link to comment Share on other sites More sharing options...
♥FWR Media Posted November 3, 2009 Author Share Posted November 3, 2009 Robert, Again I want to thank-you for your help with the manufacturer's update. You really know your stuff when it comes to search engine optimization. Although loosely related I had some ideas I wanted to shoot by you that really could improve the community. Because of the success, and ease of use of USU5 I really think on you free time developing a bundle would be appropriate and would help the community a lot. Here's what I was thinking. 1. A site modification that adheres to Sitemap Protocol 0.9 (the universal sitemap) . Currently you support chemo's mod which only supports Google using sitemap 0.84. A site map with universal acceptance would be key to improving rankings for everyone that uses USU5 2. Google Shopping contribution. With this users of USU5 would be able to submit there products to Google with the updated URLS. Again this would dramatically help. Currently if someone uses USU5 and they have a google feed all the google feed products get a 301 to the new url. However, each time they are submitted they are re-submitted with the old link. Just something to think about. What do you think? Ryan Good points Ryan The thing is that I wanted to keep USU5 clean and focussed, all of the things you mention above are seperate contributions, this I wanted to keep to producing reliable and flexible seo uris. I did write a contribution some time ago (although PHP5 code) called multilayer seo pop out menu, this menu system also includes sitemaps and an RSS2.0 feed. The contributions that are out there really should work with USU5 anyway, why? because it simply uses tep_href_link() to produce the uris. As long as the contributions are using this function they will work. Sadly some are hardcoded to use specific url contributions which is madness. Quote Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work. Link to comment Share on other sites More sharing options...
Guest Posted November 3, 2009 Share Posted November 3, 2009 Robert, Yes you are right, they should be desperate modifications. Maybe you would add them to the extras folder. I have put in a request with Jack_mcs to help make the automatic google feeder compatible with USU5. I noticed the links were hard coded. I attempted to convert it myself but failed due to lack of understanding of the SQL statement. With a little luck he will help out. I'm not asking at this point for your help but I thought I might as well post the code. <?php // Title: Google Base / Froogle Data Feeder 1.03 // Author: Calvin K // Contact: calvink@conceptulanetworking.com // Organization: Conceptual Networking // Last Update: 07/15/09 by Jack_mcs at oscommerce-solution.com /*************** BEGIN MASTER SETTINGS ******************/ define('SEO_ENABLED','true'); //Change to 'false' to disable if Ultimate SEO URLs is not installed define('FEEDNAME', 'your-outfile.txt'); //from your googlebase account define('DOMAIN_NAME', 'www.yourwebsite.com'); //your correct domain name (don't include www unless it is used) define('FTP_USERNAME', 'googleFTP-username'); //created from within your googlebase account define('FTP_PASSWORD', 'googleFTP-password'); //created from within your googlebase account define('FTP_ENABLED', '1'); //set to 0 to disable define('CONVERT_CURRENCY', '0'); //set to 0 to disable - only needed if a feed in a difference currecny is required define('CURRENCY_TYPE', 'USD'); //(eg. USD, EUR, GBP) define('DEFAULT_LANGUAGE', 1); //Change this to the id of your language. BY default 1 is english define('OPTIONS_ENABLED', 1); define('OPTIONS_ENABLED_AGE_RANGE', 0); define('OPTIONS_ENABLED_BRAND', 0); define('OPTIONS_ENABLED_CONDITION', 1); define('OPTIONS_ENABLED_CURRENCY', 0); define('OPTIONS_ENABLED_FEED_LANGUAGE', 0); define('OPTIONS_ENABLED_FEED_MANUFACTURE_ID', 0); define('OPTIONS_ENABLED_FEED_QUANTITY', 0); define('OPTIONS_ENABLED_MADE_IN', 0); define('OPTIONS_ENABLED_MANUFACTURER', 0); define('OPTIONS_ENABLED_PAYMENT_ACCEPTED', 0); define('OPTIONS_ENABLED_PRODUCT_TYPE', 0); define('OPTIONS_ENABLED_SHIPPING', 0); define('OPTIONS_ENABLED_UPC', 0); define('OPTIONS_ENABLED_WEIGHT', 0); //the following only matter if the matching option is enabled above. define('OPTIONS_AGE_RANGE', '0-9'); define('OPTIONS_BRAND', ''); define('OPTIONS_CONDITION', 'New'); //possible entries are New, Refurbished, Used define('OPTIONS_DEFAULT_CURRENCY', 'USD'); define('OPTIONS_DEFAULT_FEED_LANGUAGE', 'en'); define('OPTIONS_LOWEST_SHIPPING', ''); //this is not binary. Custom Code is required to provide the shipping cost per product. ###needs to be an array for per product. define('OPTIONS_MADE_IN', 'USA'); define('OPTIONS_PAYMENT_ACCEPTED_METHODS', ''); //Acceptable values: cash, check, GoogleCheckout, Visa, MasterCard, AmericanExpress, Discover, wiretransfer define('OPTIONS_WEIGHT_ACCEPTED_METHODS', 'lb'); //Valid units include lb, pound, oz, ounce, g, gram, kg, kilogram. /*************** END MASTER SETTINGS ******************/ /*************** NO EDITS NEEDED BELOW THIS LINE *****************/ require_once('../includes/configure.php'); if (! function_exists("tep_not_null")) { function tep_not_null($value) { if (is_array($value)) { if (sizeof($value) > 0) { return true; } else { return false; } } else { if (($value != '') && (strtolower($value) != 'null') && (strlen(trim($value)) > 0)) { return true; } else { return false; } } } } if(SEO_ENABLED=='true'){ //******************** // Modification for SEO // Since the ultimate SEO was only installed on the public side, we will include our files from there. require_once('../includes/filenames.php'); require_once('../includes/database_tables.php'); include_once('../' .DIR_WS_CLASSES . 'seo.class.php'); $seo_urls = new SEO_URL(DEFAULT_LANGUAGE); function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true) { global $seo_urls; return $seo_urls->href_link($page, $parameters, $connection, $add_session_id); } } //******************** // Start TIMER // ----------- $stimer = explode( ' ', microtime() ); $stimer = $stimer[1] + $stimer[0]; // ----------- $OutFile = "../feeds/" . FEEDNAME; $destination_file = FEEDNAME; $source_file = $OutFile; $imageURL = 'http://' . DOMAIN_NAME . '/images/'; if(SEO_ENABLED=='true'){ $productURL = 'product_info.php'; // ***** Revised for SEO $productParam = "products_id="; // ***** Added for SEO }else{ $productURL = 'http://' . DOMAIN_NAME . '/product_info.php?products_id='; } $already_sent = array(); $taxRate = 0; //default = 0 (e.g. for 17.5% tax use "$taxRate = 17.5;") $taxCalc = ($taxRate/100) + 1; //Do not edit if(CONVERT_CURRENCY) { if(SEO_ENABLED=='true'){ $productParam="currency=" . CURRENCY_TYPE . "&products_id="; }else{ $productURL = "http://" . DOMAIN_NAME . "/product_info.php?currency=" . CURRENCY_TYPE . "&products_id="; //where CURRENCY_TYPE is your currency type (eg. USD, EUR, GBP) } } $feed_exp_date = date('Y-m-d', time() + 2592000 ); if (!($link=mysql_connect(DB_SERVER,DB_SERVER_USERNAME,DB_SERVER_PASSWORD))) { echo "Error when connecting itself to the data base"; exit(); } if (!mysql_select_db( DB_DATABASE , $link )) { echo "Error the data base does not exist"; exit(); } $sql = " SELECT concat( '" . $productURL . "' ,products.products_id) AS product_url, products_model AS prodModel, manufacturers.manufacturers_name AS mfgName, manufacturers.manufacturers_id, products.products_id AS id, products_description.products_name AS name, products_description.products_description AS description, products.products_quantity AS quantity, products.products_status AS prodStatus, products.products_weight AS prodWeight, FORMAT( IFNULL(specials.specials_new_products_price, products.products_price) * " . $taxCalc . ",2) AS price, CONCAT( '" . $imageURL . "' ,products.products_image) AS image_url, products_to_categories.categories_id AS prodCatID, categories.parent_id AS catParentID, categories_description.categories_name AS catName FROM (categories, categories_description, products, products_description, products_to_categories) left join manufacturers on ( manufacturers.manufacturers_id = products.manufacturers_id ) left join specials on ( specials.products_id = products.products_id AND ( ( (specials.expires_date > CURRENT_DATE) OR (specials.expires_date is NULL) OR (specials.expires_date = 0) ) AND ( specials.status = 1 ) ) ) WHERE products.products_id=products_description.products_id AND products.products_id=products_to_categories.products_id AND products_to_categories.categories_id=categories.categories_id AND categories.categories_id=categories_description.categories_id ORDER BY products.products_id ASC "; $catInfo = " SELECT categories.categories_id AS curCatID, categories.parent_id AS parentCatID, categories_description.categories_name AS catName FROM categories, categories_description WHERE categories.categories_id = categories_description.categories_id "; function findCat($curID, $catTempPar, $catTempDes, $catIndex) { if( (isset($catTempPar[$curID])) && ($catTempPar[$curID] != 0) ) { if(isset($catIndex[$catTempPar[$curID]])) { $temp=$catIndex[$catTempPar[$curID]]; } else { $catIndex = findCat($catTempPar[$curID], $catTempPar, $catTempDes, $catIndex); $temp = $catIndex[$catTempPar[$curID]]; } } if( (isset($catTempPar[$curID])) && (isset($catTempDes[$curID])) && ($catTempPar[$curID] == 0) ) { $catIndex[$curID] = $catTempDes[$curID]; } else { $catIndex[$curID] = $temp . ", " . $catTempDes[$curID]; } return $catIndex; } $catIndex = array(); $catTempDes = array(); $catTempPar = array(); $processCat = mysql_query( $catInfo )or die( $FunctionName . ": SQL error " . mysql_error() . "| catInfo = " . htmlentities($catInfo) ); while ( $catRow = mysql_fetch_object( $processCat ) ) { $catKey = $catRow->curCatID; $catName = $catRow->catName; $catParID = $catRow->parentCatID; if($catName != "") { $catTempDes[$catKey]=$catName; $catTempPar[$catKey]=$catParID; } } foreach($catTempDes as $curID=>$des) //don't need the $des { $catIndex = findCat($curID, $catTempPar, $catTempDes, $catIndex); } $_strip_search = array( "![\t ]+$|^[\t ]+!m", // remove leading/trailing space chars '%[\r\n]+%m'); // remove CRs and newlines $_strip_replace = array( '', ' '); $_cleaner_array = array(">" => "> ", "®" => "", "®" => "", "™" => "", "™" => "", "\t" => "", " " => ""); if ( file_exists( $OutFile ) ) unlink( $OutFile ); $output = "link\ttitle\tdescription\texpiration_date\tprice\timage_link\tproduct_type\tid"; //create optional section if(OPTIONS_ENABLED == 1) { if(OPTIONS_ENABLED_AGE_RANGE == 1) $output .= "\tage_range"; if(OPTIONS_ENABLED_BRAND == 1) $output .= "\tbrand"; if(OPTIONS_ENABLED_CONDITION == 1) $output .= "\tcondition"; if(OPTIONS_ENABLED_CURRENCY == 1) $output .= "\tcurrency"; if(OPTIONS_ENABLED_FEED_LANGUAGE == 1) $output .= "\tlanguage"; if(OPTIONS_ENABLED_FEED_MANUFACTURER_ID == 1) $output .= "\tmanufacturer_id"; if(OPTIONS_ENABLED_FEED_QUANTITY == 1) $output .= "\tquantity"; if(OPTIONS_ENABLED_MADE_IN == 1) $output .= "\tmade_in"; if(OPTIONS_ENABLED_MANUFACTURER == 1) $output .= "\tmanufacturer"; if(OPTIONS_ENABLED_PAYMENT_ACCEPTED == 1) $output .= "\tpayment_accepted"; if(OPTIONS_ENABLED_PRODUCT_TYPE == 1) $output .= "\tproduct_type"; if(OPTIONS_ENABLED_SHIPPING == 1) $output .= "\tshipping"; if(OPTIONS_ENABLED_UPC == 1) $output .= "\tupc"; if(OPTIONS_ENABLED_WEIGHT == 1) $output .= "\tweight"; } $output .= "\n"; $result=mysql_query( $sql )or die( $FunctionName . ": SQL error " . mysql_error() . "| sql = " . htmlentities($sql) ); //Currency Information if(CONVERT_CURRENCY) { $sql3 = " SELECT currencies.value AS curUSD FROM currencies WHERE currencies.code = '" . CURRENCY_TYPE . "'"; $result3=mysql_query( $sql3 )or die( $FunctionName . ": SQL error " . mysql_error() . "| sql3 = " . htmlentities($sql3) ); $row3 = mysql_fetch_object( $result3 ); } $loop_counter = 0; while( $row = mysql_fetch_object( $result ) ) { if (isset($already_sent[$row->id])) continue; // if we've sent this one, skip the rest of the while loop if( $row->prodStatus == 1 || (OPTIONS_ENABLED == 1 && $quantity == 1) ) { if (CONVERT_CURRENCY) { $row->price = ereg_replace("[^.0-9]", "", $row->price); $row->price = $row->price * $row3->curUSD; $row->price = number_format($row->price, 2, '.', ','); } if(SEO_ENABLED=='true'){ $output .= tep_href_link($productURL,$productParam . $row->id) . "\t" . preg_replace($_strip_search, $_strip_replace, strip_tags( strtr($row->name, $_cleaner_array) ) ) . "\t" . preg_replace($_strip_search, $_strip_replace, strip_tags( strtr($row->description, $_cleaner_array) ) ) . "\t" . $feed_exp_date . "\t" . $row->price . "\t" . $row->image_url . "\t" . $catIndex[$row->prodCatID] . "\t" . $row->id; }else{ $output .= $row->product_url . "\t" . preg_replace($_strip_search, $_strip_replace, strip_tags( strtr($row->name, $_cleaner_array) ) ) . "\t" . preg_replace($_strip_search, $_strip_replace, strip_tags( strtr($row->description, $_cleaner_array) ) ) . "\t" . $feed_exp_date . "\t" . $row->price . "\t" . $row->image_url . "\t" . $catIndex[$row->prodCatID] . "\t" . $row->id; } //optional values section if(OPTIONS_ENABLED == 1) { if(OPTIONS_ENABLED_AGE_RANGE == 1) $output .= " \t " . OPTIONS_AGE_RANGE; if(OPTIONS_ENABLED_BRAND == 1) $output .= " \t " . OPTIONS_BRAND; if(OPTIONS_ENABLED_CONDITION == 1) $output .= " \t " . OPTIONS_CONDITION; if(OPTIONS_ENABLED_CURRENCY == 1) $output .= " \t " . OPTIONS_DEFAULT_CURRENCY; if(OPTIONS_ENABLED_FEED_LANGUAGE == 1) $output .= " \t " . OPTIONS_DEFAULT_FFEED_LANGUAGE; if(OPTIONS_ENABLED_FEED_MANUFACTURER_ID == 1) $output .= " \t " . $row->prodModel; if(OPTIONS_ENABLED_FEED_QUANTITY == 1) $output .= " \t " . $row->quantity; if(OPTIONS_ENABLED_MADE_IN == 1) $output .= " \t " . OPTIONS_MADE_IN; if(OPTIONS_ENABLED_MANUFACTURER == 1) $output .= " \t " . $row->mfgName; if(OPTIONS_ENABLED_PAYMENT_ACCEPTED == 1) $output .= " \t " . OPTIONS_PAYMENT_ACCEPTED_METHODS; if(OPTIONS_ENABLED_PRODUCT_TYPE == 1) { $catNameTemp = strtolower($catName); $output .= " \t " . $row->catName; } if(OPTIONS_ENABLED_SHIPPING == 1) $output .= " \t " . OPTIONS_LOWEST_SHIPPING; if(OPTIONS_ENABLED_UPC == 1) $output .= " \t " . "Not Supported"; if(OPTIONS_ENABLED_WEIGHT == 1) $output .= " \t " . $row->prodWeight . ' ' .OPTIONS_WEIGHT_ACCEPTED_METHODS; } $output .= " \n"; } $already_sent[$row->id] = 1; $loop_counter++; if ($loop_counter>750) { $fp = fopen( $OutFile , "a" ); $fout = fwrite( $fp , $output ); fclose( $fp ); $loop_counter = 0; $output = ""; } } $fp = fopen( $OutFile , "a" ); $fout = fwrite( $fp , $output ); fclose( $fp ); echo "File completed: <a href=\"" . $OutFile . "\" target=\"_blank\">" . $destination_file . "</a><br>\n"; chmod($OutFile, 0777); //Start FTP function ftp_file( $ftpservername, $ftpusername, $ftppassword, $ftpsourcefile, $ftpdirectory, $ftpdestinationfile ) { // set up basic connection $conn_id = ftp_connect($ftpservername); if ( $conn_id == false ) { echo "FTP open connection failed to $ftpservername <BR>\n" ; return false; } // login with username and password $login_result = ftp_login($conn_id, $ftpusername, $ftppassword); // check connection if ((!$conn_id) || (!$login_result)) { echo "FTP connection has failed!<BR>\n"; echo "Attempted to connect to " . $ftpservername . " for user " . $ftpusername . "<BR>\n"; return false; } else { echo "Connected to " . $ftpservername . ", for user " . $ftpusername . "<BR>\n"; } if ( strlen( $ftpdirectory ) > 0 ) { if (ftp_chdir($conn_id, $ftpdirectory )) { echo "Current directory is now: " . ftp_pwd($conn_id) . "<BR>\n"; } else { echo "Couldn't change directory on $ftpservername<BR>\n"; return false; } } ftp_pasv ( $conn_id, true ) ; // upload the file $upload = ftp_put( $conn_id, $ftpdestinationfile, $ftpsourcefile, FTP_ASCII ); // check upload status if (!$upload) { echo "$ftpservername: FTP upload has failed!<BR>\n"; return false; } else { echo "Uploaded " . $ftpsourcefile . " to " . $ftpservername . " as " . $ftpdestinationfile . "<BR>\n"; } // close the FTP stream ftp_close($conn_id); return true; } if (FTP_ENABLED) ftp_file( "uploads.google.com", FTP_USERNAME, FTP_PASSWORD, $source_file, "", $destination_file); //End FTP // End TIMER // --------- $etimer = explode( ' ', microtime() ); $etimer = $etimer[1] + $etimer[0]; echo '<p style="margin:auto; text-align:center">'; printf( "Script timer: <b>%f</b> seconds.", ($etimer-$stimer) ); echo '</p>'; // --------- ?> Again, I think this is something I or jack might get figured out. It seems to me that $product_url just needs to be changed to tep_href_link in the output section. With a little luck things will work out. Quote Link to comment Share on other sites More sharing options...
♥FWR Media Posted November 3, 2009 Author Share Posted November 3, 2009 (edited) Again, I think this is something I or jack might get figured out. It seems to me that $product_url just needs to be changed to tep_href_link in the output section. With a little luck things will work out. The reason that these contributions tend to hardcode stuff in and use native MySQL functions instead of e.g. tep_db_query etc is that standard cron jobs fail when there are included files. The solution to this is simply to use wget to access the cron file then includes can be used just fine. e.g. * * * * * * wget -q http://www.mysite.com/<path>/somefile.php >/dev/null Edited November 3, 2009 by FWR Media Quote Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work. Link to comment Share on other sites More sharing options...
Guest Posted November 3, 2009 Share Posted November 3, 2009 Robert, I will let you know how it goes. Quote Link to comment Share on other sites More sharing options...
graeme john Posted November 3, 2009 Share Posted November 3, 2009 Robert, Yes you are right, they should be desperate modifications. Maybe you would add them to the extras folder. I have put in a request with Jack_mcs to help make the automatic google feeder compatible with USU5. I noticed the links were hard coded. I attempted to convert it myself but failed due to lack of understanding of the SQL statement. With a little luck he will help out. I'm not asking at this point for your help but I thought I might as well post the code. <?php // Title: Google Base / Froogle Data Feeder 1.03 // Author: Calvin K // Contact: calvink@conceptulanetworking.com // Organization: Conceptual Networking // Last Update: 07/15/09 by Jack_mcs at oscommerce-solution.com /*************** BEGIN MASTER SETTINGS ******************/ define('SEO_ENABLED','true'); //Change to 'false' to disable if Ultimate SEO URLs is not installed define('FEEDNAME', 'your-outfile.txt'); //from your googlebase account define('DOMAIN_NAME', 'www.yourwebsite.com'); //your correct domain name (don't include www unless it is used) define('FTP_USERNAME', 'googleFTP-username'); //created from within your googlebase account define('FTP_PASSWORD', 'googleFTP-password'); //created from within your googlebase account define('FTP_ENABLED', '1'); //set to 0 to disable define('CONVERT_CURRENCY', '0'); //set to 0 to disable - only needed if a feed in a difference currecny is required define('CURRENCY_TYPE', 'USD'); //(eg. USD, EUR, GBP) define('DEFAULT_LANGUAGE', 1); //Change this to the id of your language. BY default 1 is english define('OPTIONS_ENABLED', 1); define('OPTIONS_ENABLED_AGE_RANGE', 0); define('OPTIONS_ENABLED_BRAND', 0); define('OPTIONS_ENABLED_CONDITION', 1); define('OPTIONS_ENABLED_CURRENCY', 0); define('OPTIONS_ENABLED_FEED_LANGUAGE', 0); define('OPTIONS_ENABLED_FEED_MANUFACTURE_ID', 0); define('OPTIONS_ENABLED_FEED_QUANTITY', 0); define('OPTIONS_ENABLED_MADE_IN', 0); define('OPTIONS_ENABLED_MANUFACTURER', 0); define('OPTIONS_ENABLED_PAYMENT_ACCEPTED', 0); define('OPTIONS_ENABLED_PRODUCT_TYPE', 0); define('OPTIONS_ENABLED_SHIPPING', 0); define('OPTIONS_ENABLED_UPC', 0); define('OPTIONS_ENABLED_WEIGHT', 0); //the following only matter if the matching option is enabled above. define('OPTIONS_AGE_RANGE', '0-9'); define('OPTIONS_BRAND', ''); define('OPTIONS_CONDITION', 'New'); //possible entries are New, Refurbished, Used define('OPTIONS_DEFAULT_CURRENCY', 'USD'); define('OPTIONS_DEFAULT_FEED_LANGUAGE', 'en'); define('OPTIONS_LOWEST_SHIPPING', ''); //this is not binary. Custom Code is required to provide the shipping cost per product. ###needs to be an array for per product. define('OPTIONS_MADE_IN', 'USA'); define('OPTIONS_PAYMENT_ACCEPTED_METHODS', ''); //Acceptable values: cash, check, GoogleCheckout, Visa, MasterCard, AmericanExpress, Discover, wiretransfer define('OPTIONS_WEIGHT_ACCEPTED_METHODS', 'lb'); //Valid units include lb, pound, oz, ounce, g, gram, kg, kilogram. /*************** END MASTER SETTINGS ******************/ /*************** NO EDITS NEEDED BELOW THIS LINE *****************/ require_once('../includes/configure.php'); if (! function_exists("tep_not_null")) { function tep_not_null($value) { if (is_array($value)) { if (sizeof($value) > 0) { return true; } else { return false; } } else { if (($value != '') && (strtolower($value) != 'null') && (strlen(trim($value)) > 0)) { return true; } else { return false; } } } } if(SEO_ENABLED=='true'){ //******************** // Modification for SEO // Since the ultimate SEO was only installed on the public side, we will include our files from there. require_once('../includes/filenames.php'); require_once('../includes/database_tables.php'); include_once('../' .DIR_WS_CLASSES . 'seo.class.php'); $seo_urls = new SEO_URL(DEFAULT_LANGUAGE); function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true) { global $seo_urls; return $seo_urls->href_link($page, $parameters, $connection, $add_session_id); } } //******************** // Start TIMER // ----------- $stimer = explode( ' ', microtime() ); $stimer = $stimer[1] + $stimer[0]; // ----------- $OutFile = "../feeds/" . FEEDNAME; $destination_file = FEEDNAME; $source_file = $OutFile; $imageURL = 'http://' . DOMAIN_NAME . '/images/'; if(SEO_ENABLED=='true'){ $productURL = 'product_info.php'; // ***** Revised for SEO $productParam = "products_id="; // ***** Added for SEO }else{ $productURL = 'http://' . DOMAIN_NAME . '/product_info.php?products_id='; } $already_sent = array(); $taxRate = 0; //default = 0 (e.g. for 17.5% tax use "$taxRate = 17.5;") $taxCalc = ($taxRate/100) + 1; //Do not edit if(CONVERT_CURRENCY) { if(SEO_ENABLED=='true'){ $productParam="currency=" . CURRENCY_TYPE . "&products_id="; }else{ $productURL = "http://" . DOMAIN_NAME . "/product_info.php?currency=" . CURRENCY_TYPE . "&products_id="; //where CURRENCY_TYPE is your currency type (eg. USD, EUR, GBP) } } $feed_exp_date = date('Y-m-d', time() + 2592000 ); if (!($link=mysql_connect(DB_SERVER,DB_SERVER_USERNAME,DB_SERVER_PASSWORD))) { echo "Error when connecting itself to the data base"; exit(); } if (!mysql_select_db( DB_DATABASE , $link )) { echo "Error the data base does not exist"; exit(); } $sql = " SELECT concat( '" . $productURL . "' ,products.products_id) AS product_url, products_model AS prodModel, manufacturers.manufacturers_name AS mfgName, manufacturers.manufacturers_id, products.products_id AS id, products_description.products_name AS name, products_description.products_description AS description, products.products_quantity AS quantity, products.products_status AS prodStatus, products.products_weight AS prodWeight, FORMAT( IFNULL(specials.specials_new_products_price, products.products_price) * " . $taxCalc . ",2) AS price, CONCAT( '" . $imageURL . "' ,products.products_image) AS image_url, products_to_categories.categories_id AS prodCatID, categories.parent_id AS catParentID, categories_description.categories_name AS catName FROM (categories, categories_description, products, products_description, products_to_categories) left join manufacturers on ( manufacturers.manufacturers_id = products.manufacturers_id ) left join specials on ( specials.products_id = products.products_id AND ( ( (specials.expires_date > CURRENT_DATE) OR (specials.expires_date is NULL) OR (specials.expires_date = 0) ) AND ( specials.status = 1 ) ) ) WHERE products.products_id=products_description.products_id AND products.products_id=products_to_categories.products_id AND products_to_categories.categories_id=categories.categories_id AND categories.categories_id=categories_description.categories_id ORDER BY products.products_id ASC "; $catInfo = " SELECT categories.categories_id AS curCatID, categories.parent_id AS parentCatID, categories_description.categories_name AS catName FROM categories, categories_description WHERE categories.categories_id = categories_description.categories_id "; function findCat($curID, $catTempPar, $catTempDes, $catIndex) { if( (isset($catTempPar[$curID])) && ($catTempPar[$curID] != 0) ) { if(isset($catIndex[$catTempPar[$curID]])) { $temp=$catIndex[$catTempPar[$curID]]; } else { $catIndex = findCat($catTempPar[$curID], $catTempPar, $catTempDes, $catIndex); $temp = $catIndex[$catTempPar[$curID]]; } } if( (isset($catTempPar[$curID])) && (isset($catTempDes[$curID])) && ($catTempPar[$curID] == 0) ) { $catIndex[$curID] = $catTempDes[$curID]; } else { $catIndex[$curID] = $temp . ", " . $catTempDes[$curID]; } return $catIndex; } $catIndex = array(); $catTempDes = array(); $catTempPar = array(); $processCat = mysql_query( $catInfo )or die( $FunctionName . ": SQL error " . mysql_error() . "| catInfo = " . htmlentities($catInfo) ); while ( $catRow = mysql_fetch_object( $processCat ) ) { $catKey = $catRow->curCatID; $catName = $catRow->catName; $catParID = $catRow->parentCatID; if($catName != "") { $catTempDes[$catKey]=$catName; $catTempPar[$catKey]=$catParID; } } foreach($catTempDes as $curID=>$des) //don't need the $des { $catIndex = findCat($curID, $catTempPar, $catTempDes, $catIndex); } $_strip_search = array( "![\t ]+$|^[\t ]+!m", // remove leading/trailing space chars '%[\r\n]+%m'); // remove CRs and newlines $_strip_replace = array( '', ' '); $_cleaner_array = array(">" => "> ", "®" => "", "®" => "", "™" => "", "™" => "", "\t" => "", " " => ""); if ( file_exists( $OutFile ) ) unlink( $OutFile ); $output = "link\ttitle\tdescription\texpiration_date\tprice\timage_link\tproduct_type\tid"; //create optional section if(OPTIONS_ENABLED == 1) { if(OPTIONS_ENABLED_AGE_RANGE == 1) $output .= "\tage_range"; if(OPTIONS_ENABLED_BRAND == 1) $output .= "\tbrand"; if(OPTIONS_ENABLED_CONDITION == 1) $output .= "\tcondition"; if(OPTIONS_ENABLED_CURRENCY == 1) $output .= "\tcurrency"; if(OPTIONS_ENABLED_FEED_LANGUAGE == 1) $output .= "\tlanguage"; if(OPTIONS_ENABLED_FEED_MANUFACTURER_ID == 1) $output .= "\tmanufacturer_id"; if(OPTIONS_ENABLED_FEED_QUANTITY == 1) $output .= "\tquantity"; if(OPTIONS_ENABLED_MADE_IN == 1) $output .= "\tmade_in"; if(OPTIONS_ENABLED_MANUFACTURER == 1) $output .= "\tmanufacturer"; if(OPTIONS_ENABLED_PAYMENT_ACCEPTED == 1) $output .= "\tpayment_accepted"; if(OPTIONS_ENABLED_PRODUCT_TYPE == 1) $output .= "\tproduct_type"; if(OPTIONS_ENABLED_SHIPPING == 1) $output .= "\tshipping"; if(OPTIONS_ENABLED_UPC == 1) $output .= "\tupc"; if(OPTIONS_ENABLED_WEIGHT == 1) $output .= "\tweight"; } $output .= "\n"; $result=mysql_query( $sql )or die( $FunctionName . ": SQL error " . mysql_error() . "| sql = " . htmlentities($sql) ); //Currency Information if(CONVERT_CURRENCY) { $sql3 = " SELECT currencies.value AS curUSD FROM currencies WHERE currencies.code = '" . CURRENCY_TYPE . "'"; $result3=mysql_query( $sql3 )or die( $FunctionName . ": SQL error " . mysql_error() . "| sql3 = " . htmlentities($sql3) ); $row3 = mysql_fetch_object( $result3 ); } $loop_counter = 0; while( $row = mysql_fetch_object( $result ) ) { if (isset($already_sent[$row->id])) continue; // if we've sent this one, skip the rest of the while loop if( $row->prodStatus == 1 || (OPTIONS_ENABLED == 1 && $quantity == 1) ) { if (CONVERT_CURRENCY) { $row->price = ereg_replace("[^.0-9]", "", $row->price); $row->price = $row->price * $row3->curUSD; $row->price = number_format($row->price, 2, '.', ','); } if(SEO_ENABLED=='true'){ $output .= tep_href_link($productURL,$productParam . $row->id) . "\t" . preg_replace($_strip_search, $_strip_replace, strip_tags( strtr($row->name, $_cleaner_array) ) ) . "\t" . preg_replace($_strip_search, $_strip_replace, strip_tags( strtr($row->description, $_cleaner_array) ) ) . "\t" . $feed_exp_date . "\t" . $row->price . "\t" . $row->image_url . "\t" . $catIndex[$row->prodCatID] . "\t" . $row->id; }else{ $output .= $row->product_url . "\t" . preg_replace($_strip_search, $_strip_replace, strip_tags( strtr($row->name, $_cleaner_array) ) ) . "\t" . preg_replace($_strip_search, $_strip_replace, strip_tags( strtr($row->description, $_cleaner_array) ) ) . "\t" . $feed_exp_date . "\t" . $row->price . "\t" . $row->image_url . "\t" . $catIndex[$row->prodCatID] . "\t" . $row->id; } //optional values section if(OPTIONS_ENABLED == 1) { if(OPTIONS_ENABLED_AGE_RANGE == 1) $output .= " \t " . OPTIONS_AGE_RANGE; if(OPTIONS_ENABLED_BRAND == 1) $output .= " \t " . OPTIONS_BRAND; if(OPTIONS_ENABLED_CONDITION == 1) $output .= " \t " . OPTIONS_CONDITION; if(OPTIONS_ENABLED_CURRENCY == 1) $output .= " \t " . OPTIONS_DEFAULT_CURRENCY; if(OPTIONS_ENABLED_FEED_LANGUAGE == 1) $output .= " \t " . OPTIONS_DEFAULT_FFEED_LANGUAGE; if(OPTIONS_ENABLED_FEED_MANUFACTURER_ID == 1) $output .= " \t " . $row->prodModel; if(OPTIONS_ENABLED_FEED_QUANTITY == 1) $output .= " \t " . $row->quantity; if(OPTIONS_ENABLED_MADE_IN == 1) $output .= " \t " . OPTIONS_MADE_IN; if(OPTIONS_ENABLED_MANUFACTURER == 1) $output .= " \t " . $row->mfgName; if(OPTIONS_ENABLED_PAYMENT_ACCEPTED == 1) $output .= " \t " . OPTIONS_PAYMENT_ACCEPTED_METHODS; if(OPTIONS_ENABLED_PRODUCT_TYPE == 1) { $catNameTemp = strtolower($catName); $output .= " \t " . $row->catName; } if(OPTIONS_ENABLED_SHIPPING == 1) $output .= " \t " . OPTIONS_LOWEST_SHIPPING; if(OPTIONS_ENABLED_UPC == 1) $output .= " \t " . "Not Supported"; if(OPTIONS_ENABLED_WEIGHT == 1) $output .= " \t " . $row->prodWeight . ' ' .OPTIONS_WEIGHT_ACCEPTED_METHODS; } $output .= " \n"; } $already_sent[$row->id] = 1; $loop_counter++; if ($loop_counter>750) { $fp = fopen( $OutFile , "a" ); $fout = fwrite( $fp , $output ); fclose( $fp ); $loop_counter = 0; $output = ""; } } $fp = fopen( $OutFile , "a" ); $fout = fwrite( $fp , $output ); fclose( $fp ); echo "File completed: <a href=\"" . $OutFile . "\" target=\"_blank\">" . $destination_file . "</a><br>\n"; chmod($OutFile, 0777); //Start FTP function ftp_file( $ftpservername, $ftpusername, $ftppassword, $ftpsourcefile, $ftpdirectory, $ftpdestinationfile ) { // set up basic connection $conn_id = ftp_connect($ftpservername); if ( $conn_id == false ) { echo "FTP open connection failed to $ftpservername <BR>\n" ; return false; } // login with username and password $login_result = ftp_login($conn_id, $ftpusername, $ftppassword); // check connection if ((!$conn_id) || (!$login_result)) { echo "FTP connection has failed!<BR>\n"; echo "Attempted to connect to " . $ftpservername . " for user " . $ftpusername . "<BR>\n"; return false; } else { echo "Connected to " . $ftpservername . ", for user " . $ftpusername . "<BR>\n"; } if ( strlen( $ftpdirectory ) > 0 ) { if (ftp_chdir($conn_id, $ftpdirectory )) { echo "Current directory is now: " . ftp_pwd($conn_id) . "<BR>\n"; } else { echo "Couldn't change directory on $ftpservername<BR>\n"; return false; } } ftp_pasv ( $conn_id, true ) ; // upload the file $upload = ftp_put( $conn_id, $ftpdestinationfile, $ftpsourcefile, FTP_ASCII ); // check upload status if (!$upload) { echo "$ftpservername: FTP upload has failed!<BR>\n"; return false; } else { echo "Uploaded " . $ftpsourcefile . " to " . $ftpservername . " as " . $ftpdestinationfile . "<BR>\n"; } // close the FTP stream ftp_close($conn_id); return true; } if (FTP_ENABLED) ftp_file( "uploads.google.com", FTP_USERNAME, FTP_PASSWORD, $source_file, "", $destination_file); //End FTP // End TIMER // --------- $etimer = explode( ' ', microtime() ); $etimer = $etimer[1] + $etimer[0]; echo '<p style="margin:auto; text-align:center">'; printf( "Script timer: <b>%f</b> seconds.", ($etimer-$stimer) ); echo '</p>'; // --------- ?> Again, I think this is something I or jack might get figured out. It seems to me that $product_url just needs to be changed to tep_href_link in the output section. With a little luck things will work out. I use the GoogleFeeder_V_2.4 with ULTIMATE Seo Urls 5 - by FWR Media and the URL's in my feed.txt are correct "http://www.mydollyandme.com.au/21australian-traffic-signs-p-121.html 21Australian Traffic Signs This is" etc. exactly as shown in the URL bar. Quote Link to comment Share on other sites More sharing options...
♥FWR Media Posted November 3, 2009 Author Share Posted November 3, 2009 I use the GoogleFeeder_V_2.4 with ULTIMATE Seo Urls 5 - by FWR Media and the URL's in my feed.txt are correct "http://www.mydollyandme.com.au/21australian-traffic-signs-p-121.html 21Australian Traffic Signs This is" etc. exactly as shown in the URL bar. So this sounds like GoogleFeeder_V_2.4 uses the correct functions. Thanks for letting us know Graeme. Quote Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work. Link to comment Share on other sites More sharing options...
Guest Posted November 3, 2009 Share Posted November 3, 2009 Link? I can't seem to find it. Quote Link to comment Share on other sites More sharing options...
Guest Posted November 3, 2009 Share Posted November 3, 2009 I use the GoogleFeeder_V_2.4 with ULTIMATE Seo Urls 5 - by FWR Media and the URL's in my feed.txt are correct "http://www.mydollyandme.com.au/21australian-traffic-signs-p-121.html 21Australian Traffic Signs This is" etc. exactly as shown in the URL bar. I am confused. I searched the contributions quite thoroughly (or at least I thought) and could not find this contribution. I even searched through google and could not find it. My question goes to Robert, did you make a googlefeed? Because the quote above says your the author. If not graeme can you please provide this for the general public ;) Thanks my friend. Ryan Quote Link to comment Share on other sites More sharing options...
Guest Posted November 3, 2009 Share Posted November 3, 2009 (edited) Are you referring too GoogleBase v2.4 by Jack_mcs? I posted his code for display. Is that what your using? Edited November 3, 2009 by 32 Degrees Quote Link to comment Share on other sites More sharing options...
jhande Posted November 4, 2009 Share Posted November 4, 2009 Header tags seo (and other contributions) use PHP_SELF incorrectly which creates issues with standard seo urls, look back a few pages in this thread where I created a patch. Other than that all is current. Well except for the new version 1.1 which is in development. Thank you so much Rob for pointing that out. I totally missed the patch for HT SEO... Thank you for taking the time to help straighten me out. Quote - :: Jim :: - - My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 - Link to comment Share on other sites More sharing options...
graeme john Posted November 4, 2009 Share Posted November 4, 2009 Are you referring too GoogleBase v2.4 by Jack_mcs? I posted his code for display. Is that what your using? Yes, "Google Base Froogle Data Feeder v1.00 - http://addons.oscommerce.com/info/4513" graeme Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.