/
get_value('user_'.$CURUSER["id"].'_inbox_count');
if ($messages == ""){
$messages = get_row_count("messages", "WHERE receiver=" . sqlesc($CURUSER["id"]) . " AND location<>0");
$Cache->cache_value('user_'.$CURUSER["id"].'_inbox_count', $messages, 900);
}
$outmessages = $Cache->get_value('user_'.$CURUSER["id"].'_outbox_count');
if ($outmessages == ""){
$outmessages = get_row_count("messages","WHERE sender=" . sqlesc($CURUSER["id"]) . " AND saved='yes'");
$Cache->cache_value('user_'.$CURUSER["id"].'_outbox_count', $outmessages, 900);
}
if (!$connect = $Cache->get_value('user_'.$CURUSER["id"].'_connect')){
$res3 = sql_query("SELECT connectable FROM peers WHERE userid=" . sqlesc($CURUSER["id"]) . " order by id desc LIMIT 1");
if($row = mysql_fetch_row($res3))
$connect = $row[0];
else $connect = 'unknown';
$Cache->cache_value('user_'.$CURUSER["id"].'_connect', $connect, 900);
}
if($connect == "yes")
$connectable = "".$lang_functions['text_yes']."";
elseif ($connect == 'no')
$connectable = "".$lang_functions['text_no']."";
else
$connectable = $lang_functions['text_unknown'];
//// check every 60 seconds //////////////////
$activeseed = $Cache->get_value('user_'.$CURUSER["id"].'_active_seed_count');
if ($activeseed == ""){
$activeseed = get_row_count("peers","WHERE userid=" . sqlesc($CURUSER["id"]) . " AND seeder='yes'");
$Cache->cache_value('user_'.$CURUSER["id"].'_active_seed_count', $activeseed, 60);
}
$activeleech = $Cache->get_value('user_'.$CURUSER["id"].'_active_leech_count');
if ($activeleech == ""){
$activeleech = get_row_count("peers","WHERE userid=" . sqlesc($CURUSER["id"]) . " AND seeder='no'");
$Cache->cache_value('user_'.$CURUSER["id"].'_active_leech_count', $activeleech, 60);
}
$unread = $Cache->get_value('user_'.$CURUSER["id"].'_unread_message_count');
if ($unread == ""){
$unread = get_row_count("messages","WHERE receiver=" . sqlesc($CURUSER["id"]) . " AND unread='yes'");
$Cache->cache_value('user_'.$CURUSER["id"].'_unread_message_count', $unread, 60);
}
$inboxpic = " ";
// $attend_desk = new Attendance($CURUSER['id']);
// $attendance = $attend_desk->check();
$attendanceRep = new \App\Repositories\AttendanceRepository();
$attendance = $attendanceRep->getAttendance($CURUSER['id'], date('Ymd'))
?>
,
[]
[]
= UC_MODERATOR) { ?> []
= UC_SYSOP) { ?> []
[]
[]:
'.$lang_functions['text_attended'].'', $attendance->points, $CURUSER['attendance_card']); }else{ printf(' %s', $lang_functions['text_attendance']);}?>
[]
[]
[]: where('inviter', $CURUSER['id'])->where('invitee', '')->where('expired_at', '>', now())->count())?>
= \App\Models\User::getAccessAdminClassMin()) printf('[%s]', nexus_env('FILAMENT_PATH', 'nexusphp'), $lang_functions['text_management_system'])?>
H&R: %s]', (new \App\Repositories\HitAndRunRepository())->getStatusStats($CURUSER['id']))?>
%s]', $CURUSER['id'], (new \App\Repositories\ClaimRepository())->getStats($CURUSER['id']))?>
|
|
get_value('staff_report_count');
if ($totalreports == ""){
$totalreports = get_row_count("reports");
$Cache->cache_value('staff_report_count', $totalreports, 900);
}
$totalcheaters = $Cache->get_value('staff_cheater_count');
if ($totalcheaters == ""){
$totalcheaters = get_row_count("cheaters");
$Cache->cache_value('staff_cheater_count', $totalcheaters, 900);
}
print(
" ".$totalcheaters
." ".$totalreports
);
}
print(" ");
print(" ");
print ' ';
//echo $lang_functions['text_the_time_is_now'].$datum['hours'].":".$datum['minutes'] . ' ';
// $cacheKey = "staff_message_count_" . $CURUSER['id'];
// $totalsm = $Cache->get_value($cacheKey);
$totalsm = \App\Repositories\MessageRepository::getStaffMessageCountCache($CURUSER['id'], 'total');
if ($totalsm === false){
$totalsm = \App\Repositories\MessageRepository::countStaffMessage($CURUSER['id']);
// $Cache->cache_value($cacheKey, $totalsm, 900);
\App\Repositories\MessageRepository::updateStaffMessageCountCache($CURUSER['id'], 'total', $totalsm);
}
if ($totalsm > 0) {
print (" ".$totalsm." ");
}
print("".$inboxpic." ".($messages ? $messages." (".$unread.$lang_functions['text_message_new'].")" : "0"));
print(" ".($outmessages ? $outmessages : "0"));
?>
|
|
|
|
enable_ad()){
$belownavad=$Advertisement->get_ad('belownav');
if ($belownavad)
echo " ".$belownavad[0]." ";
}
if ($msgalert)
{
$timeline = \App\Models\TorrentState::resolveTimeline();
$currentPromotion = $timeline['current'] ?? null;
$upcomingPromotion = $timeline['upcoming'] ?? null;
$remarkTpl = $lang_functions['full_site_promotion_remark'] ?? 'Remark: %s';
if ($currentPromotion) {
$promotionText = \App\Models\Torrent::$promotionTypes[$currentPromotion['global_sp_state']]['text'] ?? '';
$msg = sprintf($lang_functions['full_site_promotion_in_effect'], $promotionText);
if (!empty($currentPromotion['begin']) || !empty($currentPromotion['deadline'])) {
$timeRange = sprintf($lang_functions['full_site_promotion_time_range'], $currentPromotion['begin'] ?? '-∞', $currentPromotion['deadline'] ?? '∞');
$msg .= ' ' . $timeRange;
}
if (!empty($currentPromotion['remark'])) {
$msg .= ' ' . sprintf($remarkTpl, $currentPromotion['remark']);
}
msgalert("torrents.php", $msg, "green");
}
if ($upcomingPromotion) {
$promotionText = \App\Models\Torrent::$promotionTypes[$upcomingPromotion['global_sp_state']]['text'] ?? '';
$msg = sprintf($lang_functions['full_site_promotion_upcoming'] ?? 'Upcoming full site [%s]', $promotionText);
if (!empty($upcomingPromotion['begin']) || !empty($upcomingPromotion['deadline'])) {
$timeRange = sprintf($lang_functions['full_site_promotion_time_range'], $upcomingPromotion['begin'] ?? '-∞', $upcomingPromotion['deadline'] ?? '∞');
$msg .= ' ' . $timeRange;
}
if (!empty($upcomingPromotion['remark'])) {
$msg .= ' ' . sprintf($remarkTpl, $upcomingPromotion['remark']);
}
msgalert("torrents.php", $msg, "blue");
}
if($CURUSER['leechwarn'] == 'yes')
{
$kicktimeout = gettime($CURUSER['leechwarnuntil'], false, false, true);
$text = $lang_functions['text_please_improve_ratio_within'].$kicktimeout.$lang_functions['text_or_you_will_be_banned'];
msgalert("faq.php#id17", $text, "orange");
}
if($deletenotransfertwo_account) //inactive account deletion notice
{
if ($CURUSER['downloaded'] == 0 && ($CURUSER['uploaded'] == 0 || $CURUSER['uploaded'] == $iniupload_main))
{
$neverdelete_account = ($neverdelete_account <= UC_VIP ? $neverdelete_account : UC_VIP);
if (get_user_class() < $neverdelete_account)
{
$secs = $deletenotransfertwo_account*24*60*60;
$addedtime = strtotime($CURUSER['added']);
if (TIMENOW > $addedtime+($secs/3)) // start notification if one third of the time has passed
{
$kicktimeout = gettime(date("Y-m-d H:i:s", $addedtime+$secs), false, false, true);
$text = $lang_functions['text_please_download_something_within'].$kicktimeout.$lang_functions['text_inactive_account_be_deleted'];
msgalert("rules.php", $text, "gray");
}
}
}
}
if($CURUSER['showclienterror'] == 'yes')
{
$text = $lang_functions['text_banned_client_warning'];
msgalert("faq.php#id29", $text, "black");
}
if ($unread)
{
$text = $lang_functions['text_you_have'].$unread.$lang_functions['text_new_message'] . add_s($unread) . $lang_functions['text_click_here_to_read'];
msgalert("messages.php",$text, "red");
}
\App\Utils\MsgAlert::getInstance()->render();
/*
$pending_invitee = $Cache->get_value('user_'.$CURUSER["id"].'_pending_invitee_count');
if ($pending_invitee == ""){
$pending_invitee = get_row_count("users","WHERE status = 'pending' AND invited_by = ".sqlesc($CURUSER['id']));
$Cache->cache_value('user_'.$CURUSER["id"].'_pending_invitee_count', $pending_invitee, 900);
}
if ($pending_invitee > 0)
{
$text = $lang_functions['text_your_friends'].add_s($pending_invitee).is_or_are($pending_invitee).$lang_functions['text_awaiting_confirmation'];
msgalert("invite.php?id=".$CURUSER['id'],$text, "red");
}*/
$settings_script_name = $_SERVER["SCRIPT_FILENAME"];
if (!preg_match("/index/i", $settings_script_name))
{
$new_news = $Cache->get_value('user_'.$CURUSER["id"].'_unread_news_count');
if ($new_news == ""){
$new_news = get_row_count("news","WHERE notify = 'yes' AND added > ".sqlesc($CURUSER['last_home']));
$Cache->cache_value('user_'.$CURUSER["id"].'_unread_news_count', $new_news, 300);
}
if ($new_news > 0)
{
$text = $lang_functions['text_there_is'].is_or_are($new_news).$new_news.$lang_functions['text_new_news'];
msgalert("index.php",$text, "green");
}
}
//Staff message, not only staff member
// $cacheKey = 'staff_new_message_count_' . $CURUSER['id'];
// $nummessages = $Cache->get_value($cacheKey);
$nummessages = \App\Repositories\MessageRepository::getStaffMessageCountCache($CURUSER['id'], 'new');
if ($nummessages === false){
$nummessages = \App\Repositories\MessageRepository::countStaffMessage($CURUSER['id'], 0);
// $Cache->cache_value($cacheKey, $nummessages, 900);
\App\Repositories\MessageRepository::updateStaffMessageCountCache($CURUSER['id'], 'new', $nummessages);
}
if ($nummessages > 0) {
$text = $lang_functions['text_there_is'].is_or_are($nummessages).$nummessages.$lang_functions['text_new_staff_message'] . add_s($nummessages);
msgalert("staffbox.php",$text, "blue");
}
//torrent approval
if (user_can('torrent-approval') && get_setting('torrent.approval_status_none_visible') == 'no') {
$cacheKey = 'TORRENT_APPROVAL_NONE';
$toApprovalCounts = $Cache->get_value($cacheKey);
if ($toApprovalCounts === false) {
$toApprovalCounts = get_row_count('torrents', 'where approval_status = 0');
$Cache->cache_value($cacheKey, $toApprovalCounts, 60);
}
if ($toApprovalCounts) {
msgalert('torrents.php?approval_status=0&incldead=0', sprintf($lang_functions['text_torrent_to_approval'], is_or_are($toApprovalCounts), $toApprovalCounts, add_s($toApprovalCounts)), 'darkred');
}
}
//seed box approval
if (get_user_class() >= \App\Models\User::CLASS_ADMINISTRATOR && get_setting('seed_box.enabled') == 'yes') {
$cacheKey = \App\Repositories\SeedBoxRepository::APPROVAL_COUNT_CACHE_KEY;
$toApprovalCounts = $Cache->get_value($cacheKey);
if ($toApprovalCounts === false) {
$toApprovalCounts = get_row_count('seed_box_records', 'where status = 0');
$Cache->cache_value($cacheKey, $toApprovalCounts, 60);
}
if ($toApprovalCounts) {
msgalert('/nexusphp/system/seed-box-records?tableFilters[status][value]=0', sprintf($lang_functions['text_seed_box_record_to_approval'], is_or_are($toApprovalCounts), $toApprovalCounts, add_s($toApprovalCounts)), 'darkred');
}
}
if (user_can('staffmem'))
{
if(($complaints = $Cache->get_value('COMPLAINTS_COUNT_CACHE')) === false){
$complaints = get_row_count('complains', 'WHERE answered = 0');
$Cache->cache_value('COMPLAINTS_COUNT_CACHE', $complaints, 600);
}
if($complaints) {
msgalert('complains.php?action=list', sprintf($lang_functions['text_complains'], is_or_are($complaints), $complaints, add_s($complaints)), 'darkred');
}
$numreports = $Cache->get_value('staff_new_report_count');
if ($numreports == ""){
$numreports = get_row_count("reports","WHERE dealtwith=0");
$Cache->cache_value('staff_new_report_count', $numreports, 900);
}
if ($numreports){
$text = $lang_functions['text_there_is'].is_or_are($numreports).$numreports.$lang_functions['text_new_report'] .add_s($numreports);
msgalert("reports.php",$text, "blue");
}
$numcheaters = $Cache->get_value('staff_new_cheater_count');
if ($numcheaters == ""){
$numcheaters = get_row_count("cheaters","WHERE dealtwith=0");
$Cache->cache_value('staff_new_cheater_count', $numcheaters, 900);
}
if ($numcheaters){
$text = $lang_functions['text_there_is'].is_or_are($numcheaters).$numcheaters.$lang_functions['text_new_suspected_cheater'] .add_s($numcheaters);
msgalert("cheaterbox.php",$text, "blue");
}
}
//show the exam info
$exam = new \Nexus\Exam\Exam();
$currentExam = $exam->getCurrent($CURUSER['id']);
if (!empty($currentExam['html'])) {
msgalert($currentExam['exam']->type==\App\Models\Exam::TYPE_TASK ? "task.php" : "messages.php", $currentExam['html'], $currentExam['exam']->background_color ?? 'blue');
}
}
if ($offlinemsg)
{
print("| \n");
print("".$lang_functions['text_website_offline_warning']."");
print(" |
\n");
}
}
}
function stdfoot() {
global $SITENAME,$BASEURL,$Cache,$datefounded,$tstart,$icplicense_main,$add_key_shortcut,$query_name, $USERUPDATESET, $CURUSER, $enablesqldebug_tweak, $sqldebug_tweak, $Advertisement, $analyticscode_tweak;
global $hook;
print(" |