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


PHP cs_translate函数代码示例

本文整理汇总了PHP中cs_translate函数的典型用法代码示例。如果您正苦于以下问题:PHP cs_translate函数的具体用法?PHP cs_translate怎么用?PHP cs_translate使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: cs_search

function cs_search($mod)
{
    $cs_lang = cs_translate('search');
    $data = array();
    $data['search']['mod'] = $mod;
    echo cs_subtemplate(__FILE__, $data, 'search', 'search_function');
}
开发者ID:aberrios,项目名称:WEBTHESGO,代码行数:7,代码来源:functions.php

示例2: cs_subtemplate

function cs_subtemplate($source, $data, $mod, $action = 'list', $navfiles = 0)
{
    global $account, $cs_lang, $cs_main;
    $cs_lang = cs_translate($mod);
    $data = is_array($data) ? $data : array();
    $string = cs_cache_theme($mod, $action, $navfiles);
    $string = cs_conditiontemplate($string, $data);
    $string = cs_looptemplate($source, $string, $data);
    $string = preg_replace_callback("={lang:([\\S]*?)}=i", 'cs_templatelang', $string);
    if ($cs_main['xsrf_protection'] === true) {
        $string = preg_replace_callback("/<form(.*?)method=\"post\"(.*?)>/i", 'cs_xsrf_protection_field', $string);
    }
    if (!empty($navfiles)) {
        $string = cs_tokenizer_split($string);
        $theme = cs_tokenizer_parse($string);
        $string = '';
        foreach ($theme as $num => $content) {
            $string .= $content;
        }
    }
    if (!empty($cs_main['themebar']) and (!empty($cs_main['developer']) or $account['access_clansphere'] > 4)) {
        include_once 'mods/clansphere/themebar.php';
        $string = cs_themebar($source, $string, $mod, $action);
    }
    return $string;
}
开发者ID:aberrios,项目名称:WEBTHESGO,代码行数:26,代码来源:templates.php

示例3: cs_abcode_smileys

function cs_abcode_smileys($name, $keep = 0)
{
    global $cs_main;
    if (!empty($cs_main['rte_more']) and empty($keep)) {
        return '';
    }
    $cs_lang = cs_translate('system/abcodes', 1);
    $select = 'abcode_pattern, abcode_file';
    $loop_abc = cs_sql_select(__FILE__, 'abcode', $select, "abcode_func = 'img'", "abcode_order DESC, abcode_id", 0, 10, 'abcode_smileys');
    $abc_count = count($loop_abc);
    $data = array();
    $data['if']['features'] = $abc_count == 10 ? 1 : 0;
    $data['if']['row3'] = $abc_count > 6 ? 1 : 0;
    $data['if']['row2'] = $abc_count > 3 ? 1 : 0;
    $data['if']['row1'] = $abc_count > 0 ? 1 : 0;
    if ($abc_count < 3) {
        $data['var'] = array('img2' => '', 'pattern2' => '', 'img3' => '', 'pattern3' => '');
    } elseif ($abc_count < 6) {
        $data['var'] = array('img5' => '', 'pattern5' => '', 'img6' => '', 'pattern6' => '');
    } elseif ($abc_count < 9) {
        $data['var'] = array('img8' => '', 'pattern8' => '', 'img9' => '', 'pattern9' => '');
    }
    $run = 0;
    $abc_while = $abc_count > 9 ? 9 : $abc_count;
    while ($abc_while > $run) {
        $data['var']['img' . ($run + 1)] = cs_html_img('uploads/abcode/' . $loop_abc[$run]['abcode_file']);
        $data['var']['pattern' . ($run + 1)] = $loop_abc[$run]['abcode_pattern'];
        $run++;
    }
    $data['var']['textarea'] = $name;
    return empty($abc_count) ? '' : cs_subtemplate(__FILE__, $data, 'abcode', 'imgbox');
}
开发者ID:aberrios,项目名称:WEBTHESGO,代码行数:32,代码来源:abcode.php

示例4: cs_newsletter_to

