public function init() { parent::init(); stat_collector::setStamp(); // stamp $this->uid = get_uid(); $this->is_adm = hasPermissions('tservices'); // разметка страницы с левым сайдбаром $this->layout = '//layouts/content-with-right-sidebar'; // в сайдбаре вывести фильтр с учётом текущей категории $this->getClips()->add('sidebar', $this->widget('TServiceFilter', array(), true)); // чтобы отрисовать фильтр и опции # TODO добиться, чтобы $this->widget('TServiceFilter') и $this->createWidget($this,'TServiceFilter') возвращал один и тот же объект $this->filter_widget = $this->createWidget($this, 'TServiceFilter', array()); // копия, чтобы узнать, какие опции были выбраны $prof_id = $this->filter_widget->filter->category ? $this->filter_widget->filter->category : $this->filter_widget->filter->category_group; //---------------------------------------------------------------------- //@todo: возможно нужно общее хранилище собираемых данных //в течении работы скрипта с последующей передачей в GA и Adriver? GaJsHelper::getInstance()->setTuCategories($this->filter_widget->filter->category_group, $this->filter_widget->filter->category); adriver::getInstance()->setTuCategories($this->filter_widget->filter->category_group, $this->filter_widget->filter->category); //---------------------------------------------------------------------- SeoTags::getInstance()->initTserviceList($prof_id, $this->filter_widget->filter->category > 0); $this->getClips()->add('header', $this->widget('TServiceNavigation', array('category_group' => $this->filter_widget->filter->category_group, 'category' => $this->filter_widget->filter->category, 'filter_get_params' => $this->filter_widget->getUserFriendlyUrl(false)), true)); $this->getClips()->add('content_top', $this->widget('TServiceCatalogHeader', array(), true)); $this->getClips()->add('categories', $this->widget('TServiceCatalogCategories', array('category_group' => $this->filter_widget->filter->category_group, 'filter_get_params' => $this->filter_widget->getUserFriendlyUrl(false)), true)); // в футере каталога вывести список специализаций фрилансеров $this->getClips()->add('footer', $this->widget('TServiceFreelancersCategories', array(), true)); $tserviceModel = TServiceModel::model(); $this->counter_users = $tserviceModel->countUsers(); $this->counter_tu = $tserviceModel->countTservices(); }
//проверить все варианты чтобы не делать повторные запросы! $ga_profs = array_merge(array($user->spec), $specs_add); if (isset($ga_profs) && count($ga_profs)) { $dimension = array(); $groups = array_unique(professions::GetGroupIdsByProfs($ga_profs)); foreach ($groups as $group) { if ($group > 0) { $dimension[] = '[g' . $group . ']'; } } foreach ($ga_profs as $prof) { if ($prof > 0) { $dimension[] = '[p' . $prof . ']'; } } GaJsHelper::getInstance()->gaSet('dimension2', implode(',', $dimension)); } break; case 'tu': if ((substr($user->tabs, 7, 1) == 0 || $hide_tu_for_others == TRUE) && !hasPermissions('users')) { include ABS_PATH . '/404.php'; exit; } $on_page = $user->is_pro === 't' ? 20 : 21; $js_file[] = 'tservices/fineuploader.js'; $js_file[] = 'tservices/tservices.js'; require_once $_SERVER['DOCUMENT_ROOT'] . '/tu/yii/tinyyii.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/tservices/functions.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/tservices/tservices_helper.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/tservices/tservices.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/tu/widgets/TServiceOrderDebtMessage.php';
//------------------------------------------------------------------------------ $page = intval(trim($_GET['page'])); if (!$page) { $page = 1; $bPageDefault = true; } elseif ($page == 1) { $sLocation = e_url('page'); header("HTTP/1.1 301 Moved Permanently"); header("Location: {$sLocation}"); exit(0); } elseif ($page < 1) { include ABS_PATH . '/404.php'; exit; } //------------------------------------------------------------------------------ GaJsHelper::getInstance()->setFrlCategories(array($prof_group_id, $prof_group_parent_id), $prof_id); adriver::getInstance()->setFrlCategories(array($prof_group_id, $prof_group_parent_id), $prof_id); //------------------------------------------------------------------------------ $section = intval($_GET['section']); $freelancer = new freelancer(); $freelancer_seo = new freelancer_seo($section); if (!$prof_id && !$prof_group_id) { // Подсчитываем количество избранных. Переписать в отдельный метод. // $fav_count = 0; $prof_name = "Все фри-лансеры"; $prof_type = false; $prof_group_name = ''; $prof_descr = ''; $prof_descr_text = ''; $page_title = "Удаленная работа%prepositional_cityname%. Фрилансеры%cityname%. Проекты от работодателей%cityname%."; $page_keyw = "фрилансер, free-lance, freelance, нужны сотрудники удаленно, онлайн фрилансер ру, найти специалиста, сайт фрилансеров, ищу сотрудника, фриланс дизайнер, бухгалтер на дому, юрист удаленно, программист, разработчик, seo оптимизатор, копирайт, рерайт";
echo $ga_uid; ?> '}); <?php GaJsHelper::getInstance()->gaSet('dimension5', $ga_uid); ?> <?php } else { ?> ga('create', '<?php echo GA_COUNTER_CODE; ?> ', 'auto'); <?php } ?> ga(function (tracker) { var clientId = tracker.get('clientId'); document.cookie = "_ga_cid=" + clientId + "; path=/"; ga('set', 'dimension1', clientId); }); <?php echo GaJsHelper::getInstance()->render(); ?> ga('require', 'displayfeatures'); ga('send', 'pageview'); </script>
unset($_SESSION['p_ref']); } $prfs = new professions(); $profs = $prfs->GetAllProfessions("", 0, 1); $uid = get_uid(!$action); $page = intval($_GET['page']); if ($page < 1) { $page = 1; $bPageDefault = true; } // фильтр, этот фильтр не подключаем в ПДА if (!$PDA) { if ($kind != 8) { $prj_filter = new projects_filters(); $filter = $prj_filter->GetFilter($uid, $error, $filter_page); GaJsHelper::getInstance()->setProjectsFilterCategory($filter['categories']); adriver::getInstance()->setProjectsFilterCategory($filter['categories']); $filter['state'] = 0; $filter_apply = $filter['active'] == "t"; // проекты $prj = new new_projects(); $prj_content = $prj->SearchDB($kind, $page, $filter || is_emp() || hasPermissions('projects') ? 0 : 1, $filter, false, true); //echo $prj_content;die; $prj_pos = strpos($prj_content, '<!--data_found-->'); } else { $filter_page = $kind * 10; $filter_params = array('kind' => isset($_GET['kind']) ? intval($_GET['kind']) : intval($_POST['kind'])); // Развернутость / свернутость фильтра. if (isset($_COOKIE['new_pf' . $filter_page])) { $filter_show = $_COOKIE['new_pf' . $filter_page]; } else {
$item_page = 1; } #if (!$_SESSION['uid'] && !$pass) { include("../fbd.php"); exit; } // Проект. $obj_project = new projects(); $project = $obj_project->GetPrjCust($prj_id); $projectObject = $obj_project->initData($project); if (!$project) { include '../404.php'; exit; } $project['descr'] = htmlspecialchars($project['descr'], ENT_QUOTES, 'CP1251', false); $is_owner = $project['user_id'] == $uid; $is_adm = hasPermissions('projects'); $project_specs = new_projects::getSpecs($prj_id); GaJsHelper::getInstance()->setProjectCategory($project_specs); //Если это перемещенная вакансия то редиректим владельца на редактивание //А посетителю 404 /* if ($projectObject->isNotPayedVacancy()) { if($is_owner) { $popup_param = $is_pro ? '' : '&popup=1'; header("Location: /public/?step=1&kind=4&public={$project['id']}{$popup_param}"); }elseif(!$is_adm) { include("../404.php"); exit; } } */ if ($is_owner && $projectObject->isProject() && !$projectObject->isPreferSbr()) { require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/Helpers/SubBarNotificationHelper.php';