Guest Posted December 23, 2004 Posted December 23, 2004 This thread is for the cName and pName contribution. Replaces the osC stock method of passing products_id and cPath. This contribution uses the actual category and product name in the URL. Does not use mod_rewrite and all data is cached. Supports multiple languages. SCREEN SHOTS Category name in URL Product name in URL Category and product name in URL DOWNLOAD cName and pName contribution Quote
nisarek Posted December 23, 2004 Posted December 23, 2004 Hello I have some problem: Fatal error: Call to undefined function: implode_assoc() in /home/jeans/public_html/includes/functions/html_output.php on line 67 I use: 1. OS: Linux 2.4.21-15.0.3.EL 2. DB: MySQL 4.0.22-standard-log 3. WWW: Apache/1.3.33 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 FrontPage/5.0.2.2635 mod_ssl/2.8.22 OpenSSL/0.9.7a 4. PHP: 4.3.9 (Zend: 1.3.0) 5. osCommerce 2.2-MS2 Thanks for help. Quote
Guest Posted December 23, 2004 Posted December 23, 2004 Sorry...forgot a function :( Add this just above tep_href_link() in includes/functions/html_output.php function implode_assoc($array, $inner_glue='=', $outer_glue='&') { $output = array(); foreach( $array as $key => $item ) $output[] = $key . $inner_glue . $item; return implode($outer_glue, $output); } I'll get the contribution updated directly... Quote
nisarek Posted December 23, 2004 Posted December 23, 2004 Ok I install everything one more time and I found secound problem: pName and cName is missing from link. Links is: http://www.my-site.com/index.php?new-gift Quote
Guest Posted December 23, 2004 Posted December 23, 2004 Ok I install everything one more time and I found secound problem: pName and cName is missing from link. Links is: http://www.my-site.com/index.php?new-gift <{POST_SNAPBACK}> First, delete the cache file to start fresh. Then visit the store and generate the new cache file. Verify that the cache file is being generated and stored. Make sure you have uploaded the included files to your server. If all else fails comment out the settings in *catalog*/includes/seo_cache.php for compression (2 settings). Delete the cache file and now it should be in plain text (not encoded). Make sure each entry is being formed properly. Also, what is your URL? Quote
Guest Posted December 23, 2004 Posted December 23, 2004 Hi, This looks great, but i think i am using a too old version of PHP at the moment, i get a error regarding a unknown function GLOB , i am using PHP v4.22 - would this be the cause? this error was only on the admin side, the catalog gave no erros but the urls appeared to not have changed Any ideas? Thanks Matt Quote
nisarek Posted December 24, 2004 Posted December 24, 2004 (edited) Thanks now is ok. I also have problem with specific letter in ISO 8859-2, I try use unicode like &.#281; but this looks not good in link. Before I solve this problem I add this letter to $convert_me and now everything work very good. Best regards. Edited December 24, 2004 by nisarek Quote
Guest Posted December 24, 2004 Posted December 24, 2004 Hi, This looks great, but i think i am using a too old version of PHP at the moment, i get a error regarding a unknown function GLOB , i am using PHP v4.22 - would this be the cause? this error was only on the admin side, the catalog gave no erros but the urls appeared to not have changed Any ideas? Thanks Matt <{POST_SNAPBACK}> In *admin directory*/includes/reset_seo_cache.php replace the code with this: <?php # Enter your cache directory below!! $cache_dir = '''; if ( function_exists('glob') ){ foreach (glob($cache_dir."*.cache") as $filename) { unlink($filename); } } else { $dir = $cache_dir; if (is_dir($dir)) { if ($dh = opendir($dir)) { while (($file = readdir($dh)) !== false) { unlink($file); } closedir($dh); } } } ?> Tell me if that works for you... Thanks now is ok. I also have problem with specific letter in ISO 8859-2, I try use unicode like &.#281; but this looks not good in link. Before I solve this problem I add this letter to $convert_me and now everything work very good. Best regards. <{POST_SNAPBACK}> Check this thread here: http://www.oscommerce.com/forums/index.php?sho...=0entry510788 Quote
Guest Posted December 30, 2004 Posted December 30, 2004 Contribution has been updated to include support for PHP versions < 4.3 As a side note, if your host has not upgraded to the latest PHP version it's time to find another host who will keep the server software up-to-date. Bobby Quote
Guest Posted January 4, 2005 Posted January 4, 2005 Contribution has been updated to include support for PHP versions < 4.3 As a side note, if your host has not upgraded to the latest PHP version it's time to find another host who will keep the server software up-to-date. Bobby <{POST_SNAPBACK}> Thanks, the catalog side works great - but on the admin side, im assuming when a new product is added or the name modified then the cache file should be deleted/emptied? this is the part that will not seem to work Both the full paths are defined, and must be correct as the catalog side works fine, but on teh admin side when i click 'new product' i get: Warning: unlink() failed (Is a directory) in /home/xxxx/xxxx/xxxx/xxxx/www/html/admin/includes/reset_seo_cache.php on line 14 this error appears twice, and then underneath: Warning: unlink() failed (No such file or directory) in /home/xxxx/xxxx/xxxx/xxxx/www/html/admin/includes/reset_seo_cache.php on line 14 I have tried modifying the define for the cache location but although this removes the above error the cache file is not updated/emptied and the newly added product does not have a 'pname=' style link , i can just delete the cache file and then it rebuilds it and all is fine. Thanks again for this, great idea! Quote
Guest Posted January 4, 2005 Posted January 4, 2005 hhhmmm...the path to the cache file is not correct. Make sure it is the ABSOLUTE filesystem path BEGINNING with a forward slash. Bobby Quote
Guest Posted January 5, 2005 Posted January 5, 2005 hhhmmm...the path to the cache file is not correct. Make sure it is the ABSOLUTE filesystem path BEGINNING with a forward slash. Bobby <{POST_SNAPBACK}> Thanks for the quick reply! I have just double checked (even copy/pasted from the seo_cache.php catalog side file) to ensure the path is correct. I only get the errors mentioned when i have the 'correct' path, if i change the path to, say, /this/is/not/the/path/ then i get no errors at all, the errors only appear when the pach is identical to that defined on the catalog side (which im sure is the correct path, as i used the same path on other contributions). Thanks again for your help Quote
100asa Posted January 7, 2005 Posted January 7, 2005 this contribution: http://www.oscommerce.com/community/contributions,2192/ don't work after I've installed your. Help me. Quote Skype: centoasa Skype: remigioruberto
♥bruyndoncx Posted January 7, 2005 Posted January 7, 2005 Just tested with 2 products on your site, seemed to work fine. Quote KEEP CALM AND CARRY ON I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support). So if you are still here ? What are you waiting for ?! Find the most frequent unique errors to fix: grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt
100asa Posted January 8, 2005 Posted January 8, 2005 You have right! Can I move the compare box upper into page? Thank you Quote Skype: centoasa Skype: remigioruberto
♥akmac Posted January 8, 2005 Posted January 8, 2005 Chemo, Could you please direct me to the section of code I will need to modify in order to include more than two category levels? I'll explain my issue in greater detail than necessary for those following: My site has sub categories and sub/sub categories with identical names. This causes oscommerce to effectively lose it's bearings after entering the third level of navigation. For example: When I try to enter: rings/ladies-rings/colored-stone/topaz it bounces me to: earrings/colored-stone/topaz because both urls are: http://www.mysite.com/catalog/index.php?cN...one-alexandrite. Its point of reference is (in my case) too shallow. I'm in the early learning stages of php-so those who are more savvy than myself can probably find the code to reference this. But- I'm probably not the only noob to appreciate the value of this mod. -akmac Quote Quidquid latine dictum sit, profundum viditur.
Guest Posted January 9, 2005 Posted January 9, 2005 Chemo, Could you please direct me to the section of code I will need to modify in order to include more than two category levels? <{POST_SNAPBACK}> Sure cName & pName v1.4 has been uploaded that adds support for unlimited nested categories and duplicate names (both categories and products). I took a look for you and ended up recoding the entire script...so this is much different than the previous versions and is much more functional and optimized for speed. In addition, it was coded to be extremely easy on system resources while generating the cache file. Enjoy! Bobby Quote
Guest Posted January 9, 2005 Posted January 9, 2005 BTW, to upgrade do the following: 1. overwrite the includes/seo_cache.php file with the new version 2. modify the file and change file path 3. in the admin control panel edit a product or category and hit save (don't have to edit the values). This will delete the cache file for you... 4. Visit the catalog to generate a new cache file Bobby Quote
mjm Posted January 9, 2005 Posted January 9, 2005 Thanks for the update Chemo! Has anyone experienced a problem with Google NOT generating any cNames?? Check out my google-cache Google Cache of Future of Style Live Future of Style Any help would be appreciated. Thanks. Quote
Guest Posted January 9, 2005 Posted January 9, 2005 Interesting...I'd like to hear people opinions as well! Bobby Quote
mjm Posted January 9, 2005 Posted January 9, 2005 Bobby, I assume that means you have never seen this behavior? Anyone know how to view the cache of other search engines? Quote
Guest Posted January 9, 2005 Posted January 9, 2005 Never seen that before and don't know what would cause it...so cannot verify OR deny that the cName mod has anything to do with it. However, I offer a cached copy of my dev server where the cNames are fully functional: Google cache So, I know at least one site with cName is being indexed and cached properly...but I'm still interested to hear from the Google-ites. Bobby Quote
Guest Posted January 9, 2005 Posted January 9, 2005 I have only had this running for a few days so google hasn;t updated many links yet, but i have a few with the cName included and (touch wood) they look fine: http://www.google.co.uk/search?q=cache:MsO...ear-controllers Quote
mjm Posted January 10, 2005 Posted January 10, 2005 I think I fixed this by hardcoding the $language variable in the seo_cache.php file. I only support english so this isn't a problem for me... Quote
mjm Posted January 11, 2005 Posted January 11, 2005 I think I fixed this by hardcoding the $language variable in the seo_cache.php file. I only support english so this isn't a problem for me... <{POST_SNAPBACK}> This fixed my problem. Google Cache The Future of Style The google bot doesn't register a session so the $language variable wasn't being set properly because of some other contribs I have installed. All is well with FoS now :) Quote
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.
Note: Your post will require moderator approval before it will be visible.