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


PHP op_format_date函数代码示例

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


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

示例1: op_calendar_format_date

function op_calendar_format_date($date, $format = 'd', $culture = null, $charset = null)
{
    if (!$culture) {
        $culture = sfContext::getInstance()->getUser()->getCulture();
    }
    switch ($format) {
        case 'XTime':
            switch ($culture) {
                case 'ja_JP':
                    $tmpformat = 'HH時mm分';
                    break;
                default:
                    $tmpformat = 'HH:mm';
                    break;
            }
            break;
        case 'XDate':
            switch ($culture) {
                case 'ja_JP':
                    $tmpformat = 'yyyy年MM月dd日';
                    break;
                default:
                    $tmpformat = 'd';
                    break;
            }
            break;
    }
    $result = op_format_date($date, $tmpformat, $culture, $charset);
    if (!$result && $format === 'XTime') {
        switch ($culture) {
            case 'ja_JP':
                $result = '--時--分';
                break;
            default:
                $result = '--:--';
                break;
        }
    }
    return $result;
}
开发者ID:nise-nabe,项目名称:opCalendarPlugin,代码行数:40,代码来源:opCalendarHelper.php

示例2: op_chat_room_link

/**
 * opChatHelper
 *
 * @package     opChatPlugin
 * @subpackage  helper
 * @author      Kimura Youichi <kim.upsilon@gmail.com>
 */
function op_chat_room_link($room, $member_id)
{
    $html = '';
    if ($room->is_closed) {
        $html .= '[終了] ';
        $linkto = '@chatroom_log?id=' . $room->id;
    } else {
        $linkto = '@chatroom_login?id=' . $room->id;
    }
    $title = !is_null($room->open_date) && !$room->isOpened() ? $room->title : op_chat_get_title_and_count($room);
    if ($room->isOpened()) {
        $html .= link_to($title, $linkto, array('title' => '最終投稿日時: ' . op_format_date($room->getLastPostDate(), 'f')));
    } else {
        $html .= $title;
    }
    if (!is_null($room->open_date)) {
        $html .= ' (開始: ' . $room->open_date . ')';
    }
    if ($room->isEditable($member_id)) {
        $html .= ' ' . link_to('[編集]', '@chatroom_edit?id=' . $room->id);
    }
    return $html;
}
开发者ID:upsilon,项目名称:opChatPlugin,代码行数:30,代码来源:opChatHelper.php

示例3: count

<p>現在のインポート待ち件数: <strong><?php 
echo count($queue);
?>
</strong> 件</p>
</div>
<ol>
<?php 
foreach ($queue as $job) {
    ?>
<li>
<?php 
    echo $job->File->original_filename;
    ?>
 
(アップロード: <?php 
    echo op_format_date($job->File->created_at, 'f');
    ?>
)
</li>
<?php 
}
?>
</ol>
<?php 
end_slot();
?>

<?php 
op_include_box('import_queue', get_slot('queue'), array('title' => 'インポート待ちのファイル'));
?>
开发者ID:upsilon,项目名称:opMTViewerPlugin,代码行数:30,代码来源:indexSuccess.php

示例4: use_helper

<?php

use_helper('opDiary');
?>

<?php 
if (count($diaryList)) {
    $list = array();
    foreach ($diaryList as $diary) {
        $list[] = sprintf('[%s] %s', op_format_date($diary->created_at, 'XShortDate'), link_to(op_diary_get_title_and_count($diary, false, 28), 'diary_show', $diary));
    }
    $moreInfo = array();
    $moreInfo[] = link_to(__('More'), '@diary_list_member?id=' . $memberId);
    $options = array('title' => __('Recently Posted Diaries'), 'border' => true, 'moreInfo' => $moreInfo);
    op_include_list('memberDiaryList', $list, $options);
}
开发者ID:meruto,项目名称:opDiaryPlugin,代码行数:16,代码来源:_memberDiaryList.php

示例5: array

<?php

$acl = opCommunityTopicAclBuilder::buildResource($communityTopic, array($sf_user->getMember()));
op_mobile_page_title($community->getName(), $communityTopic->getName());
?>

