Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Yasu Question


ToddW

Recommended Posts

Hi, I recently installed Yasu .2 and want to change the + signs in the URL to -'s.

 

I have gone through his code, and searched for %2B & %2b and %20 and + and I can't find where it's used to replace the space with a plus sign.... I just want to replace it with a dash..

 

Can anyone tell me where this occurs.?

 

 

Thank You

-Todd

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...
Come on people... ANYONE? ??

 

 

Incase anyone still needs the answer to this:

 

 

To change + signs into dashes, change the following line from html_output.php
          $link .= preg_replace('/%2F/', '%20', implode('/', $cPath_list));

to

          $link .= preg_replace(array('/%2F/', '/+/'), array('%20', '-'), implode('/', $cPath_list));

In rewrite.php, change

    $piece = urldecode(preg_replace(array('/[+]/', '/%20/'), array(' ', '%2F'), $piece_encoded));

to

    $piece = urldecode(preg_replace(array('/-/', '/%20/'), array(' ', '%2F'), $piece_encoded));

Or more generally,

    $piece = urldecode(preg_replace(array('/[+]/', '/%20/'), array('_', '%2F'), $piece_encoded));

and change the SQL queries to use LIKE rather than =.  For example,

    $category_query = tep_db_query("select cd.categories_id from categories_description cd, categories c where cd.categories_id=c.categories_id and cd.categories_name='" . tep_db_input($piece) . "' and c.parent_id='" . (int)$current_category_id . "'");

would become

    $category_query = tep_db_query("select cd.categories_id from categories_description cd, categories c where cd.categories_id=c.categories_id and cd.categories_name like '" . tep_db_input($piece) . "' and c.parent_id='" . (int)$current_category_id . "'");

as the _ will match any character when used this way.

 

Hth,

Matt

 

 

I used it, works fine :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...