本文整理汇总了PHP中GWF_Time::getWeekdaysFromMo方法的典型用法代码示例。如果您正苦于以下问题:PHP GWF_Time::getWeekdaysFromMo方法的具体用法?PHP GWF_Time::getWeekdaysFromMo怎么用?PHP GWF_Time::getWeekdaysFromMo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GWF_Time
的用法示例。
在下文中一共展示了GWF_Time::getWeekdaysFromMo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: displayBirthdays
private function displayBirthdays(array $userdate)
{
# more vars
$today = date('md');
$tommorow = date('md', time() + GWF_Time::ONE_DAY);
$yesterday = date('md', time() - GWF_Time::ONE_DAY);
# Output
$href = '/index.php?mo=WeChall&me=BirthdayRead';
$title = $this->lang('bdnews_title');
$text = $this->lang('bdnews_body_init', array($href));
$weekdays = GWF_Time::getWeekdaysFromMo();
$i = -1;
foreach ($userdate as $date => $data) {
$i++;
if (count($data) === 0) {
continue;
}
$day = $weekdays[$i];
if ($date === $yesterday) {
$day = WC_HTML::lang('Yesterday');
} elseif ($date === $today) {
$day = '[b]' . WC_HTML::lang('Today') . '[/b]';
} elseif ($date === $tommorow) {
$day = WC_HTML::lang('Tommorow');
} elseif ($date < $today) {
$day = WC_HTML::lang('bd_over', array($day));
} elseif ($date > $today) {
$day = WC_HTML::lang('bd_soon', array($day));
}
$text .= $day . ': ';
$app = '';
foreach ($data as $username) {
$app .= sprintf(', [url=/profile/%s]%s[/url]', urlencode($username), htmlspecialchars($username));
// $text .= $day.': '.implode(', ', $data).PHP_EOL;
}
$text .= substr($app, 2) . PHP_EOL;
// $text .= $day.': '.implode(', ', $data).PHP_EOL;
}
$wechalluser = Module_WeChall::instance()->cfgWeChallUser();
$english = GWF_Language::getEnglish();
$news = GWF_News::newNews(GWF_Time::getDate(GWF_Date::LEN_SECOND), 0, $wechalluser->getID(), $english->getID(), $title, $text, true);
return Module_News::displayItem($news);
}