本文整理汇总了PHP中projects::initData方法的典型用法代码示例。如果您正苦于以下问题:PHP projects::initData方法的具体用法?PHP projects::initData怎么用?PHP projects::initData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类projects
的用法示例。
在下文中一共展示了projects::initData方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: quickprjedit_save_prj
//.........这里部分代码省略.........
$this_show_data = 0;
$row['show_data'] = 0;
}
$descr = $row['descr'];
$descr = preg_replace('/^ /', "", $descr);
$descr = preg_replace("/(\n) /", "\$1", $descr);
$descr = reformat(strip_tags(LenghtFormatEx($descr, 180), '<br />'), 50, 1, 0, 1);
$descr = preg_replace("//", ' ', $descr);
$row['descr'] = $descr;
$row['t_is_payed'] = $this_project['payed'] && $this_project['kind'] != 2 && $this_project['kind'] != 7;
$row['t_is_contest'] = $this_project['kind'] == 2 || $this_project['kind'] == 7;
$row['t_pro_only'] = $this_project['pro_only'] == 't';
$row['t_verify_only'] = $this_project['verify_only'] == 't';
$row['t_hide'] = $this_project['hide'] == 't';
$row['t_urgent'] = $this_project['urgent'] == 't';
$row['t_prefer_sbr'] = $this_project['prefer_sbr'] == 't';
$row['priceby'] = $this_project['priceby'];
$row['t_is_adm'] = hasPermissions('projects');
$row['t_is_ontop'] = strtotime($this_project['top_to']) >= time();
$row['unread'] = (int) $this_project['unread_p_msgs'] + (int) $this_project['unread_c_msgs'] + (int) $this_project['unread_c_prjs'];
$row['t_is_proonly'] = $this_project['pro_only'] == 't' && !$_SESSION['pro_last'] && !$this_edit_mode && $this_uid != $this_project['user_id'];
$attaches = projects::GetAllAttach($this_project['id']);
$attaches = !$attaches ? array() : $attaches;
foreach ($attaches as $k => $a) {
$a['virus'] = is_null($a['virus']) ? $a['virus'] : bindec($a['virus']);
$attaches[$k] = $a;
}
$row['attaches'] = $this_project['attaches'] = $attaches;
$is_ajax = true;
$can_change_prj = hasPermissions('projects');
$row['friendly_url'] = getFriendlyURL('project', $row['id']);
ob_start();
if ($type == 1) {
$project = projects::initData($row);
require_once $_SERVER['DOCUMENT_ROOT'] . '/projects/tpl.lenta-item.php';
} else {
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/employer.php';
$user = new employer();
$user->GetUserByUID($this_project['user_id']);
require_once $_SERVER['DOCUMENT_ROOT'] . '/projects/tpl.employer-project-item.php';
}
$html_data = ob_get_contents();
ob_end_clean();
$objResponse->assign("project-item{$prj_id}", 'innerHTML', $html_data);
if ($row['is_color'] == 't') {
$objResponse->script("\$('project-item{$prj_id}').addClass('b-post_bg_fffded')");
} else {
$objResponse->script("\$('project-item{$prj_id}').removeClass('b-post_bg_fffded')");
}
//$objResponse->script('alert("Лента");');
//$objResponse->script('window.location.reload();');
break;
case 2:
// Конкурс
//$objResponse->script('alert("Конкурс");');
$project_exRates = project_exrates::GetAll();
$translate_exRates = array(0 => 2, 1 => 3, 2 => 4, 3 => 1);
global $session;
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/contest.php';
$prj_id = $project['id'];
$obj_project = new projects();
$project = $obj_project->GetPrjCust($prj_id);
if (hasPermissions('projects')) {
$project_history = $obj_project->GetPrjHistory($prj_id);
}
$project_attach = $obj_project->GetAllAttach($prj_id);
示例2: foreach
</div>
</div>
</div>
</div>
<?php
}
//if
?>
<?php
foreach ($list as $row) {
?>
<?php
$project = projects::initData($row);
?>
<?php
if ($row['t_is_ontop'] && !$row['strong_top'] && isset($_COOKIE['hidetopprjlenta']) && $_COOKIE['hidetopprjlenta'] == 1 && $_COOKIE['hidetopprjlenta_time'] < strtotime($row['create_date'])) {
$hidetopprjlenta_more = 1;
}
?>
<div class="b-post <?php
echo $row['is_color'] == 't' ? 'b-post_bg_fffded' : '';
?>
b-post_padbot_15 b-post_margbot_20 b-post_bordbot_eee b-post_relative <?php
echo $row['t_is_ontop'] && !$row['strong_top'] ? 'topprjpay' : '';
?>
" id="project-item<?php
echo $row['id'];
?>
示例3: intvalPgSql
} else {
$prj_id = intvalPgSql((int) trim(str_replace('O', '0', $_GET['pid'])));
}
$action = trim($_REQUEST['action']);
$item_page = intval($_POST['page']);
if (!$item_page) {
$item_page = intval($_GET['page']);
}
if (!$item_page) {
$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';