Exemplo n.º 1
0
    if (!doesHaveOwnership() && empty($_GET["comment_{$entryId}"])) {
        printIphoneErrorPage(_text('Comment write error.'), _text('Please enter content.'), "{$blogURL}/comment/{$entryId}");
    } else {
        $comment = array();
        $comment['entry'] = $entryId;
        $comment['parent'] = null;
        $comment['name'] = empty($_GET["name_{$entryId}"]) ? '' : $_GET["name_{$entryId}"];
        $comment['password'] = empty($_GET["password_{$entryId}"]) ? '' : $_GET["password_{$entryId}"];
        $comment['homepage'] = empty($_GET["homepage_{$entryId}"]) || $_GET["homepage_{$entryId}"] == 'http://' ? '' : $_GET["homepage_{$entryId}"];
        $comment['secret'] = empty($_GET["secret_{$entryId}"]) ? 0 : 1;
        $comment['comment'] = $_GET["comment_{$entryId}"];
        $comment['ip'] = $_SERVER['REMOTE_ADDR'];
        $result = addComment($blogid, $comment);
        if (in_array($result, array('ip', 'name', 'homepage', 'comment', 'openidonly', 'etc'))) {
            if ($result == 'openidonly') {
                $blockMessage = _text('You have to log in with and OpenID to leave a comment.');
            } else {
                $blockMessage = _textf('Blocked %1', $result);
            }
            printIphoneErrorPage(_text('Comment write blocked.'), $blockMessage, "{$blogURL}/comment/{$entryId}");
        } else {
            if ($result === false) {
                printIphoneErrorPage(_text('Comment write error.'), _text('Cannot write comment.'), "{$blogURL}/comment/{$entryId}");
            } else {
                setcookie('guestName', $comment['name'], time() + 2592000, $blogURL);
                setcookie('guestHomepage', $comment['homepage'], time() + 2592000, $blogURL);
                printIphoneSimpleMessage(_text('Comment registered.'), _text('Go to comments page'), "{$blogURL}/comment/{$entryId}");
            }
        }
    }
}
Exemplo n.º 2
0
    if (!doesHaveOwnership() && empty($_GET["comment_{$replyId}"])) {
        printIphoneErrorPage(_text('댓글 작성 오류.'), _text('내용을 입력해 주세요.'), "{$blogURL}/comment/comment/{$replyId}");
    } else {
        $comment = array();
        $comment['entry'] = $entryId;
        $comment['parent'] = $replyId;
        $comment['name'] = empty($_GET["name_{$replyId}"]) ? '' : $_GET["name_{$replyId}"];
        $comment['password'] = empty($_GET["password_{$replyId}"]) ? '' : $_GET["password_{$replyId}"];
        $comment['homepage'] = empty($_GET["homepage_{$replyId}"]) || $_GET["homepage_{$replyId}"] == 'http://' ? '' : $_GET["homepage_{$replyId}"];
        $comment['secret'] = empty($_GET["secret_{$replyId}"]) ? 0 : 1;
        $comment['comment'] = $_GET["comment_{$replyId}"];
        $comment['ip'] = $_SERVER['REMOTE_ADDR'];
        $result = addComment($blogid, $comment);
        if (in_array($result, array('ip', 'name', 'homepage', 'comment', 'openidonly', 'etc'))) {
            if ($result == 'openidonly') {
                $blockMessage = _text('댓글을 쓰기 위해서는 OpenID로 로그인해야 합니다.');
            } else {
                $blockMessage = _textf('%1 은 차단되었습니다.', $result);
            }
            printIphoneErrorPage(_text('댓글 작성이 차단되었습니다.'), $blockMessage, "{$blogURL}/comment/{$entryId}");
        } else {
            if ($result === false) {
                printIphoneErrorPage(_text('댓글 작성 오류.'), _text('댓글을 작성할 수 없었습니다.'), "{$blogURL}/comment/{$entryId}");
            } else {
                setcookie('guestName', $comment['name'], time() + 2592000, $blogURL);
                setcookie('guestHomepage', $comment['homepage'], time() + 2592000, $blogURL);
                printIphoneSimpleMessage(_text('댓글이 등록되었습니다.'), _text('댓글 페이지로 이동'), "{$blogURL}/comment/{$entryId}");
            }
        }
    }
}