some changes to #1184

Please review and accept these changes, so I can accept your pull request. I tested several urls and all of them worked fine, but maybe I miss something.


I was following your idea of using param 'page' => 'search' (at first I didn't understood), so this works as follow

osc_search_url: will always try to "minimize" the url, for example:

* osc_search_url() -> domain.tld/search OR domain.tld/index.php?page=search (or subdomain.domain.tld if you're already in a subdomain page)
* osc_search_url(subdomain) -> subdomain.domain.tld
* osc_search_url(not_sub_domain) -> domain.tld/search/param,not_sub_domain OR index.php?page=search&param=not_sub_domain (or subdomain.domain.tld if you're already in a subdomain page)
* osc_search(subdomain + not_sub_domain) -> subdomain.domain.tld/search/param,not_sub_domain OR indes.php?blablabal

Additionally 
osc_search_show_all_url($params) will pass $params to osc_search_url AND add 'page' => 'search', so it will ALWAYS show the search page (not main)

New function osc_subdomain_base_url($params) will strip all params except the subdomain one.


Here are some of the urls it will generate : 

// MAIN WEBSITE (subdomains are REGION BASED) (madriguera.me)
osc_search_url()                                                                              => http://madriguera.me/osclass/Osclass/search
osc_search_url(array('sRegion' => 'Madrid'))                                                  => http://madrid.madriguera.me/osclass/Osclass/
osc_search_url(array('sRegion' => 'Murcia'))                                                  => http://murcia.madriguera.me/osclass/Osclass/
osc_search_url(array('sCategory' => 'hotel'))                                                 => http://madriguera.me/osclass/Osclass/hotel
osc_search_url(array('sRegion' => 'Madrid', 'sCategory' => 'hotel'))                          => http://madrid.madriguera.me/osclass/Osclass/hotel
osc_search_url(array('sRegion' => 'Murcia', 'sCategory' => 'hotel'))                          => http://murcia.madriguera.me/osclass/Osclass/hotel
osc_search_url(array('sCategory' => 'hotel', 'sPattern' => 'keyword'))                        => http://madriguera.me/osclass/Osclass/search/category,hotel/pattern,keyword
osc_search_url(array('sRegion' => 'Madrid', 'sCategory' => 'hotel', 'sPattern' => 'keyword')) => http://madrid.madriguera.me/osclass/Osclass/search/category,hotel/pattern,keyword
osc_search_url(array('sRegion' => 'Murcia', 'sCategory' => 'hotel', 'sPattern' => 'keyword')) => http://murcia.madriguera.me/osclass/Osclass/search/category,hotel/pattern,keyword

osc_search_show_all_url()                                                                              => http://madriguera.me/osclass/Osclass/search
osc_search_show_all_url(array('sRegion' => 'Madrid'))                                                  => http://madrid.madriguera.me/osclass/Osclass/search
osc_search_show_all_url(array('sRegion' => 'Murcia'))                                                  => http://murcia.madriguera.me/osclass/Osclass/search
osc_search_show_all_url(array('sCategory' => 'hotel'))                                                 => http://madriguera.me/osclass/Osclass/hotel
osc_search_show_all_url(array('sRegion' => 'Madrid', 'sCategory' => 'hotel'))                          => http://madrid.madriguera.me/osclass/Osclass/hotel
osc_search_show_all_url(array('sRegion' => 'Murcia', 'sCategory' => 'hotel'))                          => http://murcia.madriguera.me/osclass/Osclass/hotel
osc_search_show_all_url(array('sCategory' => 'hotel', 'sPattern' => 'keyword'))                        => http://madriguera.me/osclass/Osclass/search/category,hotel/pattern,keyword
osc_search_show_all_url(array('sRegion' => 'Madrid', 'sCategory' => 'hotel', 'sPattern' => 'keyword')) => http://madrid.madriguera.me/osclass/Osclass/search/category,hotel/pattern,keyword
osc_search_show_all_url(array('sRegion' => 'Murcia', 'sCategory' => 'hotel', 'sPattern' => 'keyword')) => http://murcia.madriguera.me/osclass/Osclass/search/category,hotel/pattern,keyword

osc_subdomain_base_url(array('sCategory' => 'hotel', 'sPattern' => 'keyword'))                        => http://madriguera.me/osclass/Osclass/
osc_subdomain_base_url(array('sRegion' => 'Murcia', 'sCategory' => 'hotel', 'sPattern' => 'keyword')) => http://murcia.madriguera.me/osclass/Osclass/


// SUBDOMAIN (REGION TYPE) (madrid.madriguera.me)

osc_search_url()                                                                              => http://madrid.madriguera.me/osclass/Osclass/search
osc_search_url(array('sRegion' => 'Madrid'))                                                  => http://madrid.madriguera.me/osclass/Osclass/
osc_search_url(array('sRegion' => 'Murcia'))                                                  => http://murcia.madriguera.me/osclass/Osclass/
osc_search_url(array('sCategory' => 'hotel'))                                                 => http://madrid.madriguera.me/osclass/Osclass/hotel
osc_search_url(array('sRegion' => 'Madrid', 'sCategory' => 'hotel'))                          => http://madrid.madriguera.me/osclass/Osclass/hotel
osc_search_url(array('sRegion' => 'Murcia', 'sCategory' => 'hotel'))                          => http://murcia.madriguera.me/osclass/Osclass/hotel
osc_search_url(array('sCategory' => 'hotel', 'sPattern' => 'keyword'))                        => http://madrid.madriguera.me/osclass/Osclass/search/category,hotel/pattern,keyword
osc_search_url(array('sRegion' => 'Madrid', 'sCategory' => 'hotel', 'sPattern' => 'keyword')) => http://madrid.madriguera.me/osclass/Osclass/search/category,hotel/pattern,keyword
osc_search_url(array('sRegion' => 'Murcia', 'sCategory' => 'hotel', 'sPattern' => 'keyword')) => http://murcia.madriguera.me/osclass/Osclass/search/category,hotel/pattern,keyword

osc_search_show_all_url()                                                                              => http://madrid.madriguera.me/osclass/Osclass/search
osc_search_show_all_url(array('sRegion' => 'Madrid'))                                                  => http://madrid.madriguera.me/osclass/Osclass/search
osc_search_show_all_url(array('sRegion' => 'Murcia'))                                                  => http://murcia.madriguera.me/osclass/Osclass/search
osc_search_show_all_url(array('sCategory' => 'hotel'))                                                 => http://madrid.madriguera.me/osclass/Osclass/hotel
osc_search_show_all_url(array('sRegion' => 'Madrid', 'sCategory' => 'hotel'))                          => http://madrid.madriguera.me/osclass/Osclass/hotel
osc_search_show_all_url(array('sRegion' => 'Murcia', 'sCategory' => 'hotel'))                          => http://murcia.madriguera.me/osclass/Osclass/hotel
osc_search_show_all_url(array('sCategory' => 'hotel', 'sPattern' => 'keyword'))                        => http://madrid.madriguera.me/osclass/Osclass/search/category,hotel/pattern,keyword
osc_search_show_all_url(array('sRegion' => 'Madrid', 'sCategory' => 'hotel', 'sPattern' => 'keyword')) => http://madrid.madriguera.me/osclass/Osclass/search/category,hotel/pattern,keyword
osc_search_show_all_url(array('sRegion' => 'Murcia', 'sCategory' => 'hotel', 'sPattern' => 'keyword')) => http://murcia.madriguera.me/osclass/Osclass/search/category,hotel/pattern,keyword

osc_subdomain_base_url(array('sCategory' => 'hotel', 'sPattern' => 'keyword'))                        => http://madrid.madriguera.me/osclass/Osclass/
osc_subdomain_base_url(array('sRegion' => 'Murcia', 'sCategory' => 'hotel', 'sPattern' => 'keyword')) => http://murcia.madriguera.me/osclass/Osclass/