toString(array('scheme', 'host', 'port')); return $prefix.JRoute::_($url); } } //Common parameters $show_published = $params->def('only_published', 1); //Individual parameters $count_estates = intval($params->def('estates', 0)); $cat_id = $params->get('cat_id'); $estate_id = $params->get('estate_id'); $new_target = $params->def('new_target', 1); $ItemId_tmp_from_params = $params->get('ItemId'); $moduleclass_sfx = $params->get('moduleclass_sfx'); $database = &JFactory::getDBO(); if ( !function_exists('getWhereUsergroupsString')) { function getWhereUsergroupsString( $table_alias ) { global $my; if ( isset($my->id) AND $my->id != 0 ) { $usergroups_sh = getGroupsByUser ($my->id,''); //$usergroups_sh = '-2'.$usergroups_sh; } else { $usergroups_sh = array (); } $usergroups_sh[] = -2; $s = ''; for ($i=0; $iYou input IDs of categories and estates together! Correct this mistake.'); else { if($estate_id != null) $sql_where = " AND h.id IN(".$estate_id.")"; if($cat_id != null) $sql_where = " AND c.id IN(".$cat_id.")"; if($cat_id == null && $estate_id == null) $sql_where = ""; $selectstring = "SELECT h.htitle,h.id,h.houseid,h.hlatitude,h.hlongitude,hc.idcat \nFROM #__rem_houses AS h \nLEFT JOIN #__rem_categories AS hc ON hc.iditem=h.id \nLEFT JOIN #__rem_main_categories AS c ON c.id=hc.idcat \nWHERE ($s) AND h.hlatitude IS NOT NULL".$sql_where.$sql_published. "\nLIMIT ".$count_estates; $database->setQuery($selectstring); $rows= $database->loadObjectList(); $selectstring = "SELECT id FROM #__menu WHERE menutype like '%menu%' AND link LIKE '%option=com_realestatemanager%'"; $database->setQuery($selectstring); $ItemId_tmp_from_db = $database->loadResult(); if($ItemId_tmp_from_params==""){ $ItemId_tmp=$ItemId_tmp_from_db; } else{ $ItemId_tmp=$ItemId_tmp_from_params; } } ?>