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


PHP smarty_modifier_tiki_date_format函数代码示例

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


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

示例1: smarty_modifier_tiki_long_datetime

function smarty_modifier_tiki_long_datetime($string)
{
    global $prefs, $smarty;
    $smarty->loadPlugin('smarty_modifier_tiki_date_format');
    // if you change the separator do not forget to change the translation instruction in lib/prefs/long.php
    return smarty_modifier_tiki_date_format($string, $prefs['long_date_format'] . ' ' . $prefs['long_time_format']);
}
开发者ID:railfuture,项目名称:tiki-website,代码行数:7,代码来源:modifier.tiki_long_datetime.php

示例2: smarty_modifier_tiki_long_date

function smarty_modifier_tiki_long_date($string)
{
    global $prefs;
    $smarty = TikiLib::lib('smarty');
    $smarty->loadPlugin('smarty_modifier_tiki_date_format');
    return smarty_modifier_tiki_date_format($string, $prefs['long_date_format']);
}
开发者ID:linuxwhy,项目名称:tiki-1,代码行数:7,代码来源:modifier.tiki_long_date.php

示例3: smarty_modifier_tiki_short_date

function smarty_modifier_tiki_short_date($string)
{
    global $prefs;
    $smarty = TikiLib::lib('smarty');
    $smarty->loadPlugin('smarty_modifier_tiki_date_format');
    $date = smarty_modifier_tiki_date_format($string, $prefs['short_date_format']);
    if ($prefs['jquery_timeago'] === 'y') {
        TikiLib::lib('header')->add_jq_onready('$("time.timeago").timeago();');
        return '<time class="timeago" datetime="' . TikiLib::date_format('c', $string, false, 5, false) . '">' . $date . '</time>';
    } else {
        return $date;
    }
}
开发者ID:linuxwhy,项目名称:tiki-1,代码行数:13,代码来源:modifier.tiki_short_date.php

示例4: smarty_modifier_tiki_short_datetime

function smarty_modifier_tiki_short_datetime($string, $intro = '', $same = 'y')
{
    global $prefs, $smarty;
    $smarty->loadPlugin('smarty_modifier_tiki_date_format');
    $date = smarty_modifier_tiki_date_format($string, $prefs['short_date_format']);
    $time = smarty_modifier_tiki_date_format($string, $prefs['short_time_format']);
    if ($same != 'n' && $prefs['tiki_same_day_time_only'] == 'y' && $date == smarty_modifier_tiki_date_format(time(), $prefs['short_date_format'])) {
        //tra('on') tra('on:') tra('at') tra('at:')
        return empty($intro) ? $time : str_replace(array('on', 'On'), array('at', 'At'), $intro) . ' ' . $time;
    } else {
        // if you change the separator do not forget to change the translation instruction in lib/prefs/short.php
        $time = $date . ' ' . $time;
        return empty($intro) ? $time : tra($intro) . ' ' . $time;
    }
}
开发者ID:jkimdon,项目名称:cohomeals,代码行数:15,代码来源:modifier.tiki_short_datetime.php

示例5: smarty_modifier_tiki_short_datetime

function smarty_modifier_tiki_short_datetime($string, $intro = '', $same = 'y')
{
    global $prefs;
    $smarty = TikiLib::lib('smarty');
    $smarty->loadPlugin('smarty_modifier_tiki_date_format');
    $date = smarty_modifier_tiki_date_format($string, $prefs['short_date_format']);
    $time = smarty_modifier_tiki_date_format($string, $prefs['short_time_format']);
    $intro = !empty($intro) ?: tra($intro) . ' ';
    if ($prefs['jquery_timeago'] === 'y' && $same === 'y') {
        TikiLib::lib('header')->add_jq_onready('$("time.timeago").timeago();');
        return '<time class="timeago" datetime="' . TikiLib::date_format('c', $string, false, 5, false) . '">' . $date . ' ' . $time . '</time>';
    } else {
        if ($same != 'n' && $prefs['tiki_same_day_time_only'] == 'y' && $date == smarty_modifier_tiki_date_format(time(), $prefs['short_date_format'])) {
            //tra('on') tra('on:') tra('at') tra('at:')
            return str_replace(array('on', 'On'), array('at', 'At'), $intro) . $time;
        } else {
            // if you change the separator do not forget to change the translation instruction in lib/prefs/short.php
            $time = $date . ' ' . $time;
            return $intro . ' ' . $time;
        }
    }
}
开发者ID:linuxwhy,项目名称:tiki-1,代码行数:22,代码来源:modifier.tiki_short_datetime.php

