Jump to content
Sign in to follow this  
ToddW

Yasu Question

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

Share this post


Link to post
Share on other sites

i ve got the same pb that Toddw, it' impossible to contact the author Matt Fletcher, there isn't his e-mail in the install.txt ;)

Share this post


Link to post
Share on other sites
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 :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×