Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.


  • Content count

  • Joined

  • Last visited

Everything posted by little.pm

  1. little.pm


    Hi everyone, I just posted a contribution that allows to have separate countries_names per language. countries_names Does anyone who is good at spanish does have the time and will to translate the countries names into spanish as I unfortunately don't speak nor even understand spanish :-) Comments regarding if such contribution is usefull or not and what I might have missed out or how to improve it are highly appreciated as well. regards ralf
  2. little.pm


    Hello Johannes, I am glad you like it. Yes, I do know the effect, but it does not only occur in german but also in all languages that use non standard ascii character sets but rather extended character sets. Think about accent acute in french for example. I like your solution to the problem. However, a single solution for just one language can not fix the problem in general. So I would prefer to go along the way with the languages themselves. Every language that we know of has an alphabet wich defines the sort order for each character. So in the end we need to define a sort function, that sorts any list we give to it according to the predefined alpahbet for that language. The alphabet could be defined in the language file, eg. includes/languages/english.php or includes/languages/german.php. The sort function gets the list we want to sort. It also gets the language ID for the language in wich (or according to that languages alphabet) we want to sort and a third argument stating a sort option, eg. ascending or descending. Such function itself could be reused all over the place for other parts of the shop where a language dependend sort function could be of use, eg. to display and sort products options names. The reason why I take the short time to write this down, is simply because I do currently not have the time to code such sort_function. May be you would have time and would want to code it : I would say to you as to everyone else: You're welcome, because its an open source project based on collabortaion :-) regards Ralf
  3. little.pm


    Just posted an update so the contribution now contains also the spanish countries names (wich where provided by Pablo Ferrer). regards ralf
  4. the above syntax is wrong as ORDER BY requires an argument wich has been omitted and hence the following LIMIT causes the error regards ralf
  5. little.pm

    Credit Class

    Patrick, first off the question "why would you want to do this?" DO you use HTTPS? Do you have your own SSL-Cert? Do you have your own dedicated server? Can you assure taht no one ever hacks into your server? Can you assure that no third person reads your email while being send (you do use encryption for the order emails from your shop to your account?)? In Short can you assure the users data are protected? If any of the above had the answer NO then please consider using PayPal or Worldpay or Moneybookers or whatever ThirdParty Payment Processor seems able to provide the above required security. (If they fail and someone discloses user data from their machines its their fault, you can blaim them and users can charge them. If you fail you probably will have to retire from your current way of living, and spend your life paying back the damaged users charges etc.) On the other Hand if you never said NO above you might easily use the credit card acceptance that comes preinstalled with the shop, but remember to protect the users credit card data as needed. The module itself works fine and without any knwon bugs. The only problem that you face and have to be aware of is the security of the data against unwanted dirsclosure (wich covers all cases where it is not you who sees that data). regards Ralf (btw. I am on the german forum too *grin*)
  6. little.pm

    B2B Suite

    see here http://www.oscommerce.com/community/contributions,403 have a nice day regards ralf
  7. little.pm


    Just posted an update with a minor bug fix. regards ralf
  8. little.pm


    go to your admin area and under cache control delete the cached version of the categories :-) on the other hand it seems that you include the classic categories parallel to cool_menu. (feel free to post SOME code to be examinded) regards ralf
  9. right Chris, you already posted a solution. Please allow me to offer another on (which by the way forces no extra database queries) ;-) regards ralf Have a nice day! All decision is left to your taste
  10. <title><?php echo STORE_NAME . ' - ' . $breadcrumb->currentTitle(); ?></title> and do not forget to insert these lines function currentTitle() { $tmp = end($this->_trail); return $tmp['title']; } before the closing curly brace of the class breadcrumb in includes/classes/breadcrumb.php under you catalog directory. I am sorry but I can only attempt to guess where the solution for you is as you are not specific enough to let me know what goes wrong or in another way. regards ralf
  11. what does your shop send to the client browser as <title> in the documents head section? Do you get an error emssage and if what kind of? what does it say? Wich version of osCommerce are you using?
  12. little.pm

    redirect_login_to problems

    you are getting the erro because you did not "require" nor "include" DIR_WS_FUNCTIONS . 'html_output.php' as this is the file in wich the function tep_href_link() is defined. compare the contents of your file 'redirect_login_to.php' with for example to 'application_top.php'. As you'll see you need to include or require the file that contains a function (so it gets to life so to say) before you could use that function. regards ralf btw. working with snapshots is not recommended for live servers :-)
  13. not really to say it would not matter what to use, the protocol for Http says that if a parameter list is passed to a document it has to start the list with a '?' Alle name value pairs in this parameter list have to be assigned with the the symbol '=' and the symbol '&' has to be used to separate all entries from each other. So that gives http://server.domain.tld/uri.php?param=value and http://server.domain.tld/uri.php?param=val...e&param1=value1 etc. If the parameter list is not started with a '?' then the webserver looks for a document named alike uri.php&param which he won't be able to find, so the server should return a "302 document not found" or a prepared error document (set by rules in httpd.conf or .htacces) or produced by a errorhandler (also set by rules in httpd.conf or .htacces). I don't know and can not imagine what causes your loop. I will think about it. Maybe you'll find a hint on what s really going on if it loop. Do you have a shell access to your server? try tail -f /var/log/httpd/access.log or use the path where you know that your logs are stored to see wich document is being requested actually. (you can exit that command and the output and return to the shell wit CTRL+C.) If that doesn't work insert a die() before the output for the javascript redirection as <?php } else { ?> <script language="JavaScript"> <!-- window.location.href = document.URL + ((document.URL.match(/[?]/))? '&' : '?') + 'javascript=on'; //--> </script> <?php } ?> to see if its really the javascript test that fails. If it dies then so please start debugging. Let php echo the values for javascript and even the ones for 'blah'. A full list you get (not always needed but helpfull with this) /* // debugging help foreach (array_keys($HTTP_POST_VARS) as $tmp_str) { echo "keys: " . $tmp_str . ' : value ->' . $HTTP_POST_VARS[$tmp_str] . '<br />' . "n"; if (is_array($HTTP_POST_VARS[$tmp_str])) { foreach ($HTTP_POST_VARS[$tmp_str] as $tmp_tmp_str) { echo ' : value ->' . $tmp_tmp_str . '<br />' . "n"; } } } */ Do the same accordingly for HTTP_GET_VARS and you can see what the server gets and how it modified what it got or if it didn't at all. I am sorry to have no solution by now for this. I will look into it in the evening. regards Ralf (GMT +01 ;-))
  14. another change :-) That should do it :-) //////////////////////////////////////////////// // rb 20030803 13:00 JAVASCRIPT DETECTION if (!tep_session_is_registered('javascript')) { tep_session_register('javascript'); } if (isset($HTTP_GET_VARS['javascript']) || isset($HTTP_POST_VARS['javascript'])) { $javascript = ((isset($HTTP_GET_VARS['javascript']) == 'on') || ( isset($HTTP_POST_VARS['javascript']) == 'on'))? 'on' : 'off'; unset($HTTP_GET_VARS['javascript']); unset($HTTP_POST_VARS['javascript']); $parameters = array('javascript', 'pid', 'ref'); tep_redirect(tep_href_link(substr($PHP_SELF,1), tep_get_all_get_params($parameters))); } // END JAVASCRIPT DETECTION //////////////////////////////////////////////// The reason is that $PHP_SELF always returns the DOCUMENT_URI, so the document and path relative to the WEBSERVER_ROOT_DIR, and not important here but to be complete the tep_get_all_get_params() returns also the get parameters given to the document except those namely listed in the array $parameters. With the substr() we get rid of the always present preceeding slash from $PHP_SELF and with tep_get_all_get_params() we rebuilt the full REQUEST_PATH except for 'javascript' and 'ref' or whatever you don't want to show up. (sometimes I change code before reading the comments, sometimes code doesn't even have comments, sometimes I rechange code after I read the code others wrote :-) Enjoy :-) regards ralf
  15. Ok, I admit, I am no JavaScript Guru (but hey still willing to learn, dunno why Netscape croaks on that but who cares, here s another way to do it). I moved my little code modification a bit down in application_top in order of being able to use 'general.php' and 'html_output.php' // include the language translations require(DIR_WS_LANGUAGES . $language . '.php'); // define our general functions used application-wide require(DIR_WS_FUNCTIONS . 'general.php'); require(DIR_WS_FUNCTIONS . 'html_output.php'); //////////////////////////////////////////////// // rb 20030803 13:00 JAVASCRIPT DETECTION if (!tep_session_is_registered('javascript')) { tep_session_register('javascript'); } if (isset($HTTP_GET_VARS['javascript']) || isset($HTTP_POST_VARS['javascript'])) { $javascript = ((isset($HTTP_GET_VARS['javascript']) == 'on') || ( isset($HTTP_POST_VARS['javascript']) == 'on'))? 'on' : 'off'; unset($HTTP_GET_VARS['javascript']); unset($HTTP_POST_VARS['javascript']); $parameters = array('action', 'cPath', 'products_id', 'pid'); tep_redirect(tep_href_link($PHP_SELF, tep_get_all_get_params($parameters))); } // END JAVASCRIPT DETECTION //////////////////////////////////////////////// // currency and the javascript will still use the get method and not post a form. <link rel="stylesheet" type="text/css" href="/styles/common.css" /> <?php if ($javascript == 'on') { ?> <?php } else { ?> <script language="JavaScript"> <!-- window.location.href = document.URL + ((document.URL.match(/[?]/))? '&' : '?') + 'javascript=on'; //--> </script> <?php } ?> </head> <body> I personally would like to see the solution with the form to work as well but that might take a while and is not urgent now, but as I see it it can be used to allow users later on to enable or disable javascript use in their "preferences" on a website, so they might have javascrpt enabled in their browsers but don't want the site to use it or to use use it, but at least they'd have a choice :-) Isn't that what we are here fore? Having choices and making our own decisions?*grin* regards Ralf let me know if get into any problems with the code, I'll help as soon as I can
  16. <?php if ($javascript == 'on') { ?> /* your script goes here */ <?php } else { ?> <form id="jstest" action="<?php echo $PHP_SELF; ?>" method="post"><input type="hidden" name="javascript" value="on" /></form> <script language="JavaScript"> <!-- document.getElementsByName('jstest').submit(); /* window.location.href = document.URL + ((document.URL.match(/[?]/))? '&' : '?') + 'javascript=on';*/ //--> </script> <?php } ?> compare this to the previous version in the head section of the other files, I hope it works for you. Normally a form element must not be in the head section but you could go around that if you'd say for example <head> <meta http-equiv="content-type" content="text/html;charset=iso-8859-1" /> <title>Oktoberfest Shop</title> <meta name="keywords" content="Oktoberfest 2003, oktoberfest.de, oktoberfest-shop, Wiesn-Artikel, Wiesn, Wisn-Haferl, Wiesn-Truck, Oktoberfest-Truck, München 2003" /> <meta name="description" content="Willkommen im offiziellen Oktoberfest-Shop. Hier bekommen Sie die original Oktoberfest-Artikel zum Oktoberfest 2003." /> <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>" /> <link rel="stylesheet" type="text/css" href="/styles/common.css" /> <?php if ($javascript == 'on') { ?> /* your script goes here */ </head> <body> <?php } else { ?> </head> <body> <form id="jstest" action="<?php echo $PHP_SELF; ?>" method="post"><input type="hidden" name="javascript" value="on" /></form> <script language="JavaScript"> <!-- document.getElementsByName('jstest').submit(); //--> </script> <?php } ?>
  17. short correction the lines if (isset($HTTP_GET_VARS['javascript']) || isset($HTTP_GET_VARS['javascript'])) { $javascript = ((isset($HTTP_GET_VARS['javascript']) == 'on') || ( isset($HTTP_GET_VARS['javascript']) == 'on'))? 'on' : 'off' should actually be if (isset($HTTP_GET_VARS['javascript']) || isset($HTTP_POST_VARS['javascript'])) { $javascript = ((isset($HTTP_GET_VARS['javascript']) == 'on') || ( isset($HTTP_POST_VARS['javascript']) == 'on'))? 'on' : 'off'
  18. Hi Tony, I did not need this functionality but I think I will use it to the extend as using javascript can help caching site contents if a script is used to display some content to the user. First the reason that your attempt failed: PHP is only parsed on the serverside whereas javascript as you use it for the menu is client side parsed only. The fact that a browser submits also the mime type "text/javascript" accompanied with the file extension ".js" does not mean that the user allows the execution javascript. On the other hand do the MS internet explorers not send such mime type accept lists upon page refresh. Hence the server will never know if the client will execute any javascript. So th eonly way to find out if javascript will be executed is to attempt using javscript. To do that I added follwing in the head section of a php file. ... <head> ... <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>" /> <link rel="stylesheet" type="text/css" href="/styles/common.css" /> <?php if ($javascript == 'on') { ?> <!-- add here the stuff to be executed if we detected javascript to be executed //--> <?php } else { ?> <script language="JavaScript"> <!-- window.location.href = document.URL + ((document.URL.match(/[?]/))? '&' : '?') + 'javascript=on'; //--> </script> <?php } ?> </head> <body> ... The other part I've put into application_top.php. Between the blocks "// Create the cart & Fix the cart if necesary" and "// include currencies class and create an instance" I've added the following: // rb 20030803 13:00 JAVASCRIPT ON/OFF if (!tep_session_is_registered('javascript')) { tep_session_register('javascript'); } if (isset($HTTP_GET_VARS['javascript']) || isset($HTTP_GET_VARS['javascript'])) { $javascript = ((isset($HTTP_GET_VARS['javascript']) == 'on') || ( isset($HTTP_GET_VARS['javascript']) == 'on'))? 'on' : 'off'; } // END JAVASCRIPT ON/OFF But as a side note I'd like to remember everyone who wants to use this that users get quite quick angry if javascript is abused. If the user decides to disable javascript during the session the server has no way of determining that javascript has been disabled. So don't use javascript for popups and popunders and such annoying stuff. (yeah I know that I am a bit "old fashioned") :-) Anyway, I hope this helps to built better websites. Enjoy :-) regards Ralf
  19. <title><?php echo TITLE . ' : ' . $breadcrumb->currentTitle(); ?></title> and in /catalog/includes/classes/breadcrumb.php add this function function currentTitle() { $tmp = end($this->_trail); return $tmp['title']; } It will work with any language and that is the reason why no one who runs a shop in different languages should ever use it. Google will be confused to get a different title and document content for the same unique URL. But thats more a technical problem. It can be solved when oscommerce in general starts to use the "lang" and "hreflang" and/or "xml:lang" so that google and user who do use reader applications can more easily determine which language currently is being displayed. Without google and other search and indexing applications will fail. However if you run your shop only in english (or in only one language to say it more in general) the above modification will work for you :-) Have a nice day. regards ralf