function cs_newsletter_to($select)
{
    $cs_lang = cs_translate('newsletter');
    $op_squads = cs_sql_option(__FILE__, 'squads', 'label');
    $op_clans = cs_sql_option(__FILE__, 'clans', 'label');
    $dp = cs_html_option('----', '0', 1);
    $dp .= cs_html_option($cs_lang['all_users'], '1');
    $dp .= cs_html_option('&raquo;' . $cs_lang['ac_group'], '');
    $usergroups = cs_sql_select(__FILE__, 'access', 'access_id,access_name', 'access_id != 1', 0, 0, 0);
    foreach ($usergroups as $value) {
        $dp .= cs_html_option('&nbsp;&nbsp;&nbsp;' . cs_secure($value['access_name']), '2?' . $value['access_id']);
    }
    $dp .= cs_html_option(' &raquo;' . $cs_lang[$op_squads['label']], '');
    $squads = cs_sql_select(__FILE__, 'squads', 'squads_id, squads_name', 0, 'squads_name', 0, 0);
    $squads = empty($squads) ? array() : $squads;
    foreach ($squads as $squad) {
        $dp .= cs_html_option('&nbsp;&nbsp;&nbsp;' . cs_secure($squad['squads_name']), '3?' . $squad['squads_id']);
    }
    $dp .= cs_html_option('&raquo;' . $cs_lang[$op_clans['label']], '');
    $clans = cs_sql_select(__FILE__, 'clans', 'clans_id, clans_name', 0, 'clans_name', 0, 0);
    $clans = empty($clans) ? array() : $clans;
    foreach ($clans as $clan) {
        $dp .= cs_html_option('&nbsp;&nbsp;&nbsp;' . cs_secure($clan['clans_name']), '4?' . $clan['clans_id']);
    }
    $data['nl']['to_dropdown'] = $dp;
    return $dp;
}
开发者ID:aberrios,项目名称:WEBTHESGO,代码行数:27,代码来源:functions.php

示例5: cs_installerror

function cs_installerror($old_query = '')
{
    global $cs_db, $cs_lang, $account;
    $cs_lang = cs_translate('install');
    $error = empty($cs_db['last_error']) ? 'Unknown' : $cs_db['last_error'];
    $msg = 'Error: ' . $error . cs_html_br(2) . 'Query: ' . $old_query . cs_html_br(4);
    $msg .= cs_link($cs_lang['remove_and_again'], 'install', 'sql', 'lang=' . $account['users_lang'] . '&amp;uninstall=1');
    die(cs_error_internal('sql', $msg));
}
开发者ID:aberrios,项目名称:WEBTHESGO,代码行数:9,代码来源:sql.php

示例6: cs_gray

function cs_gray($imgfile)
{
    $info = getimagesize($imgfile);
    switch ($info[2]) {
        case 1:
            $cs_lang = cs_translate('gallery');
            $message = $cs_lang['gray_error'] . cs_html_br(1);
            $g_error = 1;
            break;
        case 2:
            $sourceImage = imagecreatefromjpeg($imgfile);
            break;
        case 3:
            $sourceImage = imagecreatefrompng($imgfile);
            break;
    }
    if (empty($g_error)) {
        $img_width = imagesx($sourceImage);
        $img_height = imagesy($sourceImage);
        for ($y = 0; $y < $img_height; $y++) {
            for ($x = 0; $x < $img_width; $x++) {
                $rgb = imagecolorat($sourceImage, $x, $y);
                $red = $rgb >> 16 & 0xff;
                $green = $rgb >> 8 & 0xff;
                $blue = $rgb & 0xff;
                $gray = round(0.299 * $red + 0.587 * $green + 0.114 * $blue);
                $grayR = $gray << 16;
                // R: red
                $grayG = $gray << 8;
                // G: green
                $grayB = $gray;
                // B: blue
                $grayColor = $grayR | $grayG | $grayB;
                imagesetpixel($sourceImage, $x, $y, $grayColor);
                imagecolorallocate($sourceImage, $gray, $gray, $gray);
            }
        }
        $destinationImage = imagecreatetruecolor($img_width, $img_height);
        imagecopy($destinationImage, $sourceImage, 0, 0, 0, 0, $img_width, $img_height);
        switch ($info[2]) {
            case 2:
                return imagejpeg($destinationImage, $imgfile);
                break;
            case 3:
                return imagepng($destinationImage, $imgfile);
                break;
        }
        imagedestroy($destinationImage);
        imagedestroy($sourceImage);
    }
}
开发者ID:aberrios,项目名称:WEBTHESGO,代码行数:51,代码来源:gd_2.php

示例7: cs_admin_menu