示例6: smarty_function_datetime_range

function smarty_function_datetime_range($params, $smarty)
{
    global $prefs;
    $smarty = TikiLib::lib('smarty');
    $smarty->loadPlugin('smarty_modifier_tiki_date_format');
    if (!is_array($params) || !isset($params['from']) || !isset($params['to'])) {
        trigger_error(tra("Missing 'to' or 'from' parameter"));
        return;
    }
    if ($params['datetime_separator']) {
        $datetime_separator = tra($params['datetime_separator']);
    } else {
        $datetime_separator = tra("at");
    }
    if ($params['range_separator']) {
        $range_separator = tra($params['range_separator']);
    } else {
        $range_separator = tra("to");
    }
    if ($params['type'] == 'long') {
        $fromDate = smarty_modifier_tiki_date_format($params['from'], $prefs['long_date_format']);
        $fromTime = smarty_modifier_tiki_date_format($params['from'], $prefs['long_time_format']);
        $toDate = smarty_modifier_tiki_date_format($params['to'], $prefs['long_date_format']);
        $toTime = smarty_modifier_tiki_date_format($params['to'], $prefs['long_time_format']);
    } else {
        $fromDate = smarty_modifier_tiki_date_format($params['from'], $prefs['short_date_format']);
        $fromTime = smarty_modifier_tiki_date_format($params['from'], $prefs['short_time_format']);
        $toDate = smarty_modifier_tiki_date_format($params['to'], $prefs['short_date_format']);
        $toTime = smarty_modifier_tiki_date_format($params['to'], $prefs['short_time_format']);
    }
    if ($fromDate == $toDate && $prefs['tiki_same_day_time_only'] == 'y') {
        $range = $fromDate . ' ' . $datetime_separator . ' ' . $fromTime . ' ' . $range_separator . ' ' . $toTime;
    } else {
        $range = $fromDate . ' ' . $datetime_separator . ' ' . $fromTime . ' ' . $range_separator . ' ' . $toDate . ' ' . $datetime_separator . ' ' . $toTime;
    }
    return $range;
}
开发者ID:linuxwhy,项目名称:tiki-1,代码行数:37,代码来源:function.datetime_range.php

示例7: smarty_modifier_tiki_long_date

function smarty_modifier_tiki_long_date($string)
{
    global $prefs;
    return smarty_modifier_tiki_date_format($string, $prefs['long_date_format']);
}
开发者ID:Kraiany,项目名称:kraiany_site_docker,代码行数:5,代码来源:modifier.tiki_long_date.php

示例8: smarty_modifier_tiki_short_date

function smarty_modifier_tiki_short_date($string)
{
    global $prefs, $smarty;
    $smarty->loadPlugin('smarty_modifier_tiki_date_format');
    return smarty_modifier_tiki_date_format($string, $prefs['short_date_format']);
}
开发者ID:jkimdon,项目名称:cohomeals,代码行数:6,代码来源:modifier.tiki_short_date.php

示例9: wikiplugin_trackerstat

