function timeInterval($start, $current) { $interval = $current - $start; if (0 <= $interval && $interval < 60) { return $interval . _text('초'); } else { if (60 <= $interval && $interval < 3600) { return ceil($interval / 60) . _text('분'); } else { if (3600 <= $interval && $interval < 86400) { return ceil($interval / 60 / 60) . _text('시간'); } else { if (86400 <= $interval && $interval < 2592000) { return ceil($interval / 60 / 60 / 24) . _text('일'); } else { if (2592000 <= $interval && $interval < 31104000) { return ceil($interval / 60 / 60 / 24 / 30) . _text('달'); } else { if (31104000 <= $interval) { return ceil($interval / 60 / 60 / 24 / 30 / 12) . _text('년'); } } } } } } return ceil($interval / 60 / 60 / 24 / 30 / 12 / 100) . _text('세기'); }
/** * Validate class * * First, use _text to filter raw input * Next, validate filtered input against classes * * @param string $unfiltered The unfiltered class * @return mixed * @var string $new The filtered class */ function _class($unfiltered) { $new = _text($unfiltered); if ('extra' === $new || 'plan' === $new || 'site' === $new || 'subscription' === $new || 'user' === $new) { return $new; } else { return false; } }
function WikiCube_FormatErrorPage($target) { $context = Model_Context::getInstance(); $config = $context->getProperty('plugin.config'); if (empty($config['mode'])) { $config['mode'] = 'entry'; } $additional = '<div style="border:none;width:100%;text-align:center;"><a href="' . $context->getProperty('uri.blog') . '/owner/entry/post?slogan=' . $context->getProperty('suri.value') . ($config['mode'] == 'entry' ? '' : '&category=-3') . '">' . _text('Empty page. Click here to add a new entry.') . '</a></div>'; return $target . $additional; }
/** * @param mixed $current_language_code Currently selected language * @param type $current_region_code Currently selected region */ function __initialize($current_language_code = false, $current_region_code = false) { parent::__initialize(); $this->script("Locale_Settings_Init();"); $this->setData('role', 'region'); $this->setData('controller', buildQuery($this->id)); if ($current_language_code) { if ($current_language_code instanceof CultureInfo) { $lang = $current_language_code->ResolveToLanguage(); } else { $lang = Localization::getLanguageCulture($current_language_code); } if (!$lang) { $lang = Localization::detectCulture()->ResolveToLanguage(); } $regions = $lang->GetRegions(false); if (!$current_region_code) { $current_region_code = $lang->DefaultRegion()->Code; } } else { $regions = Localization::get_all_regions(false); } if ($current_region_code) { if ($current_region_code instanceof CultureInfo) { $this->SetCurrentValue($current_region_code->DefaultRegion()->Code); } else { $this->SetCurrentValue($current_region_code); } } if (count($regions) > 0) { $cc = current_controller(false); $translations_active = $cc instanceof Renderable && $cc->_translate; $sorted = array(); foreach ($regions as $reg) { if (!$reg) { continue; } $code = $reg->Code; if ($translations_active) { $sorted[$code] = array("name" => _text(tds("TXT_COUNTRY_" . strtoupper($code), $reg->EnglishName)), "code" => $code); } else { $sorted[$code] = array("name" => $reg->EnglishName, "code" => $code); } } uasort($sorted, __CLASS__ . "::compareCountryNames"); foreach ($sorted as $code => $item) { $this->AddOption($code, $item['name']); } } }
function add() { $number = intval(v('number')); if ($number < 1) { info_page(_text('system_input_right_no')); } if (intval($this->invite->get_invite_limit()) && intval($this->invite->get_invite_limit()) < $number) { info_page(_text('invite_buy_over_limit')); } if ($this->invite->buy($number)) { info_page(_text('invite_buy_success'), '/invite/myinvite'); } else { info_page(_text('invite_buy_money_limit')); } }
function clearCache() { global $database, $changed, $errorlog, $memcache; static $isCleared = false; if ($isCleared == true) { return; } if (!is_null($blogids = POD::queryColumn("SELECT blogid FROM {$database['prefix']}PageCacheLog"))) { $changed = true; $errorlog = false; echo '<li>', _textf('페이지 캐시를 초기화합니다.'), ': '; foreach ($blogids as $ids) { if (CacheControl::flushAll($ids) == false) { $errorlog = true; } } if ($errorlog == false) { echo '<span class="result success">', _text('성공'), '</span></li>'; } else { echo '<span class="result fail">', _text('실패'), '</span></li>'; } } if (!is_null($memcache)) { echo '<li>', _textf('Memcached 캐시를 초기화합니다.'), ': '; if ($memcache->flush()) { echo '<span class="result success">', _text('성공'), '</span></li>'; } else { echo '<span class="result fail">', _text('실패'), '</span></li>'; } } echo '<li>', _textf('공지사항 캐시를 초기화합니다.'), ': '; if (POD::execute("DELETE FROM {$database['prefix']}ServiceSettings WHERE name like 'TextcubeNotice%'")) { echo '<span class="result success">', _text('성공'), '</span></li>'; } else { echo '<span class="result fail">', _text('실패'), '</span></li>'; } $isCleared = true; }
function save($info, $extra = NULL) { if (is_array($extra)) { $data = $extra; } $data['u2_title'] = $info['u2_title']; $data['u2_desp'] = $info['u2_desp']; $data['u2_uid'] = format_uid(); $data['u2_nickname'] = _sess('u2_nickname'); $data['u2_addtime'] = date("Y-m-d H:i:s"); $data['u2_hit'] = 0; $data['u2_pic'] = $info['u2_pic']; if (check_active()) { $data['u2_is_active'] = 1; } else { $data['u2_is_active'] = 0; } $data['u2_cate'] = $info['cate']; $this->db->insert('u2_content', $data); $id = $this->db->insert_id(); $type = _text('system_pro'); $desc = '<a href="/riki/display/' . $id . '" target="_blank">' . $info['u2_title'] . '</a>'; add_to_manager('u2_content', $id, $desc, $type, $data['u2_is_active']); }
<input type="text" id="url" class="input-text" name="url" onkeydown="if (event.keyCode == 13) { sendTrackback(<?php echo $suri['id']; ?> ); return false;}" /> <input type="button" class="input-button" name="Submit" value="<?php echo _text('전송'); ?> " onclick="sendTrackback(<?php echo $context->getProperty('suri.id'); ?> ); return false;" /> </dd> </dl> <div id="logs_<?php echo $context->getProperty('suri.id'); ?> "></div> </div> <div class="button-box"> <input type="button" class="input-button" value="<?php echo _text('닫기'); ?> " onclick="window.close()" /> </div> </div> </form> </body> </html>
<?php printIphoneTrackbackView($entry['id']); ?> <fieldset class="navi margin-top10"> <?php printIphoneNavigation($entry, true, false); ?> </fieldset> </div> <?php } else { ?> <div id="trackback_<?php echo "_" . time(); ?> " title="<?php echo _text('최근 트랙백'); ?> " selected="false"> <?php printIphoneRecentTrackbackView($page); ?> <fieldset class="navi margin-top10"> <?php printIphoneNavigation($entry, false, false, $paging, 'trackback'); ?> </fieldset> </div> <?php }
function cate_do_action($action, $cid, $name = NULL) { if ($action == '1') { $this->db->select('*')->from('u2_cate')->where('id', $cid); $cinfo = lazy_get_line(); $this->db->select('count(*)')->from('u2_cate')->where('u2_cate_num <', $cinfo['u2_cate_num'] . '9999')->where('u2_cate_num >', $cinfo['u2_cate_num'] . '0000'); $count = lazy_get_var(); if ($count) { info_page(_text('admin_data_cate_del_error')); die; } $this->db->where('u2_cate', $cid); $this->db->delete('u2_content'); $this->db->where('u2_cate_id', $cid); $this->db->delete('u2_meta_field'); $this->db->where('id', $cid); $this->db->delete('u2_cate'); } elseif ($action == '2') { $this->db->where('id', $cid); $data['u2_cate_desc'] = $name; $this->db->update('u2_cate', $data); } elseif ($action == '0') { if ($cid != '0') { $this->db->select('*')->from('u2_cate')->where('id', $cid); $cinfo = lazy_get_line(); $father_num = $cinfo['u2_cate_num']; } else { $father_num = NULL; } $this->db->select('*')->from('u2_cate')->where('u2_cate_num <', $father_num . '9999')->where('u2_cate_num >', $father_num . '0000')->orderby('u2_cate_num', 'DESC')->limit(1); $now = lazy_get_line(); if (!isset($now['u2_cate_num']) || strlen($now['u2_cate_num']) == strlen($father_num)) { $data['u2_cate_num'] = $father_num . '0001'; } else { $temp = substr($now['u2_cate_num'], -4) + 1; //$temp = str_replace( $father_num , '' ,$now['u2_cate_num']) + 1; $data['u2_cate_num'] = $father_num . str_pad($temp, 4, "0", STR_PAD_LEFT); } $data['u2_cate_desc'] = $name; $this->db->insert('u2_cate', $data); } }
function sendInvitationMail($blogid, $userid, $name, $comment, $senderName, $senderEmail) { $ctx = Model_Context::getInstance(); $pool = DBModel::getInstance(); if (empty($blogid)) { $pool->reset('BlogSettings'); $blogid = $pool->getCell('max(blogid)'); // If no blogid, get the latest created blogid. } $email = User::getEmail($userid); $pool->reset('Users'); $pool->setQualifier('userid', 'eq', $userid); $password = getCell('password'); $authtoken = getAuthToken($userid); $blogName = getBlogName($blogid); if (empty($email)) { return 1; } if (!preg_match('/^[^@]+@([-a-zA-Z0-9]+\\.)+[-a-zA-Z0-9]+$/', $email)) { return 2; } if (empty($name)) { $name = User::getName($userid); } if (strcmp($email, Utils_Unicode::lessenAsEncoding($email, 64)) != 0) { return 11; } //$loginid = POD::escapeString(Utils_Unicode::lessenAsEncoding($email, 64)); $name = POD::escapeString(Utils_Unicode::lessenAsEncoding($name, 32)); //$headers = 'From: ' . encodeMail($senderName) . '<' . $senderEmail . ">\n" . 'X-Mailer: ' . TEXTCUBE_NAME . "\n" . "MIME-Version: 1.0\nContent-Type: text/html; charset=utf-8\n"; if (empty($name)) { $subject = _textf('귀하를 %1님이 초대합니다', $senderName); } else { $subject = _textf('%1님을 %2님이 초대합니다', $name, $senderName); } $message = file_get_contents(ROOT . "/resources/style/letter/letter.html"); $message = str_replace('[##_title_##]', _text('초대장'), $message); $message = str_replace('[##_content_##]', $comment, $message); $message = str_replace('[##_images_##]', $ctx->getProperty('uri.service') . "/resources/style/letter", $message); $message = str_replace('[##_link_##]', getInvitationLink(getBlogURL($blogName), $email, $password, $authtoken), $message); $message = str_replace('[##_go_blog_##]', getBlogURL($blogName), $message); $message = str_replace('[##_link_title_##]', _text('블로그 바로가기'), $message); if (empty($name)) { $message = str_replace('[##_to_##]', '', $message); } else { $message = str_replace('[##_to_##]', _text('받는 사람') . ': ' . $name, $message); } $message = str_replace('[##_sender_##]', _text('보내는 사람') . ': ' . $senderName, $message); $ret = sendEmail($senderName, $senderEmail, $name, $email, $subject, $message); if ($ret !== true) { return array(14, $ret[1]); } return true; }
<?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); require ROOT . '/library/preprocessor.php'; requireView('iphoneView'); if (isset($suri['id'])) { $page = $suri['id']; } else { $page = 1; } ?> <div id="guestbook_<?php echo time(); ?> " title="<?php echo _text('방명록'); ?> " selected="false"> <?php printIphoneGuestbookView($page); ?> <fieldset class="navi margin-top10"> <?php printIphoneNavigation(0, false, false, $paging, 'guestbook'); ?> </fieldset> </div>
<label for="password"><?php echo _text('비밀번호'); ?> </label> <input type="password" name="password" id="password" placeholder="<?php echo _text('비밀번호'); ?> " /> <button data-role="button" data-theme="b" class="whiteButton margin-top10" type="submit"><?php echo _text('댓글 삭제'); ?> </button> <a href="<?php echo $blogURL; ?> /comment/<?php echo $entryId; ?> " data-role="button" class="whiteButton"><?php echo _text('댓글 페이지로 이동'); ?> </a> </fieldset> </form> </div> <?php } printMobileHTMLFooter(); ?> </div>
/** * Update Plan in database * * Prepare and execute query to create Plan in Plans table * * @since 0.2.0 * * @uses fccdb::insert() * @uses _text() * * @param int $plan_id The ID of the Plan to update * @param string $plan_name The name of the Plan * @param float $plan_cost The variable cost of the Plan * @param string $plan_desc The description of the Plan * * @return void * * @var int $plan_id The primary key of the Plan being registered, as created in Plan database * * @todo Test */ public static function set_instance($plan_id, $plan_name = null, $plan_cost = null, $plan_desc = null) { global $fccdb; $plan_id = (int) $plan_id; $_Plan = self::get_instance($plan_id); $plan_name = !empty($plan_name) ? _text($plan_name, 32) : $_Plan->plan_name; $plan_cost = !empty($plan_cost) ? floatval($plan_cost) : $_Plan->plan_cost; $plan_desc = !empty($plan_desc) ? _text($plan_desc, 32) : $_Plan->plan_desc; $fccdb->update('plans', 'plan_name,plan_cost,plan_desc', "'{$plan_name}', {$plan_cost}, '{$plan_desc}'", "plan_id = {$plan_id}"); }
function finishAuth($tid) { // Complete the authentication process using the server's response. $tr = Transaction::taste($tid); ob_start(); $response = $this->consumer->complete($tr['finishURL']); ob_end_clean(); $msg = ''; if ($response->status == Auth_OpenID_CANCEL) { // This means the authentication was cancelled. $msg = _text("인증이 취소되었습니다."); } else { if ($response->status == Auth_OpenID_FAILURE) { $msg = _text("오픈아이디 인증이 실패하였습니다: ") . $response->message; } else { if ($response->status == Auth_OpenID_SUCCESS) { $this->openid = $response->identity_url; $this->delegatedid = $response->endpoint->local_id; $sreg_resp = Auth_OpenID_SRegResponse::fromSuccessResponse($response); $this->sreg = $sreg_resp->contents(); if (!isset($this->sreg['nickname'])) { $this->sreg['nickname'] = ""; } $msg = ''; if (empty($tr['authenticate_only'])) { $this->setAcl($this->openid); $this->update($this->openid, $this->delegatedid, $this->sreg['nickname']); if (!empty($tr['need_writers'])) { if (!Acl::check('group.writers')) { $msg = _text("관리자 권한이 없는 오픈아이디 입니다") . " : " . $this->openid; } } fireEvent("AfterOpenIDLogin", $this->openid); } else { Acl::authorize('openid_temp', $this->openid); } } } } return $msg ? $this->_redirectWithError($msg, $tid) : $this->_redirectWithSucess($tid); }
function applyMF2Entry($type, $content) { /* This function contains heavy regular expressions, but this function is called once and stored in cache by skin setup logic */ $bareContent = $this->getTopLevelContent($content); $content = preg_replace("/<((br|hr|img)[^>]*)>/sm", "{{{\\1}}}", $content); /* hAtom:entry-title */ $content = addAttributeCore($content, '@(.*?)(<(a|span|textarea|td|h1|h2|h3|strong|cite|font)[^>]*>[^<>]*?\\[##_article_rep_title_##\\].*?</\\3>)(.*)@sm', array('class' => 'entry-title'), array(1, 2, 4), 1); if (preg_match('@<(a|span|textarea|td|h1|h2|h3|strong|cite|font)[^>]*?class=[\'"][^\'"]*entry-title[^\'"]*[\'"][^>]*>@sm', $content)) { array_push($this->microformatDebug, _text('Microformat-info: 제목에 hAtom용 title을 추가합니다.')); } else { array_push($this->microformatDebug, _text('Microformat-warn: 제목에 hAtom용 title을 추가하지 못했습니다.')); } /* hAtom:entry-content */ $content = addAttributeCore($content, '@(.*?)(<(div|td|span|p)[^>]*>[^<>]*?\\[##_article_rep_desc_##\\].*?</\\3>)(.*)@sm', array('class' => 'entry-content'), array(1, 2, 4), 1); if (strstr($bareContent, '[##_article_rep_desc_##]') !== false) { $content = str_replace("[##_article_rep_desc_##]", "<div class=\"entry-content\">[##_article_rep_desc_##]</div>", $content); array_push($this->microformatDebug, _text('Microformat-info: 본문을 감싸고 있는 태그가 없어 div를 삽입한 뒤 hAtom용 entry-content를 추가합니다.')); } else { if (preg_match('@<(div|td|span|p)[^>]*?class=[\'"][^\'"]*entry-content[^\'"]*[\'"][^>]*>@sm', $content)) { array_push($this->microformatDebug, _text('Microformat-info: hAtom용 content를 추가합니다.')); } else { array_push($this->microformatDebug, _text('Microformat-warn: hAtom용 content를 추가하지 못했습니다.')); } } /* hAtom:updated, published */ if (Setting::getBlogSettingGlobal('useMicroformat', 3) > 2) { /* Adding published, updated date */ $content = preg_replace('@(<(div|td|span|p)[^>]*>[^<>]*?\\[##_article_rep_desc_##\\].*?</\\2>)@sm', "\\1\n\t\t\t\t\t<div style=\"display:none\">\n\t\t\t\t\t<abbr class=\"updated\" title=\"[##_article_rep_microformat_updated_##]\">[##_article_rep_date_##]</abbr>\n\t\t\t\t\t<abbr class=\"published\" title=\"[##_article_rep_microformat_published_##]\">[##_article_rep_date_##]</abbr>\n\t\t\t\t\t</div>", $content); if (preg_match('@<abbr[^>]*?class=[\'"][^\'"]*\\bupdated\\b[^\'"]*[\'"][^>]*>@sm', $content)) { array_push($this->microformatDebug, _text('Microformat-info: hAtom용 발행일(published,updated)을 보이지 않게 추가하였습니다.')); } else { array_push($this->microformatDebug, _text('Microformat-warn: hAtom용 발행일을 추가하지 못하였습니다.')); } } else { array_push($this->microformatDebug, _text('Microformat-info: 의미상 어긋나는 사용인 hAtom용 발행일(published,updated)을 추가하지 않았습니다.')); } /* hAtom:author should be a complete inner text(without other text such as 'By', 'From') of span,cite,label,li. */ if (!preg_match('@<(\\w+)\\b[^>]*?class=[\'"][^\'"]*author[^\'"]*[\'"][^>]*>@sm', $content)) { if (preg_match('@<(span|cite|label|li)[^>]*>([^<>]*)\\[##_article_rep_author_##\\]([^<>]*)</\\1>@sm', $content, $match)) { /* If there are garbage texts around author's name..., embrace author's name with a span */ if (!preg_match('/^\\s*$/', $match[2]) || !preg_match('/^\\s*$/', $match[3])) { $content = str_replace("[##_article_rep_author_##]", "<span>[##_article_rep_author_##]</span>", $content); array_push($this->microformatDebug, _text('Microformat-info: 작성자 주위로 공백외의 문자가 있어 <span>으로 한번 더 감쌉니다.')); } } else { array_push($this->microformatDebug, _text('Microformat-info: 작성자가 출력되지 않는 스킨입니다. 작성자를 보이지 않게 추가하였습니다.')); $content = preg_replace('@(<(div|td|span|p)[^>]*>[^<>]*?\\[##_article_rep_desc_##\\].*?</\\2>)@sm', "\\1\n\t\t\t\t\t<span style=\"display:none\">[##_article_rep_author_##]</span>", $content); } $content = addAttributeCore($content, '@(.*?)(<(span|cite|label|li|div)[^>]*>\\s*\\[##_article_rep_author_##\\]\\s*</\\3>)(.*)@sm', array('class' => 'author'), array(1, 2, 4), 1); if (preg_match('@<(span|cite|label|li|div)[^>]*?class=[\'"][^\'"]*\\bauthor\\b[^\'"]*[\'"][^>]*>@sm', $content)) { array_push($this->microformatDebug, _text('Microformat-info: 작성자에 hAtom용 class="author"를 추가합니다')); } else { array_push($this->microformatDebug, _text('Microformat-warn: 작성자에 hAtom용 class="author"를 추가하지 못하였습니다')); } } else { array_push($this->microformatDebug, _text('Microformat-info: class="author"를 사용한 스킨입니다. hAtom용 author는 삽입하지 않았습니다. 주의: 스킨에 사용된 author의 용도가 마이크로포맷과 다를 수 있습니다.')); } /* hAtom:hEntry is a unique division in a blog entry*/ if (!preg_match('/<(p|div)[^>]*class=[\'"][^\'"]*\\bhentry\\b[^\'"]*[\'"][^>]*>/sm', $content)) { $content = "<div class=\"hentry\">\r\n{$content}\r\n</div>"; array_push($this->microformatDebug, _text('Microformat-info: 블로그 글영역 전체를 hAtom용 entry로 간주합니다. 적절한 class="hentry" 삽입이 필요할 수 있습니다.')); } else { array_push($this->microformatDebug, _text('Microformat-info: 스킨에 class="hentry"가 있으므로, hAtom용 entry는 삽입하지 않았습니다.')); } /* bookmark to A link */ addAttribute($content, 'a', 'href', '##_article_rep_link_##', array('rel' => 'bookmark', 'title' => "[##_article_rep_title_##]")); if (preg_match('@<a\\b[^>]*?rel=[\'"][^\'"]*bookmark[^\'"]*[\'"][^>]*>@sm', $content)) { array_push($this->microformatDebug, _text('Microformat-info: 제목에 bookmark를 추가합니다')); } else { if (Setting::getBlogSettingGlobal('useMicroformat', 3) > 2) { $content = str_replace("[##_article_rep_desc_##]", "<a style=\"display:none\" href=\"[##_article_rep_link_##]\" rel=\"bookmark\" class=\"entry-title\" title=\"[##_article_rep_title_##]\">[##_article_rep_title_##]</a>\r\n[##_article_rep_desc_##]", $content); } array_push($this->microformatDebug, _text('Microformat-info: 링크가 걸린 제목이 없어 보이지 않는 링크를 추가한 뒤 rel="bookmark"와 hAtom용 title을 추가하였습니다')); } $this->hentryExisted = true; $content = preg_replace("/{{{([^}]+)}}}/sm", '<\\1>', $content); return $content; }
function printIphoneErrorPage($messageTitle, $messageBody, $redirectURL) { ?> <div id="postError" title="Error" class="panel"> <h2 class="title"><?php echo htmlspecialchars($messageTitle); ?> </h2> <div class="content"> <?php echo htmlspecialchars($messageBody); ?> </div> <a href="<?php echo $redirectURL; ?> " class="whiteButton margin-top10"><?php echo _text('이전 페이지로 돌아가기'); ?> </a> </div> <?php }
<?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); require ROOT . '/library/preprocessor.php'; requireView('iphoneView'); $linkView .= '<ul class="posts" id="links" title="' . _text('링크') . '" selected="false">' . CRLF; $linkView .= printIphoneLinksView(getLinks($blogid)); $linkView .= '</ul>'; print $linkView;
/// All rights reserved. Licensed under the GPL. /// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT) define('__TEXTCUBE_IPHONE__', true); require ROOT . '/library/preprocessor.php'; requireView('iphoneView'); $context = Model_Context::getInstance(); printMobileHTMLHeader(); if (empty($suri['id']) && empty($suri['value'])) { printMobileHTMLMenu('', 'list'); $blog['entriesOnList'] = 8; if (!($listWithPaging = getEntriesWithPaging($blogid, $suri['page'], $blog['entriesOnList']))) { $listWithPaging = array(array(), array('total' => 0)); } $list = array('title' => empty($suri['value']) ? getCategoryLabelById($blogid, 0) : $suri['value'], 'items' => $listWithPaging[0], 'count' => $listWithPaging[1]['total']); $paging = $listWithPaging[1]; print printMobileEntryListView($list['items'], 'blog_posts_' . $suri['page'], _text('글목록'), $paging, $list['count']); print printMobileListNavigation($paging, 'entry'); } else { if (!empty($suri['id'])) { list($entries, $paging) = getEntryWithPaging($blogid, $suri['id']); } else { if (!empty($suri['value'])) { $entryPrint = true; list($entries, $paging) = getEntryWithPagingBySlogan($blogid, $suri['value']); // printMobileHTMLHeader(); } } printMobileHTMLMenu('', 'list'); $entry = $entries ? $entries[0] : null; ?> <div id="post_<?php
$comment['ip'] = $_SERVER['REMOTE_ADDR']; $result = addComment($blogid, $comment); $errorString = ''; if (in_array($result, array("ip", "name", "homepage", "comment", "etc"))) { switch ($result) { case "name": $errorString = _text('차단된 이름을 사용하고 계시므로 댓글을 남기실 수 없습니다.'); break; case "ip": $errorString = _text('차단된 IP를 사용하고 계시므로 댓글을 남기실 수 없습니다.'); break; case "homepage": $errorString = _text('차단된 홈페이지 주소를 사용하고 계시므로 댓글을 남기실 수 없습니다.'); break; case "comment": $errorString = _text('금칙어를 사용하고 계시므로 댓글을 남기실 수 없습니다.'); break; case "etc": $errorString = _text('귀하는 차단되었으므로 사용하실 수 없습니다.'); break; } } else { if ($result === false) { $errorString = _text('댓글을 달 수 없습니다.'); } } if ($errorString) { OpenIDConsumer::printErrorReturn($errorString, $_POST["requestURI"]); } OpenIDConsumer::updateUserInfo($userName, $userHomepage); header("Location: {$_POST['requestURI']}");
/** * Update site in database * * Prepare and execute query to create site in sites table * * @since 0.2.0 * * @uses fccdb::insert() * @uses _text() * * @param int $site_id The ID of the site to update * @param string $site_name The name of the site * @param float $site_cost The variable cost of the site * @param string $site_desc The description of the site * * @return void * * @var int $site_id The primary key of the site being registered, as created in site database * * @todo Test */ public static function set_instance($site_id, $site_name = null, $site_cost = null, $site_desc = null) { global $fccdb; $site_id = (int) $site_id; $_site = self::get_instance($site_id); $site_name = !empty($site_name) ? _text($site_name, 32) : $_site->site_name; $site_cost = !empty($site_cost) ? floatval($site_cost) : $_site->site_cost; $site_desc = !empty($site_desc) ? _text($site_desc, 32) : $_site->site_desc; $fccdb->update('sites', 'site_name,site_cost,site_desc', "'{$site_name}', {$site_cost}, '{$site_desc}'", "site_id = {$site_id}"); }
function addOpenIDPannel($comment, $prefix) { $context = Model_Context::getInstance(); if (!isActivePlugin('CL_OpenID')) { return $comment; } $openid_identity = Acl::getIdentity('openid'); $whatisopenid = '<a target="_blank" href="' . _text('http://www.google.co.kr/search?q=OpenID&lr=lang_ko') . '"><span style="color:#ff6200">' . _text('오픈아이디란?') . '</span></a>'; //$lastcomment = ' | <a href="#" onClick="recallLastComment([##_article_rep_id_##]); return false"><span style="color:#ff6200">'._text('마지막 댓글로 채우기').'</span></a>'; $lastcomment = ''; $openidOnlySettingNotice = ''; if ($context->getProperty('blog.AddCommentMode', '') == 'openid') { $openidOnlySettingNotice = "<b>" . _text('오픈아이디로만 댓글을 남길 수 있습니다') . "</b>"; } $tag_login = '******' . $context->getProperty('uri.blog') . '/login/openid/guest?requestURI=' . urlencode($_SERVER["REQUEST_URI"]) . '"><span style="color:#ff6200">' . _text('로그인') . '</span></a>'; $tag_logoff = '<a href="' . $context->getProperty('uri.blog') . '/login/openid?action=logout&requestURI=' . urlencode($_SERVER["REQUEST_URI"]) . '"><span style="">' . _text('로그아웃') . '</span></a>'; $pannel = '<div class="commentOuterPannel">' . CRLF; $openid_input = 'OPENID_TAG_NEEDED'; $cookie_openid = ''; if (!empty($_COOKIE['openid'])) { $cookie_openid = $_COOKIE['openid']; } if ($openidOnlySettingNotice || $openid_identity) { $checked1 = 'checked="checked"'; $checked2 = ''; $disabled1 = ''; $disabled2 = 'disabled="disabled"'; } else { $checked1 = ''; $checked2 = 'checked="checked"'; $disabled1 = 'disabled="disabled"'; $disabled2 = ''; } $pannel_style = "style=\"width:100%; text-align:left\""; $radio_style = "style=\"width:15px;vertical-align:text-bottom;height:15px;border:0px;margin:0px;padding:0px;\""; $label_style = "style=\"display:inline;margin-top:0px;padding-left:0px;cursor:pointer\""; $openid_input_style = 'style="padding-left:21px;width:165px;background-image:url(' . $context->getProperty('service.path') . '/resources/image/icon_openid.gif' . ');' . 'background-repeat:no-repeat;background-position:0px center"'; if ($openid_identity) { $openid_input = '<span><a href="' . $openid_identity . '">' . OpenID::getDisplayName($openid_identity) . '</a></span>' . CRLF; $openid_input .= '<input type="hidden" name="openid_identifier" id="openid_identifier_[##_article_rep_id_##]" value="' . htmlentities($openid_identity) . '" />'; $openid_input = _text('현재 로그인한 오픈아이디') . ' ' . $openid_input; $_COOKIE['guestHomepage'] = $_SESSION['openid']['homepage']; $_COOKIE['guestName'] = $_SESSION['openid']['nickname']; } else { if (preg_match('/.*?(<input[^>]+_(?:guest|rp)_input_homepage_[^>]+>).*/sm', $comment, $match)) { $openid_input = $match[1]; $openid_input = str_replace('homepage_[##', 'openid_identifier_[##', $openid_input); $openid_input = str_replace('[##_' . $prefix . '_input_homepage_##]', 'openid_identifier', $openid_input); $openid_input = preg_replace('/value=(?:"|\')?(?:[^"\']+)(?:"|\')?/', 'value="' . $cookie_openid . '"', $openid_input); $openid_input = preg_replace('/style=("|\')?([^"\']+)("|\')?/', '', $openid_input); $openid_input = preg_replace('/(value=(?:"|\'))/', $openid_input_style . ' $1', $openid_input); } } if ($disabled1) { $openid_input = preg_replace('/(name=(?:"|\'))/', $disabled1 . ' $1', $openid_input); } if ($disabled2) { $comment = preg_replace("/(.*)(<input)((?:[^>]+)name_\\[##_article_rep_id_##\\](?:[^>]+)>(?:.*))/sm", "\$1\$2 {$disabled2} \$3", $comment); $comment = preg_replace("/(.*)(<input)((?:[^>]+)password_\\[##_article_rep_id_##\\](?:[^>]+)>(?:.*))/sm", "\$1\$2 {$disabled2} \$3", $comment); $comment = preg_replace("/(.*)(<input)((?:[^>]+)\\[##_{$prefix}_input_name_##\\](?:[^>]+)>(?:.*))/sm", "\$1\$2 {$disabled2} \$3", $comment); $comment = preg_replace("/(.*)(<input)((?:[^>]+)\\[##_{$prefix}_input_password_##\\](?:[^>]+)>(?:.*))/sm", "\$1\$2 {$disabled2} \$3", $comment); } $pannel .= '<div class="commentTypeOpenid" ' . $pannel_style . '>' . '<input class="commentTypeCheckbox" ' . $checked1 . ' type="radio" ' . CRLF . $radio_style . CRLF . 'id="comment_type_[##_article_rep_id_##]_openid" ' . CRLF . 'name="comment_type" value="openid" ' . CRLF . 'onclick="this.form.[##_' . $prefix . '_input_name_##].disabled=this.form.[##_' . $prefix . '_input_password_##].disabled=true;this.form.openid_identifier.disabled=false;this.form.openid_identifier.disabled=false;"' . CRLF . '/> ' . CRLF . '<label for="comment_type_[##_article_rep_id_##]_openid" ' . $label_style . '>' . _text('오픈아이디로 글쓰기') . '</label> <span>[' . ($openid_identity ? $tag_logoff : $tag_login) . '][' . $whatisopenid . $lastcomment . ']</span></div>' . CRLF; /* Opera browser does not work with single 'this.form.openid_identifier.disabled=false;', is it a bug? */ $pannel .= '<div style="padding:5px 0 5px 0px;width:100%;">' . $openid_input . '</div>' . CRLF; $pannel .= '<div class="commentTypeNamepassword" ' . $pannel_style . ' >' . CRLF . '<input class="commentTypeCheckbox" ' . $checked2 . ' type="radio" ' . CRLF . $radio_style . CRLF . 'id="comment_type_[##_article_rep_id_##]_idpwd" ' . CRLF . 'name="comment_type" value="idpwd" ' . CRLF . 'onclick="this.form.[##_' . $prefix . '_input_name_##].disabled=this.form.[##_' . $prefix . '_input_password_##].disabled=false;this.form.openid_identifier.disabled=true;this.form.openid_identifier.disabled=true;"' . CRLF . '/> ' . CRLF . '<label for="comment_type_[##_article_rep_id_##]_idpwd" ' . $label_style . '>' . _text('이름/비밀번호로 글쓰기') . '</label> ' . $openidOnlySettingNotice . '</div>' . CRLF; $comment = $pannel . $comment . "</div>"; return $comment; }
</a><br /><?php echo htmlspecialchars($trackback['site']); ?> (<?php echo Timestamp::format2($trackback['written']); ?> )</li> <?php } if (count($trackbacks) > 0) { echo '</ul>'; } ?> <!-- <h2><?php echo _text('글 보관함'); ?> </h2> <ul> <?php foreach (getArchives($blogid) as $archive) { ?> <li><a href="<?php echo $context->getProperty('uri.blog'); ?> /archive/<?php echo $archive['period']; ?> "><?php echo getPeriodLabel($archive['period']); ?>
echo _text('댓글'); ?> : <?php echo htmlspecialchars($entry['title']); ?> " selected="false"> <?php printMobileCommentView($entry['id']); printMobileNavigation($entry, false, true); ?> </fieldset> </div> <?php } else { // All comments ?> <div id="comment_<?php echo time(); ?> " title="<?php echo _text('최근 댓글'); ?> " selected="false"> <?php list($comments, $paging) = printMobileRecentCommentView($page); printMobileNavigation($entry, false, false, $paging, 'comment'); ?> </div> <?php } printMobileHTMLFooter();
define('__TEXTCUBE_PAGE__', true); if (isset($suri['id']) || isset($suri['value']) && strlen($suri['value']) > 0) { if (!isset($suri['id']) || Setting::getBlogSettingGlobal('useSloganOnPost', 1) == 1) { list($entries, $paging) = getEntryWithPagingBySlogan($blogid, $suri['value'], true); } else { list($entries, $paging) = getEntryWithPaging($blogid, $suri['id'], true); } if (count($entries) === 1) { unset($paging); } fireEvent('OBStart'); require ROOT . '/interface/common/blog/begin.php'; if (empty($entries)) { header('HTTP/1.1 404 Not Found'); if (empty($skin->pageError)) { dress('article_rep', fireEvent('ViewErrorPage', '<div class="TCwarning">' . _text('존재하지 않는 페이지입니다.') . '</div>'), $view); } else { dress('article_rep', NULL, $view); dress('page_error', fireEvent('ViewErrorPage', $skin->pageError), $view); } unset($paging); } else { require ROOT . '/interface/common/blog/entries.php'; } require ROOT . '/interface/common/blog/end.php'; fireEvent('OBEnd'); } else { if (!empty($freeSlogan)) { header("HTTP/1.1 404 Not Found"); exit; }
function getLinesFeed($blogid, $category = 'public', $mode = 'atom') { global $blog; $channel = array(); $channel = initializeRSSchannel($blogid); $lineobj = Model_Line::getInstance(); $lineobj->reset(); $lineobj->setFilter(array('created', 'bigger', Timestamp::getUNIXTime() - 86400)); $lineobj->setFilter(array('blogid', 'equals', $blogid)); $lineobj->setFilter(array('category', 'equals', $category, true)); $lines = $lineobj->get(); $channel['items'] = getFeedItemByLines($lines); $channel['title'] = RSSMessage($blog['title'] . ': ' . _text('Lines')); $rss = array('channel' => $channel); if ($mode == 'rss') { return publishRSS($blogid, $rss); } else { if ($mode == 'atom') { return publishATOM($blogid, $rss); } } return false; }
function getAttachmentValue($attachment) { if (strpos($attachment['mime'], 'image') === 0) { return "{$attachment['name']}|width=\"{$attachment['width']}\" height=\"{$attachment['height']}\" alt=\"" . _text('사용자 삽입 이미지') . "\""; } else { return "{$attachment['name']}|"; } }
function getEntryVisibilityName($visibility) { switch (abs($visibility)) { case 0: return _text('비공개'); case 1: return _text('보호'); case 2: return _text('공개'); case 3: default: return _text('발행'); } }
/** * Update subscription in database * * Prepare and execute query to create subscription in subscriptions table * * @since 0.2.0 * * @uses fccdb::insert() * @uses _text() * * @param int $sub_id The ID of the subscription to update * @param int $sub_plan The ID of the plan for this subscription * @param int $sub_user The ID of the user that own this subscription * @param float $sub_balance The balance of the subscription * @param string $sub_status The status of the subscription * @param string $sub_pmt_schedule The payment schedule for this subscription * * @return void * * @var int $sub_id The primary key of the subscription being registered, as created in subscription database * * @todo Test */ public static function set_instance($sub_id, $sub_plan = null, $sub_user = null, $sub_balance = null, $sub_status = null, $sub_pmt_schedule = null) { global $fccdb; $sub_id = (int) $sub_id; $_subscription = self::get_instance($sub_id); $sub_plan = !empty($sub_plan) && fcc_validate_fk($sub_plan, 'plans', 'plan_id') ? $sub_plan : $_subscription->sub_plan; $sub_user = !empty($sub_user) && fcc_validate_fk($sub_user, 'users', 'user_id') ? $sub_user : $_subscription->sub_user; $sub_balance = !empty($sub_balance) ? fcc_validate_dollars($sub_balance) : $_subscription->sub_balance; $sub_status = !empty($sub_status) ? _text($sub_status, 32) : $_subscription->sub_status; $sub_pmt_schedule = !empty($sub_pmt_schedule) ? _text($sub_pmt_schedule, 32) : $_subscription->sub_pmt_schedule; $fccdb->update('subscriptions', "sub_plan={$sub_plan},sub_user={$sub_user},sub_balance={$sub_balance},sub_status='{$sub_status}',sub_pmt_schedule='{$sub_pmt_schedule}'", "sub_id = {$sub_id}"); }
obj = loader.document.getElementById("commentCountOnRecentEntries<?php echo $comment['entry']; ?> "); if (obj != null) obj.innerHTML = "<?php echo str_innerHTML($commentCount); ?> "; } catch(e) { } try { obj = loader.document.getElementById('list-form'); if(obj != null) loader.document.getElementById('list-form').submit(); } catch(e) { } if (opener == null) { parent.tcDialog.close(); } else { window.close(); } //]]> </script> <?php printHtmlFooter(); exit; } } } } $pageTitle = _text('댓글에 댓글 달기'); $comment = array('name' => '', 'password' => '', 'homepage' => 'http://', 'secret' => 0, 'comment' => ''); $viewMode = 'comment'; require ROOT . '/library/view/replyEditorView.php';