<?php 
echo op_within_page_link();
echo op_format_date($communityTopic->getCreatedAt(), 'MM/dd HH:mm');
if ($communityTopic->getMemberId() === $sf_user->getMemberId()) {
}
?>
<br>
<?php 
if ($communityTopic->getMember() && $communityTopic->getMember()->getName()) {
    echo link_to($communityTopic->getMember()->getName(), 'member/profile?id=' . $communityTopic->getMember()->getId());
}
if ($communityTopic->isEditable($sf_user->getMemberId())) {
    ?>
&nbsp;[<?php 
    echo link_to(__('Edit'), '@communityTopic_edit?id=' . $communityTopic->getId());
    ?>
]
<?php 
}
?>
<br>
<?php 
echo nl2br($communityTopic->getBody());
?>
<br>
开发者ID:kiwpon,项目名称:opCommunityTopicPlugin,代码行数:31,代码来源:showSuccess.php

示例6: use_helper

<?php

use_helper('opCommunityTopic');
$comment->state(Doctrine_RECORD::STATE_CLEAN);
echo op_within_page_link();
?>
[<?php 
printf('%03d', $comment->getNumber());
?>
]<?php 
echo op_format_date($comment->getCreatedAt(), 'MM/dd HH:mm');
if ($comment->isDeletable($sf_user->getMemberId())) {
    ?>
&nbsp;[<?php 
    echo link_to(__('Delete'), '@communityTopic_comment_delete_confirm?id=' . $comment->getId());
    ?>
]
<?php 
}
?>
<br>
<?php 
echo op_community_topic_link_to_member($comment->getMember());
?>
<br>
<?php 
echo op_auto_link_text_for_mobile(nl2br($comment->getBody()));
?>

<?php 
if (count($comment->getImages())) {
开发者ID:te-koyama,项目名称:openpne,代码行数:31,代码来源:_comment.php

示例7: __

$title = __('Diary Comment History');
if ($pager->getNbResults()) {
    ?>
<div class="dparts recentList"><div class="parts">
<div class="partsHeading"><h3><?php 
    echo $title;
    ?>
</h3></div>
<?php 
    op_include_pager_navigation($pager, '@diary_comment_history?page=%d');
    foreach ($pager->getResults() as $diaryCommentUpdate) {
        $diary = $diaryCommentUpdate->Diary;
        ?>
<dl>
<dt><?php 
        echo op_format_date($diaryCommentUpdate->last_comment_time, 'XDateTimeJa');
        ?>
</dt>
<dd><?php 
        echo op_diary_link_to_show($diary, true, false);
        ?>
</dd>
</dl>
<?php 
    }
    op_include_pager_navigation($pager, '@diary_comment_history?page=%d');
    ?>
</div></div>
<?php 
} else {
    op_include_box('diaryList', __('There are no diaries.'), array('title' => $title));
开发者ID:meruto,项目名称:opDiaryPlugin,代码行数:31,代码来源:historySuccess.php

示例8: slot

    slot('pager');
    op_include_pager_navigation($pager, '@vote_list?page=%d');
    end_slot();
    ?>

<div class="dparts recentList"><div class="parts">
<div class="partsHeading">
<h3>質問リスト</h3>
</div>
<?php 
    include_slot('pager');
    foreach ($pager->getResults() as $item) {
        ?>
<dl>
<dt><?php 
        echo op_format_date($item->getUpdatedAt(), 'f');
        ?>
</dt>
<dd><?php 
        echo link_to(sprintf("%s(%d)", $item->getTitle(), count($item->getVoteAnswers())), '@vote_show?id=' . $item->getId());
        ?>
</dd>
</dl>
<?php 
    }
    include_slot('pager');
    ?>
</div>
</div>

<?php 
开发者ID:kawahara,项目名称:opVotePlugin,代码行数:31,代码来源:indexSuccess.php

示例9: __

    $ageValue = __('%1% years old', array('%1%' => $member->getAge()));
    if ($member->getConfig('age_public_flag') == ProfileTable::PUBLIC_FLAG_FRIEND) {
        $ageValue .= ' (' . __('Only Open to %my_friend%', array('%my_friend%' => $op_term['my_friend']->titleize()->pluralize())) . ')';
    }
    $list[__('Age')] = $ageValue;
}
foreach ($member->getProfiles(true) as $profile) {
    $caption = $profile->getCaption();
    $value = $profile;
    if ($profile->getProfile()->isPreset()) {
        $presetConfig = $profile->getProfile()->getPresetConfig();
        $caption = __($presetConfig['Caption']);
        if ($profile->getFormType() === 'country_select') {
            $value = __($culture->getCountry((string) $profile));
        } elseif ('op_preset_birthday' === $profile->getName()) {
            $value = op_format_date((string) $profile, 'XShortDateJa');
        } else {
            $value = __((string) $profile);
        }
    }
    if ($member->getId() == $sf_user->getMemberId() && $profile->getPublicFlag() == ProfileTable::PUBLIC_FLAG_FRIEND) {
        $value .= '<font color="' . $op_color["core_color_22"] . '">(' . __('Only Open to %my_friend%') . ')</font><br>';
    } elseif ($member->getId() == $sf_user->getMemberId() && $profile->getPublicFlag() == ProfileTable::PUBLIC_FLAG_WEB) {
        $value .= '<font color="' . $op_color["core_color_22"] . '">(' . __('All Users on the Web') . ')</font><br>';
    }
    $list[$caption] = $value;
}
?>

<?php 
foreach ($list as $caption => $value) {
开发者ID:TadahiroKudo,项目名称:OpenPNE3,代码行数:31,代码来源:profileSuccess.php

示例10: link_to

            echo link_to(__('Newer'), '@diary_show?id=' . $diary->id . '&page=' . $pager->getNewerPage() . '&size=' . $size . '&order=' . $order);
            ?>
</p><?php 
        }
        ?>
</div>
<?php 
    }
    ?>

