Пример #1
0
function ForumSetReadForum($FID = false)
{
    $UserLogin = "******";
    $timestamp = CForumNew::GetNowTime("timestamp");
    $FID = intVal($FID);
    if ($GLOBALS["USER"]->IsAuthorized()) {
        $UserLogin = $GLOBALS["USER"]->GetLogin();
        CForumUser::SetUserForumLastVisit($GLOBALS["USER"]->GetID(), $FID, $timestamp);
    }
    if ($FID <= 0) {
        if (is_array($_SESSION["FORUM"])) {
            foreach ($_SESSION["FORUM"] as $key => $val) {
                if (substr($key, 0, strLen("LAST_VISIT_FORUM_")) == "LAST_VISIT_FORUM_") {
                    unset($_SESSION["FORUM"][$key]);
                }
            }
        }
        unset($_SESSION["FORUM"][$UserLogin]);
    }
    $_SESSION["FORUM"][$UserLogin][$FID] = $timestamp;
    $_SESSION["FORUM"]["LAST_VISIT_FORUM_" . $FID] = $timestamp;
    return ForumInitParams();
}