$sObjName = hyphen_words(reformat($user['uname'] . ' ' . $user['usurname'] . ' [' . $user['login'] . ']', 60), true); $sObjLink = "/users/{$user['login']}"; $sLoginSt = $session->view_online_status($user['login'], false, ''); $ago = $session->ago; if (!$session->is_active) { $oUser = new users(); $oUser->GetUserByUID($user['uid']); if ($oUser->last_time) { $fmt = 'ynjGi'; if (time() - ($lt = strtotime($oUser->last_time)) > 24 * 3600) { $fmt = 'ynjG'; if (time() - $lt > 30 * 24 * 3600) { $fmt = 'ynj'; } } $ago = ago_pub($lt, $fmt); } } $ago = $ago ? $ago : 'меньше минуты'; if ($user['safety_bind_ip']) { $safety_ip = users::GetSafetyIP($user['uid']); } // права админа $bHasAll = hasPermissions('all'); $bHasPayments = hasPermissions('payments'); ?> <h3>Действия / История пользователя</h3> <div class="plashka"> <span><a href="<?php echo $_SESSION['admin_log_user'];
?> <?php if ($stage->data['status'] == sbr_stages::STATUS_PROCESS) { ?> Старт работ <span class="b-layout__bold"><?php echo date('d.m.Y', strtotime($stage->data['first_time'])); ?> </span>, <?php echo $stage->stageWorkTimeLeft(false, array(strtotime($stage->data['start_time_without_pause'])), '<span class="b-layout__bold">%s</span>'); ?> <?php } else { //if ?> <span class="b-layout__bold"><?php echo ago_pub(time() + $stage->work_rem * 3600 * 24, 'ynj'); ?> </span> на этап <?php } //else ?> <?php } //else ?> </div> <?php // проверяем в какой валюте будет выплата if (!$stage->payouts) { $stage->getPayouts($sbr->uid);
/** * Генерирует информацию про юзера, по его данным, в HTML-код (новая версия) * * @global session $session * @param type $user * @return $session */ function view_user3($user, $query_link = "") { global $session; if (is_object($user)) { $user = get_object_vars($user); } $is_emp = is_emp($user['role']); $is_emp_pfx = $is_emp ? 'e' : 'f'; $is_emp_pfx = $user['is_pro_test'] === 't' ? 'test' : $is_emp_pfx; $login = $user['login']; $link = '/users/' . $login; $login_cls = $is_emp ? '6db335' : 'fd6c30'; $username = $user['uname'] . ' ' . $user['usurname']; $html = $session->view_online_status($login) . '<a class="b-username__link b-username__link_color_000 b-username__link-empty" href="' . $link . $query_link . '">' . $username . '</a> <span class="b-username__login-mark"> <span class="b-username__login b-username__login_color_' . $login_cls . '">[<a class="b-username__link b-username__link_color_' . $login_cls . '" href="' . $link . $query_link . '">' . $login . '</a>]</span>'; //$pro = ' ' . view_profi(); $is_pro = $user['is_pro'] == 't' || $user['is_pro_tes'] == 't'; $html .= ($is_pro || $user['is_team'] == 't' || @$user['is_profi'] == 't' ? ' ' : '') . '<span class="b-username__marks">'; if (@$user['is_profi'] == 't') { $html .= view_profi(); } else { if ($is_pro && $user['is_team'] == 'f') { /* $is_emp_pfx = $is_emp_pfx . 'pro'; */ $title = 'PRO'; $html .= $is_emp ? view_pro_emp() : view_pro(); } } if ($user['is_team'] == 't') { $is_emp_pfx = 'team'; $title = 'Команда Free-lance.ru'; $html .= view_team_fl(); //$html .= ' <a class="b-layout__link" href="/about/team/" target="_blank"><span alt="Платный аккаунт" title="Платный аккаунт" class="b-icon b-icon__pro b-icon__pro_' . $is_emp_pfx . ' "></span></a>'.(is_verify($login)? view_verify():''); } $is_verify = !empty($user['is_verify']) ? $user['is_verify'] == 't' : is_verify($login); $html .= ($is_verify ? view_verify() : '') . '</span>'; $status = $session->getActivityByLogin($user['login']); $last_ref_unixtime = strtotime($status); if ($status && time() - $last_ref_unixtime <= 30 * 60) { $ago = ago_pub(strtotimeEx($status)); if (intval($ago) == 0) { $ago = "менее минуты"; } /* $html .= ' <span class="b-layout__txt b-layout__txt_fontsize_11 b-layout__txt_color_fd6c30 b-layouyt__txt_weight_normal">На сайте</span>';*/ } else { /* $html .= ' <span class="b-layout__txt b-layout__txt_fontsize_11 b-layout__txt_color_808080 b-layouyt__txt_weight_normal">Нет на сайте</span>';*/ } $html .= '</span>'; return $html; }
} else { $dstr = 'До окончания ' . ago_pub(time() + $stage->work_rem * 3600 * 24, 'ynj'); } } ?> <strong><?php echo $dstr; ?> </strong> <?php } else { if ($stage->work_days) { if ($stage->work_days > 0) { $dstr = 'Время выполнения ' . $stage->work_days . ' ' . ending(abs($stage->work_days), 'день', 'дня', 'дней'); } else { $dstr = '<span class="nr-day-red">Проект просрочен на ' . ago_pub(time() + $stage->work_days * 3600 * 24, 'ynj') . '</span>'; } ?> <strong><?php echo $dstr; ?> </strong> <?php } } } } if ($stage->first_time) { ?> <span>Проект был открыт <?php echo date('j ' . strtolower($MONTHA[date('n', strtotime($stage->first_time))]) . ' Y года в H:i', strtotime($stage->first_time));
public function stageWorkTimeLeft($days = false, $dates = array(), $tpl = '%s') { if (!$dates) { $dates[0] = $this->first_time ? strtotime($this->first_time) : time(); $dates[1] = time(); } if (!$dates[0]) { $dates[0] = $this->first_time ? strtotime($this->first_time) : time(); } if (!$dates[1]) { $dates[1] = time(); } if (!$days) { $days = (int) $this->int_work_time; } $is_overtime = $dates[0] + $days * 3600 * 24 - $dates[1]; // проект просрочен $work_rem = (strtotime(date('Y-m-d', $dates[0])) + $days * 3600 * 24 - strtotime(date('Y-m-d', $dates[1]))) / 3600 / 24; if ($is_overtime < 0) { $ago = ago_pub($dates[0] + $days * 3600 * 24, $work_rem <= 1 ? 'ynjGi' : 'ynjG', $dates[1]); if ($ago == '') { $ago = '1 минуту'; } $title = 'проект просрочен на ' . $tpl; } else { $ago = ago_pub($dates[0] + $days * 3600 * 24, $work_rem <= 1 ? 'ynjGx' : 'ynjG', $dates[1]); if ($ago == '' || $ago == '1 минуту') { $ago = '1 минута'; } $title = ending(intval($ago), $ago == '1 минута' ? 'осталась' : 'остался', 'осталось', 'осталось') . ' ' . $tpl; } return sprintf($title, $ago); }
/** * Выдает хтмл-блок для индикатора присутствия в профиле пользователя (также используется в проектах (для автора проекта)). * В отличие от session::view_online_status(), выдает время последнего посещения сайта даже при отсутствии на сайте. * * @return string */ public function getOnlineStatus4Profile(&$message = null) { global $session; if (!$this->uid) { return; } $online_status = $session->view_online_status($this->login, false); $ago = $session->ago; if (!$session->is_active) { $lt = max((int) strtotime($this->last_time), self::getLastVisit($this->uid)); $fmt = 'ynjGi'; if (time() - $lt > 24 * 3600) { $fmt = 'ynjG'; if (time() - $lt > 30 * 24 * 3600) { $fmt = 'ynj'; } } $ago = ago_pub($lt, $fmt); } if (!$ago) { $ago = 'менее минуты'; } if ($ago == 'Только что') { $ago = 'только что'; } $message = $session->is_active ? ' ' : 'заходил' . ($this->sex == 'f' ? 'а ' : ' ') . $ago . ($ago != 'только что' ? ' назад' : ''); $online_status .= $message; return $online_status; }
$freelancer->GetUser($exec); } else { $freelancer->GetUserByUID($project['exec_id']); } if ($freelancer->uid && ($project['kind'] == projects::KIND_PERSONAL || $kind == projects::KIND_PERSONAL)) { $is_personal = true; } } if (!$kind) { $kind = $project['kind']; } //#0026326 //Лимит на кол-во публикаций проектов для неPRO за 24 часа if ($kind == 1 && !$proj_id && ($last_prj_date = $tmpPrj->isProjectsLimit($uid))) { //и есть лимит $last_prj_date = ago_pub($last_prj_date, 'G:i'); $content = "new/tpl.limit.php"; include "../template2.php"; exit; } if ($kind == 7) { $page_title = "Публикация конкурса - фриланс, удаленная работа на FL.ru"; } elseif ($kind == 4) { $page_title = "Новая вакансия - фриланс, удаленная работа на FL.ru"; } if ($proj_id && projects::isProjectOfficePostedAfterNewSBR($project) && !hasPermissions('projects')) { header("Location: /404.php"); exit; } if ($proj_id && $tmpPrj->isKonkurs() && !$tmpPrj->isActiveKonkurs() && !hasPermissions('projects')) { $error = 'contest_closed';
/** * Отображает значек активности юзера на сайте (новая версия view_online_status) * * @param string $login логин юзера * @param boolean $full отображать ли строковую информацию ("Нет на сайте") * @return string HTML-код значка активности */ function view_online_status_new($login, $full = false, $nbsp = ' ', &$activity = NULL) { if ($login) { $last_ref = $this->getActivityByLogin($login); } $activity = $last_ref; $last_ref_unixtime = strtotime($last_ref); if ($last_ref && time() - $last_ref_unixtime <= 30 * 60) { $ago = ago_pub(strtotimeEx($last_ref)); if (intval($ago) == 0) { $ago = "менее минуты"; } /* return ($full ? "<span class='u-act' title=\"Последняя активность была ".$ago." назад\">На сайте</span>" : "{$nbsp}<img src=\"/images/dot_active.png\" class=\"u-act\" alt=\"Последняя активность была ".$ago." назад\" title=\"Последняя активность была ".$ago." назад\" />$nbsp");*/ return "<span class='b-layout__txt b-layout__txt_fontsize_11 b-layout__txt_color_6db335 b-layouyt__txt_weight_normal'>На сайте.</span>"; } /*return ($full ? "<span class='u-inact'>Нет на сайте</span>" : "{$nbsp}<img src=\"/images/dot_inactive.png\" width=\"8\" height=\"9\" alt=\"Нет сайте\" class=\"u-inact\" title=\"Нет на сайте\" />$nbsp");*/ return "<span class='b-layout__txt b-layout__txt_fontsize_11 b-layout__txt_color_808080 b-layouyt__txt_weight_normal'>Нет на сайте.</span>"; }
<?php echo seo_end(); ?> <?php if ($theme['yt_link']) { // Не понял зачем это надо, всеравно ничего здесь не выводится show_video($theme['id'], $theme['yt_link']); } if ($ord == 'relevant') { if ($theme['num'] > 1) { ?> <table align="right" border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td class="lastime" align="right">Последний комментарий был <?php echo time() - strtotimeEx($theme['last_activity']) < 60 ? "только что" : ago_pub(strtotimeEx($theme['last_activity'])) . " назад"; ?> </td> </tr> </table> <?php } /* else { ?> Комментариев еще не было <? } */ }
/** * Изменение бана пользователя * * @param string $sUsers JSON строка с массивом UID пользователей * @param int $nActId * @param string $sReasonTxt причина * @param int $nReasonId ID причины, если она выбрана из списка (таблица admin_reasons) * @param int $nNoSend опционально. установить в 1 если не нужно оповещать юзера о том что он забанен. * @param string $sContext Контекст (для лога админских действий) * @param $sContext * @param bool $noticeSbrPartners уведомить партнеров по сделке о блокировке аккаунта * @return object xajaxResponse */ function updateUserBan($sUsers = '', $nActId, $sReasonTxt = '', $nReasonId = null, $sDateTo = '', $nNoSend = 0, $sContext = '', $noticeSbrPartners = false) { session_start(); $objResponse = new xajaxResponse(); if (hasPermissions('users')) { require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/users.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/messages_spam.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/messages.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/sbr_emp.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/sbr_frl.php'; $objUser = new users(); $nReasonId = $nReasonId ? $nReasonId : null; $aContext = _jsonArray($sContext); $aContext = $aContext ? $aContext : array('uid' => '', 'code' => 0, 'link' => '', 'name' => ''); $aUsers = _jsonArray($sUsers); $bCheck = true; if ($aContext['uid'] == 'moder') { global $user_content; $bCheck = $user_content->checkContent($aContext['contentId'], $aContext['streamId'], $aContext['recId']); } if ($bCheck && $aUsers && hasPermissions('users')) { foreach ($aUsers as $sUid) { $objUser->GetUserByUID($sUid); if ($objUser->uid) { $sReason = str_replace('%USERNAME%', $objUser->uname . ' ' . $objUser->usurname, $sReasonTxt); $sReason = change_q($sReason, FALSE, 0, TRUE); $sUniqId = "userban_{$sUid}"; $sObjName = $objUser->uname . ' ' . $objUser->usurname . '[' . $objUser->login . ']'; $sObjLink = '/users/' . $objUser->login; if ($nActId == 1) { // разблокируем if ($objUser->is_banned || $objUser->ban_where) { if ($objUser->is_banned) { $objResponse->script("\$\$('.warnbutton-{$sUid}').setStyle('display','');"); $objResponse->script("\$\$('.warnlist-{$sUid}').set('html','');"); $objResponse->script("\$\$('span[id^=\"warn_{$user->uid}\"]').set('html', '0')"); $objResponse->script("\$\$('div[id^=\"warn_{$user->uid}\"]').set('html', '0')"); } //$objUser->ban_where = 0; $objUser->unsetUserBan($sUid, $objUser->ban_where); // пишем лог админских действий $nLogActId = $objUser->is_banned ? 4 : 6; if ($objUser->self_deleted == 't') { $nLogActId = admin_log::ACT_ID_RESTORE_ACC; } admin_log::addLog(admin_log::OBJ_CODE_USER, $nLogActId, $sUid, $sUid, $sObjName, $sObjLink, 0, '', $nReasonId, $sReason); } $objResponse->script("\$\$('.warnlink-{$sUid} a').set('html','Забанить!');"); $objResponse->script("\$\$('.comm-ban-{$sUid} a').set('html','Заблокировать');"); $objResponse->script("\$\$('.admin-block h4 em').setStyle('display','none');"); if ($objUser->uid == $aContext['uid']) { $objResponse->script("\$('banreasonblock-{$objUser->uid}').setStyle('display','none');"); } $warns = $objUser->GetWarns($sUid); $warncount = $warns ? count($warns) : 0; $objResponse->script("if(\$('warncount-{$sUid}')) { \$('warncount-{$sUid}').set('html', {$warncount}); }"); } else { if ($sDateTo) { $sError = ''; $aDate = explode('-', $sDateTo); if (!$aDate[1] || !$aDate[2] || !$aDate[0] || !checkdate($aDate[1], $aDate[2], $aDate[0])) { $sError = 'Укажите корректную конечную дату'; } elseif (($toRes = strtotime($sDateTo)) <= time()) { $sError = 'Укажите конечную дату в будущем'; } if ($sError) { $objResponse->alert($sError); $objResponse->script("\$('ban_btn').set( 'disabled', false );\$('ban_btn').set( 'value', 'Сохранить' );"); return $objResponse; } } if ($objUser->is_banned || $objUser->ban_where) { // редактируем текущую блокировку $nBanWhere = $nActId == 3 ? 0 : 1; $objUser->updateUserBan($sUid, $objUser->ban_where, $nBanWhere, $sReason, $nReasonId, $sDateTo); } else { $nBanWhere = $nActId == 3 ? 0 : 1; $sBanId = $objUser->setUserBan($sUid, $nBanWhere, $sReason, $nReasonId, $sDateTo, $nNoSend); // пишем лог админских действий admin_log::addLog(admin_log::OBJ_CODE_USER, $nActId, $sUid, $sUid, $sObjName, $sObjLink, $aContext['code'], $aContext['link'], $nReasonId, $sReason, $sBanId, $aContext['name']); // уведомляем партнеров по сбр if ($noticeSbrPartners) { if (is_emp($objUser->role)) { $sbr = new sbr_emp($sUid); } else { $sbr = new sbr_frl($sUid); } $sbrPartners = $sbr->_new_getOpenSbrPartners(); $messages = new messages(); $messages->yourSbrPartnerIsBanned($sbrPartners, $objUser->login); } $objResponse->script("\$\$('.warnlink-{$sUid} a').set('html','Разбанить');"); $objResponse->script("\$\$('.comm-ban-{$sUid} a').set('html','Разблокировать');"); if (!$nBanWhere) { $GLOBALS['session']->nullActivityByLogin($objUser->login); // статус присутсвия ------ $online_status = $GLOBALS['session']->view_online_status($objUser->login, false); $ago = $GLOBALS['session']->ago; if (!$GLOBALS['session']->is_active && $objUser->last_time) { $fmt = 'ynjGi'; if (time() - ($lt = strtotime($objUser->last_time)) > 24 * 3600) { $fmt = 'ynjG'; if (time() - $lt > 30 * 24 * 3600) { $fmt = 'ynj'; } } $ago = ago_pub($lt, $fmt); } if (!$ago) { $ago = "менее минуты"; } $online_status .= ' <span class="' . ($GLOBALS['session']->is_active ? 'u-act' : '') . '">' . ($GLOBALS['session']->is_active ? 'на сайте' : 'Был' . ($objUser->sex == 'f' ? 'а' : '') . ' на сайте: ' . $ago . ' назад') . '</span>'; //------------------------- $objResponse->script("\$\$('.colB .bBA').set('html','{$online_status}');"); } } $warns = $objUser->GetWarns($sUid); $warncount = $warns ? count($warns) : 0; $objResponse->script("if(\$('warncount-{$sUid}')) { \$('warncount-{$sUid}').set('html', {$warncount}); }"); $sDisplay = $nBanWhere = $nActId == 3 ? 'none' : ''; if ($sDisplay == '' && $warncount == 3) { $sDisplay = 'none'; } $objResponse->script("\$\$('.warnbutton-{$sUid}').setStyle('display','{$sDisplay}');"); if ($objUser->uid == $aContext['uid']) { $sDateToParts = preg_split("/-/", $sDateTo); $admin_info = $objUser->getName(get_uid(), $ee); $objResponse->assign('banreasonblock-text-' . $objUser->uid, 'innerHTML', 'Блокировка ' . ($nBanWhere ? 'везде' : 'в блогах') . ' ' . ($sDateTo ? 'до ' . $sDateToParts[2] . ' ' . monthtostr($sDateToParts[1], true) . ' ' . $sDateToParts[0] : 'навсегда')); $objResponse->assign('banreasonblock-comment-' . $objUser->uid, 'innerHTML', reformat($sReason, 50)); $objResponse->assign('banreasonblock-date-' . $objUser->uid, 'innerHTML', date("d.m.Y H:i")); $objResponse->assign('banreasonblock-admin-' . $objUser->uid, 'innerHTML', $admin_info['login']); $objResponse->assign('banreasonblock-admin-' . $objUser->uid, 'href', '/users/' . $admin_info['login']); $objResponse->script("\$('banreasonblock-{$objUser->uid}').setStyle('display','block');"); } // удаляем все жалобы на спам для юзера $oSpam = new messages_spam(); $oSpam->deleteSpamBySpamer($sUid, 3); } $objResponse->script("delete banned.buffer['userban_{$sUid}'];"); $str = "<b>Пользователь забанен</b>"; if ($objUser->is_banned) { $str = ""; } $objResponse->script("\n if (\$('user_banned_" . $objUser->uid . "')) { \n \t\$('user_banned_" . $objUser->uid . "').set('html', '{$str}');\n }else {\n \tvar p = \$('user_first_paragraph_" . $objUser->uid . "'); \t\n \tif (p) {\n \t\tvar span = new Element('span', {\"style\":\"color:#000\", \"id\":\"user_banned_" . $objUser->uid . "\"});\n \t\tspan.inject(p, 'bottom');\n\t\t\t\t\t\t\tspan.set('html', '{$str}'); \t\t\n \t}\n }\n "); } } } if ($aContext['uid'] == 'gray_ip') { $objResponse->script('if(window.opener){window.opener.window.location.reload(true);}'); } $objResponse->script("\$\$(\"div[id^='ov-notice']\").setStyle('display', 'none');"); $objResponse->script("\$('ov-notice22').toggleClass('b-shadow_hide');"); $objResponse->script("if(banned.reload==1){window.location.reload(true);}"); $objResponse->script("if(banned.zero){banned.zeroShow();}"); $objResponse->script("if(typeof(adminLogCheckUsers)!='undefined'){adminLogCheckUsers(false);};if(\$('chk_all')){\$('chk_all').checked=false;};"); if ($aContext['uid'] == 'admin_log_page' || $aContext['uid'] == 'admin_user_search') { $objResponse->script('window.location.reload(true)'); } if ($aContext['uid'] == 'moder') { // если бан делается из потока модерирования $objResponse->script('user_content.resolveContent(user_content.resolveSid, 2, user_content.resolveUid)'); $objResponse->script("parent.\$\$(\"div[id^='ov-notice']\").setStyle('display', 'none');"); $objResponse->script("parent.\$('ov-notice22').toggleClass('b-shadow_hide');"); } } return $objResponse; }
function view_online_status($login, $full = false) { if ($login) { $last_ref = getActivityByLogin($login); } if ($last_ref) { $ago = ago_pub(strtotimeEx($last_ref)); if (intval($ago) == 0) { $ago = "менее минуты"; } return "<img src=\"" . $GLOBALS["host"] . "/images/dot_active.gif\" style=\"width:10px;height:10px;padding-right:3px;vertical-align:middle;\" alt=\"Последняя активность была " . $ago . " назад\" title=\"Последняя активность была " . $ago . " назад\" border=\"0\">" . ($full ? "<span class='u_active'>На сайте</span>" : ""); } return "<img src=\"" . $GLOBALS["host"] . "/images/dot_inactive.gif\" style=\"width:8px;height:9px;padding-right:3px;vertical-align:middle;\" alt=\"Нет на сайте\" title=\"Нет на сайте\" border=\"0\">" . ($full ? "<span class='u_inactive'>Нет на сайте</span>" : ""); }
/** * вывод для админки арбитража * сделано на основе ago_pub * но если прошло менее часа, то так и показывает 'менее часа' * @param type $from_date * @return type */ function ago_arbitrage_answered($from_date) { // Менее часа назад if ($from_date > strtotime('-1 hours')) { return 'менее 1 часа'; } else { return ago_pub($from_date); } }
function view_online_status($login, $full = false) { if ($login) { $last_ref = getActivityByLogin($login); } if ($last_ref) { $ago = ago_pub(strtotimeEx($last_ref)); if (intval($ago) == 0) { $ago = 'менее минуты'; } return '<img src="' . $GLOBALS['host'] . '/images/dot_active.gif" style="width:10px;height:10px;padding-right:3px;vertical-align:middle;" alt="Последняя активность была ' . $ago . ' назад" title="Последняя активность была ' . $ago . ' назад" border="0">' . ($full ? "<span class='u_active'>На сайте</span>" : ''); } return '<img src="' . $GLOBALS['host'] . '/images/dot_inactive.gif" style="width:8px;height:9px;padding-right:3px;vertical-align:middle;" alt="Нет на сайте" title="Нет на сайте" border="0">' . ($full ? "<span class='u_inactive'>Нет на сайте</span>" : ''); }