PHP Notice: Undefined index: fk_i_category_id in /oc-includes/osclass/helpers/hDefines.php on line 487
PHP Notice: Undefined index: pk_i_id in /oc-includes/osclass/helpers/hDefines.php on line 493
PHP Notice: Undefined index: s_city in /oc-includes/osclass/helpers/hDefines.php on line 494
PHP Notice: Undefined index: s_title in /oc-includes/osclass/helpers/hDefines.php on line 495
How to define them?
/**
* Create item url from item data without exported to view.
*
* @since 3.3
* @param array $item
* @param string $locale
* @return string
*/
function osc_item_url_from_item($item, $locale = '')
{
if ( osc_rewrite_enabled() ) {
$url = osc_get_preference('rewrite_item_url');
if( preg_match('|{CATEGORIES}|', $url) ) {
$sanitized_categories = array();
487: $cat = Category::newInstance()->hierarchy($item['fk_i_category_id']);
for ($i = (count($cat)); $i > 0; $i--) {
$sanitized_categories[] = $cat[$i - 1]['s_slug'];
}
$url = str_replace('{CATEGORIES}', implode("/", $sanitized_categories), $url);
}
493 $url = str_replace('{ITEM_ID}', osc_sanitizeString($item['pk_i_id']), $url);
494 $url = str_replace('{ITEM_CITY}', osc_sanitizeString($item['s_city']), $url);
495 $url = str_replace('{ITEM_TITLE}', osc_sanitizeString($item['s_title']), $url);
$url = str_replace('?', '', $url);
if($locale!='') {
$path = osc_base_url().$locale."/".$url;
} else {
$path = osc_base_url().$url;
}
} else {
$path = osc_item_url_ns($item['pk_i_id'], $locale);
}
return $path;
}