当前位置: 首页>>代码示例>>PHP>>正文


PHP functions::trans方法代码示例

本文整理汇总了PHP中functions::trans方法的典型用法代码示例。如果您正苦于以下问题:PHP functions::trans方法的具体用法?PHP functions::trans怎么用?PHP functions::trans使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在functions的用法示例。


在下文中一共展示了functions::trans方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: mysql_query

    require '../incfiles/end.php';
    exit;
}
$req_r = mysql_query("SELECT * FROM `forum` WHERE `id` = '{$id}' AND `type` = 'r' LIMIT 1");
if (!mysql_num_rows($req_r)) {
    require '../incfiles/head.php';
    echo functions::display_error($lng['error_wrong_data']);
    require '../incfiles/end.php';
    exit;
}
$th = isset($_POST['th']) ? functions::check(mb_substr(trim($_POST['th']), 0, 100)) : '';
$msg = isset($_POST['msg']) ? functions::checkin(trim($_POST['msg'])) : '';
$buzz_prefix = $_POST['tiento'];
if (isset($_POST['msgtrans'])) {
    $th = functions::trans($th);
    $msg = functions::trans($msg);
}
$msg = preg_replace_callback('~\\[url=(http://.+?)\\](.+?)\\[/url\\]|(http://(www.)?[0-9a-zA-Z\\.-]+\\.[0-9a-zA-Z]{2,6}[0-9a-zA-Z/\\?\\.\\~&_=/%-:#]*)~', 'forum_link', $msg);
if (isset($_POST['submit']) && isset($_POST['token']) && isset($_SESSION['token']) && $_POST['token'] == $_SESSION['token']) {
    $error = array();
    if (empty($th)) {
        $error[] = $lng_forum['error_topic_name'];
    }
    if (mb_strlen($th) < 2) {
        $error[] = $lng_forum['error_topic_name_lenght'];
    }
    if (empty($msg)) {
        $error[] = $lng['error_empty_message'];
    }
    if (mb_strlen($msg) < 4) {
        $error[] = $lng['error_message_short'];
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:nt.php

示例2: msg_check

 private function msg_check($rpt_check = false)
 {
     $error = array();
     $message = isset($_POST['message']) ? mb_substr(trim($_POST['message']), 0, $this->max_lenght) : false;
     $code = isset($_POST['code']) ? intval($_POST['code']) : NULL;
     $code_chk = isset($_SESSION['code']) ? $_SESSION['code'] : NULL;
     $translit = isset($_POST['translit']);
     // Проверяем код
     if ($code == $code_chk) {
         return false;
     }
     // Проверяем на минимально допустимую длину
     if (mb_strlen($message) < $this->min_lenght) {
         $error[] = core::$lng['error_message_short'];
     } else {
         // Проверка на флуд
         $flood = functions::antiflood();
         if ($flood) {
             $error[] = core::$lng['error_flood'] . ' ' . $flood . '&#160;' . core::$lng['seconds'];
         }
     }
     // Проверка на повтор сообщений
     if (!$error && $rpt_check) {
         $req = mysql_query("SELECT * FROM `" . $this->comments_table . "` WHERE `user_id` = '" . $this->user_id . "' ORDER BY `id` DESC LIMIT 1");
         $res = mysql_fetch_assoc($req);
         if (mb_strtolower($message) == mb_strtolower($res['text'])) {
             $error[] = core::$lng['error_message_exists'];
         }
     }
     // Транслит сообщения
     if (!$error && $translit) {
         $message = functions::trans($message);
     }
     // Возвращаем результат
     return array('code' => $code, 'text' => $message, 'error' => $error);
 }
开发者ID:chegestar,项目名称:catroxs,代码行数:36,代码来源:comments.php

示例3: array_chunk

         $smileys = array_chunk($smileys, $kmess, TRUE);
         if ($start) {
             $key = ($start - $start % $kmess) / $kmess;
             $smileys_view = $smileys[$key];
             if (!count($smileys_view)) {
                 $smileys_view = $smileys[0];
             }
             $smileys = $smileys_view;
         } else {
             $smileys = $smileys[0];
         }
     }
     $i = 0;
     foreach ($smileys as $value) {
         $smile = ':' . $value . ':';
         echo ($i % 2 ? '<div class="list2">' : '<div class="list1">') . '<input type="checkbox" name="delete_sm[]" value="' . $value . '" />&#160;' . functions::smileys($smile, $rights >= 1 ? 1 : 0) . '&#160;' . $smile . ' ' . $lng['lng_or'] . ' ' . functions::trans($smile) . '</div>';
         $i++;
     }
     if ($total) {
         echo '<div class="rmenu"><input type="submit" name="delete" value=" ' . $lng['delete'] . ' "/></div></form>';
     } else {
         echo '<div class="menu"><p>' . $lng['list_empty'] . '<br /><a href="faq.php?act=smileys">' . $lng['add_smileys'] . '</a></p></div>';
     }
     echo '<div class="phdr">' . $lng['total'] . ': ' . $total . ' / ' . $user_smileys . '</div>';
     if ($total > $kmess) {
         echo '<div class="topmenu">' . functions::display_pagination('faq.php?act=my_smileys&amp;', $start, $total, $kmess) . '</div>';
     }
     echo '<p>' . ($total ? '<a href="faq.php?act=set_my_sm&amp;clean">' . $lng['clear'] . '</a><br />' : '') . '<a href="' . $_SESSION['ref'] . '">' . $lng['back'] . '</a></p>';
     break;
 case 'set_my_sm':
     /*
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:faq.php

示例4: isset

        echo '<p><a href="../users/profile.php?act=office">' . $lng['personal'] . '</a></p>';
        require_once '../incfiles/end.php';
        exit;
    }
}
if (empty($_SESSION['error'])) {
    $_SESSION['error'] = '';
}
$out .= '<div class="phdr"><b>' . $lng['mail'] . '</b></div>';
if (isset($_POST['submit']) && empty($ban['1']) && empty($ban['3']) && !functions::is_ignor($id)) {
    if (!$id) {
        $name = isset($_POST['nick']) ? functions::rus_lat(mb_strtolower(trim($_POST['nick']))) : '';
    }
    $text = isset($_POST['text']) ? trim($_POST['text']) : '';
    if ($set_user['translit'] && isset($_POST['msgtrans'])) {
        $text = functions::trans($text);
    }
    $newfile = '';
    $sizefile = 0;
    $do_file = FALSE;
    $do_file_mini = FALSE;
    $error = array();
    if (!$id && empty($name)) {
        $error[] = $lng_mail['indicate_login_grantee'];
    }
    if (empty($text)) {
        $error[] = $lng_mail['message_not_empty'];
    } elseif (mb_strlen($text) < 2 || mb_strlen($text) > 5000) {
        $error[] = $lng_mail['error_long_message'];
    }
    if ($id && $id == $user_id || !$id && $datauser['name_lat'] == $name) {
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:write.php


注:本文中的functions::trans方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。