本文整理汇总了PHP中month_name函数的典型用法代码示例。如果您正苦于以下问题:PHP month_name函数的具体用法?PHP month_name怎么用?PHP month_name使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了month_name函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display_week
function display_week()
{
global $vars;
$heading_html = tag('tr');
$heading_html->add(tag('th', __p('Week', 'W')));
for ($i = 0; $i < 7; $i++) {
$d = ($i + day_of_week_start()) % 7;
$heading_html->add(tag('th', day_name($d)));
}
if (!isset($vars['week']) || !isset($vars['year'])) {
soft_error(__('Invalid date.'));
}
$week_of_year = intval($vars['week']);
$year = intval($vars['year']);
$day_of_year = 1 + ($week_of_year - 1) * 7 - day_of_week(1, 1, $year);
$from_stamp = mktime(0, 0, 0, 1, $day_of_year, $year);
$start_month = date("n", $from_stamp);
$start_year = date("Y", $from_stamp);
$last_day = $day_of_year + 6;
$to_stamp = mktime(23, 59, 59, 1, $last_day, $year);
$end_month = date("n", $to_stamp);
$end_year = date("Y", $to_stamp);
$heading = month_name($start_month) . " {$start_year}";
if ($end_month != $start_month) {
$heading .= " - " . month_name($end_month) . " {$end_year}";
}
return tag('', tag("div", attributes('id="phpc-summary-view"'), tag("div", attributes('id="phpc-summary-head"'), tag("div", attributes('id="phpc-summary-title"'), ''), tag("div", attributes('id="phpc-summary-author"'), ''), tag("div", attributes('id="phpc-summary-category"'), ''), tag("div", attributes('id="phpc-summary-time"'), '')), tag("div", attributes('id="phpc-summary-body"'), '')), tag('table', attributes('class="phpc-main phpc-calendar"'), tag('caption', $heading), tag('colgroup', tag('col', attributes('class="phpc-week"')), tag('col', attributes('class="phpc-day"')), tag('col', attributes('class="phpc-day"')), tag('col', attributes('class="phpc-day"')), tag('col', attributes('class="phpc-day"')), tag('col', attributes('class="phpc-day"')), tag('col', attributes('class="phpc-day"')), tag('col', attributes('class="phpc-day"'))), tag('thead', $heading_html), create_week($week_of_year, $from_stamp, $to_stamp, $year)));
}
示例2: display_month
function display_month()
{
global $phpc_month, $phpc_year, $phpc_home_url, $phpcid;
$months = array();
for ($i = 1; $i <= 12; $i++) {
$m = month_name($i);
$months["{$phpc_home_url}?action=display_month&phpcid={$phpcid}&month={$i}&year={$phpc_year}"] = $m;
}
$years = array();
for ($i = $phpc_year - 5; $i <= $phpc_year + 5; $i++) {
$years["{$phpc_home_url}?action=display_month&phpcid={$phpcid}&month={$phpc_month}&year={$i}"] = $i;
}
$next_month = $phpc_month + 1;
$next_year = $phpc_year;
if ($next_month > 12) {
$next_month -= 12;
$next_year++;
}
$prev_month = $phpc_month - 1;
$prev_year = $phpc_year;
if ($prev_month < 1) {
$prev_month += 12;
$prev_year--;
}
$heading = tag('', tag('a', attrs('class="phpc-icon-link"', "href=\"{$phpc_home_url}?action=display_month&phpcid={$phpcid}&month={$prev_month}&year={$prev_year}\""), tag('span', attrs('class="fa fa-chevron-left"'), '')), create_dropdown_list(month_name($phpc_month), $months), create_dropdown_list($phpc_year, $years), tag('a', attrs('class="phpc-icon-link"', "href=\"{$phpc_home_url}?action=display_month&phpcid={$phpcid}&month={$next_month}&year={$next_year}\""), tag('span', attrs('class="fa fa-chevron-right"'), '')));
return create_display_table($heading, create_month($phpc_month, $phpc_year));
}
示例3: display_small_month
function display_small_month($thismonth, $thisyear, $showyear)
{
global $WEEK_START, $user, $login;
if ($user != $login && !empty($user)) {
$u_url = "&user={$user}";
} else {
$u_url = "";
}
echo "<TABLE BORDER=\"0\" CELLPADDING=\"1\" CELLSPACING=\"2\">";
if ($WEEK_START == "1") {
$wkstart = get_monday_before($thisyear, $thismonth, 1);
} else {
$wkstart = get_sunday_before($thisyear, $thismonth, 1);
}
$monthstart = mktime(2, 0, 0, $thismonth, 1, $thisyear);
$monthend = mktime(2, 0, 0, $thismonth + 1, 0, $thisyear);
echo "<TR><TD COLSPAN=\"7\" ALIGN=\"center\">" . "<A HREF=\"month.php?year={$thisyear}&month={$thismonth}" . $u_url . "\" CLASS=\"monthlink\">";
echo month_name($thismonth - 1) . "</A></TD></TR>";
echo "<TR>";
if ($WEEK_START == 0) {
echo "<TD><FONT SIZE=\"-3\">" . weekday_short_name(0) . "</TD>";
}
for ($i = 1; $i < 7; $i++) {
echo "<TD><FONT SIZE=\"-3\">" . weekday_short_name($i) . "</TD>";
}
if ($WEEK_START == 1) {
echo "<TD><FONT SIZE=\"-3\">" . weekday_short_name(0) . "</TD>";
}
for ($i = $wkstart; date("Ymd", $i) <= date("Ymd", $monthend); $i += 24 * 3600 * 7) {
echo "<TR>";
for ($j = 0; $j < 7; $j++) {
$date = $i + $j * 24 * 3600;
if (date("Ymd", $date) >= date("Ymd", $monthstart) && date("Ymd", $date) <= date("Ymd", $monthend)) {
echo "<TD ALIGN=\"right\"><A HREF=\"day.php?date=" . date("Ymd", $date) . $u_url . "\" CLASS=\"dayofmonthyearview\">";
echo "<FONT SIZE=\"-1\">" . date("j", $date) . "</A></FONT></TD>";
} else {
echo "<TD></TD>";
}
}
// end for $j
echo "</TR>";
}
// end for $i
echo "</TABLE>";
}
示例4: display_month
function display_month()
{
global $month, $year, $phpc_home_url, $phpcid;
$heading_html = tag('tr');
$heading_html->add(tag('th', __p('Week', 'W')));
for ($i = 0; $i < 7; $i++) {
$d = ($i + day_of_week_start()) % 7;
$heading_html->add(tag('th', day_name($d)));
}
$months = array();
for ($i = 1; $i <= 12; $i++) {
$m = month_name($i);
$months["{$phpc_home_url}?action=display_month&phpcid={$phpcid}&month={$i}&year={$year}"] = $m;
}
$years = array();
for ($i = $year - 5; $i <= $year + 5; $i++) {
$years["{$phpc_home_url}?action=display_month&phpcid={$phpcid}&month={$month}&year={$i}"] = $i;
}
return tag('', tag("div", attributes('id="phpc-summary-view"'), tag("div", attributes('id="phpc-summary-head"'), tag("div", attributes('id="phpc-summary-title"'), ''), tag("div", attributes('id="phpc-summary-author"'), ''), tag("div", attributes('id="phpc-summary-category"'), ''), tag("div", attributes('id="phpc-summary-time"'), '')), tag("div", attributes('id="phpc-summary-body"'), '')), tag('table', attributes('class="phpc-main phpc-calendar"'), tag('caption', create_dropdown_list(month_name($month), $months), create_dropdown_list($year, $years)), tag('colgroup', tag('col', attributes('class="phpc-week"')), tag('col', attributes('class="phpc-day"')), tag('col', attributes('class="phpc-day"')), tag('col', attributes('class="phpc-day"')), tag('col', attributes('class="phpc-day"')), tag('col', attributes('class="phpc-day"')), tag('col', attributes('class="phpc-day"')), tag('col', attributes('class="phpc-day"'))), tag('thead', $heading_html), create_month($month, $year)));
}
示例5: create_day_menu
function create_day_menu()
{
global $phpc_month, $phpc_day, $phpc_year;
$html = tag('div', attrs('class="phpc-bar ui-widget-content"'));
$monthname = month_name($phpc_month);
$lasttime = mktime(0, 0, 0, $phpc_month, $phpc_day - 1, $phpc_year);
$lastday = date('j', $lasttime);
$lastmonth = date('n', $lasttime);
$lastyear = date('Y', $lasttime);
$lastmonthname = month_name($lastmonth);
$last_args = array('year' => $lastyear, 'month' => $lastmonth, 'day' => $lastday);
menu_item_prepend($html, "{$lastmonthname} {$lastday}", 'display_day', $last_args);
$nexttime = mktime(0, 0, 0, $phpc_month, $phpc_day + 1, $phpc_year);
$nextday = date('j', $nexttime);
$nextmonth = date('n', $nexttime);
$nextyear = date('Y', $nexttime);
$nextmonthname = month_name($nextmonth);
$next_args = array('year' => $nextyear, 'month' => $nextmonth, 'day' => $nextday);
menu_item_append($html, "{$nextmonthname} {$nextday}", 'display_day', $next_args);
return $html;
}
示例6: display_week
function display_week()
{
global $vars, $phpc_home_url, $phpcid, $phpc_year, $phpc_month, $phpc_day;
if (!isset($vars['week'])) {
$week_of_year = week_of_year($phpc_month, $phpc_day, $phpc_year);
} else {
if (!is_numeric($vars['week'])) {
soft_error(__('Invalid date.'));
}
$week_of_year = $vars['week'];
}
$day_of_year = 1 + ($week_of_year - 1) * 7 - day_of_week(1, 1, $phpc_year);
$from_stamp = mktime(0, 0, 0, 1, $day_of_year, $phpc_year);
$start_day = date("j", $from_stamp);
$start_month = date("n", $from_stamp);
$start_year = date("Y", $from_stamp);
$last_day = $day_of_year + 6;
$to_stamp = mktime(23, 59, 59, 1, $last_day, $phpc_year);
$end_day = date("j", $to_stamp);
$end_month = date("n", $to_stamp);
$end_year = date("Y", $to_stamp);
$title = month_name($start_month) . " {$start_year}";
if ($end_month != $start_month) {
$title .= " - " . month_name($end_month) . " {$end_year}";
}
$prev_week = $week_of_year - 1;
$prev_year = $phpc_year;
if ($prev_week < 1) {
$prev_year--;
$prev_week = week_of_year($start_month, $start_day - 7, $start_year);
}
$next_week = $week_of_year + 1;
$next_year = $phpc_year;
if ($next_week > weeks_in_year($phpc_year)) {
$next_week = week_of_year($end_month, $end_day + 1, $end_year);
$next_year++;
}
$heading = tag('', tag('a', attrs('class="phpc-icon-link"', "href=\"{$phpc_home_url}?action=display_week&phpcid={$phpcid}&week={$prev_week}&year={$prev_year}\""), tag('span', attrs('class="fa fa-chevron-left"'), '')), $title, tag('a', attrs('class="phpc-icon-link"', "href=\"{$phpc_home_url}?action=display_week&phpcid={$phpcid}&week={$next_week}&year={$next_year}\""), tag('span', attrs('class="fa fa-chevron-right"'), '')));
return create_display_table($heading, create_week($from_stamp, $phpc_year, get_events($from_stamp, $to_stamp)));
}
示例7: switch
switch ($cal_type) {
case "daily":
$rep_str .= translate("Day");
break;
case "weekly":
$rep_str .= translate("Week");
for ($i = 0; $i <= 7; $i++) {
if (substr($cal_days, $i, 1) == "y") {
$rep_str .= ", " . weekday_short_name($i);
}
}
break;
case "monthlyByDay":
case "monthlyByDayR":
if ($cal_frequency == 12) {
$rep_str .= month_name($thismonth - 1) . " / ";
} else {
$rep_str .= translate("Month") . " / ";
}
$days_this_month = $thisyear % 4 == 0 ? $ldays_per_month[$thismonth] : $days_per_month[$thismonth];
if ($cal_type == 'monthlyByDay') {
$dow1 = date("w", mktime(3, 0, 0, $thismonth, 1, $thisyear));
$days_in_first_week = 7 - $dow1;
$whichWeek = ceil($thisday / 7);
} else {
$whichWeek = floor(($days_this_month - $thisday) / 7);
$whichWeek++;
}
$rep_str .= ' ';
switch ($whichWeek) {
case 1:
示例8: date
$wkend = $wkstart + 86400 * 6;
$startdate = date('Ymd', $wkstart);
$enddate = date('Ymd', $wkend);
/* Pre-Load the repeated events for quckier access */
$repeated_events = read_repeated_events($login, $startdate, $enddate, '');
/* Pre-load the non-repeating events for quicker access */
$events = read_events($login, $startdate, $enddate);
$first_hour = $WORK_DAY_START_HOUR;
$last_hour = $WORK_DAY_END_HOUR;
$untimed_found = false;
$tmpOut1 = $tmpOut2 = '';
for ($i = 0; $i < 7; $i++) {
$days[$i] = $wkstart + 86400 * $i;
$date = date('Ymd', $days[$i]);
$tmpOut1 .= '
<th style="width: 13%; background: ' . (date('Ymd', $days[$i]) == date('Ymd', $today) ? $TODAYCELLBG : $THBG) . ';">' . weekday_name(($i + $WEEK_START) % 7, $DISPLAY_LONG_DAYS) . '<br />' . month_name(date('m', $days[$i]) - 1, 'M') . ' ' . date('d', $days[$i]) . '</th>';
$tmpOut2 .= '
<td style="vertical-align: top; width: 75px; height: 75px; ' . 'background: ' . ($date == date('Ymd') ? $TODAYCELLBG : $CELLBG) . print_date_entries($date, $login, true, true) . ' </td>';
}
echo '
<table width="100%">
<tr>
<td style="background: ' . $TABLEBG . ';">
<table style="border: 0; width: 100%;" cellspacing="1" cellpadding="2">
<tr>' . $tmpOut1 . '
</tr>
<tr>' . $tmpOut2 . '
</tr>
</table>
</td>
</tr>
示例9: etranslate
etranslate("Previous");
?>
" /></a>
<a title="<?php
etranslate("Next");
?>
" class="next" href="<?php
echo $next_url;
?>
"><img src="rightarrow.gif" class="prevnext" alt="<?php
etranslate("Next");
?>
" /></a>
<div class="title">
<span class="date"><?php
printf("%s, %s %d, %d", weekday_name($wday), month_name($month - 1), $day, $year);
?>
</span><br />
</div></div>
<br />
<form action="availability.php" method="post">
<?php
daily_matrix($date, $users);
?>
</form>
<?php
print_trailer(false, true, true);
?>
示例10: big_calendar_week
//.........这里部分代码省略.........
$prev_month = '12';
}
$view = 'bigcalendarweek';
$views = explode(',', $view_select);
$defaultview = 'week';
array_pop($views);
$display = '';
if (count($views) == 0) {
$display = "display:none";
}
if (count($views) == 1 && $views[0] == $defaultview) {
$display = "display:none";
}
$activedate = explode('/', $header_format);
for ($i = 0; $i < count($activedate); $i++) {
if ($activedate[$i] == 'w') {
$activedate[$i] = 'l';
}
if ($activedate[$i] == 'm') {
$activedate[$i] = 'F';
}
if ($activedate[$i] == 'y') {
$activedate[$i] = 'Y';
}
}
$activedatestr = "";
for ($i = 0; $i < count($activedate); $i++) {
$activedatestr .= $activedate[$i];
}
$weekstartday = substr($week_days[0], 8, 2);
$weekendday = substr($week_days[6], 8, 2);
$startmonth = substr($week_days[0], 5, 2);
$endmonth = substr($week_days[6], 5, 2);
$startmonth_name = month_name($startmonth);
$endmonth_name = month_name($endmonth);
$dateformat_arrays = array("dFY", "dYF", "FYd", "FdY", "YdF", "YFd");
$dates_formats = array($weekstartday . ' ' . __($startmonth_name, 'sp_calendar') . ' - ' . $weekendday . ' ' . __($endmonth_name, 'sp_calendar'), $weekstartday . ' ' . __($startmonth_name, 'sp_calendar') . ' - ' . $weekendday . ' ' . __($endmonth_name, 'sp_calendar'), __($startmonth_name, 'sp_calendar') . ' ' . $weekstartday . ' - ' . __($endmonth_name, 'sp_calendar') . ' ' . $weekendday, __($startmonth_name, 'sp_calendar') . ' ' . $weekstartday . ' - ' . __($endmonth_name, 'sp_calendar') . ' ' . $weekendday, $weekstartday . ' ' . __($startmonth_name, 'sp_calendar') . ' - ' . $weekendday . ' ' . __($endmonth_name, 'sp_calendar'), __($startmonth_name, 'sp_calendar') . ' ' . $weekstartday . ' - ' . __($endmonth_name, 'sp_calendar') . ' ' . $weekendday);
for ($i = 0; $i < count($dateformat_arrays); $i++) {
if (strpos($activedatestr, $dateformat_arrays[$i]) !== false) {
$weekdays = $dates_formats[$i];
}
}
?>
<style type='text/css'>
.week_list:last-child{
border-top-left-radius: <?php
echo $border_radius2;
?>
px !important;
border-top-right-radius: <?php
echo $border_radius2;
?>
px !important;
border-radius:<?php
echo $border_radius2;
?>
px !important;
border-bottom-left-radius: <?php
echo $border_radius2;
?>
px !important;
}
#TB_iframeContent{
background-color: <?php
echo $show_event_bgcolor;
?>
示例11: etranslate
<a title="<?php
etranslate("Next");
?>
" class="next" href="view_d.php?id=
<?php
echo $id . "&date=" . $nextdate;
?>
"><img src="rightarrow.gif"
class="prevnext" alt="<?php
etranslate("Next");
?>
" /></a>
<div class="title">
<span class="date"><?php
printf("%s, %s %d, %d", weekday_name($wday), month_name($thismonth - 1), $thisday, $thisyear);
?>
</span><br />
<span class="viewname"><?php
echo $view_name;
?>
</span>
</div></div>
<?php
daily_matrix($date, $participants);
?>
<br />
<!-- Hidden form for booking events -->
<form action="edit_entry.php" method="post" name="schedule">
示例12: elseif
} elseif (empty($month)) {
echo str_replace('XXX', translate('month'), $noXStr);
exit;
} elseif (empty($day)) {
echo str_replace('XXX', translate('day'), $noXStr);
exit;
}
print_header(array('js/availability.php/false/' . "{$month}/{$day}/{$year}/" . getGetValue('form')), '', 'onload="focus();"', true, false, true);
$next_url = $prev_url = '?users=' . $users;
$time = mktime(0, 0, 0, $month, $day, $year);
$date = date('Ymd', $time);
$next_url .= strftime('&year=%Y&month=%m&day=%d', $time + 86400);
$prev_url .= strftime('&year=%Y&month=%m&day=%d', $time - 86400);
$span = ($WORK_DAY_END_HOUR - $WORK_DAY_START_HOUR) * 3 + 1;
$users = explode(',', $users);
$nextStr = translate('Next');
$prevStr = translate('Previous');
echo '
<div style="width:99%;">
<a title="' . $prevStr . '" class="prev" href="' . $prev_url . '"><img src="images/leftarrow.gif" class="prev" alt="' . $prevStr . '" /></a>
<a title="' . $nextStr . '" class="next" href="' . $next_url . '"><img src="images/rightarrow.gif" class="next" alt="' . $nextStr . '" /></a>
<div class="title">
<span class="date">';
printf("%s, %s %d, %d", weekday_name(strftime("%w", $time)), month_name($month - 1), $day, $year);
echo '</span><br />
</div>
</div><br />
<form action="availability.php" method="post">
' . daily_matrix($date, $users) . '
</form>
' . print_trailer(false, true, true);
示例13: getGetValue
$fyear = getGetValue('fyear');
$form = getGetValue('form');
$date = getGetValue('date');
if (strlen($date) > 0) {
$thisyear = substr($date, 0, 4);
$thismonth = substr($date, 4, 2);
} else {
$thisyear = date('Y');
$thismonth = date('m');
}
$href = 'href="datesel.php?form=' . $form . '&fday=' . $fday . '&fmonth=' . $fmonth . '&fyear=' . $fyear . '&date=';
$nextdate = $href . date('Ym01"', mktime(0, 0, 0, $thismonth + 1, 1, $thisyear));
$nextStr = translate('Next');
$prevdate = $href . date('Ym01"', mktime(0, 0, 0, $thismonth - 1, 1, $thisyear));
$previousStr = translate('Previous');
$monthStr = month_name($thismonth - 1);
$wkstart = get_weekday_before($thisyear, $thismonth);
$monthstartYmd = date('Ymd', mktime(0, 0, 0, $thismonth, 1, $thisyear));
$monthendYmd = date('Ymd', mktime(23, 59, 59, $thismonth + 1, 0, $thisyear));
print_header('', '', '', true, false, true, true, true);
//build weekday names
$wkdys = '';
for ($i = 0; $i < 7; $i++) {
$wkdys .= '<td>' . weekday_name(($i + $WEEK_START) % 7, 'D') . '</td>';
}
//build month grid
$mdays = '';
for ($i = $wkstart; date('Ymd', $i) <= $monthendYmd; $i += 604800) {
$mdays .= '
<tr>';
for ($j = 0; $j < 7; $j++) {
示例14: navbar
function navbar()
{
global $vars, $action, $config, $year, $month, $day;
$html = tag('div', attributes('class="phpc-navbar"'));
if (can_add_event() && $action != 'add') {
menu_item_append($html, _('Add Event'), 'event_form', $year, $month, $day);
}
if ($action != 'search') {
menu_item_append($html, _('Search'), 'search', $year, $month, $day);
}
if (!empty($vars['day']) || !empty($vars['id']) || $action != 'display') {
menu_item_append($html, _('Back to Calendar'), 'display', $year, $month);
}
if ($action != 'display' || !empty($vars['id'])) {
menu_item_append($html, _('View date'), 'display', $year, $month, $day);
}
if (is_user()) {
menu_item_append($html, _('Log out'), 'logout', empty($vars['year']) ? false : $year, empty($vars['month']) ? false : $month, empty($vars['day']) ? false : $day, $action);
} else {
menu_item_append($html, _('Log in'), 'login', empty($vars['year']) ? false : $year, empty($vars['month']) ? false : $month, empty($vars['day']) ? false : $day, $action);
}
if (is_admin() && $action != 'admin') {
menu_item_append($html, _('Admin'), 'admin');
}
if (isset($var['display']) && $var['display'] == 'day') {
$monthname = month_name($month);
$lasttime = mktime(0, 0, 0, $month, $day - 1, $year);
$lastday = date('j', $lasttime);
$lastmonth = date('n', $lasttime);
$lastyear = date('Y', $lasttime);
$lastmonthname = month_name($lastmonth);
$nexttime = mktime(0, 0, 0, $month, $day + 1, $year);
$nextday = date('j', $nexttime);
$nextmonth = date('n', $nexttime);
$nextyear = date('Y', $nexttime);
$nextmonthname = month_name($nextmonth);
menu_item_prepend($html, "{$lastmonthname} {$lastday}", 'display', $lastyear, $lastmonth, $lastday);
menu_item_append($html, "{$nextmonthname} {$nextday}", 'display', $nextyear, $nextmonth, $nextday);
}
return $html;
}
示例15: etranslate
<a title="<?php
etranslate("Next");
?>
" class="next" href="view_m.php?id=<?php
echo $id;
?>
&date=<?php
echo $nextdate;
?>
"><img src="rightarrow.gif" alt="<?php
etranslate("Next");
?>
" /></a>
<div class="title">
<span class="date"><?php
printf("%s %d", month_name($thismonth - 1), $thisyear);
?>
</span><br />
<span class="viewname"><?php
echo $view_name;
?>
</span>
</div>
</div><br />
<?php
// The table has names across the top and dates for rows. Since we need
// to spit out an entire row before we can move to the next date, we'll
// save up all the HTML for each cell and then print it out when we're
// done....
// Additionally, we only want to put at most 6 users in one table since