<?php 
    foreach ($pager->getResults() as $comment) {
        ?>
<dl>
<dt><?php 
        echo nl2br(op_format_date($comment->created_at, 'XDateTimeJaBr'));
        ?>
</dt>
<dd>
<div class="title">
<p class="heading"><strong><?php 
        echo $comment->number;
        ?>
</strong>:
<?php 
        echo op_link_to_member($comment->Member);
        if ($diary->member_id === $sf_user->getMemberId() || $comment->member_id === $sf_user->getMemberId()) {
            ?>
 <?php 
            echo link_to(__('Delete'), 'diary_comment_delete_confirm', $comment);
        }
开发者ID:meruto,项目名称:opDiaryPlugin,代码行数:31,代码来源:_list.php

示例11: array

<?php

$acl = opCommunityTopicAclBuilder::buildCollection($community, array($sf_user->getMember()));
?>

<?php 
if ($acl->isAllowed($sf_user->getMemberId(), null, 'view')) {
    use_helper('Date');
    $list = array();
    foreach ($communityEvents as $communityEvent) {
        $list[] = sprintf("[%s] %s", op_format_date($communityEvent->getUpdatedAt(), 'XShortDate'), link_to(sprintf("%s(%d)", op_truncate($communityEvent->getName(), 28), $communityEvent->getCommunityEventComment()->count()), '@communityEvent_show?id=' . $communityEvent->getId()));
    }
    $moreInfo = array();
    if (count($communityEvents)) {
        $moreInfo[] = link_to(__('More'), '@communityEvent_list_community?id=' . $community->getId());
    }
    if ($acl->isAllowed($sf_user->getMemberId(), null, 'add')) {
        $moreInfo[] = link_to(__('Create a new event'), '@communityEvent_new?id=' . $community->getId());
    }
    $option = array('title' => __('Recently Posted This %Community% Events'), 'border' => true, 'moreInfo' => $moreInfo);
    op_include_list('communityEvent', $list, $option);
}
开发者ID:te-koyama,项目名称:openpne,代码行数:22,代码来源:_communityEventList.php

示例12: op_format_activity_time

function op_format_activity_time($from_time, $to_time = null)
{
    use_helper('Date');
    $to_time = $to_time ? $to_time : time();
    $distance_in_minutes = floor(abs($to_time - $from_time) / 60);
    if ($distance_in_minutes >= 1440) {
        return op_format_date($from_time, 'XDateTime');
    } else {
        return op_distance_of_time_in_words($from_time, $to_time, true);
    }
}
开发者ID:shotaatago,项目名称:OpenPNE3,代码行数:11,代码来源:opUtilHelper.php

示例13: array

<?php

if (count($communityTopic)) {
    $list = array();
    foreach ($communityTopic as $topic) {
        $list[] = sprintf("[%s] %s<br>%s", op_format_date($topic->getUpdatedAt(), 'XShortDate'), $topic->getCommunity()->getName(), link_to(sprintf("%s(%d)", op_truncate($topic->getName(), 28), $topic->getCommunityTopicComment()->count()), '@communityTopic_show?id=' . $topic->getId()));
    }
    $options = array('title' => __('Recently Posted %Community% Topics'), 'border' => true, 'moreInfo' => array(link_to(__('More'), 'communityTopic_recently_topic_list')));
    op_include_list('communityList', $list, $options);
    ?>

<?php 
}
开发者ID:te-koyama,项目名称:openpne,代码行数:13,代码来源:_topicCommentListBox.php

示例14: use_helper

use_helper('opDiary');
?>

<?php 
if ($pager->getNbResults()) {
    ?>

<center>
<?php 
    op_include_pager_total($pager);
    ?>
</center>
<?php 
    $list = array();
    foreach ($pager->getResults() as $diary) {
        $list[] = sprintf("%s<br>%s (%s)", op_format_date($diary->created_at, 'XDateTime'), link_to(op_diary_get_title_and_count($diary, false, 28), 'diary_show', $diary), $diary->Member->name);
    }
    $options = array('border' => true);
    op_include_list('diaryList', $list, $options);
    echo op_include_pager_navigation($pager, '@diary_list_friend?page=%d', array('is_total' => false));
    ?>

<?php 
} else {
    ?>

<?php 
    echo __('There are no diaries.');
    ?>

<?php 
开发者ID:nothan,项目名称:opDiaryPlugin,代码行数:31,代码来源:listFriendSuccess.php

示例15: use_helper

use_helper('Date', 'opCommunityTopic');
?>

<?php 
$body = '';
$images = $communityEvent->getImages();
if (count($images)) {
    $body .= '<ul class="photo">';
    foreach ($images as $image) {
        $body .= '<li><a href="' . sf_image_path($image->File) . '" target="_blank">' . image_tag_sf_image($image->File, array('size' => '120x120')) . '</a></li>';
    }
    $body .= '</ul>';
}
$body .= nl2br($communityEvent->getBody());
$list = array('Writer' => op_community_topic_link_to_member($communityEvent->getMember()), 'Name' => $communityEvent->getName(), 'Open date' => op_format_date($communityEvent->getOpenDate(), 'D') . ($communityEvent->getOpenDate() ? ' ' . $communityEvent->getOpenDateComment() : ''), 'Area' => op_url_cmd($communityEvent->getArea()), 'Body' => op_url_cmd($body), 'Application deadline' => op_format_date($communityEvent->getApplicationDeadline(), 'D'), 'Capacity' => $communityEvent->getCapacity(), 'Count of Member' => $communityEvent->getCommunityEventMember()->count());
if ($list['Count of Member']) {
    $list['Count of Member'] .= '(' . link_to(__('See Member List'), '@communityEvent_memberList?id=' . $communityEvent->getId()) . ')';
}
$i18nlist = array();
foreach ($list as $key => $value) {
    $i18nlist[__($key, array(), 'community_event_form')] = $value;
}
$options = array('title' => '[' . $community->getName() . '] ' . __('Event'), 'list' => $i18nlist);
op_include_parts('listBox', 'communityEvent', $options);
?>


<?php 
if ($communityEvent->isEditable($sf_user->getMemberId())) {
    ?>
开发者ID:te-koyama,项目名称:openpne,代码行数:30,代码来源:showSuccess.php


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