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}"); } } } }
<?php /// Copyright (c) 2004-2011, Needlworks / Tatter Network Foundation /// All rights reserved. Licensed under the GPL. /// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT) define('__TEXTCUBE_IPHONE__', true); $IV = array('POST' => array('password' => array('string', 'default' => null))); require ROOT . '/library/preprocessor.php'; requireView('iphoneView'); $entry = getEntry($blogid, $suri['id']); if (!is_null($entry) && isset($_POST['password']) && $entry['password'] == $_POST['password']) { setcookie('GUEST_PASSWORD', $_POST['password'], time() + 86400, "{$blogURL}/"); header("Location: {$blogURL}/entry/{$suri['id']}"); } else { printIphoneErrorPage(_text('Password (again)!'), _text('Wrong password.'), "{$blogURL}/entry/{$suri['id']}"); }
if (empty($suri['id'])) { $IV = array('GET' => array('replyId' => array('id'), 'password' => array('string', 'mandatory' => false))); } require ROOT . '/library/preprocessor.php'; requireView('iphoneView'); requireStrictRoute(); if (empty($suri['id'])) { list($entryId) = getCommentAttributes($blogid, $_GET['replyId'], 'entry'); if (deleteComment($blogid, $_GET['replyId'], $entryId, isset($_GET['password']) ? $_GET['password'] : '') === false) { printIphoneErrorPage(_text('Comment delete error.'), _text('Incorrect Password.'), "{$blogURL}/comment/delete/{$_GET['replyId']}"); exit; } } else { list($entryId) = getCommentAttributes($blogid, $suri['id'], 'entry'); if (deleteComment($blogid, $suri['id'], $entryId, '') === false) { printIphoneErrorPage(_t('Comment delete error'), _t('Administrator access only.'), "{$blogURL}/comment/delete/{$suri['id']}"); exit; } } list($entries, $paging) = getEntryWithPaging($blogid, $entryId); $entry = $entries ? $entries[0] : null; ?> <div id="commentDeleted" title="Deleted" class="panel"> <div class="content"> <?php echo _t('Comment deleted.'); ?> </div> <a href="<?php echo "{$blogURL}/comment/{$entryId}"; ?>
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}"); } } } }