fatmcgav Posted March 3, 2005 Share Posted March 3, 2005 Turn off the stock osC option of SEF URLs. Bobby <{POST_SNAPBACK}> hmm, how did that get witched back on :S:S Worked, cheers. Fatmcgav Quote Link to comment Share on other sites More sharing options...
Guest Posted March 3, 2005 Share Posted March 3, 2005 Glad to hear it WORKS! :) Bobby Quote Link to comment Share on other sites More sharing options...
ari Posted March 3, 2005 Share Posted March 3, 2005 I had the same problem installing the SEO for articles enhancement - and then I read your post in this thread suggesting to comment out one line of code. Magic - it did work! Did you had any other issues with this? - really want to go live with this. Apart from one error in the code added to seo_cache.php: # Get the topic path ?#tep_get_parent_topics($c, $record['id']); Quote Link to comment Share on other sites More sharing options...
oldworldcharms Posted March 4, 2005 Share Posted March 4, 2005 For those of you considering this contribution it works great. I am already being indexed. sometimes on the first page, sometimes not and that is only my fault because I have not properly seo'd my site. thats my next goal. but I can see with proper seo this is a great contribution! I need to retract, my next goal is to get my froogle working with this contribution although some say it worked right out of the box. probably something in my code that I am doing wrong. Any ideas? Thanks Eizabeth Quote Link to comment Share on other sites More sharing options...
aspiringarts Posted March 5, 2005 Share Posted March 5, 2005 Hi Bobby! Thought my website was all set, but turns out that I have in shopping cart-related pages lots of warnings like these: Warning: in_array(): Wrong datatype for second argument in /www/s/susanrm1/htdocs/catalog/includes/boxes/categories.php on line 40 Warning: in_array(): Wrong datatype for second argument in /www/s/susanrm1/htdocs/catalog/includes/boxes/categories.php on line 63 Warning: in_array(): Wrong datatype for second argument in /www/s/susanrm1/htdocs/catalog/includes/boxes/categories.php on line 72 I did add a contribution for category box, and it works well on other pages, but thought I'd copy it here - at least lines 37-74, the offending lines. The contribution I used (and lightly modified) is located at Great categories // display category name // $categories_string .= $foo[$counter]['name']; if (tep_has_category_subcategories($counter) || $foo[$counter]['level'] == 0) { if ( ($id) && (in_array($counter, $id)) ) { // display category name $categories_string .= '<table class="categ"><tr><td class="categ" nowrap>' . tep_image(DIR_WS_IMAGES . 'categories/bullet.gif', '', '16', '16') . " </td>"; } else { // display category name $categories_string .= '<table class="categ"><tr><td class="categ" nowrap>' . " </td>"; } } else { $categories_string .= '<table class="categ"><tr><td class="categ" nowrap> ' .tep_image(DIR_WS_IMAGES . 'categories/arrow_bullet.gif', 'nokta', '9', '9') . "</td>"; } $categories_string .= '<td class="categ"><a href="'; if ($foo[$counter]['parent'] == 0) { $cPath_new = 'cPath=' . $counter; } else { $cPath_new = 'cPath=' . $foo[$counter]['path']; } $categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new); $categories_string .= '">'; if ( ($id) && (in_array($counter, $id)) ) { $categories_string .= '<b>'; } //category name $categories_string .= $foo[$counter]['name']; if ( ($id) && (in_array($counter, $id)) ) { $categories_string .= '</b>'; } You can see examples of my error messages at Secure page. Because the error occurs when the pages load from the secure server (a config maybe special to my host), I looked for a hard-coded path, but I couldn't find anything. Any help would be appreciated. If you think I should go to the author of the other contrib, let me know! Susan Quote Link to comment Share on other sites More sharing options...
homewetbar Posted March 5, 2005 Share Posted March 5, 2005 I have upgraded your contrib on my site but i have still problems with customer sessions,all work fine until i click on nonssl link, when i go on from ssl to nonssl, my account information disappear, and when i 'm come back on ssl i retrieve my information, my cart disappear so, could you say me in which direction to seek I am lost, My Webpagethanks a lot for your help To anyone else who may encounter this problem I found the reason for it. I assumed I just needed the .htaccess in my main directory. This was incorrect I added the .htaccess file to the /test/ directory and changed the path in it to /test/ and now it works great! Quote Most Valuable OsCommerce Contributions: Also Purchased (AP) Preselection (cuts this resource hogging query down to nothing) -- Contribution 3294 FedEx Automated Labels -- Contribution 2244 RMA Returns system -- Contribution 1136 Sort Products By Dropdown -- Contribution 4312 Ultimate SEO URLs -- Contribution 2823 Credit Class & Gift Voucher -- Contribution 282 Cross-Sell -- Contribution 5347 Link to comment Share on other sites More sharing options...
Velveeta Posted March 5, 2005 Share Posted March 5, 2005 (edited) I hope someone out there has an answer for this, because it's boggling the hell out of me at the moment :) I installed this contribution a while back, and it seemed to work flawlessly... then i tweaked it for my needs so that the urls are a little prettier, at least in my opinion, and i was going to reupload it as a modified contribution, but i couldn't remember where i'd made all the changes :D so anyway, mine rewrites now, instead of like the -c-<name and cpath>, like this: <basename>/category/<category>/<subcategory>/<subcategory>/index.html and i have regexes that return the entire category and subcategory string as cPath, which is then parsed and queried for to construct the real cPath and cPath_array... this works just fine, and has for quite some time, here's the problem... when i originally installed this, it was on an empty storefront, with a few test products just for checking that urls were being constructed and translated properly, now that i have a little over 300 products in the listings, i'm finding some quirks, here they are: i have 1 puzzle and 1 game that i noticed this from, the puzzle is a Baby "Rex" something-something-something, and the quotations are not being stripped when creating the url or the cached name definition (since this was installed w/ the cache class by chemo as well)... the game is called Uncle Milton's something-something, and the apostrophe isn't being stripped either... i tried manually adding those in to the strip function's array to be stripped altogether, but it didn't work (and i suspect that punctuation that obvious was a part of those codes already), so i took them out... i turned on a test mode where i echo'd the entire cache to the page upon refresh and noticed the definition was appearing w/ that punctuation in it, and then added a line into seo_cache to echo this test message: echo "Uncle Milton's Ant Farm Game stripped to ".strip("Uncle Milton's Ant Farm Game")."<br>"; and then inside the while loop that creates the definitions i had it echo this: echo $product['products_name']." stripped to ".strip($product['products_name'])."<br>"; i reset the cache and refreshed the page... when i refreshed the page, that line i manually typed in (which is cut and pasted from the product's info on the page, and so should be exactly what is being extracted from products_name) stripped perfectly to: Uncle Milton's Ant Farm Game stripped to uncle-miltons-ant-farm-game then further down the page when i saw the definition for it, it had this: Uncle Milton's Ant Farm Game stripped to uncle-milton's-ant-farm-game the majority of links on my site work just fine, but it seems to not be stripping some of them correctly, any ideas? My strip function is the stock one from the contribution, unmodified by me, i even redownloaded it and compared to the original... Richard Lindsey Edited March 5, 2005 by Velveeta Quote Richard Lindsey Link to comment Share on other sites More sharing options...
Guest Posted March 5, 2005 Share Posted March 5, 2005 Hi Bobby! Thought my website was all set, but turns out that I have in shopping cart-related pages lots of warnings like these:I did add a contribution for category box, and it works well on other pages, but thought I'd copy it here - at least lines 37-74, the offending lines. < snip whole bunch of code > You can see examples of my error messages at Secure page. Because the error occurs when the pages load from the secure server (a config maybe special to my host), I looked for a hard-coded path, but I couldn't find anything. Any help would be appreciated. If you think I should go to the author of the other contrib, let me know! Susan <{POST_SNAPBACK}> Susan, I checked the site under SSL and did not notice those errors. However, I am familiar as others have reported the same directly after resetting the cache. This can be corrected by suppressing the error generation by prepending an "@" symbol in front of each in_array() comparison. So, everywhere you see the function in_array put an @ symbol in front of it...that wil suppress the error output. It will not affect form, fit, or function of the category menu. ...the majority of links on my site work just fine, but it seems to not be stripping some of them correctly, any ideas? My strip function is the stock one from the contribution, unmodified by me, i even redownloaded it and compared to the original... Richard Lindsey <{POST_SNAPBACK}> You are on the right path to debugging the problem...those are the same steps I would take if it were me doing it. Keep plugging along and tell us what you find...sorry to not be any help but can't do much without looking at the code. Do me a favor and post it on my pastebin and let me take a look. If I get time tomorrow I'll breeze through it => Chemo's PHP Code Pastebin. Bobby Quote Link to comment Share on other sites More sharing options...
aspiringarts Posted March 5, 2005 Share Posted March 5, 2005 Susan, I checked the site under SSL and did not notice those errors. However, I am familiar as others have reported the same directly after resetting the cache. This can be corrected by suppressing the error generation by prepending an "@" symbol in front of each in_array() comparison. Bobby <{POST_SNAPBACK}> Beeeeyutiful. It did the trick! Thank you so much. You didn't see the errors using the link I sent you? Surprising. They showed up every time I hit those pages. The SSL server is a different domain name than my regular domain name, so that's why I thought the errors were generated. Richard - I'm interested in your mod of the this contribution! If you do get it working, will you say so on the forum? I like "pretty" URLs too. Susan Quote Link to comment Share on other sites More sharing options...
Guest Posted March 6, 2005 Share Posted March 6, 2005 Hey Chemo, If I get this to work tonight I am going to drop you 10 bucks!!!! If I get it done in less than 30 mins I may add more!!!! Quote Link to comment Share on other sites More sharing options...
Guest Posted March 6, 2005 Share Posted March 6, 2005 when I add the install-cashe.php and try to go to it it just directs to my main page. Any reason why this would happen? How else can I add this information to the database? Quote Link to comment Share on other sites More sharing options...
Guest Posted March 6, 2005 Share Posted March 6, 2005 ??? Do you have the script uploaded to your site? What is your URL? Bobby Quote Link to comment Share on other sites More sharing options...
Guest Posted March 6, 2005 Share Posted March 6, 2005 yeah I had actually found the correct forum for version 2.0 thats where all of my other questions went. I am hung up on the SID being attached to the end of the site now. Quote Link to comment Share on other sites More sharing options...
Velveeta Posted March 7, 2005 Share Posted March 7, 2005 (edited) yeah I had actually found the correct forum for version 2.0 thats where all of my other questions went. I am hung up on the SID being attached to the end of the site now. <{POST_SNAPBACK}> This may not work for you (i seem to remember reading that it doesn't work for everyone), but it worked fine for me :) to remove the oscSid being appended to the end of the url, and yet retain the session information (i'd originally tried just changing the variable to false in tep_href_link that controlled the sid being appended, but then it wouldn't retain shopping cart entries or anything), find (on approx. line 148 of *catalog*/includes/application_top.php) this code chunk: // set the session cookie parameters if (function_exists('session_set_cookie_params')) { session_set_cookie_params(0, $cookie_path, $cookie_domain); } elseif (function_exists('ini_set')) { ini_set('session.use_trans_sid', '0'); ini_set('session.cookie_lifetime', '0'); ini_set('session.cookie_path', $cookie_path); ini_set('session.cookie_domain', $cookie_domain); } and replace it with this (i'd comment out the original before pasting in the new one, in case it doesn't work for you, you can simply switch it back): // set the session cookie parameters if (function_exists('session_set_cookie_params')) { session_set_cookie_params(0, '/', (tep_not_null($current_domain) ? '.' . $current_domain : '')); ini_set('url_rewriter.tags', ''); } elseif (function_exists('ini_set')) { ini_set('session.cookie_lifetime', '0'); ini_set('session.cookie_path', '/'); ini_set('session.cookie_domain', (tep_not_null($current_domain) ? '.' . $current_domain : '')); ini_set('url_rewriter.tags', ''); } that should do it, it's apparently the php.ini file that controls when certain things happen like the sid getting appended, through the use of the url_rewrite.tags, this simply changes that setting :D Richard Lindsey. Edited March 7, 2005 by Velveeta Quote Richard Lindsey Link to comment Share on other sites More sharing options...
AJRYAN Posted March 7, 2005 Share Posted March 7, 2005 So far this looks like one of the better contributions I've seen out there with regard to ease of setup and complete/clear instructions. Well done. I have a question though. Regarding POST vs get , it appears that my "case" "buy now" is coded as "post", yet you use "get". I wonder, as a request will fetch either post or get based on my limited understanding, will this work out of the box, or will I need to change your "gets" to "posts" in the appropriate places? I would guess that this would be necessary only where there are tests using if statements with post, would that be correct? If I am not being clear please let me know. Here is a sample of the original code: case 'buy_now' : if (isset($HTTP_POST_VARS['products_id'])) { if (tep_has_product_attributes($HTTP_POST_VARS['products_id'])) { tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_POST_VARS['products_id'])); } else { $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity($HTTP_POST_VARS['products_id'])+1); } } tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters))); break; Here is the recommeded replacement per instructions: case 'buy_now' : if (isset($HTTP_GET_VARS['products_id'])) { if (tep_has_product_attributes($HTTP_GET_VARS['products_id'])) { tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id'])); } else { $cart->add_cart($HTTP_GET_VARS['products_id'], $cart->get_quantity($HTTP_GET_VARS['products_id'])+1); } } if ( (defined('SEO_URLS') && SEO_URLS == 'true') && (defined('SEO_URLS_TYPE') && SEO_URLS_TYPE == 'Rewrite') ){ $cPath = tep_get_product_path($HTTP_GET_VARS['products_id']); $cPath_array = tep_parse_category_path($cPath); $cPath = implode('_', $cPath_array); tep_redirect(tep_href_link($goto, 'cPath=' . $cPath . '&' . tep_get_all_get_params($parameters))); } else { tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters))); } break; I don't want to break anything as this has been a heavily modified version, so I will wait for your expertise. Thanks.... Quote Link to comment Share on other sites More sharing options...
Velveeta Posted March 7, 2005 Share Posted March 7, 2005 So far this looks like one of the better contributions I've seen out there withregard to ease of setup and complete/clear instructions. Well done. I have a question though. Regarding POST vs get , it appears that my "case" "buy now" is coded as "post", yet you use "get". I wonder, as a request will fetch either post or get based on my limited understanding, will this work out of the box, or will I need to change your "gets" to "posts" in the appropriate places? I would guess that this would be necessary only where there are tests using if statements with post, would that be correct? If I am not being clear please let me know. Here is a sample of the original code: case 'buy_now' : if (isset($HTTP_POST_VARS['products_id'])) { if (tep_has_product_attributes($HTTP_POST_VARS['products_id'])) { tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_POST_VARS['products_id'])); } else { $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity($HTTP_POST_VARS['products_id'])+1); } } tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters))); break; Here is the recommeded replacement per instructions: case 'buy_now' : if (isset($HTTP_GET_VARS['products_id'])) { if (tep_has_product_attributes($HTTP_GET_VARS['products_id'])) { tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id'])); } else { $cart->add_cart($HTTP_GET_VARS['products_id'], $cart->get_quantity($HTTP_GET_VARS['products_id'])+1); } } if ( (defined('SEO_URLS') && SEO_URLS == 'true') && (defined('SEO_URLS_TYPE') && SEO_URLS_TYPE == 'Rewrite') ){ $cPath = tep_get_product_path($HTTP_GET_VARS['products_id']); $cPath_array = tep_parse_category_path($cPath); $cPath = implode('_', $cPath_array); tep_redirect(tep_href_link($goto, 'cPath=' . $cPath . '&' . tep_get_all_get_params($parameters))); } else { tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters))); } break; I don't want to break anything as this has been a heavily modified version, so I will wait for your expertise. Thanks.... <{POST_SNAPBACK}> Good question, I hadn't even noticed that when I installed it, I guess I was just caught up in the cutting and pasting (plus it was on a vanilla version of OSC so I wasn't too concerned :D)... I know this has worked fine for me, and you're right, if it were passing the variables via $_POST and he were referencing them with $_GET, I don't think it would work, but I know it does work fine for me... it may have something to do w/ the mod_rewrite rules, which pass everything to the code in the form of a $_GET url with all the options in the url, and it may be that I have it wrong also, and that $_GET will reference $_POST variables, perhaps depending on your version of PHP (I know they've locked it down quite a bit in version 5, and I'm pretty positive you can't reference one array by calling the other and hoping it checks both, but perhaps in older versions you could do this, I'm pretty new to the language)... my advice, as I'm sure anyone will tell you, especially if your code is already heavily modified, would be to simply perform a backup of your code and database prior to installation of this snippet... Richard Lindsey. Quote Richard Lindsey Link to comment Share on other sites More sharing options...
AJRYAN Posted March 7, 2005 Share Posted March 7, 2005 Good question, I hadn't even noticed that when I installed it, I guess I was just caught up in the cutting and pasting (plus it was on a vanilla version of OSC so I wasn't too concerned :D)... I know this has worked fine for me, and you're right, if it were passing the variables via $_POST and he were referencing them with $_GET, I don't think it would work, but I know it does work fine for me... it may have something to do w/ the mod_rewrite rules, which pass everything to the code in the form of a $_GET url with all the options in the url, and it may be that I have it wrong also, and that $_GET will reference $_POST variables, perhaps depending on your version of PHP (I know they've locked it down quite a bit in version 5, and I'm pretty positive you can't reference one array by calling the other and hoping it checks both, but perhaps in older versions you could do this, I'm pretty new to the language)... my advice, as I'm sure anyone will tell you, especially if your code is already heavily modified, would be to simply perform a backup of your code and database prior to installation of this snippet... Richard Lindsey. <{POST_SNAPBACK}> Hi Richard. Do you recall if the code you replaced was the same as mine? Thanks. Art Quote Link to comment Share on other sites More sharing options...
Velveeta Posted March 7, 2005 Share Posted March 7, 2005 Hi Richard. Do you recall if the code you replaced was the same as mine? Thanks. Art <{POST_SNAPBACK}> i'm afraid i don't remember if that was the case, but all you'd have to do to find out is go grab a stock version of OSC and check the application_top file, because that's the version i installed it into, a plain old stock OSC MS2.2... but i can tell you that the case statements above that one (update_product, add_product) use HTTP_POST_VARS, and the ones below it (notify, notify_remove, cust_order) use HTTP_GET_VARS... if this looks similar to yours, then it's probably the same version... Richard Lindsey. Quote Richard Lindsey Link to comment Share on other sites More sharing options...
Neil.H Posted March 7, 2005 Share Posted March 7, 2005 I had the same problem installing the SEO for articles enhancement - and then I read your post in this thread suggesting to comment out one line of code. Magic - it did work! Did you had any other issues with this? - really want to go live with this. <{POST_SNAPBACK}> I've not found any other issues, I've been testing for a week or so and all seems to be working fine. Neil Quote Link to comment Share on other sites More sharing options...
AJRYAN Posted March 7, 2005 Share Posted March 7, 2005 i'm afraid i don't remember if that was the case, but all you'd have to do to find out is go grab a stock version of OSC and check the application_top file, because that's the version i installed it into, a plain old stock OSC MS2.2... but i can tell you that the case statements above that one (update_product, add_product) use HTTP_POST_VARS, and the ones below it (notify, notify_remove, cust_order) use HTTP_GET_VARS... if this looks similar to yours, then it's probably the same version... Richard Lindsey. <{POST_SNAPBACK}> I love this contribution. I have it installed and I love the results (with 1 exception). Great work, Bobby, and thanks for your replies Richard. I appreciate the help. :) Unfortunately, I have encountered a problem with my shopping cart. When trying to add from product listings, it takes me to the cart but nothing gets added. It does work with product info, however. Anyone have any ideas? Thanks in advance for any help you can give me. Art Quote Link to comment Share on other sites More sharing options...
ari Posted March 7, 2005 Share Posted March 7, 2005 Any idea why when I set the ?Enable SEO URL?s? to false, my category links start spinning in an endless redirect loop? Shouldn?t is be include only if ?Enable SEO URL?s? set to ?true?? Ari Quote Link to comment Share on other sites More sharing options...
ari Posted March 7, 2005 Share Posted March 7, 2005 (edited) Unfortunately, I have encountered a problem with my shopping cart.? When trying to add from product listings, it takes me to the cart but nothing gets added.? It does work with product info, however.? Anyone have any ideas? ... Art <{POST_SNAPBACK}> I had the same problem and then I remembered that I changed my "add to cart" to form submission rather then href - so whenever you have somthing like this... case 'buy_now' : ? ? ? ?if (isset($HTTP_GET_VARS['products_id'])) change it to HTTP_POST_VARS Edited March 7, 2005 by ari Quote Link to comment Share on other sites More sharing options...
AJRYAN Posted March 7, 2005 Share Posted March 7, 2005 I had the same problem and then I remembered that I changed my "add to cart" to form submission rather then href - so whenever you have somthing like this... case 'buy_now' : if (isset($HTTP_GET_VARS['products_id'])) change it to HTTP_POST_VARS <{POST_SNAPBACK}> Hi Ari: I had a hunch that might be the ticket. Seems to be working fine now. Thanks.... Art Quote Link to comment Share on other sites More sharing options...
jond Posted March 7, 2005 Share Posted March 7, 2005 Hi, Ive searched everywhere and cant solve this. How can i prevent my sorted pages (by product name/price) from being indexed. I realize i cant include special characters in robots.txt, but this is the effect i would want: Disallow: /*?sort=2d&page=1 Disallow: /*?sort=2a&page=1 Disallow: /*?sort=3a&page=1 Disallow: /*?sort=3d&page=1 I need the user to be able to sort the pages internally, so total redirect in htaccess would not work. If i could somehow get all requests from outside the domain to redirect to a move permanently? or perhaps i could change these urls to forms - if i knew how, this would probably be easiest... Suggestions? Quote Link to comment Share on other sites More sharing options...
Velveeta Posted March 7, 2005 Share Posted March 7, 2005 Hi, Ive searched everywhere and cant solve this. How can i prevent my sorted pages (by product name/price) from being indexed. I realize i cant include special characters in robots.txt, but this is the effect i would want: Disallow: /*?sort=2d&page=1 Disallow: /*?sort=2a&page=1 Disallow: /*?sort=3a&page=1 Disallow: /*?sort=3d&page=1 I need the user to be able to sort the pages internally, so total redirect in htaccess would not work. If i could somehow get all requests from outside the domain to redirect to a move permanently? or perhaps i could change these urls to forms - if i knew how, this would probably be easiest... Suggestions? <{POST_SNAPBACK}> This is a tricky one, because of the way the searchbots work... one way you could do it would be to go into includes/application_top.php (approx. line 200) and find where the spider check is done and if passed, the session is started... at that point i would register $spider_flag... then, anywhere you don't want spiders to index options, such as sort options, check if $spider_flag is registered, and if it's not (most likely a spider) then don't print the href link for those options in the column headers, otherwise print them... that way a user can still sort, and a spider can still see the same page (default-sorted), but the clickable links to sort by various columns won't work for the spider to follow, and it can't index the page w/ those extra options... i don't think you can do it w/ .htaccess, even if you got a mod_rewrite snippet that would convert your arguments into directory appearance (like index.php/sort/2/page/1), because i believe .htaccess operates after mod_rewrite translates the url, so it would still be operating on the actual file (index.php or whatever) and wouldn't be able to deny access for spiders to say, index.php/* Hope that helps... Richard Lindsey. Quote Richard Lindsey 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.