Ejemplo n.º 1
0
if ($pm['drafting'] && !$snoop) {
    Kill(__("Unknown PM"));
}
//could say "PM is addresssed to you, but is being drafted", but what they hey?
$rUser = Query("select * from {users} where id = {0}", $pm['userfrom']);
if (NumRows($rUser)) {
    $user = Fetch($rUser);
} else {
    Kill(__("Unknown user."));
}
$links = array();
if (!$snoop && $pm['userto'] == $loguserid) {
    Query("update {pmsgs} set msgread=1 where id={0}", $pm['id']);
    DismissNotification('pm', $pm['id'], $loguserid);
    $links[] = actionLinkTag(__("Send reply"), "sendprivate", "", "pid=" . $pm['id']);
} else {
    if ($_GET['markread']) {
        Query("update {pmsgs} set msgread=1 where id={0}", $pm['id']);
        DismissNotification('pm', $pm['id'], -1);
        die(header('Location: ' . actionLink('private')));
    }
}
$pmtitle = htmlspecialchars($pm['title']);
MakeCrumbs(array(actionLink("private") => __("Private messages"), '' => $pmtitle), $links);
$pm['num'] = 0;
$pm['posts'] = $user['posts'];
$pm['id'] = 0;
foreach ($user as $key => $value) {
    $pm['u_' . $key] = $value;
}
MakePost($pm, POST_PM);
Ejemplo n.º 2
0
        if ($block && !$isBlocked) {
            $rBlock = Query("insert into {blockedlayouts} (user, blockee) values ({0}, {1})", $id, $loguserid);
        } elseif (!$block && $isBlocked) {
            $rBlock = Query("delete from {blockedlayouts} where user={0} and blockee={1} limit 1", $id, $loguserid);
        }
        die(header("Location: " . actionLink("profile", $id, '', $user['name'])));
    }
    if ($_GET['action'] == "delete") {
        $postedby = FetchResult("SELECT cid FROM {usercomments} WHERE uid={0} AND id={1}", $id, (int) $_GET['cid']);
        if ($canDeleteComments || $postedby == $loguserid && HasPermission('user.deleteownusercomments')) {
            Query("delete from {usercomments} where uid={0} and id={1}", $id, (int) $_GET['cid']);
            if ($loguserid != $id) {
                // dismiss any new comment notification that has been sent to that user, unless there are still new comments
                $lastcmt = FetchResult("SELECT date FROM {usercomments} WHERE uid={0} ORDER BY date DESC LIMIT 1", $id);
                if ($lastcmt < $user['lastprofileview']) {
                    DismissNotification('profilecomment', $id, $id);
                }
            }
            die(header("Location: " . actionLink("profile", $id, '', $user['name'])));
        }
    }
    if (isset($_POST['actionpost']) && !IsReallyEmpty($_POST['text']) && $canComment) {
        $rComment = Query("insert into {usercomments} (uid, cid, date, text) values ({0}, {1}, {2}, {3})", $id, $loguserid, time(), $_POST['text']);
        if ($loguserid != $id) {
            SendNotification('profilecomment', $id, $id);
        }
        die(header("Location: " . actionLink("profile", $id, '', $user['name'])));
    }
}
if ($loguserid) {
    if (Settings::get('postLayoutType')) {