function cs_admin_menu()
{
    global $cs_main, $account;
    $cs_lang = cs_translate('clansphere');
    $data = array();
    $recent_mod = $cs_main['mod'];
    $recent_action = $cs_main['action'];
    $link_count = 0;
    if (file_exists('mods/' . $recent_mod . '/manage.php') && $account['access_' . $recent_mod] >= 3) {
        include $cs_main['def_path'] . '/mods/' . $recent_mod . '/info.php';
        # look for sql table named like mod, else use first sql table given
        $mod_tables = is_array($mod_info['tables']) ? $mod_info['tables'] : array();
        if (in_array($recent_mod, $mod_tables)) {
            $sql_table = $recent_mod;
        } elseif (isset($mod_tables[0])) {
            $sql_table = $mod_tables[0];
        } else {
            $sql_table = false;
        }
        $sql_count = empty($sql_table) ? '' : ' (' . cs_sql_count(__FILE__, $sql_table) . ')';
        $link_count++;
        $data['menu']['manage'] = $recent_action == 'manage' ? $cs_lang['manage'] : cs_link($cs_lang['manage'], $recent_mod, 'manage') . $sql_count;
        $data['if']['manage'] = true;
    } else {
        $data['menu']['manage'] = '';
        $data['if']['manage'] = false;
    }
    if (file_exists('mods/' . $recent_mod . '/create.php') && $account['access_' . $recent_mod] >= 3 && $recent_mod != 'shoutbox') {
        $link_count++;
        $data['menu']['create'] = $recent_action == 'create' ? $cs_lang['create'] : cs_link($cs_lang['create'], $recent_mod, 'create');
        $data['if']['create'] = true;
    } else {
        $data['menu']['create'] = '';
        $data['if']['create'] = false;
    }
    if (file_exists('mods/' . $recent_mod . '/options.php') && $account['access_' . $recent_mod] >= 5) {
        $link_count++;
        $data['menu']['options'] = $recent_action == 'options' ? $cs_lang['options'] : cs_link($cs_lang['options'], $recent_mod, 'options');
        $data['if']['options'] = true;
    } else {
        $data['menu']['options'] = '';
        $data['if']['options'] = false;
    }
    if ($link_count > 1) {
        $data['links']['count'] = $link_count;
        return cs_subtemplate(__FILE__, $data, 'clansphere', 'admin_menu');
    }
}
开发者ID:aberrios,项目名称:WEBTHESGO,代码行数:48,代码来源:admin_menu.php

示例8: cs_pictures_select

function cs_pictures_select($mod, $fid = 0)
{
    settype($fid, 'integer');
    $cs_lang = cs_translate('pictures');
    $data = array();
    if (empty($fid)) {
        $data['if']['already'] = false;
    } else {
        $where = "pictures_mod = '" . $mod . "' AND pictures_fid = " . $fid;
        $picture = cs_sql_select(__FILE__, 'pictures', 'pictures_file', $where);
        if (empty($picture)) {
            $data['if']['already'] = false;
        } else {
            $data['if']['already'] = true;
            $data['picture']['file'] = $picture['pictures_file'];
        }
    }
    $string = cs_subtemplate(__FILE__, $data, 'pictures', 'select');
    return $string;
}
开发者ID:aberrios,项目名称:WEBTHESGO,代码行数:20,代码来源:functions.php

示例9: cs_translate

<?php

// ClanSphere 2010 - www.clansphere.net
// $Id$
$cs_lang = cs_translate('board');
$count_abo = cs_sql_count(__FILE__, 'abonements', 'users_id=' . $account['users_id']);
$count_att = cs_sql_count(__FILE__, 'boardfiles', 'users_id=' . $account['users_id']);
$data = array();
$data['head']['getmsg'] = cs_getmsg();
$data['count']['abos'] = $count_abo;
$data['count']['attachments'] = $count_att;
$data['link']['abos'] = cs_url('board', 'center');
$data['link']['attachments'] = cs_url('board', 'attachments');
$data['link']['avatar'] = cs_url('board', 'avatar');
$data['action']['form'] = cs_url('board', 'signature');
$data['signature']['smileys'] = cs_abcode_smileys('signature');
$data['signature']['abcode'] = cs_abcode_features('signature');
$signature_sql = cs_sql_select($file, 'users', 'users_signature', "users_id = '" . $account['users_id'] . "'");
$signature = $signature_sql['users_signature'];
$signature = isset($_POST['signature']) ? $_POST['signature'] : $signature;
$signature = preg_replace_callback("=\\[img\\](.*?)\\[/img\\]=si", "cs_abcode_resize", $signature);
$signature = preg_replace_callback("=\\[img width\\=(.*?) height\\=(.*?)\\](.*?)\\[/img\\]=si", "cs_abcode_resize", $signature);
$data['signature']['text'] = $signature;
$data['signature']['preview'] = cs_secure($signature, 1, 1);
$data['if']['preview'] = (isset($_POST['preview']) and !empty($signature)) ? 1 : 0;
if (isset($_POST['submit'])) {
    $signature_cells = array('users_signature');
    $signature_save = array($signature);
    cs_sql_update(__FILE__, 'users', $signature_cells, $signature_save, $account['users_id']);
    cs_redirect($cs_lang['create_done'], 'board', 'signature');
}
开发者ID:aberrios,项目名称:WEBTHESGO,代码行数:31,代码来源:signature.php

