Loading


Advertisement:

Author Topic: Possible Footer links URL fix  (Read 358 times)

SmaRTeY

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2232
Possible Footer links URL fix
« on: August 22, 2016, 12:26:09 am »
Hi there,

Using Osclass 3.6.1 I found that my footer links on search page (bottom) were showing interesting links which were referring to an url that was just part of the link shown. Some investigation lead to the following fix, works for me so far but nevertheless if you use it for your own system/theme make sure you keep your old code backed up since this is a *core* fix/change that will be overwritten when upgrading Osclass to a new version. That said, here's the change that makes my footerlinks work correctly:

File: oc-includes/osclass/functions.php
Funtion: osc_footer_link_url

Code: [Select]
function osc_footer_link_url($f = null) {
    if($f==null) {
        if(View::newInstance()->_exists('footer_link')) {
            $f = View::newInstance()->_get('footer_link');
        } else {
            return '';
        }
    } else {
        View::newInstance()->_exportVariableToView('footer_link', $f);
    }
    $params = array();
    $tmp = osc_search_category_id();
    //21-08-2016 FIX by SmaRTeY, categories in footer link were missed using "!empty($tmp)"
    if(isset($tmp)) {
        $params['sCategory'] = $f['fk_i_category_id'];
    }

    if( osc_search_region() == '' ) {
        $params['sRegion'] = $f['fk_i_region_id'];
    } else {
        $params['sCity'] = $f['fk_i_city_id'];
    }

    return osc_search_url($params);
}

Hope it helps others, use at own risk and do not forget to keep track of this change with regard to future Osclass updates!


Regards,
Eric
« Last Edit: August 29, 2016, 01:47:54 am by SmaRTeY »

portatil33

  • Newbie
  • *
  • Posts: 12
Re: Possible Footer links URL fix
« Reply #1 on: February 17, 2017, 05:00:03 pm »
Great!  Now works !!  ;)
Is not "posible .....  It´s the FIX !!!

 :D

http://www.buscadisimo.com/anuncios

SmaRTeY

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2232
Re: Possible Footer links URL fix
« Reply #2 on: March 01, 2017, 11:42:20 am »
Nice to hear you like the fix :D

Regards,
Eric