本文整理汇总了PHP中_text函数的典型用法代码示例。如果您正苦于以下问题:PHP _text函数的具体用法?PHP _text怎么用?PHP _text使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_text函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: timeInterval
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('세기');
}
示例2: _class
/**
* 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;
}
}
示例3: WikiCube_FormatErrorPage
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;
}
示例4: __initialize
/**
* @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']);
}
}
}
示例5: add
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'));
}
}
示例6: clearCache
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;
}
示例7: save
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']);
}
示例8: sendTrackback
<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>
示例9: printIphoneTrackbackView
<?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
}
示例10: cate_do_action
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);
}
}
示例11: sendInvitationMail
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;
}
示例12: define
<?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>
示例13: _text
<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>
示例14: set_instance
/**
* 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}");
}
示例15: finishAuth
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);
}