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


PHP qtranxf_join_b函数代码示例

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


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

示例1: qtrans_join

 function qtrans_join($texts)
 {
     if (!is_array($texts)) {
         $texts = qtranxf_split($texts);
     }
     return qtranxf_join_b($texts);
 }
开发者ID:AndreyLanko,项目名称:perevorot-prozorro-wp,代码行数:7,代码来源:qtranslate_compatibility.php

示例2: qtrans_join

 function qtrans_join($texts)
 {
     if (!is_array($texts)) {
         $texts = qtranxf_split($texts);
     }
     $char = qtransx_getTagCharacter();
     if ($char == '{') {
         return qtranxf_join_s($texts);
     }
     return qtranxf_join_b($texts);
 }
开发者ID:raxdev,项目名称:qtranslate-x,代码行数:11,代码来源:qtranslate_compatibility.php

示例3: qtranxf_slug_multilingual

function qtranxf_slug_multilingual($name)
{
    global $q_config;
    $results = qtranxf_slug_get_translations($name);
    if (empty($results)) {
        return $name;
    }
    $slugs = array();
    foreach ($results as $row) {
        $slugs[$row->lang] = $row->slug;
    }
    foreach ($q_config['enabled_languages'] as $lang) {
        if (isset($slugs[$lang])) {
            continue;
        }
        $slugs[$lang] = $name;
    }
    return qtranxf_join_b($slugs);
}
开发者ID:vallsargente,项目名称:qtranslate-x,代码行数:19,代码来源:qtx_admin_slug.php

示例4: qtranxf_join_byline

/**
 * Prepare multilingal text leaving new line outside of language tags '[:]'.
*/
function qtranxf_join_byline($texts)
{
    $text = qtranxf_allthesame($texts);
    if (!is_null($text)) {
        return $text;
    }
    $lines = array();
    foreach ($texts as $lang => $text) {
        $lines[$lang] = preg_split('/\\r?\\n\\r?/', $text);
    }
    $text = '';
    for ($i = 0; true; ++$i) {
        $done = true;
        $ln = array();
        foreach ($lines as $lang => $txts) {
            if (sizeof($txts) <= $i) {
                continue;
            }
            $done = false;
            $t = $txts[$i];
            if (!$t || $t == '') {
                continue;
            }
            $ln[$lang] = $t;
        }
        if ($done) {
            break;
        }
        $char = qtransx_getTagCharacter();
        if ($char == '{') {
            $text .= qtranxf_join_b($ln) . PHP_EOL;
        } else {
            $text .= qtranxf_join_s($ln) . PHP_EOL;
        }
    }
    return $text;
}
开发者ID:raxdev,项目名称:qtranslate-x,代码行数:40,代码来源:qtranslate_core.php

示例5: qtranxf_trim_words

function qtranxf_trim_words($text, $num_words, $more, $original_text)
{
    global $q_config;
    //qtranxf_dbg_log('qtranxf_trim_words: $text: ',$text);
    //qtranxf_dbg_log('qtranxf_trim_words: $original_text: ',$original_text);
    $blocks = qtranxf_get_language_blocks($original_text);
    //qtranxf_dbg_log('qtranxf_trim_words: $blocks: ',$blocks);
    if (count($blocks) <= 1) {
        return $text;
    }
    $lang = $q_config['language'];
    $texts = qtranxf_split_blocks($blocks);
    foreach ($texts as $key => $txt) {
        $texts[$key] = wp_trim_words($txt, $num_words, $more);
    }
    return qtranxf_join_b($texts);
    //has to be 'b', because 'c' gets stripped in /wp-admin/includes/nav-menu.php:182: esc_html( $item->description )
}
开发者ID:ycms,项目名称:framework,代码行数:18,代码来源:qtx_admin_utils.php

示例6: qtranxf_slug_multilingual

/**
 * @param (string) $name - rawurlencoded post name or other slug (not permastruct).
 * @return string - multilingual urldecoded value for post name or other slug.
 */
function qtranxf_slug_multilingual($name)
{
    global $q_config;
    $name = urldecode($name);
    $slugs = qtranxf_slug_get_translations(qtranxf_slug_encode($name));
    if (empty($slugs)) {
        return $name;
    }
    foreach ($q_config['enabled_languages'] as $lang) {
        if (isset($slugs[$lang])) {
            //$slugs[$lang] = urldecode($slugs[$lang]);
        } else {
            $slugs[$lang] = $name;
        }
    }
    return urldecode(qtranxf_join_b($slugs));
}
开发者ID:dmitriyvi,项目名称:qtranslate-x,代码行数:21,代码来源:qtx_admin_slug.php

示例7: qtranxf_date_i18n_multilinual

/**
 * @param string   $format Format to display the date or time https://codex.wordpress.org/Formatting_Date_and_Time.
 * @param bool|int $i Optional. Unix timestamp. Default false.
 * @param bool     $gmt Optional. Whether to use GMT timezone. Default false.
 *
 * @return string multilingual string with date/time formatted for each language.
 */
function qtranxf_date_i18n_multilinual($fmt, $i = false, $gmt = false)
{
    global $q_config;
    if (!$i) {
        $i = time();
    }
    $t = array();
    $d = date_i18n($fmt, $i, $gmt);
    foreach ($q_config['enabled_languages'] as $lang) {
        $t[$lang] = empty($q_config['date_i18n'][$fmt][$lang]) ? $d : date_i18n($q_config['date_i18n'][$fmt][$lang], $i, $gmt);
    }
    return qtranxf_join_b($t);
}
开发者ID:vinnygats,项目名称:qtranslate-x,代码行数:20,代码来源:qtx_configuration.php

示例8: qts_UpdateOrder

function qts_UpdateOrder($order_id)
{
    global $wpdb;
    $orders = get_option('qts_orders');
    if (!is_array($orders)) {
        return false;
    }
    foreach ($orders as $key => $order) {
        // search for wanted order
        if ($order['order']['order_id'] != $order_id) {
            continue;
        }
        // query server for updates
        $order['order']['order_url'] = get_option('home');
        $result = qts_queryQS(QTS_RETRIEVE_TRANSLATION, $order['order']);
        if (isset($result['order_comment'])) {
            $orders[$key]['status'] = $result['order_comment'];
        }
        // update db if post is updated
        if (isset($result['order_status']) && $result['order_status'] == QTS_STATE_CLOSED) {
            $order['post_id'] = intval($order['post_id']);
            $p = get_post($order['post_id']);
            $post =& $p;
            $title = qtranxf_split($post->post_title);
            $content = qtranxf_split($post->post_content);
            $title[$order['target_language']] = $result['order_translated_title'];
            $content[$order['target_language']] = $result['order_translated_text'];
            $post->post_title = qtranxf_join_b($title);
            $post->post_content = qtranxf_join_b($content);
            $wpdb->show_errors();
            $wpdb->query($wpdb->prepare('UPDATE ' . $wpdb->posts . ' SET post_title = %s, post_content = %s WHERE ID = %d', $post->post_title, $post->post_content, $post->ID));
            wp_cache_add($post->ID, $post, 'posts');
            unset($orders[$key]);
        }
        update_option('qts_orders', $orders);
        return true;
    }
    return false;
}
开发者ID:morovan,项目名称:granitpiestany.sk,代码行数:39,代码来源:qtranslate_services.php


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