function wikiplugin_trackerstat($data, $params)
{
    global $prefs, $tiki_p_admin_trackers;
    $trklib = TikiLib::lib('trk');
    $tikilib = TikiLib::lib('tiki');
    $smarty = TikiLib::lib('smarty');
    extract($params, EXTR_SKIP);
    if ($prefs['feature_trackers'] != 'y' || !isset($trackerId) || !($tracker_info = $trklib->get_tracker($trackerId))) {
        return $smarty->fetch("wiki-plugins/error_tracker.tpl");
    }
    $perms = Perms::get(array('type' => 'tracker', 'object' => $trackerId));
    if (!$perms->view_trackers) {
        return tra('Permission denied');
    }
    if (!empty($show_lastmodif)) {
        $date = $trklib->lastModif($trackerId);
        if (!function_exists('smarty_modifier_tiki_date_format')) {
            include 'lib/smarty_tiki/modifier.tiki_date_format.php';
        }
        if ($show_lastmodif == 'y') {
            $show_lastmodif = $prefs['short_date_format'];
        }
        return smarty_modifier_tiki_date_format($date, tra($show_lastmodif));
    }
    if (!isset($status)) {
        $status = 'o';
    } elseif (!$trklib->valid_status($status)) {
        return tra('invalid status');
    }
    if (isset($show_count) && $show_count == 'n') {
        $smarty->assign('show_count', 'n');
    } else {
        $smarty->assign('show_count', 'y');
    }
    if (isset($show_percent) && $show_percent == 'y') {
        $average = 'y';
        $smarty->assign('show_percent', 'y');
    } else {
        $smarty->assign('show_percent', 'n');
    }
    if (isset($show_bar) && $show_bar == 'y') {
        $average = 'y';
        $smarty->assign('show_bar', 'y');
    } else {
        $smarty->assign('show_bar', 'n');
    }
    if (isset($show_link) && $show_link == 'y') {
        $smarty->assign('show_link', 'y');
    } else {
        $smarty->assign('show_link', 'n');
    }
    $allFields = $trklib->list_tracker_fields($trackerId, 0, -1, 'position_asc', '');
    for ($iUser = count($allFields['data']) - 1; $iUser >= 0; $iUser--) {
        if ($allFields['data'][$iUser]['type'] == 'u') {
            // this tracker has a user field - can look for the value the user sets
            break;
        }
    }
    if ($iUser <= -1) {
        for ($iIp = count($allFields['data']) - 1; $iIp >= 0; $iIp--) {
            if ($allFields['data'][$iIp]['type'] == 'I') {
                // this tracker has a IP field - can look for the value the user sets
                break;
            }
        }
    }
    if (!empty($fields)) {
        $listFields = $fields;
    } else {
        foreach ($allFields['data'] as $f) {
            $listFields[] = $f['fieldId'];
        }
    }
    if ($t = $trklib->get_tracker_options($trackerId)) {
        $tracker_info = array_merge($tracker_info, $t);
    }
    $status_types = $trklib->status_types();
    foreach ($listFields as $fieldId) {
        for ($i = count($allFields['data']) - 1; $i >= 0; $i--) {
            if ($allFields['data'][$i]['fieldId'] == $fieldId) {
                break;
            }
        }
        if ($i < 0) {
            return tra('incorrect fieldId') . ' ' . $fieldId;
        }
        if ($allFields['data'][$i]['type'] == 'u' || $allFields['data'][$i]['type'] == 'I' || $allFields['data'][$i]['type'] == 's') {
            continue;
        }
        if (!($allFields['data'][$i]['isHidden'] == 'n' || $allFields['data'][$i]['isHidden'] == 'p' || $allFields['data'][$i]['isHidden'] == 'y' && $tiki_p_admin_trackers == 'y')) {
            continue;
        }
        if ($allFields['data'][$i]['type'] == 'e') {
            $categlib = TikiLib::lib('categ');
            $parent = (int) $allFields['data'][$i]['options'];
            // FIXME: Lazy access to the first option. Only works when a field only has its first option set.
            if ($parent > 0) {
                $filter = array('identifier' => $parent, 'type' => 'children');
                $listCategs = $categlib->getCategories($filter, true, false);
            } else {
//.........这里部分代码省略.........
开发者ID:rjsmelo,项目名称:tiki,代码行数:101,代码来源:wikiplugin_trackerstat.php

示例10: smarty_modifier_tiki_short_date

function smarty_modifier_tiki_short_date($string)
{
    global $tikilib;
    return smarty_modifier_tiki_date_format($string, $tikilib->get_short_date_format(), null, tra("%a %d of %b, %Y"));
}
开发者ID:noikiy,项目名称:owaspbwa,代码行数:5,代码来源:modifier.tiki_short_date.php

示例11: smarty_modifier_tiki_short_time

function smarty_modifier_tiki_short_time($string)
{
    global $tikilib;
    return smarty_modifier_tiki_date_format($string, $tikilib->get_short_time_format(), null, tra("%H:%M %Z"));
}
开发者ID:noikiy,项目名称:owaspbwa,代码行数:5,代码来源:modifier.tiki_short_time.php

示例12: smarty_modifier_tiki_long_datetime

function smarty_modifier_tiki_long_datetime($string)
{
    global $tikilib;
    return smarty_modifier_tiki_date_format($string, $tikilib->get_long_datetime_format(), null, tra("%A %d of %B, %Y[%H:%M:%S %Z]"));
}
开发者ID:noikiy,项目名称:owaspbwa,代码行数:5,代码来源:modifier.tiki_long_datetime.php

示例13: smarty_modifier_tiki_short_time

function smarty_modifier_tiki_short_time($string)
{
    global $prefs;
    return smarty_modifier_tiki_date_format($string, $prefs['short_time_format']);
}
开发者ID:Kraiany,项目名称:kraiany_site_docker,代码行数:5,代码来源:modifier.tiki_short_time.php


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