本文整理汇总了PHP中is_pro函数的典型用法代码示例。如果您正苦于以下问题:PHP is_pro函数的具体用法?PHP is_pro怎么用?PHP is_pro使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了is_pro函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: indexAction
/**
* Вывод главной страницы
* Выводит главную страницу. По умолчанию Пополнить счет.
*/
public function indexAction()
{
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/wizard/wizard_billing.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/wizard/wizard.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/wizard/step_freelancer.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/wizard/step_employer.php';
unset($_SESSION['sum']);
front::og('tpl')->page = 'index';
if ($this->uri[0] == 'success.php') {
header('Location: /bill/success/');
exit;
}
front::og('tpl')->no_banner = is_pro() ? true : false;
$master = wizard_billing::getDraftAccountOperations($_SESSION['uid']);
if (!is_emp()) {
$pro_op_codes = step_freelancer::getOperationCodePRO();
foreach ($master as $pay) {
if (in_array($pay['op_code'], $pro_op_codes)) {
$is_pro = true;
$op_id = $pay['id'];
} elseif ($pay['op_code'] == step_freelancer::OFFERS_OP_CODE) {
$disabled[$pay['id']] = $pay['id'];
}
}
if (!$is_pro) {
unset($disabled);
}
if ($disabled) {
$str_disabled = implode(',', $disabled);
$dis[$op_id] = $str_disabled;
}
front::og('tpl')->pro_op_codes = $pro_op_codes;
front::og('tpl')->disabled = $disabled;
front::og('tpl')->dis = $dis;
front::og('tpl')->is_pay_pro = $is_pro;
} else {
foreach ($master as $pay) {
if ($pay['op_code'] == step_employer::OP_CODE_PRO) {
$is_pro = true;
$op_id = $pay['id'];
} elseif ($pay['op_code'] == 53 && $pay['option'] == 'color') {
$disabled[$pay['id']] = $pay['id'];
}
}
if (!$is_pro) {
unset($disabled);
}
if ($disabled) {
$str_disabled = implode(',', $disabled);
$dis[$op_id] = $str_disabled;
}
front::og('tpl')->pro_op_codes = step_employer::OP_CODE_PRO;
front::og('tpl')->disabled = $disabled;
front::og('tpl')->dis = $dis;
front::og('tpl')->is_pay_pro = $is_pro;
}
front::og('tpl')->master = $master;
front::og('tpl')->text = static_pages::get('bill_index');
front::og('tpl')->display('bill/bill_index.tpl');
}
示例2: __construct
public function __construct($type = false, $tbl_name = false)
{
$this->is_pro = is_pro() ? '10' : '01';
$this->is_role = get_uid(false) ? is_emp() ? '01' : '10' : '00';
if ($tbl_name) {
$this->tbl_name = $tbl_name;
}
if ($type) {
$this->setType($type, 1);
}
}
示例3: FPEP_getTab
/**
* Получить станицу с выбором работ для таба.
*
* @param bool $params
*
* @return \xajaxResponse
*/
function FPEP_getTab($params)
{
$objResponse = new xajaxResponse();
$uid = get_uid(false);
if ($uid > 0 && !is_emp() && is_pro()) {
$query = http_build_query($params);
$params['is_ajax'] = true;
require_once ABS_PATH . '/freelancers/widgets/FreelancersPreviewEditorPopup.php';
$freelancersPreviewEditorPopup = new FreelancersPreviewEditorPopup($params);
$html = $freelancersPreviewEditorPopup->render();
$objResponse->call("window.popups_factory.getPopup('freelancersPreviewEditorPopup').showTabContent", $freelancersPreviewEditorPopup->getCurrentTab(), $html, $query);
}
return $objResponse;
}
示例4: SaveStatus
function SaveStatus($text, $statusType, $login = NULL)
{
session_start();
$freelancer = new freelancer();
$text = addslashes(substr(stripslashes(trim($text)), 0, 200));
close_tags($text, 's');
$freelancer->status_text = antispam(htmlspecialchars(htmlspecialchars_decode(change_q_x(trim($text), true, false), ENT_QUOTES), ENT_QUOTES));
$freelancer->status_type = intval($statusType);
if ($freelancer->statusToStr($statusType)) {
$stdStatus = "";
$objResponse = new xajaxResponse();
$uid = hasPermissions('users') && $login != $_SESSION['login'] ? $freelancer->GetUid($err, $login) : get_uid(false);
$pro = hasPermissions('users') && $login != $_SESSION['login'] ? is_pro(true, $uid) : is_pro();
$error = $freelancer->Update($uid, $res);
if (!$freelancer->status_text) {
$freelancer->status_text = $stdStatus;
}
$freelancer->status_text = stripslashes($freelancer->status_text);
switch ($freelancer->status_type) {
case 1:
$status_cls = 'b-status b-status_busy';
break;
case 2:
$status_cls = 'b-status b-status_abs';
break;
case -1:
$status_cls = 'b-status b-status_no';
break;
default:
$status_cls = 'b-status b-status_free';
}
if (!$noassign) {
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/stop_words.php';
$stop_words = new stop_words(hasPermissions('users'));
$sStatusText = $pro ? $freelancer->status_text : $stop_words->replace($freelancer->status_text);
//$GLOBALS['xajax']->setCharEncoding("windows-1251");
$jsobj = json_encode(array('data' => iconv('CP1251', 'UTF8', $freelancer->status_text)));
$objResponse->assign("statusText", "innerHTML", $freelancer->status_text == $stdStatus ? "" : reformat($sStatusText, 40, 0, 1, 25));
$objResponse->assign("statusTitle", "innerHTML", $freelancer->statusToStr($statusType));
// $objResponse->assign("statusTitle", "style.display", $statusType > -1 ? '' : 'none');
$objResponse->script("statusType = {$statusType};\n\t\t\t statusTxt = document.getElementById('statusText').innerHTML;\n\t\t\t statusTxtSrc = {$jsobj};");
}
$objResponse->script("\$('bstatus').erase('class');\n \$('bstatus').addClass('{$status_cls}');");
}
return $objResponse;
}
示例5: _ceSend
/**
* Отправка сообщения.
*
* @param type $attr
*/
public function _ceSend($attr)
{
$user = new users();
$messages = new messages();
$stopWords = new stop_words(false);
$user->getUserByUID(intval($attr->uid));
if (empty($user->login) || $user->login == 'admin') {
self::error(3, false);
return;
}
if ($user->is_banned) {
self::error(4, false);
return;
}
$text = iconv('UTF-8', 'CP1251', $attr->text);
$text = antispam(change_q_x($text, false, true, null, false, false));
$messages->Add($this->_uid, $user->login, addslashes($text), array(), 0, false, null, $id);
if (!is_pro() && !is_pro(true, $attr->uid)) {
if (!hasPermissions('streamnomod') && !hasPermissions('streamnomod', $attr->uid)) {
$stopWords = new stop_words(false);
$text = $stopWords->replace($text);
}
}
$text = reformat($text, 14, 0, 0, 1);
$time = date('Y-m-d H:i:s');
$data = array('func' => 'income', 'attr' => array('id' => $id, 'uid' => $this->_uid, 'cuid' => $user->uid, 'text' => iconv('CP1251', 'UTF-8', $text), 'files' => array(), 'date' => $time));
$this->_addEvent($data);
return array('id' => $id, 'uid' => $user->uid, 'text' => iconv('CP1251', 'UTF-8', $text), 'date' => $time);
}
示例6:
?>
/setup/specaddsetup/" id="ap11">Дополнительные специализации</a>: <?php
echo $specs_add_string;
?>
</div>
<?php
}
?>
<div class="b-check b-check_padbot_20">
<table class="b-layout__table b-layout__table_width_full">
<tr class="b-layout__tr">
<td class="b-layout__td b-layout__td_width_null_ipad b-layout__td_ipad"><input name="cat_show" class="b-check__input" type="checkbox" value="1" <?php
echo !is_pro() ? 'disabled="disabled"' : '';
?>
<?php
echo $user->cat_show == 't' || !is_pro() ? 'checked="checked"' : '';
?>
id="cat_showl" /></td>
<td class="b-layout__td b-layout__td_ipad b-layout__td_width_full b-layout__td_width_full_ipad">
<label class="b-check__label b-check__label_color_71" for="cat_showl"> <strong class="b-layout__txt_bold">Разрешить размещение в каталоге</strong><span class="b-layout__txt b-layout__txt_fontsize_11 b-layout__txt_color_71 b-layout__txt_lineheight_1 b-layout_block_iphone"> (только для <span title="владельцев платного аккаунта" class="b-icon b-icon__pro b-icon__pro_f b-icon_valign_bas"></span>)</span></label>
</td>
</tr>
</table>
</div>
<table class="b-layout__table b-layout__table_width_full">
<tr class="b-layout__tr">
<td class="b-layout__td b-layout__td_width_240 b-layout__td_padbot_10">
<div class="b-layout__txt b-layout__txt_fontsize_11 b-layout__txt_padtop_2">Опыт работы (в годах)</div>
</td>
示例7: billingOperation
/**
* Обработка и оплата операций
*
* @global type $DB
* @param type $option
* @return boolean
*/
function billingOperation($option, $transaction_id)
{
global $DB;
$ok = false;
$account = new account();
switch ($option['op_code']) {
// Аккаунт ПРО у фрилансера
case 48:
case 49:
case 50:
case 51:
case 76:
// Удаляем операции по покупке ответов - публикуем ответы
$prof = new payed();
$ok = $prof->SetOrderedTarif($this->uid, $transaction_id, 1, "Аккаунт PRO", $option['op_code'], $error);
if ($ok) {
$_SESSION['pro_last'] = payed::ProLast($_SESSION['login']);
$_SESSION['pro_last'] = $_SESSION['pro_last']['freeze_to'] ? false : $_SESSION['pro_last']['cnt'];
$userdata = new users();
$_SESSION['pro_test'] = $userdata->GetField($this->uid, $error2, 'is_pro_test', false);
$this->clearBlockedOperations(step_freelancer::OFFERS_OP_CODE);
$step_frl = new step_freelancer();
$offers = $step_frl->getWizardOffers($this->uid, 'all', false);
if ($offers) {
require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/users.php";
$step_frl->log = $this->log;
$step_frl->user = new users();
$step_frl->user->GetUserByUID($this->uid);
$step_frl->transferOffers($offers);
}
$this->showProjectsFeedbacks();
}
break;
// Аккаунт ПРО у работодателя
// Аккаунт ПРО у работодателя
case 15:
$prof = new payed();
$ok = $prof->SetOrderedTarif($this->uid, $transaction_id, 1, "Аккаунт PRO", $option['op_code'], $error);
if ($ok) {
$_SESSION['pro_last'] = payed::ProLast($_SESSION['login']);
$_SESSION['pro_last'] = $_SESSION['pro_last']['freeze_to'] ? false : $_SESSION['pro_last']['cnt'];
$userdata = new users();
$_SESSION['pro_test'] = $userdata->GetField($this->uid, $error2, 'is_pro_test', false);
}
// Обновляем выбор цвета для проектов тк он для ПРО бесплатный
$colorProjects = $this->updateColorProject();
$prj = new new_projects();
foreach ($colorProjects as $k => $project) {
$delete_color[] = $project['op_id'];
if ($project['country'] == null) {
$project['country'] = 'null';
}
if ($project['city'] == null) {
$project['city'] = 'null';
}
$project['name'] = addslashes($project['name']);
$project['descr'] = addslashes($project['descr']);
if ($project['logo_id'] <= 0) {
$project['logo_id'] = 'null';
}
$project['payed_items'] = $project['payed_items'] | '010';
$project['is_color'] = 't';
$prj->editPrj($project, false);
}
// Удаляем данные операции
if ($delete_color) {
$this->deleteDraftAccountOperation($delete_color);
}
break;
// Публикация конкурса
// Публикация конкурса
case new_projects::OPCODE_KON:
case new_projects::OPCODE_KON_NOPRO:
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/wizard/step_wizard_registration.php';
$drafts = new drafts();
$draft = $drafts->getDraft($option['parent_id'], $this->uid, 1);
// Если еще не опубликован
if (!$draft['prj_id']) {
$project_id = $draft['id'];
$error = $account->Buy($bill_id, $transaction_id, $option['op_code'], $this->uid, $option['descr'], $option['comment'], 1, 0);
$ok = $bill_id > 0;
if ($bill_id) {
$color = $DB->val("SELECT id FROM draft_account_operations WHERE parent_id = ? AND op_type = 'contest' AND option = 'color' AND uid = ?", $project_id, wizard::getUserIDReg());
$draft['billing_id'] = $bill_id;
$draft['folder_id'] = 'null';
$draft['payed'] = '0';
$draft['payed_items'] = '000';
if (is_pro() && $color > 0) {
$draft['is_color'] = 't';
} else {
$draft['is_color'] = 'f';
}
$draft['win_date'] = date('d-m-Y', strtotime($draft['win_date']));
//.........这里部分代码省略.........
示例8: actionSaveInfoMobile
/**
* Заполнение обязательных полей после регистрации через API мобильного приложения.
*
* @param array $aParams массив входящих данных
* @return bool true - успех, false - провал
*/
public function actionSaveInfoMobile($aParams = array())
{
$this->setFieldInfo('uname', __paramValue('string', iconv('utf-8', 'cp1251', $aParams['first_name'])));
$this->setFieldInfo('usurname', __paramValue('string', iconv('utf-8', 'cp1251', $aParams['last_name'])));
$this->setFieldInfo('birthday', __paramValue('string', $aParams['birthday']));
$this->setFieldInfo('country', __paramValue('int', $aParams['country_id']));
$this->setFieldInfo('city', __paramValue('int', $aParams['city_id']));
$this->setFieldInfo('info_for_reg', array('birthday' => 0, 'sex' => 0, 'country' => 0, 'city' => 0));
$gender = __paramValue('int', $aParams['gender']);
$this->setFieldInfo('sex', $gender == 1 ? 't' : ($gender == 2 ? 'f' : NULL));
$this->checkedFields();
if (date('Y-m-d', strtotime($aParams['birthday'])) != $aParams['birthday']) {
$this->error['birthday'] = 'Укажите некорректную дату дня рождения';
$this->errno['birthday'] = 2;
}
if (empty($this->error)) {
if (!is_emp()) {
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/freelancer.php';
$user = new freelancer();
} else {
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/employer.php';
$user = new employer();
}
$user->info_for_reg = serialize($this->info_for_reg);
$user->uname = $this->uname;
$user->usurname = $this->usurname;
$user->sex = $this->sex;
$user->birthday = $this->birthday;
$user->country = $this->country;
$user->city = $this->city;
if (!is_emp()) {
$spec = intvalPgSql($aParams['prof_id']);
if ($spec) {
require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/professions.php";
$or_spec = professions::GetProfessionOrigin($spec);
$spec_mod = professions::getLastModifiedSpec($_SESSION['uid']);
if (!is_pro() && $spec_mod['days'] > 0) {
$this->error['spec'] = 'Не прошло 30 дней с момента последней смены специализации';
$this->errno['spec'] = 2;
} else {
$user->spec = $spec;
$user->spec_orig = $or_spec;
professions::setLastModifiedSpec($_SESSION['uid'], $spec);
}
} else {
$this->error['spec'] = 'Не указан параметр ID профессии';
$this->errno['spec'] = 1;
}
}
if (empty($this->error)) {
if ($sError = $user->Update($_SESSION['uid'], $res)) {
$this->error['save'] = $sError;
} else {
if (!is_emp()) {
$_SESSION['specs'] = $user->GetAllSpecs($_SESSION['uid']);
}
}
}
if (empty($this->error['save'])) {
$_SESSION['check_user_access'] = true;
}
}
return empty($this->error);
}
示例9:
<?php
// ЗАГОЛОВОК
?>
<h3>
<img id="istop"<?php
echo $remTPeriod || $addedTD ? '' : ' style="display:none"';
?>
src="/images/tp<?php
echo $project['is_color'] == 't' ? '2' : '';
?>
.gif" alt="" title="<?php
echo $topDays;
?>
"/>
<?php
$sName = $project['kind'] != 4 && !is_pro() ? $stop_words->replace($project['name']) : $project['name'];
?>
<?php
if ($project['id'] > 0) {
?>
<a name="prj<?php
echo $project['id'];
?>
" href="/projects/?pid=<?php
echo $project['id'];
?>
">
<?php
echo reformat2($sName, 30, 0, 1);
?>
</a>
示例10: transferWizardContent
/**
* Перенос всех данных введнных в мастере на боевые таблицы
* должен запускаться синхронно с завершением работы мастера
*
* @return type
*/
public function transferWizardContent()
{
require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/users.php";
require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/log.php";
$this->log = new log('wizard/transfer-' . SERVER . '-%d.log', 'a', '%d.%m.%Y %H:%M:%S : ');
$user = new users();
$user->GetUserByUID(wizard::getUserIDReg());
$this->user = $user;
// Чистим ответы на заблокированные проекты
$this->clearOffers();
// некоторые ответы могут остатся в этой таблице поэтому обновляем им Ид пользователя (при завершении мастера все данные по Ид пользователя мастера удаляются)
$this->updateOffers(array('reg_uid' => wizard::getUserIDReg()));
// пользователь может быть уже PRO (если он ранее был авторизован) - учитываем это
$pro = is_pro();
$limit = $pro ? "all" : 3;
// Берем все конкурсы + 3 обычных проекта для публикации ответов (без конкурсов и проектов для ПРО)
$offers = $this->getWizardOffers(false, $limit, !$pro);
if ($offers) {
$error = $this->transferOffers($offers);
}
// Пишем данные пользователя введенные в шаге портфолио
$field = $this->parent->getFieldsUser();
$data = unserialize($field['portfolio']);
if ($data) {
$error = $this->transferUserInformation($data);
}
//Перенос порфтолио
$works = $this->getWorks();
if ($works) {
$error = $this->transferWorks($works);
}
return $error;
}
示例11: printBanner240
?>
<?php
if (hasPermissions('articles')) {
include 'form.php';
}
?>
</div>
<div class="p-a-left b-layout__left b-layout__left_width_25ps">
<div class="p-a-popular c">
</div>
<div class="favorites">
</div>
<!-- Banner 240x400 -->
<div class="banner_240x400">
<?php
echo printBanner240(is_pro(), true);
?>
</div>
<!-- end of Banner 240x400 -->
</div>
</div>
</div>
<div id="del-article-form" class="form fs-o form-adel" style="display: none;">
<b class="b1"></b>
<b class="b2"></b>
<div class="form-in">
<form id="del_article_frm" method="post" action="/articles/?task=del-article">
<div class="form-block first last">
<h4>Удаление статьи</h4>
<div class="form-el">
示例12: removeWork
function removeWork($uid, $params)
{
$objResponse =& new xajaxResponse();
if (!$uid) {
$uid = get_uid(false);
}
$uid = intval($uid);
$work_id = intval($params['id']);
$prof_id = intval($params['prof_id']);
if ($uid != get_uid(false) || !get_uid(false) || $work_id < 0) {
return $objResponse;
}
$deleted = portfolio::DelPortf($uid, $work_id);
if (!$deleted) {
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/stop_words.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/professions.php';
$stop_words = new stop_words(hasPermissions('users'));
$profession = new professions();
$portfolio = new portfolio();
$user = new users();
$user->login = $_SESSION['login'];
$user->uid = $_SESSION['uid'];
$user->is_pro = is_pro() ? 't' : 'f';
$is_owner = $uid == $_SESSION['uid'];
$pinfo = current(portfolio::getPortfolioCategory($prof_id));
$pinfo['mainprofname'] = $pinfo['group_name'];
$pinfo['profname'] = $pinfo['prof_name'];
$pinfo['gr_prevs'] = $pinfo['show_preview'];
$pinfo = $profession->prepareCostText($pinfo, $stop_words);
$works = $portfolio->GetPortf($uid, $prof_id, true);
if (!empty($works)) {
$result = portfolio::prepareDataPortfolio($works, $uid, $stop_words, true);
extract($result);
$work[0]['id'] = 100;
ob_start();
include_once $_SERVER['DOCUMENT_ROOT'] . '/user/tpl.portfolio.works.php';
$sWorks = ob_get_contents();
ob_end_clean();
} else {
$work[0]['id'] = null;
$pp_noblocks[$prof_id] = array();
ob_start();
include $_SERVER['DOCUMENT_ROOT'] . '/user/tpl.portfolio.works.php';
$sWorks = ob_get_contents();
ob_end_clean();
}
if ($sWorks != '') {
$objResponse->assign("prof_works_{$prof_id}", 'innerHTML', $sWorks);
}
$objResponse->script("\$('portfolio_work_edit').getParent().dispose()");
} else {
$objResponse->call('alert', 'Ошибка, работу удалить не удалось.');
}
return $objResponse;
}
示例13: FreelancersTServicesWidget
//if ($page < 20) $buffer_on = true;
/*
$additional_header = '<script type="text/javascript" src="/scripts/kwords.js"></script>' .
'<script type="text/javascript" src="/kword_js.php"></script>';
*/
//------------------------------------------------------------------------------
require_once ABS_PATH . '/freelancers/widgets/FreelancersTServicesWidget.php';
//Инициализация виджета плитки ТУ вместо портфолио
$freelancersTServicesWidget = new FreelancersTServicesWidget();
//------------------------------------------------------------------------------
//Популярные услуги из этой же категории
require_once ABS_PATH . '/tu/widgets/TServicesPopular.php';
$tservicesPopular = new TServicesPopular();
$tservicesPopular->setOptions(array('prof_group_id' => $prof_group_id, 'prof_id' => $prof_id, 'limit' => 9, 'title' => 'Услуги фрилансеров', 'title_css' => 'b-layout__title_padtop_10'));
$tservicesPopular->init();
//------------------------------------------------------------------------------
if ($uid > 0 && !is_emp() && !in_array($action, array('search', 'search_advanced')) && is_pro()) {
require_once ABS_PATH . '/freelancers/widgets/FreelancersPreviewEditorPopup.php';
$freelancersPreviewEditorPopup = FreelancersPreviewEditorPopup::getInstance(array('group_id' => $prof_group_id, 'prof_id' => $prof_id));
}
//------------------------------------------------------------------------------
$header = "../header.php";
$footer = "../footer.html";
$js_file[] = '/css/block/b-text/b-text.js';
$js_file[] = '/css/block/b-popup/b-popup.js';
$css_file = array('/css/block/b-icon/__cat/b-icon__cat.css', '/css/block/b-search/b-search.css', 'main.css', '/css/nav.css');
$js_file[] = 'search.js';
$js_file[] = 'freelancers/freelancers.js';
//@todo: Сюда переносить все inline-скрипты!
$freelancers_catalog = true;
include "../template2.php";
示例14: offerSpecIsAllowed
/**
* Проверяет по специализациям, может ли текущий пользователь ответить на проект.
*
* @param int $projec_id ид проекта
*
* @return boolean
*/
public static function offerSpecIsAllowed($projec_id)
{
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/professions.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/projects.php';
// ПРО отвечают без ограничений
if (is_pro()) {
return true;
}
if (!get_uid(false)) {
return false;
}
$is_send_offers = false;
$spec_project = new_projects::getSpecs($projec_id);
$user_spec = professions::GetProfsAddSpec($_SESSION['uid']);
if (is_array($user_spec)) {
$user_spec = array_merge($user_spec, $_SESSION['specs']);
} else {
$user_spec = $_SESSION['specs'];
}
if ($user_spec) {
$user_spec = array_merge($user_spec, professions::GetMirroredProfs(professions::GetProfessionOrigin(implode(',', $user_spec))));
$user_spec = array_unique($user_spec);
//@todo запехать в один запрос
foreach ($user_spec as $spec) {
$prof_group[$spec] = professions::GetProfField($spec, 'prof_group');
}
}
foreach ($spec_project as $specs) {
if (is_array($prof_group) && in_array($specs['category_id'], $prof_group)) {
$is_send_offers = true;
// Разрашаем оставлять отзыв
break;
}
}
return $is_send_offers;
}
示例15: RestoreComment
/**
* Восстанавливает комментарий.
*
* @param int $cid id комментария
*
* @return string сообщение об ошибке или пустая строка, если все нормально
*/
public function RestoreComment($cid)
{
global $DB;
if ($this->is_moder) {
$cid = intval($cid);
$sModer = '';
if (!hasPermissions('projects') && !is_pro()) {
$p_comment = $this->GetComment($cid);
if ($p_comment['user_id'] == $_SESSION['uid']) {
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/stop_words.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/user_content.php';
$stop_words = new stop_words();
$nStopWordsCnt = $stop_words->calculate($p_comment['msg']);
$sModer = ' , moderator_status =' . ($nStopWordsCnt ? ' 0 ' : ' NULL ');
if ($nStopWordsCnt) {
$DB->insert('moderation', array('rec_id' => $cid, 'rec_type' => user_content::MODER_CONTEST_COM, 'stop_words_cnt' => $nStopWordsCnt));
} else {
$DB->query('DELETE FROM moderation WHERE rec_id = ?i AND rec_type = ?i;', $cid, user_content::MODER_CONTEST_COM);
}
}
}
$DB->query("UPDATE projects_contest_msgs SET deleted = NULL, deluser_id = NULL {$sModer} WHERE id = ?i", $cid);
return $DB->error;
}
}