示例10: cs_translate

<?php

// ClanSphere 2010 - www.clansphere.net
// $Id$
$cs_lang = cs_translate('ajax');
$mod_info['name'] = $cs_lang['ajax'];
$mod_info['version'] = $cs_main['version_name'];
$mod_info['released'] = $cs_main['version_date'];
$mod_info['creator'] = 'ClanSphere';
$mod_info['team'] = 'ClanSphere';
$mod_info['url'] = 'www.clansphere.net';
$mod_info['text'] = $cs_lang['mod_text'];
$mod_info['icon'] = 'agt_reload';
$mod_info['show'] = array('options/roots' => 5);
$mod_info['categories'] = FALSE;
$mod_info['comments'] = FALSE;
$mod_info['protected'] = FALSE;
$mod_info['tables'] = array();
开发者ID:aberrios,项目名称:WEBTHESGO,代码行数:18,代码来源:info.php

示例11: cs_translate

<?php

// ClanSphere 2010 - www.clansphere.net
// $Id$
$cs_lang = cs_translate('servers');
$id = empty($_GET['id']) ? 0 : (int) $_GET['id'];
$cache_name = 'servers_list_' . (int) $id;
$cache_time = 60;
$data = cs_cache_load($cache_name, $cache_time);
// Test if fsockopen active
if (empty($data) and fsockopen("udp://127.0.0.1", 1)) {
    $results = array();
    $data = array('servers' => array());
    $data['if']['noquery'] = false;
    $data['if']['server'] = false;
    include_once 'mods/servers/servers.class.php';
    /* Get Server SQL-Data */
    $select = 'servers_name, servers_ip, servers_port, servers_info, servers_query, servers_class, servers_slots, servers_stats, servers_order, servers_id';
    $order = 'servers_order ASC';
    $where = empty($id) ? '' : 'servers_id = \'' . $id . '\'';
    $cs_servers = cs_sql_select(__FILE__, 'servers', $select, $where, $order, 0, 0);
    $servers_count = count($cs_servers);
    /* if no Server in SQL */
    if (empty($servers_count)) {
        unset($data['servers']);
    } else {
        $data['if']['server'] = true;
        /* Settings */
        $objServers = Servers::__getInstance();
        for ($run = 0; $run < $servers_count; $run++) {
            $server_query_ex = explode(";", $cs_servers[$run]['servers_class']);
开发者ID:aberrios,项目名称:WEBTHESGO,代码行数:31,代码来源:list.php

示例12: cs_translate

<?php

// ClanSphere 2010 - www.clansphere.net
// $Id$
$cs_lang = cs_translate('computers');
if (isset($_POST['submit'])) {
    $save = array();
    $save['max_width'] = (int) $_POST['max_width'];
    $save['max_height'] = (int) $_POST['max_height'];
    $save['max_size'] = (int) $_POST['max_size'];
    require_once 'mods/clansphere/func_options.php';
    cs_optionsave('computers', $save);
    cs_redirect($cs_lang['changes_done'], 'options', 'roots');
} else {
    $data = array();
    $data['com'] = cs_sql_option(__FILE__, 'computers');
    echo cs_subtemplate(__FILE__, $data, 'computers', 'options');
}
开发者ID:aberrios,项目名称:WEBTHESGO,代码行数:18,代码来源:options.php

示例13: cs_translate

<?php

// ClanSphere 2010 - www.clansphere.net
// $Id$
$cs_lang = cs_translate('events');
$cs_get = cs_get('catid');
$cs_option = cs_sql_option(__FILE__, 'events');
$from = 'events evs INNER JOIN {pre}_categories cat ON evs.categories_id = cat.categories_id';
$select = 'evs.events_id AS events_id, evs.events_name AS events_name, evs.events_time AS events_time';
$upcome = 'evs.events_time > ' . cs_time() . ' AND cat.categories_access <= ' . $account['access_events'];
if (!empty($cs_get['catid'])) {
    $upcome .= ' AND cat.categories_id = ' . $cs_get['catid'];
}
$cs_events = cs_sql_select(__FILE__, $from, $select, $upcome, 'evs.events_time', 0, $cs_option['max_navnext']);
$events_loop = count($cs_events);
$data = array();
if (empty($cs_events)) {
    echo $cs_lang['no_events'];
} else {
    for ($run = 0; $run < $events_loop; $run++) {
        $data['events'][$run]['date'] = cs_date('unix', $cs_events[$run]['events_time'], 1);
        $data['events'][$run]['name'] = cs_secure($cs_events[$run]['events_name']);
        $data['events'][$run]['link'] = cs_url('events', 'view', 'id=' . $cs_events[$run]['events_id']);
    }
    echo cs_subtemplate(__FILE__, $data, 'events', 'navnext');
}
开发者ID:aberrios,项目名称:WEBTHESGO,代码行数:26,代码来源:navnext.php

示例14: cs_translate

<?php

// ClanSphere 2010 - www.clansphere.net
// $Id$
$cs_lang = cs_translate('gallery');
$files_gl = cs_files();
require_once 'mods/gallery/functions.php';
$cs_gallery['gallery_read'] = '0';
$cs_gallery['gallery_zip_read'] = '0';
$cs_gallery['gallery_del'] = '0';
$cs_gallery['gallery_access'] = '0';
$cs_gallery['gallery_status'] = '0';
$watermark_pos = 0;
$zip_file = '0';
$data = array();
$data['if']['start'] = FALSE;
$data['if']['no_thumb'] = FALSE;
$data['if']['nopic'] = FALSE;
$data['if']['error_zip'] = FALSE;
$data['if']['zipfile'] = FALSE;
$data['if']['pictures_found'] = FALSE;
$data['if']['pictures_done'] = FALSE;
$data['if']['thumb'] = FALSE;
$data['manage']['head'] = cs_subtemplate(__FILE__, $data, 'gallery', 'manage_head');
if (isset($_POST['submit'])) {
    if (isset($_POST['read']) or isset($_POST['del']) or isset($_POST['read_zip'])) {
        if (isset($_POST['read_zip'])) {
            if (!isset($_POST['submit_zipfile'])) {
                $data['if']['zipfile'] = TRUE;
            } else {
                $file = $files_gl['zipfile']['tmp_name'];
开发者ID:aberrios,项目名称:WEBTHESGO,代码行数:31,代码来源:manage_advanced.php

示例15: cs_translate

<?php

// ClanSphere 2010 - www.clansphere.net
// $Id$
$cs_lang = cs_translate('gbook');
$cs_post = cs_post('where,start,sort');
$cs_get = cs_get('where,start,sort');
$data = array();
if (!empty($_GET['active'])) {
    cs_sql_update(__FILE__, 'gbook', array('gbook_lock'), array('1'), (int) $_GET['active']);
    cs_redirectmsg($cs_lang['active_done']);
}
if (!empty($_GET['deactive'])) {
    cs_sql_update(__FILE__, 'gbook', array('gbook_lock'), array('0'), (int) $_GET['deactive']);
    cs_redirectmsg($cs_lang['deactive_done']);
}
$id = empty($cs_get['where']) ? 0 : $cs_get['where'];
if (!empty($cs_post['where'])) {
    $id = $cs_post['where'];
}
$start = empty($cs_get['start']) ? 0 : $cs_get['start'];
if (!empty($cs_post['start'])) {
    $start = $cs_post['start'];
}
$sort = empty($cs_get['sort']) ? 1 : $cs_get['sort'];
if (!empty($cs_post['sort'])) {
    $sort = $cs_post['sort'];
}
$cs_sort[1] = 'gbk.gbook_time DESC';
$cs_sort[2] = 'gbk.gbook_time ASC';
$cs_sort[3] = 'usr.users_email DESC';
开发者ID:aberrios,项目名称:WEBTHESGO,代码行数:31,代码来源:manage.php


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