本文整理汇总了PHP中projects::SetRead方法的典型用法代码示例。如果您正苦于以下问题:PHP projects::SetRead方法的具体用法?PHP projects::SetRead怎么用?PHP projects::SetRead使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类projects
的用法示例。
在下文中一共展示了projects::SetRead方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: comments
/**
* Выводит дерево комментариев. Используется здесь и в xajax/contest.server.php
* @param integer $pid id проекта
* @param string $name название проекта
* @param array $comments массив с деревом комментариев (подробнее в classes/contest.php)
* @param boolean $comm_blocked автор отключил возможность оставлять комментарии?
* @param boolean $project_end проект закрыт?
* @param integer $s_level уровень вложенности комментария
* @return string HTML с кнопками управления
*/
function comments($pid, $name, &$comments, $comm_blocked, $project_end, $s_level = 0)
{
global $stop_words, $contest, $project, $session;
static $level = 0;
$level = ($s_level ? $s_level : $level) + 1;
$html = '';
$set_branch_as_read = false;
for ($i = 0, $c = count($comments); $i < $c; $i++) {
if (($comments[$i]['is_banned'] || $comments[$i]['usr_banned'] || $comments[$i]['user_blocked'] === 't') && !hasPermissions('projects') && !$contest->is_owner) {
$msg = $msg2 = 'Ответ от заблокированного пользователя';
} else {
if (!trim($comments[$i]['deleted'])) {
$sMsg = $comments[$i]['moderator_status'] === '0' ? $stop_words->replace($comments[$i]['msg']) : $comments[$i]['msg'];
$msg = reformat($sMsg, 30, 0, 0, 1);
$msg2 = reformat($comments[$i]['msg'], 30, 0, 0, 1);
} else {
$msg2 = $msg = "Комментарий удален модератором";
if (hasPermissions("comments")) {
$moderator = '';
$moderatorData = new users();
$moderatorData->GetUserByUID($comments[$i]['deluser_id']);
if ($moderatorData->login) {
$moderator = ' ' . $moderatorData->login . ' (' . $moderatorData->uname . ' ' . $moderatorData->usurname . ') ';
}
$msg2 = $msg = $msg . " {$moderator}";
}
if ($comments[$i]['deluser_id'] == $comments[$i]['user_id']) {
$msg2 = $msg = "Комментарий удален автором";
} else {
if (trim($comments[$i]['deleted_reason']) && (hasPermissions("comments") || $comments[$i]['user_id'] == get_uid(false))) {
$msg2 = $msg = $msg . "<div style='color:#ff0000'>Причина: " . $comments[$i]['deleted_reason'] . "</div>";
}
}
}
}
$a_is_banned = ($comments[$i]['is_banned'] || $comments[$i]['usr_banned']) && hasPermissions('projects');
$html .= "\n\t\t\t<li class='thread' id='thread-{$comments[$i]['id']}'" . ($level >= 9 ? " style='margin-left: 0'" : "") . ">\n\t\t\t\t<a name='c-comment-{$comments[$i]['id']}'></a>\n\t\t\t\t<div class='comment-one" . ($comments[$i]['deleted'] || $comments[$i]['hidden'] ? " comment-deleted" : "") . "' id='comment-{$comments[$i]['id']}'>\n\t\t\t\t\t<div class='contest-ea'>" . view_avatar($comments[$i]['login'], $comments[$i]['photo'], 1) . "</div>\n\t\t\t\t\t<div class='comment-body'>\n\t\t\t\t\t\t<h3 class='username'>" . $session->view_online_status($comments[$i]['login']) . "\n\t\t\t\t\t\t\t<a href='/users/{$comments[$i]['login']}' class='" . (is_emp($comments[$i]['role']) ? 'employer-name' : 'freelancer-name') . "'>{$comments[$i]['uname']} {$comments[$i]['usurname']} [{$comments[$i]['login']}]</a> " . view_mark_user($comments[$i]) . " " . ($comments[$i]['completed_cnt'] > 0 ? '<a href="/promo/bezopasnaya-sdelka/" title="Пользователь работал через Безопасную Сделку" target="_blank"><span class="b-icon b-icon__shield b-icon_top_1"></span></a>' : '') . "\n\t\t\t\t\t\t\t<span>[" . dateFormat('d.m.Y | H:i', $comments[$i]['post_date']) . "]</span>\n\t\t\t\t\t\t\t<span id='comment-modified-{$comments[$i]['id']}'>" . ($comments[$i]['modified'] ? "[изменен " . dateFormat('d.m.Y | H:i', $comments[$i]['modified']) . "]" : ' ') . "</span>\n\t\t\t\t\t\t\t" . ($a_is_banned ? "<b style=\"color:#ff0000\">Пользователь забанен</b>" : "") . "\n\t\t\t\t\t\t</h3>\n\t\t\t\t\t\t" . ($_SESSION['uid'] && $comments[$i]['is_new'] ? "<p><img src='/images/mark-new.png' width='53' height='12' alt='новое' class='mark-new' /></p>" : "") . "\n\t\t\t\t\t\t<div id='comment-change-{$comments[$i]['id']}'>\n\t\t\t\t\t\t<p id='comment-msg-{$comments[$i]['id']}' " . ($a_is_banned ? "style='color:silver'" : "") . ".>" . $msg . "</p>\n\t\t\t\t\t\t<div id='comment-msg-original-{$comments[$i]['id']}' style='display:none'>" . $msg2 . "</div>\n\t\t\t\t\t\t<script type=\"text/javascript\">\n banned.addContext( 'p{$pid}c{$comments[$i]['id']}', 3, '" . HTTP_PREFIX . "{$_SERVER['HTTP_HOST']}" . getFriendlyURL("project", $pid) . "?comm={$comments[$i]['id']}#comment-{$comments[$i]['id']}', \"" . htmlspecialchars($name) . "\" );\n </script>\n\t\t\t\t\t\t<ul class='thread-options' id='comment-options-{$comments[$i]['id']}'>\n\t\t\t\t\t\t\t" . comment_options($pid, $comments[$i], $comm_blocked, $project_end, $level, $name) . "\n\t\t\t\t\t\t</ul>\n <div id='warnreason-" . $comments[$i]['id'] . "-" . $comments[$i]['user_id'] . "' style='display:none; padding: 0 0 5px 0px;'> </div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t" . (empty($comments[$i]['comments']) ? '' : '<ul>' . comments($pid, $name, $comments[$i]['comments'], $comm_blocked, $project_end) . '</ul>') . "\n\t\t\t</li>\n\t\t";
if ($comments[$i]['is_new']) {
$set_branch_as_read = true;
}
}
if ($set_branch_as_read) {
$p = new projects();
$data = array("id" => $pid, "kind" => 7, "user_id" => $project["user_id"]);
$p->SetRead($data, get_uid(false), true);
}
--$level;
return $html;
}
示例2: foreach
foreach ($offers as $key => $value) {
$offers[$key]['dialogue'] = $obj_dialogue->GetDialogueForOffer($value['id']);
}
}
$header = '../header.php';
$footer = '../footer.html';
//Валидный пользователь или нет для показа ему дополнительной информации о проекте
$show_info = $project['kind'] == 2 || $project['kind'] == 7 || $uid > 0 && (($is_pro || $project['exec_id'] == $uid) && $projectObject->isAllowShowOffers() || hasPermissions('projects') || $project['user_id'] == $uid);
$aNote = false;
if (get_uid() && $show_info && $_SESSION['uid'] != $project['user_id']) {
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/notes.php';
$oNotes = new notes();
$aNote = $oNotes->GetNoteInt($_SESSION['uid'], $project['user_id'], $error);
}
//Помечаем проект как прочитанный (счетчик просмотров)
$obj_project->SetRead($project, $uid);
if (is_emp()) {
if ($project['kind'] == 2) {
/*
* todo: неиспользуемый кусок?
if (($project['user_id'] == $uid) && ($op_count_all > 0)) {
#close: onload $onload = 'start_scroll();';
}
*/
$css_file = array('/css/block/b-free-share/b-free-share.css', '/css/block/b-note/b-note.css', '/css/block/b-button-multi/b-button-multi.css', '/css/block/b-prev/b-prev.css', '/css/nav.css', '/css/projects3.css');
$content = 'content_kon_emp.php';
} else {
if ($project['kind'] == 7) {
$content = 'contest.php';
$css_file = array('/css/block/b-free-share/b-free-share.css', '/css/block/b-note/b-note.css', '/css/block/b-button-multi/b-button-multi.css', '/css/block/b-prev/b-prev.css', 'contest.css', '/css/nav.css');
$js_file = array('ibox.js', 'contest.js', 'banned.js', 'calendar.js', 'projects.js', '/css/block/b-popup/b-popup.js', 'note.js', 'mootools.resizableTextarea.js', 'attachedfiles.js', 'calendar.js', '/css/block/b-pay-answer/b-pay-answer.js', '/css/block/b-shadow/b-shadow.js');