Latest News: (loading..)

squivo

Members
  • Content count

    5
  • Joined

  • Last visited

About squivo

Profile Information

  • Real Name
    Steven
  • Gender
    Male
  • Location
    CANADA
  • Interests
    music, coding, soccer, hockey, reading
  • Website
  1. Here's what I've done to accomplish search friendly urls AND prevent people from accessing folders/pages that don't exist or are forbidden/restricted Conditions for these code snippets to work out of the box: osCommerce 2.2 rc2a & php 5.whatever (4 might work too, don't know, don't use it) You'll need to create an .htaccess file for this to work. All your links MUST call the tep_href_link function You will have to add your add-ons (payments) and such in the .htaccess file All of your page names contain only letters and underscores (modifiable) You have not changed the variable names 'cPath', 'pid' and 'products_id' (modifiable) You have created an error.php page that catches all exceptions (still works if you don't, but for security reasons you should always have one) Step 1) in the HTML_output.php file, rewrite the tep_href_link function (Changes are in Green) : // The HTML href link wrapper function function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true) { global $request_type, $session_started, $SID; if (!tep_not_null($page)) { die('</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine the page link!<br><br>'); } if ($connection == 'NONSSL') { $link = HTTPS_SERVER . DIR_WS_HTTP_CATALOG;//changed to HTTPS to force SSL connection on ALL links } elseif ($connection == 'SSL') { if (ENABLE_SSL == true) { $link = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG; } else { $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG; } } else { die('</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine connection method on a link!<br><br>Known methods: NONSSL SSL</b><br><br>'); } [color="#008000"] //Added by Squivo , loses the .php part of the name if ( (SEARCH_ENGINE_FRIENDLY_URLS == 'true') && ($search_engine_safe == true) ) { $page_arr = explode(".",$page); $page =$page_arr[0]; $link .= $page; } // else{ if (tep_not_null($parameters)) { $link .= $page . '?' . tep_output_string($parameters); $separator = '&'; } else { $link .= $page; $separator = '?'; } }[/color] // while ( (substr($link, -1) == '&') || (substr($link, -1) == '?') ) $link = substr($link, 0, -1); // Add the session ID when moving from different HTTP and HTTPS servers, or when SID is defined if ( ($add_session_id == true) && ($session_started == true) && (SESSION_FORCE_COOKIE_USE == 'False') ) { if (tep_not_null($SID)) { $_sid = $SID; } elseif ( ( ($request_type == 'NONSSL') && ($connection == 'SSL') && (ENABLE_SSL == true) ) || ( ($request_type == 'SSL') && ($connection == 'NONSSL') ) ) { if (HTTP_COOKIE_DOMAIN != HTTPS_COOKIE_DOMAIN) { $_sid = tep_session_name() . '=' . tep_session_id(); } } } [color="#008000"] //Modified by Squivo if ( (SEARCH_ENGINE_FRIENDLY_URLS == 'true') && ($search_engine_safe == true) ) { $parameters2=str_replace('?', '', $parameters); $params_arr=explode("&",$parameters2); $otherParams=''; for($i=0;$i<sizeof($params_arr);$i++){ if(substr($params_arr[$i],0,5)=='cPath'||substr($params_arr[$i],0,3)=='pid'||substr($params_arr[$i],0,11)=='products_id'){ $params_arr[$i]=strstr($params_arr[$i],"="); $params_arr[$i]=substr($params_arr[$i],1); $link.="/".$params_arr[$i]; } else if($params_arr[$i]!=''){ $otherParams.=$params_arr[$i]."&"; } } if($otherParams!=''|| $otherParams!="&"){ $link.="?".$otherParams; $separator=''; } else{ $separator="?"; } }[/color] if (isset($_sid)) { $link .= $separator . tep_output_string($_sid); } return $link; } Step 2) Then Comment out the section in Application_top.php: if (SEARCH_ENGINE_FRIENDLY_URLS == 'true') { /*if (strlen(getenv('PATH_INFO')) > 1) { $GET_array = array(); $PHP_SELF = str_replace(getenv('PATH_INFO'), '', $PHP_SELF); $vars = explode('/', substr(getenv('PATH_INFO'), 1)); for ($i=0, $n=sizeof($vars); $i<$n; $i++) { if (strpos($vars[$i], '[]')) { $GET_array[substr($vars[$i], 0, -2)][] = $vars[$i+1]; } else { $HTTP_GET_VARS[$vars[$i]] = $vars[$i+1]; } $i++; } if (sizeof($GET_array) > 0) { while (list($key, $value) = each($GET_array)) { $HTTP_GET_VARS[$key] = $value; } } }*/ } Step 3) Set up your .htaccess rewrite rules RewriteEngine On #Rewritebase may need to be /catalog/, or whatever the root of the store is RewriteBase / #PRODUCTS and CATEGORIES (includes reviews, anything product related) RewriteRule ^([a-zA-Z_]+)/([0-9_]+)/([0-9]+)(/)?$ $1.php?cPath=$2&products_id=$3&%{QUERY_STRING} [NC,L] RewriteRule ^index/([0-9_]+)(/)?$ index.php?cPath=$1&%{QUERY_STRING} [NC,L] RewriteRule ^([a-zA-Z_]+)/([0-9\{\}]+)(/)?$ $1.php?products_id=$2&%{QUERY_STRING} [NC,L] # ALL OTHER CASES , THIS RULE IS LAST Rewriterule ^([a-zA-Z_]+)(/)?$ $1.php?%{QUERY_STRING} [NC,L] Once these steps are done, turn on Search friendlies in yer admin panel and see if it works - surf your site - I have only tested this on my own sites, all successfully BOOSH!
  2. It took me a while to find the right paypal option too, and I'm not a noob. I use 'Express Checkout' ---> the way it works is like this From your 'checkout_payment' page, you choose the option to pay with paypal. Click confirm -- you shoot to paypal site, login and pay, you are then redirected back your checkout at the 'checkout_confirmation page'. Orders appear as normal osCommerce orders. 1) You need a paypal business account. 2) download the Express Checkout package 3) install it 4) Apply for an API in you paypal business account 5) configure the API settings in the admin payment panel I advise playing around in paypal sandbox before any actual money is transferred - this way you can test different envrionments. https://developer.paypal.com/us/cgi-bin/devscr?cmd=home/main The sandbox will show you step by step what you need for your IPN if that's really what you want.
  3. yes, you can. You can use all of them, I think. I currently am using the 'Express Checkout' with version 2.2 rc2a
  4. This is my first post on this site. I've been tearing apart version 2.2 rc2a since Oct last year. It's pretty awesome code and thanks to all contributors for their thorough and hard work. After installing the moneris eSELECT module (API), i (obviously) tried a test order and got a PHP error after entering the credit card information and clicking on 'confirm order'. Fatal error: Cannot use object of type order as array in /(my folder path)/modules/payment/monerisusmpg.php on line 702 At Line 702 in modules/payment/monerisusmgp.php is the following: $custInfo->setInstructions($order['info']['comment']); Changed it to this and you won't have any more problems $custInfo->setInstructions($order->info['comment']); Forgive me if this had already been mentioned, if not, I hope it helps. I emailed Moneris to have their code changed/updated so this problem doesn't happen to anyone else. Who knows if they'll change it.