本文整理汇总了PHP中projects::_getSpecsStr方法的典型用法代码示例。如果您正苦于以下问题:PHP projects::_getSpecsStr方法的具体用法?PHP projects::_getSpecsStr怎么用?PHP projects::_getSpecsStr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类projects
的用法示例。
在下文中一共展示了projects::_getSpecsStr方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetPreview
//.........这里部分代码省略.........
foreach ($data['contacts'] as $name => $value) {
if (!isset($contacts[$name])) {
continue;
}
switch ($name) {
case 'site':
if (!url_validate(ltrim(ltrim($value, 'http://'), 'https://')) && trim($value) != '') {
$error["contact_{$name}"] = 'Поле заполнено некорректно';
}
if (strpos($value, 'htt') === false && trim($value) != '') {
$value = 'http://' . $value;
}
break;
case 'email':
if (!is_email($value) && trim($value) != '') {
$error["contact_{$name}"] = 'Поле заполнено некорректно';
}
break;
}
$contacts[$name]['value'] = __paramValue('htmltext', stripslashes($value));
}
$row['contacts'] = serialize($contacts);
}
$descrFull = stripslashes(__paramValue('html', $data['descr'], null, true));
$descr = preg_replace('/^ /', "", $descrFull);
$descr = preg_replace("/(\n) /", "\$1", $descr);
$descr = reformat(strip_tags(htmlspecialchars(LenghtFormatEx(htmlspecialchars_decode($descr, ENT_QUOTES), 180), ENT_QUOTES), '<br />'), 50, 1, 0, 1);
$descr = preg_replace("//", ' ', $descr);
$row['descr'] = $descr;
$row['t_is_payed'] = $data['logo_ok'] || $data['top_ok'];
$row['t_is_ontop'] = __paramValue('bool', $data['top_ok']);
$row['t_pro_only'] = $data['pro_only'] ? 't' : 'f';
$row['t_verify_only'] = $data['verify_only'] ? 't' : 'f';
$row['t_urgent'] = $data['urgent'] ? 't' : 'f';
$row['t_hide'] = $data['hide'] ? 't' : 'f';
$row['create_date'] = date('Y-m-d H:i', strtotime(date('Y-m-d H:i:s')) - 120);
// делаем дату публикации 2 минуты назад
$row['end_date'] = __paramValue('string', $data['end_date']);
$row['win_date'] = __paramValue('string', $data['win_date']);
$row['country'] = __paramValue('int', $data['project_location_columns'][0]);
$row['city'] = __paramValue('int', $data['project_location_columns'][1]);
list($row['country_name'], $row['city_name']) = explode(': ', __paramValue('string', $data['location']));
$logoOK = __paramValue('bool', $data['logo_ok']);
$topOK = __paramValue('bool', $data['top_ok']);
$row['link'] = __paramValue('string', $data['link']);
if ($logoOK) {
$logoAttach = new attachedfiles($data['logo_attachedfiles_session']);
$logoFiles = $logoAttach->getFiles(array(1));
if (count($logoFiles)) {
$logoFile = array_pop($logoFiles);
// загружено может быть несколько файлов, берем последний
$logoCFile = new CFile($logoFile['id']);
} elseif (__paramValue('int', $data['logo_file_id'])) {
$logoCFile = new CFile(__paramValue('int', $data['logo_file_id']));
}
$row['logo_name'] = $logoCFile->name;
$row['logo_path'] = $logoCFile->path;
}
$is_ajax = true;
// подготовка данных для подробной страницы проекта
$project = $row;
$categories = array();
for ($i = 0; $i < 3; ++$i) {
$categoryID = __paramValue('int', $data['project_profession' . $i . '_columns'][0]);
$subcategoryID = __paramValue('int', $data['project_profession' . $i . '_spec_columns'][0]);
if ($categoryID || $subcategoryID) {
$categories[] = array('category_id' => $categoryID, 'subcategory_id' => $subcategoryID);
}
}
$project['spec_txt'] = projects::_getSpecsStr($categories, ' / ', ', ', true);
$project['ico_payed'] = $logoOK;
$project['is_upped'] = $topOK;
$project['descr'] = $descrFull;
$project['logo_id'] = $logoCFile->id;
$project['prefer_sbr'] = __paramValue('bool', $data['prefer_sbr']) ? 't' : 'f';
$project['urgent'] = __paramValue('bool', $data['urgent']) ? 't' : 'f';
$project['hide'] = __paramValue('bool', $data['hide']) ? 't' : 'f';
if (trim($project['contacts']) != '') {
$contacts_employer = unserialize($project['contacts']);
$empty_contacts_employer = 0;
foreach ($contacts_employer as $name => $contact) {
if (trim($contact['value']) == '') {
$empty_contacts_employer++;
}
}
$is_contacts_employer_empty = count($contacts_employer) == $empty_contacts_employer;
}
$isPreview = true;
$project_exRates = project_exrates::GetAll();
$translate_exRates = array(0 => 2, 1 => 3, 2 => 4, 3 => 1);
ob_start();
include $_SERVER['DOCUMENT_ROOT'] . '/public/new/tpl.preview.php';
?>
<?php
$htmlProject = ob_get_clean();
$objResponse->assign('project_preview_lenta', 'innerHTML', $htmlLenta);
$objResponse->assign('project_preview_content', 'innerHTML', $htmlProject);
$objResponse->script('Public.showPreview()');
return $objResponse;
}
示例2:
}
?>
<?php
if ($project['kind'] != 9) {
?>
<div class="b-layout__txt b-layout__txt_fontsize_11 b-layout__txt_bold">Разделы:</div>
<div class="b-layout__txt b-layout__txt_fontsize_11 <?php
if (!($project['ico_payed'] == 't' || $project['is_upped'] == 't' || $project['kind'] == 4)) {
?>
b-layout__txt_padbot_20<?php
}
?>
"><?php
echo $isPreview ? $project['spec_txt'] : projects::_getSpecsStr($project_specs, ' / ', ', ', true);
?>
</div>
<?php
if ($project['ico_payed'] == 't' || $project['is_upped'] == 't' || $project['kind'] == 4) {
?>
<div class="b-layout__txt b-layout__txt_fontsize_11 b-layout__txt_padbot_20">
<?php
if ($project['ico_payed'] == 't' || $project['is_upped'] == 't') {
?>
Платный проект <?php
if ($project['kind'] == 4) {
?>
— в<?php
}