Santafe
Участники-
Публикации
17 -
Зарегистрирован
-
Посещение
О Santafe
-
Звание
Любопытный
Посетители профиля
598 просмотров профиля
-
Сори.. Я наверно на другом шаблоне смотрел.. А сделать сортировку как-то на виде отображения thumbs возможно сделать?
-
на фронте. Шаблон стандартный agency
-
Собственно сами кнопки исчезли.
-
Почему-то исчезла сортировка. Помогите разобраться. Изменял шаблоны, настраивал сайт, она исчезла. Если ставлю исходный шаблон она не появляется. Если не сложно можете показать в каких файлах искать косяки. Где копать. Либо это на базу как-то завязано? Пытался разобраться сам, ничего путного не нашёл.. Документация по двигу привязок никаких не даёт.
-
Дак регион один. областной город. вокруг него 40-50 населённых пунктов.. причём если брать разные категории, их разное количество т.к. есть коттеджные посёлки в которых отсутствуют квартиры и наоборот есть города где нет частных домов. В итоге выборка будет из позиций 30 это нормально. Уверен что для поиска будет очень удобно т.к. если посмотреть внедрение движка, основная масса его внедряет в регионах и как правило у них вообще до 10 населённых пунктов. Так называемой портянки не получается. Есть примеры реализации такой выборки. Меня это устраивает. Хотелось бы реализовать
-
По направлениям неудобно разделять. Это не Москва всего населённых пунктов 40-50.. Лишних привязок совершенно не надо. Лишняя работа + для пользователей дополнительные параметры при выборе. Жалко что невозможно реализовать простым способом.
-
У меня на сайте представлены населённые пункты одной области. Допустим дома в городе и дома в области. мне необходимо отфильтровать только дома в области без одного населённого пункта. как я могу это реализовать. второй вопрос. Как можно сделать в поиске выбор города, но не одного как по умолчанию, а допустим галочками (надо / не надо). Т.е. если человек смотрит дома в области, он как правило выбирает несколько населённых пунктов. И было бы удобно чтобы была такая возможность. Заранее спасибо.
-
файл template/frontend/agency/main/view/local_kvartira_view.php откуда берётся? и какое его должно быть содержание?
-
если убрать.. ситуация примерно такая.. Warning: require_once(/template/frontend/agency/main/view/local_kvartira_view.php) [function.require-once]: failed to open stream: No such file or directory in /template/frontend/agency/main/main.php on line 606 в файле main.php всё заменил.
-
вы просили main.php перепутал.. не то выложил.. выкладываю main.php <?phpclass frontend_main extends SiteBill_Krascap { function local_apps_processor () { $this->apps_dir = SITEBILL_DOCUMENT_ROOT.'/apps'; if ( preg_match('/simpleeditor/', $_SERVER['REQUEST_URI']) ) { $this->run_apps('fasteditor'); } elseif ( preg_match('/freeorder/', $_SERVER['REQUEST_URI']) ) { $this->run_apps('freeorder'); } elseif ( $this->run_apps('page') ) { } else { $this->run_apps('realtypro'); } } /** * Set executed apps * @param string $apps_name */ private function set_executed_apps ( $apps_name ) { $this->apps_executed[] = $apps_name; } /** * Get executed apps * @return Array */ function get_executed_apps () { return $this->apps_executed; } function run_apps ( $app_dir ) { if ( is_dir($this->apps_dir.'/'.$app_dir) and !preg_match('/\./', $app_dir) ) { if ( is_file($this->apps_dir.'/'.$app_dir.'/site/site.php') ) { require_once ($this->apps_dir.'/'.$app_dir.'/admin/admin.php'); require_once ($this->apps_dir.'/'.$app_dir.'/site/site.php'); $app_class_name = $app_dir.'_site'; //echo $app_class_name.'<br>'; $app_class_inst = new $app_class_name; if ( $app_class_inst->frontend() ) { $this->set_executed_apps($app_class_name); //closedir($dh); return true; } } } return false; } function check_local_config () { require_once (SITEBILL_DOCUMENT_ROOT.'/apps/system/lib/admin/object_manager.php'); require_once (SITEBILL_DOCUMENT_ROOT.'/apps/config/admin/admin.php'); $config_admin = new config_admin(); if ( !$config_admin->check_config_item('grid_type') ) { $config_admin->addParamToConfig('grid_type','list','Тип списка объявлений (list - обычная таблица, thumbs - div-блоки'); } } /** * Main * @param void * @return string */ function main () { $this->check_local_config(); $layouts=array( '_default'=>'layout_basic.tpl' ); /*require_once(SITEBILL_DOCUMENT_ROOT.'/apps/system/lib/system/sitebill_includer.php'); $Sitebill_Includer=Sitebill_Includer::getInstance(); $Sitebill_Includer->addCss('/template/frontend/agency/css/style.css'); $Sitebill_Includer->addCss('/template/frontend/agency/css/style3.css'); */ /*if(!preg_match('/\/login/', $_SERVER['REQUEST_URI']) && (int)$_SESSION['user_id']==0){ header('location:'.SITEBILL_MAIN_URL.'/login/'); }*/ $work_subcontroller=''; $has_result=false; $undetected_url=false; global $__site_title, $folder, $smarty; $REQUESTURIPATH=Sitebill::getClearRequestURI(); /*if($REQUESTURIPATH=='GD'){ $this->getDataS(); exit(); }*/ if($this->getConfigValue('use_google_map')){ $this->template->assign('map_type', 'google'); }else{ $this->template->assign('map_type', 'yandex'); } require_once(SITEBILL_DOCUMENT_ROOT.'/apps/system/lib/admin/object_manager.php'); require_once(SITEBILL_DOCUMENT_ROOT.'/apps/system/lib/system/apps/apps_processor.php'); $apps_processor = new Apps_Processor(); $apps_processor->run_preload(); require_once(SITEBILL_DOCUMENT_ROOT.'/apps/system/lib/admin/structure/structure_manager.php'); $Structure_Manager = new Structure_Manager(); $this->template->assert('template_vars_logo', $this->getConfigValue('template.'.$this->getConfigValue('theme').'.logo')); $this->template->assert('current_theme_name', $this->getConfigValue('theme')); $this->template->assert('allow_register_account', $this->getConfigValue('allow_register_account')); $result=$this->_detectUrlParams($_SERVER['REQUEST_URI']); if($result['topic_id']/* && !is_array($result['topic_id'])*/){ $this->setRequestValue('topic_id', $result['topic_id']); } if($result['city_id']){ $this->setRequestValue('city_id', $result['city_id']); } require_once(SITEBILL_DOCUMENT_ROOT.'/apps/system/lib/frontend/search/kvartira_search.php');require_once(SITEBILL_DOCUMENT_ROOT.'/template/frontend/'.$this->getConfigValue('theme').'/main/search/local_kvartira_search.php'); $kvartira_search_form = new Local_Kvartira_Search_Form(); $kvartira_search_form->main(); $this->template->assert('search_form_template', 'search_form.tpl'); if ( file_exists(SITEBILL_DOCUMENT_ROOT.'/apps/upper/upper.xml') ) { $this->template->assert('show_upper', 'true'); } if ( $this->getConfigValue('menu_type') == 'purecss' ) { require_once(SITEBILL_DOCUMENT_ROOT.'/apps/system/lib/frontend/menu/purecssmenu.php'); $purecssmenu = new PureCSS_Menu(); $this->template->assert('slide_menu', $purecssmenu->get_menu()); } elseif ( $this->getConfigValue('menu_type') == 'onelevel' ) { require_once(SITEBILL_DOCUMENT_ROOT.'/apps/onelevelmenu/lib/onelevelmenu.php'); $onelevel = new Onelevel_Menu(); $this->template->assert('slide_menu', $onelevel->get_menu()); } else { require_once(SITEBILL_DOCUMENT_ROOT.'/apps/system/lib/frontend/menu/slidemenu.php'); $slidemenu = new Slide_Menu(); $this->template->assert('slide_menu', $slidemenu->get_menu()); } $extendedSearchFormParams=$this->getExtendedSearchFormParams(); $this->template->assert('max_floor_count', $extendedSearchFormParams['max_floor_count']); $this->template->assert('max_price', $extendedSearchFormParams['max_price']); if(file_exists(SITEBILL_DOCUMENT_ROOT.'/apps/billing/lib/billing.php') && $this->getConfigValue('apps.billing.enable')==1){ $this->template->assert('apps_billing', 'on'); $this->template->assert('per_day_price', $this->getConfigValue('vip_cost')); $this->template->assert('per_day_price_premium', $this->getConfigValue('premium_cost')); $this->template->assert('ups_price', $this->getConfigValue('ups_price')); $this->template->assert('per_day_price_bold', $this->getConfigValue('bold_cost')); $this->template->assert('now', time()); $this->grid_vip_right(); }else{ $this->template->assert('apps_billing', 'off'); $this->grid_special_right(); } $this->template->assert('base', SITEBILL_MAIN_URL); $this->template->assert('show_demo_banners', $this->getConfigValue('show_demo_banners')); $this->template->assert('REQUEST_URI', $_SERVER['REQUEST_URI']); $this->template->assert('type_list2', ''); $this->template->assert('type_list3', ''); $this->template->assert('title', $this->getConfigValue('site_title')); $this->template->assert('city_by_default', $this->getConfigValue('city')); $this->template->assert('estate_folder', $folder); $this->template->assert('right_column', 1); $this->template->assert('structure_box', $Structure_Manager->getCategorySelectBoxWithName('topic_id', $this->getRequestValue('topic_id') )); require_once(SITEBILL_DOCUMENT_ROOT.'/apps/system/lib/system/user/login.php'); $Login = new Login(); if ( preg_match('/^logout(\/?)$/', $REQUESTURIPATH) ) { require_once(SITEBILL_DOCUMENT_ROOT.'/apps/system/lib/system/user/logout.php'); $Logout = new Logout; $Logout->main(); } $this->template->assert('user_id', $Login->getSessionUserId()); $this->template->assert('user_menu', $Login->getUserMenu()); if ( $this->getConfigValue('allow_register_account') ) { require_once(SITEBILL_DOCUMENT_ROOT.'/apps/system/lib/admin/users/user_object_manager.php'); require_once(SITEBILL_DOCUMENT_ROOT.'/apps/system/lib/system/user/register_using_model.php'); $Register = new Register_Using_Model(); $rs1 = $Register->getRegisterFormElements(); $this->template->assert('register_form_elements', $rs1); } /* if ( $_SERVER['REQUEST_URI'] == '/' ) { $this->grid_special(); } */ //$this->grid_special_right(); /* if ( $_SERVER['REQUEST_URI'] == '/' and ($page_array = $this->getPageByURI('/index.html')) ) { } else { $page_array = $this->getPageByURI($_SERVER['REQUEST_URI']); } if ( $page_array ) { $this->template->assert('main', $page_array['body']); $this->template->assert('title', $page_array['title']); $this->template->assert('meta_keywords', $page_array['meta_keywords']); $this->template->assert('meta_description', $page_array['meta_description']); $this->template->render(); $rs = $this->template->toHTML(); return $rs; } */ if($this->getConfigValue('apps.freeorder.enable')==1){ require_once SITEBILL_DOCUMENT_ROOT.'/apps/freeorder/admin/admin.php'; require_once SITEBILL_DOCUMENT_ROOT.'/apps/freeorder/site/site.php'; $FreeOrder=new freeorder_site(); $this->template->assert('freeorder_form', $FreeOrder->getForm()); $this->template->assert('freeorder_on', 'yes'); }else{ $this->template->assert('freeorder_on', 'no'); } $this->template->assert('meta_keywords', ''); $this->template->assert('meta_description', ''); if ( !$has_result && preg_match('/^myfavorites/', $REQUESTURIPATH) ) { $this->template->assert('main', '<p><br></p>'.$this->grid_adv_favorites()); $work_subcontroller='realtygrid'; $has_result=true; } if ( !$has_result && preg_match('/^robox/', $REQUESTURIPATH) ) { require_once(SITEBILL_DOCUMENT_ROOT.'/apps/system/lib/system/robokassa/robokassa.php'); $robokassa = new Robox(); $rs = $robokassa->main(); if ( preg_match('/^robox\/result/', $REQUESTURIPATH) ) { echo $rs; exit; } $this->template->assert('main', $rs); $work_subcontroller='robox'; $has_result=true; } if ( !$has_result && preg_match('/^map(\/(\?.*)?)?$/', $REQUESTURIPATH) ) { $this->template->assert('main', '<p><br></p>'.$this->map()); $work_subcontroller='realtygrid'; $has_result=true; } if ( !$has_result && preg_match('/^map_full_screen(\/(\?.*)?)?$/', $REQUESTURIPATH) ) { $this->template->assert('data', $this->map(true)); $work_subcontroller='realtygrid'; $has_result=true; } if ( $this->getConfigValue('apps.geodata.on_home') and $_SERVER['REQUEST_URI'] == SITEBILL_MAIN_URL.'/' ) { $this->template->assert('geodata_on_home', 1); $this->template->assert('_geo_data', $this->map(true)); } if ( !$has_result && preg_match('/^goroda\//', $REQUESTURIPATH) ) { $city=$this->getCityListTr(); $topic=$this->getTopicListTr(); if(count($city)>0 && count($topic)>0){ foreach($city as $c){ foreach($topic as $t){ $rs.='<a href="/'.$c['translit_name'].'-'.$t['translit_name'].'.html">'.$c['name'].' ('.$t['name'].')</a><br />'; } } } $this->template->assert('main', $rs); $work_subcontroller='goroda'; $has_result=true; } if ( !$has_result && preg_match('/^register/', $REQUESTURIPATH) ) { if ( !$this->getConfigValue('allow_register_account') ) { $this->template->assert('main', 'Функция регистрации отключена администратором'); } else { require_once(SITEBILL_DOCUMENT_ROOT.'/apps/system/lib/admin/users/user_object_manager.php'); require_once(SITEBILL_DOCUMENT_ROOT.'/apps/system/lib/system/user/register_using_model.php'); $Register = new Register_Using_Model(); $rs1 = $Register->main(); $this->template->assert('main', $rs1); } $work_subcontroller='register'; $has_result=true; } if ( !$has_result && preg_match('/^remind/', $REQUESTURIPATH) ) { if ( !$this->getConfigValue('allow_remind_password') ) { $this->template->assert('main', 'Функция напоминания пароля отключена администратором'); } else { require_once(SITEBILL_DOCUMENT_ROOT.'/apps/system/lib/system/user/user.php'); require_once(SITEBILL_DOCUMENT_ROOT.'/apps/system/lib/system/user/remind.php'); $remind = new Remind; $this->template->assert('main', $remind->main()); } $work_subcontroller='register'; $has_result=true; } if ( !$has_result && preg_match('/^login/', $REQUESTURIPATH) ) { $this->template->assert('main', $Login->main()); if ( $Login->getSessionUserId() > 0 ) { $this->template->assert('auth_menu', $Login->getAuthMenu()); } $work_subcontroller='login'; $has_result=true; } if ( !$has_result && preg_match('/^add(\/?)$/', $REQUESTURIPATH) ) { require_once(SITEBILL_DOCUMENT_ROOT.'/apps/system/lib/admin/object_manager.php'); require_once(SITEBILL_DOCUMENT_ROOT.'/apps/system/lib/frontend/form/add.php'); $user_add = new User_Add(); $this->template->assert('main', $user_add->main()); $work_subcontroller='add'; $has_result=true; } if ( !$has_result && preg_match('/^ipotekaorder/', $REQUESTURIPATH) ) { require_once(SITEBILL_DOCUMENT_ROOT.'/apps/system/lib/admin/object_manager.php'); require_once(SITEBILL_DOCUMENT_ROOT.'/apps/system/lib/frontend/form/ipoteka.php'); $ipoteka_order = new Ipoteka_Order_Form(); $this->template->assert('main', $ipoteka_order->main()); $work_subcontroller='ipotekaorder'; $has_result=true; } if ( !$has_result && preg_match('/^contactus/', $REQUESTURIPATH) ) { require_once(SITEBILL_DOCUMENT_ROOT.'/apps/system/lib/admin/object_manager.php'); require_once(SITEBILL_DOCUMENT_ROOT.'/apps/system/lib/frontend/form/contactus.php'); $contactus_form = new contactus_Form(); $this->template->assert('main', $contactus_form->main()); $work_subcontroller='contactus'; $has_result=true; } if ( !$has_result && preg_match('/^land\//', $REQUESTURIPATH) ) { require_once('lib/admin/land/land_manager.php'); require_once('lib/frontend/land/land_front.php'); $land_front = new Land_Front(); $this->template->assert('main', $land_front->main()); $this->template->assert('search_form', $land_front->getSearchForm()); $this->template->render(); $rs = $this->template->toHTML(); return $rs; } if(!$has_result){ $apps_processor->run_frontend(); if ( count($apps_processor->get_executed_apps()) > 0 ) { $work_subcontroller='apps'; $has_result=true; } } /*if ( preg_match('/\/getrent\//', $_SERVER['REQUEST_URI']) ) { require_once (SITEBILL_DOCUMENT_ROOT.'/apps/getrent/admin/admin.php'); require_once (SITEBILL_DOCUMENT_ROOT.'/apps/getrent/site/site.php'); $getrent_site = new getrent_site(); $getrent_site->frontend(); $this->template->render(); $rs = $this->template->toHTML(); return $rs; }*/ if ( !$has_result && preg_match('/^account/', $REQUESTURIPATH) ) { $this->template->assert('right_column', ''); $this->template->assert('is_account', '1'); $this->template->assert('search_form_template', ''); //return; require_once(SITEBILL_DOCUMENT_ROOT.'/apps/system/lib/system/user/account.php'); $Account = new Account; if ( $Account->get_user_id() > 0 ) { $company_profile = $Account->get_company_profile($Account->get_user_id()); $this->template->assert('company', $company_profile); } $this->template->assert('breadcrumbs', $this->get_breadcrumbs( array( '<a href="'.$folder.'/">'.Multilanguage::_('L_HOME').'</a>', '<a href="'.$folder.'/account/">Личный кабинет</a>' ))); if ( preg_match('/^account\/profile/', $REQUESTURIPATH) ) { require_once(SITEBILL_DOCUMENT_ROOT.'/apps/system/lib/system/user/profile.php'); require_once(SITEBILL_DOCUMENT_ROOT.'/apps/system/lib/system/user/profile_using_model.php'); $profile = new User_Profile_Model(); $this->template->assert('breadcrumbs', $this->get_breadcrumbs( array( '<a href="'.$folder.'/">'.Multilanguage::_('L_HOME').'</a>', '<a href="'.$folder.'/account/">Личный кабинет</a>', '<a href="'.$folder.'/account/profile/">Профиль</a>' ))); $this->template->assert('main', $profile->main()); } elseif ( preg_match('/^account\/balance/', $REQUESTURIPATH) ) { $this->template->assert('breadcrumbs', $this->get_breadcrumbs( array( '<a href="'.$folder.'/">'.Multilanguage::_('L_HOME').'</a>', '<a href="'.$folder.'/account/">Личный кабинет</a>', '<a href="'.$folder.'/account/balance/">Баланс</a>' ))); $this->template->assert('main', $Account->main()); } elseif ( preg_match('/^account\/user/', $REQUESTURIPATH) ) { if ( $this->getConfigValue('apps.company.enable') ) { $this->template->assert('breadcrumbs', $this->get_breadcrumbs( array( '<a href="'.$folder.'/">'.Multilanguage::_('L_HOME').'</a>', '<a href="'.$folder.'/account/">Личный кабинет</a>', '<a href="'.$folder.'/account/user/">Риелторы</a>' ))); require_once(SITEBILL_DOCUMENT_ROOT.'/apps/system/lib/admin/users/user_object_manager.php'); require_once(SITEBILL_DOCUMENT_ROOT.'/apps/system/lib/frontend/user/user_company_manager.php'); $user_company_manager = new User_Company_Manager(); $this->template->assert('main', $user_company_manager->frontend_main()); } } else { $this->template->assert('breadcrumbs', $this->get_breadcrumbs( array( '<a href="'.$folder.'/">'.Multilanguage::_('L_HOME').'</a>', '<a href="'.$folder.'/account/">Личный кабинет</a>', '<a href="'.$folder.'/account/data/">Мои объявления</a>' ))); if(preg_match('/add/', $REQUESTURIPATH)){ require_once(SITEBILL_DOCUMENT_ROOT.'/apps/system/lib/admin/sitebill_krascap_admin.php'); require_once(SITEBILL_DOCUMENT_ROOT.'/apps/system/lib/admin/sitebill_krascap_editor.php'); require_once(SITEBILL_DOCUMENT_ROOT.'/apps/system/lib/system/user/data/user_data.php'); $user_data_manager = new User_Data_Manager(); $this->template->assert('main', $user_data_manager->add()); }else{ require_once(SITEBILL_DOCUMENT_ROOT.'/apps/system/lib/admin/sitebill_krascap_admin.php'); require_once(SITEBILL_DOCUMENT_ROOT.'/apps/system/lib/admin/sitebill_krascap_editor.php'); require_once(SITEBILL_DOCUMENT_ROOT.'/apps/system/lib/system/user/data/user_data.php'); $user_data_manager = new User_Data_Manager(); $this->template->assert('main', $user_data_manager->main()); } } $work_subcontroller='account'; $has_result=true; } if(!$has_result && $this->isRealtyDetected($REQUESTURIPATH)){ $work_subcontroller='realtyview'; $has_result=true; } if(preg_match('/user(\d+).html/', $_SERVER['REQUEST_URI'], $matches)){ $this->setRequestValue('user_id', (int)$matches[1]); $this->template->assert('main', '<p><br></p>'.$this->grid_adv()); $work_subcontroller='realtygrid'; $has_result=true; } elseif( $this->getRequestValue('do') == 'news' ) { $this->template->assert('main', $this->viewNews( $this->getRequestValue('news_id') )); } elseif( $this->getRequestValue('do') == 'buy' ) { $this->template->assert('main', $this->processAdvancedForm('buy')); } elseif( $this->getRequestValue('do') == 'rent' ) { $this->template->assert('main', $this->processAdvancedForm('rent')); } elseif ( $this->getRequestValue('view') != '' ) { $this->template->assert('main', $this->getPage($this->getRequestValue('view'))); } else { if($this->getConfigValue('apps.realtypro.enable')!=1){ if(!$has_result){ $work_subcontroller='realtygrid'; $this->template->assert('main', '<p><br></p>'.$this->grid_adv()); } } } if($work_subcontroller!=='' && isset($layouts[$work_subcontroller])){ $this->template->assert('_layout', $layouts[$work_subcontroller]); }else{ $this->template->assert('_layout', $layouts['_default']); } $this->template->render(); $rs = $this->template->toHTML(); return $rs; } function grid_vip_right () { require_once SITEBILL_DOCUMENT_ROOT.'/apps/system/lib/frontend/grid/grid_constructor.php'; $grid_constructor = new Grid_Constructor(); $params['vip'] = '1'; $url_params=$this->_detectUrlParams($server_request_uri); $params['topic_id'] = $url_params['topic_id']; $grid_constructor->vip_right($params); } function isRealtyDetected($requesturi){ $result=false; $unknown_address=false; if(!$result && 1==$this->getConfigValue('apps.seo.data_alias_enable')){ $url_string_parts=explode('/',$requesturi); if(count($url_string_parts)>0){ $possible_alias=$url_string_parts[count($url_string_parts)-1]; $possible_alias=preg_replace('/[^A-Za-z0-9_-]/','',urldecode($possible_alias)); if($possible_alias!=''){ $q="SELECT id FROM ".DB_PREFIX."_data WHERE translit_alias='".$possible_alias."'"; $this->db->exec($q); if($this->db->success){ $this->db->fetch_assoc(); if((int)$this->db->row['id']>0){ $realty_id=(int)$this->db->row['id']; $this->growCounter('data', 'id', $realty_id, $this->getSessionUserId()); //require_once(SITEBILL_DOCUMENT_ROOT.'/apps/system/lib/frontend/view/kvartira_view.php'); //$kvartira_view = new Kvartira_View();require_once(SITEBILL_DOCUMENT_ROOT.'/apps/system/lib/frontend/view/kvartira_view.php');require_once(SITEBILL_DOCUMENT_ROOT.'/template/frontend/agency/main/view/local_kvartira_view.php');$kvartira_view = new Local_Kvartira_View(); if($html=$kvartira_view->main($realty_id)){ $this->template->assert('main', $kvartira_view->main($realty_id)); $result=true; } } } } } } if ( !$result && preg_match('/realty/', $requesturi) ) { if(1==$this->getConfigValue('apps.seo.level_enable') && preg_match('/^realty/', $requesturi)){ $realty_id = $this->getIDfromURI($requesturi); if($realty_id){ $query='SELECT topic_id FROM '.DB_PREFIX.'_data WHERE id='.$realty_id; $this->db->exec($query); $this->db->fetch_assoc(); $topic_id=$this->db->row['topic_id']; //echo $topic_id; require_once(SITEBILL_DOCUMENT_ROOT.'/apps/system/lib/admin/structure/structure_manager.php'); $Structure_Manager = new Structure_Manager(); $category_structure = $Structure_Manager->loadCategoryStructure(); if($category_structure['catalog'][$topic_id]['url']!=''){ $parent_category_url=$category_structure['catalog'][$topic_id]['url'].'/'; }else{ $parent_category_url=''; } if(1==$this->getConfigValue('apps.seo.html_prefix_enable')){ $new_location=SITEBILL_MAIN_URL.'/'.$parent_category_url.'realty'.$realty_id.'.html'; }else{ $new_location=SITEBILL_MAIN_URL.'/'.$parent_category_url.'realty'.$realty_id; } header('HTTP/1.1 301 Moved Permanently'); header('Location: '.$new_location); } }elseif(1==$this->getConfigValue('apps.seo.level_enable') && !preg_match('/^realty/', $requesturi)){ $realty_id = $this->getIDfromURI($requesturi); require_once(SITEBILL_DOCUMENT_ROOT.'/apps/system/lib/frontend/view/kvartira_view.php'); $kvartira_view = new Kvartira_View(); $html=$kvartira_view->main($realty_id); if($html){ $this->growCounter('data', 'id', $realty_id, $this->getSessionUserId()); $this->template->assert('main', $html); $result=true; } } elseif(0==$this->getConfigValue('apps.seo.level_enable') && preg_match('/^realty/', $requesturi)){ $realty_id = $this->getIDfromURI($_SERVER['REQUEST_URI']); require_once(SITEBILL_DOCUMENT_ROOT.'/apps/system/lib/frontend/view/kvartira_view.php'); $kvartira_view = new Kvartira_View(); $html=$kvartira_view->main($realty_id); if($html){ $this->growCounter('data', 'id', $realty_id, $this->getSessionUserId()); $this->template->assert('main', $html); $result=true; } } } return $result; } /* private function getDataS(){ global $smarty; require_once SITEBILL_DOCUMENT_ROOT.'/apps/system/lib/frontend/grid/grid_constructor.php'; $grid_constructor = new Grid_Constructor(); $DBC=DBC::getInstance(); $query='SELECT * FROM re_country'; $stmt=$DBC->query($query); $countries=array(); if($stmt){ while($ar=$DBC->fetch($stmt)){ $countries[$ar['country_id']]=$ar; } } foreach($countries as $c){ $ra[$c['country_id']]=$grid_constructor->get_sitebill_adv_ext_base(array('country_id'=>$c['country_id'], 'page_limit'=>1000), false, false); } foreach($ra as $k=>$v){ $smarty->assign('title', $countries[$k]['name']); $smarty->assign('grid_items', $ra[$k]); $html.=$smarty->fetch('gd.tpl'); } $ra=array(); $query='SELECT * FROM re_city'; $stmt=$DBC->query($query); $cities=array(); if($stmt){ while($ar=$DBC->fetch($stmt)){ $cities[$ar['city_id']]=$ar; } } foreach($cities as $c){ $ra[$c['city_id']]=$grid_constructor->get_sitebill_adv_ext_base(array('city_id'=>$c['city_id'], 'page_limit'=>1000), false, false); } foreach($ra as $k=>$v){ $smarty->assign('title', $cities[$k]['name']); $smarty->assign('grid_items', $ra[$k]); $html.=$smarty->fetch('gd.tpl'); } echo $html; }*/}?>kvartira_view.php тот который создавали class Local_Kvartira_View extends Kvartira_View { protected function makeUserOperatios($form_data_shared){ $text=strip_tags($form_data_shared['text']['value']); $text_parts=explode(' ', $text); $text_parts=array_slice($text_parts, 0, 50); $this->template->assign('meta_description', implode(' ', $text_parts)); }}
-
<?php /** * Kvartira view * @author Kondin Dmitriy <kondin@etown.ru> http://www.sitebill.ru */ class Kvartira_View extends SiteBill { /** * Constructor */ function __construct() { $this->SiteBill(); } /** * Main * @param int $realty_id realty id * @return mixed */ function main ( $realty_id ) { $result=false; require_once(SITEBILL_DOCUMENT_ROOT.'/apps/system/lib/model/model.php'); require_once(SITEBILL_DOCUMENT_ROOT.'/apps/system/lib/admin/structure/structure_manager.php'); require_once(SITEBILL_DOCUMENT_ROOT.'/apps/system/lib/admin/users/user_object_manager.php'); $Structure_Manager = new Structure_Manager(); $category_structure = $Structure_Manager->loadCategoryStructure(); $user_object_manager = new User_Object_Manager(); $data_model = new Data_Model(); //$m=$data_model->init_model_data_from_db2('data', 'id', $realty_id); /*echo '<pre>'; print_r($m); echo '</pre>';*/ //load Data model with rules $form_data = $data_model->get_kvartira_model(false, false); //load Data model full without rules $form_data_shared = $data_model->get_kvartira_model(false, true); //init lang variables $form_data_language = $data_model->get_kvartira_model(false, true); //load User model with rules $form_user = $user_object_manager->get_user_model(); //init Data model with rules $form_data = $data_model->init_model_data_from_db ( 'data', 'id', $realty_id, $form_data['data'], true ); //init lang variables $form_data_language = $data_model->init_model_data_from_db ( 'data', 'id', $realty_id, $form_data_language['data'], true ); //init Data model full without rules $form_data_shared = $data_model->init_model_data_from_db ( 'data', 'id', $realty_id, $form_data_shared['data'], true ); if(!$form_data){ return $result; } if(isset($form_data_shared['active']) && $form_data_shared['active']['value']==0){ header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found'); $this->template->assign('main_file_tpl', 'error_message.tpl'); return false; //return $result; } $result=true; $form_data = $data_model->init_language_values($form_data, $form_data_language); foreach($form_data_shared as $k=>$item){ if($item['type']=='geodata' && 1==$this->getConfigValue('apps.geodata.enable') && 1==$this->getConfigValue('apps.geodata.allow_view_coding')){ if($item['value']['lat']=='' && $item['value']['lng']=='' && file_exists(SITEBILL_DOCUMENT_ROOT.'/apps/geodata/admin/admin.php') && 1==$this->getConfigValue('apps.geodata.enable')){ require_once SITEBILL_DOCUMENT_ROOT.'/apps/geodata/admin/admin.php'; if(method_exists('geodata_admin', 'geocode_address')){ $address_array=array(); if(isset($form_data_shared['country_id']) && $form_data_shared['country_id']['value_string']!=''){ $address_array[]=$form_data_shared['country_id']['value_string']; } if(isset($form_data_shared['region_id']) && $form_data_shared['region_id']['value_string']!=''){ $address_array[]=$form_data_shared['region_id']['value_string']; } if(isset($form_data_shared['city_id']) && $form_data_shared['city_id']['value_string']!=''){ $address_array[]=$form_data_shared['city_id']['value_string']; if(isset($form_data_shared['street_id']) && $form_data_shared['street_id']['value_string']!=''){ $address_array[]=$form_data_shared['street_id']['value_string']; if(isset($form_data_shared['number']) && $form_data_shared['number']['value']!=''){ $address_array[]=$form_data_shared['number']['value']; } } } $data=geodata_admin::geocode_address(implode(', ', $address_array)); if($data && $data['lat']!='' && $data['lng']!=''){ $form_data_shared[$k]['value']['lat']=$data['lat']; $form_data_shared[$k]['value']['lng']=$data['lng']; $form_data[$k]['value']['lat']=$data['lat']; $form_data[$k]['value']['lng']=$data['lng']; $DBC=DBC::getInstance(); $query='UPDATE '.DB_PREFIX.'_data SET `'.$item['name'].'_lat`=?, `'.$item['name'].'_lng`=? WHERE id=?'; $stmt=$DBC->query($query, array($data['lat'], $data['lng'], $form_data_shared['id']['value'])); } } } break; } } //clearing by in topic activity $topic_id=0; if(isset($form_data['topic_id'])){ $topic_id=(int)$form_data['topic_id']['value']; } if($topic_id!=0){ foreach ( $form_data as $key => $item_array ) { if($topic_id!=0 && isset($item_array['active_in_topic']) && $item_array['active_in_topic']!=0){ $active_array_ids = explode(',',$item_array['active_in_topic']); $child_cats = array(); foreach ($active_array_ids as $item_id => $check_active_id) { $child_cats_compare = $Structure_Manager->get_all_childs($check_active_id, $category_structure); if ( is_array($child_cats_compare) ) { $child_cats = array_merge($child_cats, $child_cats_compare); } $child_cats[]=$check_active_id; } if(!in_array($topic_id, $child_cats)){ unset($form_data[$key]); continue; } } } } //load user data. always available! if($this->getConfigValue('apps.realtypro.show_contact.enable')){ $form_user = $data_model->init_model_data_from_db ( 'user', 'user_id', $form_data_shared['user_id']['value'], $form_user['user'], true); }else{ $form_user = $data_model->init_model_data_from_db ( 'user', 'user_id', $form_data_shared['user_id']['value'], $form_user['user'], true); } /* if($this->getConfigValue('apps.realtypro.show_contact.enable')){ $form_user = $data_model->init_model_data_from_db ( 'user', 'user_id', $form_data['user_id']['value'], $form_user['user'], true); }else{ $form_user = $data_model->init_model_data_from_db ( 'user', 'user_id', $form_data['user_id']['value'], $form_user['user'], true); } */ if(isset($form_data['date_added']) && $form_data['date_added']['value']!=''){ $form_data['date_added']['value_string']=date('d-m-Y', strtotime($form_data['date_added']['value'])); } if ( $this->getConfigValue('apps.company.timelimit') ) { $current_time = time(); $query = "select re_data.* from re_data, re_user u, re_company c where re_data.id=$realty_id and re_data.user_id=u.user_id and u.company_id=c.company_id and c.start_date <= $current_time and c.end_date >= $current_time"; $this->db->exec($query); $this->db->fetch_assoc(); if ( $this->db->row['id'] == '' ) { header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found'); $this->template->assign('error_message', 'Страница не найдена. 404 not found'); $this->template->assign('main_file_tpl', 'error_message.tpl'); return false; } } if ( $this->getConfigValue('apps.company.enable') ) { require_once (SITEBILL_DOCUMENT_ROOT.'/apps/company/admin/admin.php'); $company_admin = new company_admin(); $company_profile = $company_admin->load_by_id($form_user['company_id']['value']); if ( $company_profile ) { $this->template->assign('company_profile', $company_profile); } $this->template->assign('user_company_data', $company_admin->getUserCompanyData($form_user['user_id']['value'])); } if(isset($form_data['topic_id'])){ $form_data['topic_id']['value_string']=$category_structure['catalog'][$form_data['topic_id']['value']]['name']; } $this->template->assert('hvd_tabbed', $this->getAutoOutputData($form_data)); require_once SITEBILL_DOCUMENT_ROOT.'/apps/currency/admin/admin.php'; $CA=new currency_admin(); //append similar advs if(method_exists($this, 'getCustomSimilarData')){ $this->template->assign('similar_data', $this->getCustomSimilarData($category_structure, $form_data_shared)); }else{ $simparams=array( 'id'=>(int)$form_data['id']['value'], 'topic_id'=>(int)$form_data['topic_id']['value'], 'city_id'=>(int)$form_data['city_id']['value'], 'district_id'=>(int)$form_data['district_id']['value'], 'street_id'=>(int)$form_data['street_id']['value'], ); $this->template->assign('similar_data', $this->getSimilar($category_structure, $simparams)); } if($form_user['login']['value']=='_unregistered'){ $form_user['fio']['value']=$form_data['fio']['value']; $form_user['phone']['value']=$form_data['phone']['value']; } if($this->getConfigValue('use_google_map')){ $this->template->assign('map_type', 'google'); } $this->template->assign('admin_user_id', $this->getAdminUserId()); $this->template->assign('current_user_id', $this->getSessionUserId()); $this->template->assign('photo', $form_data['image']['image_array']); $this->template->assign('user_data', $form_user); //$this->template->assign('yandex_map_key', $this->getConfigValue('yandex_map_key')); //$this->template->assign('pmap', $this->getConfigValue('pmap')); $params['topic_id'] = (int)$form_data['topic_id']['value']; $breadcrumbs=$this->getBreadcrumbs($params); $this->template->assign('realty_breadcrumbs', explode(' / ', $breadcrumbs)); $this->template->assign('breadcrumbs', $breadcrumbs ); $hasTlocation=false; $tlocationElement=''; foreach($form_data as $key=>$val){ if($val['type']=='tlocation'){ //print_r($val); $hasTlocation=true; $tlocationElement=$key; $form_data['country_id']['value_string']=$val['value_string']['country_id']; $form_data['region_id']['value_string']=$val['value_string']['region_id']; $form_data['city_id']['value_string']=$val['value_string']['city_id']; $form_data['district_id']['value_string']=$val['value_string']['district_id']; $form_data['street_id']['value_string']=$val['value_string']['street_id']; $form_data_shared['country_id']['value_string']=$val['value_string']['country_id']; $form_data_shared['region_id']['value_string']=$val['value_string']['region_id']; $form_data_shared['city_id']['value_string']=$val['value_string']['city_id']; $form_data_shared['district_id']['value_string']=$val['value_string']['district_id']; $form_data_shared['street_id']['value_string']=$val['value_string']['street_id']; } } $this->template->assign('data', $form_data); $this->template->assign('data_shared', $form_data_shared); $meta_data=$this->getMetaData($form_data_shared, $hasTlocation, $tlocationElement); $this->template->assign('meta_title', $meta_data['meta_title']); $this->template->assign('title', $meta_data['title']); $this->template->assign('meta_description', $meta_data['meta_description']); $this->template->assign('meta_keywords',$meta_data['meta_keywords']); if(1==$this->getConfigValue('apps.comment.enable')){ require_once SITEBILL_DOCUMENT_ROOT.'/apps/comment/admin/admin.php'; require_once SITEBILL_DOCUMENT_ROOT.'/apps/comment/site/site.php'; $CoM=new comment_site(); require_once(SITEBILL_DOCUMENT_ROOT.'/apps/system/lib/system/user/login.php'); $Login = new Login(); $user_id=(int)$Login->getSessionUserId(); $commentsPanel=$CoM->generateCommentPanel($user_id, 'data', $realty_id); } $this->template->assert('geoobjects_collection_clustered', json_encode($this->getRealtyOnMap($form_data))); if ( $this->getConfigValue('theme') != 'estate' and !file_exists(SITEBILL_DOCUMENT_ROOT.'/template/frontend/'.$this->getConfigValue('theme').'/realty_view.tpl') ) { $this->template->assign('main_file_tpl', '../estate/realty_view.tpl'); } else { $this->template->assign('main_file_tpl', 'realty_view.tpl'); } $this->makeUserOperatios($form_data_shared); $this->makePDF($realty_id); return $result; } protected function makeUserOperatios($form_data_shared){ } protected function makePDF($realty_id){ if(1==(int)$this->getConfigValue('apps.pdfreport.enabled') && $_GET['format']=='pdf'){ $this->template->assign('_core_folder', SITEBILL_DOCUMENT_ROOT); $pdf_file_name='realty'.$realty_id.'.pdf'; $pdf_file_storage=SITEBILL_DOCUMENT_ROOT.'/cache/'; if(0==(int)$this->getConfigValue('apps.pdfreport.use_cache')){ require_once(SITEBILL_DOCUMENT_ROOT."/apps/pdfreport/lib/dompdf/dompdf_config.inc.php"); //$tmpfile = tempnam(SITEBILL_DOCUMENT_ROOT.'/cache/', 'dompdf_'); global $smarty; if(file_exists(SITEBILL_DOCUMENT_ROOT.'/template/frontend/'.$this->getConfigValue('theme').'/apps/pdfreport/realty_view.tpl')){ $html = $smarty->fetch(SITEBILL_DOCUMENT_ROOT.'/template/frontend/'.$this->getConfigValue('theme').'/apps/pdfreport/realty_view.tpl'); }else{ $html = $smarty->fetch(SITEBILL_DOCUMENT_ROOT.'/apps/pdfreport/admin/template/realty_view.tpl'); } $dompdf = new DOMPDF(); $dompdf->load_html($html); $dompdf->render(); $output = $dompdf->output(); //header("Content-type: application/pdf"); //echo $output; //file_put_contents(SITEBILL_DOCUMENT_ROOT.'/cache/'.$pdf_file_name, $output); }else{ if(file_exists($pdf_file_storage.$pdf_file_name)){ $output=file_get_contents(SITEBILL_DOCUMENT_ROOT.'/cache/'.$pdf_file_name); }else{ require_once(SITEBILL_DOCUMENT_ROOT."/apps/pdfreport/lib/dompdf/dompdf_config.inc.php"); $tmpfile = tempnam(SITEBILL_DOCUMENT_ROOT.'/cache/', 'dompdf_'); global $smarty; if(file_exists(SITEBILL_DOCUMENT_ROOT.'/template/frontend/'.$this->getConfigValue('theme').'/apps/pdfreport/realty_view.tpl')){ $html = $smarty->fetch(SITEBILL_DOCUMENT_ROOT.'/template/frontend/'.$this->getConfigValue('theme').'/apps/pdfreport/realty_view.tpl'); }else{ $html = $smarty->fetch(SITEBILL_DOCUMENT_ROOT.'/apps/pdfreport/admin/template/realty_view.tpl'); } $dompdf = new DOMPDF(); $dompdf->load_html($html); $dompdf->render(); $output = $dompdf->output(); file_put_contents(SITEBILL_DOCUMENT_ROOT.'/cache/'.$pdf_file_name, $output); //$output=file_get_contents(SITEBILL_DOCUMENT_ROOT.'/cache/'.$pdf_file_name); } } header("Content-type: application/pdf"); echo $output; exit(); } } public function getPublicAutoOutputData($form_data){ return $this->getAutoOutputData($form_data); } protected function getAutoOutputData($form_data){ $hvd_tabbed=array(); foreach($form_data as $hvd){ if($hvd['tab']==''){ $hvd_tabbed[$this->getConfigValue('default_tab_name')][]=$hvd; }else{ $hvd_tabbed[$hvd['tab']][]=$hvd; } } return $hvd_tabbed; } protected function getRealtyOnMap($form_data){ $gdata=array(); $geoobjects_collection=array(); $gd=array(); foreach ($form_data as $key=>$value){ if($key=='city_id'){ $gd['city']=SiteBill::iconv(SITE_ENCODING, 'utf-8', $value['value_string']); }elseif($key=='street_id'){ $gd['street']=SiteBill::iconv(SITE_ENCODING, 'utf-8', $value['value_string']); }elseif($key=='price'){ $gd['price']=$value['value']; }elseif($key=='topic_id'){ $gd['type_sh']=SiteBill::iconv(SITE_ENCODING, 'utf-8', $value['value_string']); }else{ $gd[$key]=$value['value']; } } if(file_exists(SITEBILL_DOCUMENT_ROOT.'/template/frontend/'.$this->getConfigValue('theme').'/realty_on_map.tpl')){ global $smarty; $smarty->assign('realty', $gd); $html=$smarty->fetch(SITEBILL_DOCUMENT_ROOT.'/template/frontend/'.$this->getConfigValue('theme').'/realty_on_map.tpl'); $html = str_replace("\r\n", ' ', $html); $html = str_replace("\n", ' ', $html); $html = str_replace("\t", ' ', $html); $html = addslashes($html); }else{ $html = ''; } $gd['html']=SiteBill::iconv(SITE_ENCODING, 'utf-8', $html); $gd['href']='#'; if(isset($form_data['geo']) && $form_data['geo']['value']['lat']!='' && $form_data['geo']['value']['lng']!=''){ $gd['geo_lat']=$form_data['geo']['value']['lat']; $gd['geo_lng']=$form_data['geo']['value']['lng']; $gc=$gd['geo_lat'].'_'.$gd['geo_lng']; $geoobjects_collection[$gc]['html'].=$gd['html']; $geoobjects_collection[$gc]['count']++; $geoobjects_collection[$gc]['lat']=$gd['geo_lat']; $geoobjects_collection[$gc]['lng']=$gd['geo_lng']; } return $geoobjects_collection; } protected function formatPhoneNumber($num){ $parts=array(); $matches=array(); $num=preg_replace('/[^\d]/','',$num); //echo if(substr($num,0,1)=='8' && strlen($num)==11){ preg_match_all('/(\d*)(\d{3})(\d{3})(\d{2})(\d{2})$/',$num,$matches); }elseif(strlen($num)==11 || strlen($num)==10){ preg_match_all('/(\d*)(\d{3})(\d{3})(\d{2})(\d{2})$/',$num,$matches); }else{ preg_match_all('/(\d*)(\d{2})(\d{2})$/',$num,$matches); } for($i=1; $i<6; $i++){ if(isset($matches[$i]) && $matches[$i]!==''){ $parts[]=$matches[$i][0]; } } if(count($parts)>0){ return implode('-',$parts); }else{ return $num; } } protected function getSimilar($categories, $params=array()){ $similar_items_count=(0==(int)$this->getConfigValue('similar_items_count') ? 5 : (int)$this->getConfigValue('similar_items_count')); require_once(SITEBILL_DOCUMENT_ROOT.'/apps/system/lib/admin/structure/structure_manager.php'); $Structure_Manager = new Structure_Manager(); $category_structure = $Structure_Manager->loadCategoryStructure(); $ret=array(); $datas=array(); $where=array(); if(!empty($params)){ $ids[]=$params['id']; $where['active']='active=1'; if($params['street_id']!=0){ $where['street_id']='street_id='.$params['street_id']; } if($params['topic_id']!=0){ $where['topic_id']='topic_id='.$params['topic_id']; } if($params['city_id']!=0){ $where['city_id']='city_id='.$params['city_id']; } if($params['district_id']!=0){ $where['district_id']='district_id='.$params['district_id']; } if($params['id']!=0){ $where['id']='id NOT IN ('.implode(',',$ids).')'; } $q='SELECT id FROM '.DB_PREFIX.'_data'.(!empty($where) ? ' WHERE '.implode(' AND ',$where) : '').' LIMIT '.$similar_items_count; $this->db->exec($q); while($this->db->fetch_assoc()){ $ret[]=$this->db->row['id']; $ids[]=$this->db->row['id']; } if(count($ret)<$similar_items_count){ unset($where['district_id']); unset($where['street_id']); $where['id']='id NOT IN ('.implode(',',$ids).')'; $q='SELECT id FROM '.DB_PREFIX.'_data'.(!empty($where) ? ' WHERE '.implode(' AND ',$where) : '').' LIMIT '.$similar_items_count; $this->db->exec($q); while($this->db->fetch_assoc()){ $ret[]=$this->db->row['id']; $ids[]=$this->db->row['id']; } } if(count($ret)<$similar_items_count){ unset($where['city_id']); //unset($where['street_id']); $where['id']='id NOT IN ('.implode(',',$ids).')'; $q='SELECT id FROM '.DB_PREFIX.'_data'.(!empty($where) ? ' WHERE '.implode(' AND ',$where) : '').' LIMIT '.$similar_items_count; $this->db->exec($q); while($this->db->fetch_assoc()){ $ret[]=$this->db->row['id']; $ids[]=$this->db->row['id']; } } if(count($ret)<$similar_items_count){ $last=$similar_items_count-count($ret); unset($where['topic_id']); $where['id']='id NOT IN ('.implode(',',$ids).')'; $q='SELECT id FROM '.DB_PREFIX.'_data'.(!empty($where) ? ' WHERE '.implode(' AND ',$where) : '').' LIMIT '.$last; $this->db->exec($q); while($this->db->fetch_assoc()){ $ret[]=$this->db->row['id']; $ids[]=$this->db->row['id']; } } } require_once(SITEBILL_DOCUMENT_ROOT.'/apps/system/lib/model/model.php'); $data_model = new Data_Model(); $form_data = $data_model->get_kvartira_model(false, false); $hasTlocation=false; foreach($form_data['data'] as $key=>$val){ if($val['type']=='tlocation'){ $hasTlocation=true; $tlocationElement=$key; break; } } $i=0; foreach($ret as $r){ $form_data = $data_model->get_kvartira_model(false, false); $form_data = $data_model->init_model_data_from_db ( 'data', 'id', $r, $form_data['data'], true ); //print_r($form_data); $form_data['topic_id']['value_string']=$categories['catalog'][$form_data['topic_id']['value']]['name']; if(1==$this->getConfigValue('apps.seo.level_enable')){ if($category_structure['catalog'][$form_data['topic_id']['value']]['url']!=''){ $form_data['parent_category_url']=$category_structure['catalog'][$form_data['topic_id']['value']]['url'].'/'; }else{ $form_data['parent_category_url']=''; } }else{ $form_data['parent_category_url']=''; } if(1==$this->getConfigValue('apps.seo.data_alias_enable') && $form_data['translit_alias']['value']!=''){ $form_data['href']=SITEBILL_MAIN_URL.'/'.$form_data['parent_category_url'].$form_data['translit_alias']['value']; //$ra[$item_id]['href']=SITEBILL_MAIN_URL.'/'.$ra[$item_id]['parent_category_url'].$this->getTranslitAlias($ra[$item_id]['city'],$ra[$item_id]['street'],$ra[$item_id]['number']); }elseif(1==$this->getConfigValue('apps.seo.html_prefix_enable')){ $form_data['href']=SITEBILL_MAIN_URL.'/'.$form_data['parent_category_url'].'realty'.$form_data['id']['value'].'.html'; }else{ $form_data['href']=SITEBILL_MAIN_URL.'/'.$form_data['parent_category_url'].'realty'.$form_data['id']['value']; } if($hasTlocation){ $form_data['country_id']['value_string']=$form_data[$tlocationElement]['value_string']['country_id']; $form_data['region_id']['value_string']=$form_data[$tlocationElement]['value_string']['region_id']; $form_data['city_id']['value_string']=$form_data[$tlocationElement]['value_string']['city_id']; $form_data['district_id']['value_string']=$form_data[$tlocationElement]['value_string']['district_id']; $form_data['street_id']['value_string']=$form_data[$tlocationElement]['value_string']['street_id']; } $datas[]=$form_data; $i++; if($i==5){ break; } } /*echo '<pre>'; print_r($datas); echo '</pre>';*/ return $datas; } protected function getBreadcrumbs($params){ require_once(SITEBILL_DOCUMENT_ROOT.'/apps/system/lib/admin/structure/structure_manager.php'); $Structure_Manager = new Structure_Manager(); $category_structure = $Structure_Manager->loadCategoryStructure(); return $this->get_category_breadcrumbs( $params, $category_structure, SITEBILL_MAIN_URL.'/' ); } public function getPublicMetaData($form_data, $hasTlocation=false, $tlocationElement=''){ return $this->getMetaData($form_data, $hasTlocation, $tlocationElement); } protected function getMetaData($form_data, $hasTlocation=false, $tlocationElement=''){ require_once(SITEBILL_DOCUMENT_ROOT.'/apps/system/lib/admin/structure/structure_manager.php'); $Structure_Manager = new Structure_Manager(); $category_structure = $Structure_Manager->loadCategoryStructure(); $title=''; $meta_title=''; $meta_description=''; $meta_keywords=''; $params['topic_id']= $form_data['topic_id']['value']; if($hasTlocation){ $title=$this->get_category_breadcrumbs_string( $params, $category_structure, SITEBILL_MAIN_URL.'/' ).", ".$form_data[$tlocationElement]['tlocation_string'].", ".number_format($form_data['price']['value'],0,',',' '); }else{ //echo '<pre>'; //print_r($form_data); $title=$this->get_category_breadcrumbs_string( $params, $category_structure, SITEBILL_MAIN_URL.'/' ).", ".$form_data['city_id']['value_string'].", ".$form_data['street_id']['value_string'].", ".number_format($form_data['price']['value'],0,',',' '); } if($form_data['meta_title']['value']==''){ $meta_title=$title; }else{ $meta_title=$form_data['meta_title']['value']; } if($form_data['meta_description']['value']!=''){ $meta_description=$form_data['meta_description']['value']; } if($form_data['meta_keywords']['value']!=''){ $meta_keywords=$form_data['meta_keywords']['value']; } /* if($form_data['meta_title']['value']==''){ $this->template->assign('title', $form_data['topic_id']['value_string'].", ".$form_data['city_id']['value_string'].", ".$form_data['street_id']['value_string'].', цена: '.$form_data['price']['value'].' '.($form_data['currency_id']['value_string']=='' ? Multilanguage::_('L_RUR_SHORT') : $form_data['currency_id']['value_string']).' | '.$this->getConfigValue('site_title') ); }else{ $this->template->assign('title', $form_data['meta_title']['value']); } if($form_data['meta_description']['value']!=''){ $this->template->assign('meta_description', $form_data['meta_description']['value']); }else{ $this->template->assign('meta_description', $form_data['text']['value'].' '.$this->getConfigValue('site_title')); } if($form_data['meta_keywords']['value']!=''){ $this->template->assign('meta_keywords', $form_data['meta_keywords']['value']); }else{ $kw=array(); $kw[]=$this->getConfigValue('meta_keywords_main'); $kw[]=$form_data['optype']['value_string']; $kw[]=$form_data['topic_id']['value_string']; $kw[]=$form_data['city_id']['value_string']; $kw[]=$form_data['district_id']['value_string']; if($form_data['room_count']['value']>0){ $kw[]='комнат '.$form_data['room_count']['value']; } $kw=array_filter($kw); if(count($kw)>0){ $this->template->assign('meta_keywords', implode(', ', $kw)); }else{ $this->template->assign('meta_keywords', $this->getConfigValue('meta_keywords_main')); } } */ return array( 'title'=>$title, 'meta_title'=>$meta_title, 'meta_description'=>$meta_description, 'meta_keywords'=>$meta_keywords ); } } ?>
-
у меня вот тоже не получилось. Поясните с пункт 1-4 сделал как написано .. что конкретно писать в файл /template/frontend/имя_шаблона/main/view/kvartira_view.php там у нас такой текст class Local_Kvartira_View extends Kvartira_View {}если я правильно понял пункт 2б должно получиться в файле так? class Local_Kvartira_View extends Kvartira_View { protected function makeUserOperatios($form_data_shared){ $text=strip_tags($form_data_shared['text']['value']); $text_parts=explode(' ', $text); $text_parts=array_slice($text_parts, 0, 50); $this->template->assign('meta_description', implode(' ', $text_parts)); }}но после этих изменений нигде не происходит.. Извините если что не так сделал, не специалист. насколько я понимаю description должен заполняться на странице с конкретным объектом (квартирой)?
-
можно поподробнее создал я поле.. ввёл в базе доп поле.. переменная туда записывается при добавлении объявления. вопрос остался в поиске по данному полю.. можно подробнее описать как мне сделать допустим поиск только по id для пользователей очень удобно. на форуме уже нашёл аналогичную тему, но не получилось создать.. Если не сложно можно описать как.
-
А помочь кто-нибудь может?
-
При редактировании поле есть.. заполняешь его нужным id, но после сохранения остаётся всё равно старое id которое автоматом присвоил двиг.