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


PHP Calendar::getMonthView方法代码示例

本文整理汇总了PHP中Calendar::getMonthView方法的典型用法代码示例。如果您正苦于以下问题:PHP Calendar::getMonthView方法的具体用法?PHP Calendar::getMonthView怎么用?PHP Calendar::getMonthView使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Calendar的用法示例。


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

示例1: index

 function index()
 {
     global $viewhelper;
     require CACHE_COMMON_PATH . "cache_type.php";
     $title = L("industry_info", "tpl");
     //cal
     require CLASS_PATH . "calendar.class.php";
     $cal = new Calendar();
     $cal->setMonthNames(explode(",", L("month_unit", "tpl")));
     $cal->setDayNames(explode(",", L("week_unit", "tpl")));
     $d = getdate(time());
     $day = $_GET['day'];
     if ($day == "") {
         $day = $d['mday'];
     }
     $month = $_GET['month'];
     if ($month == "") {
         $month = $d["mon"];
     }
     $year = $_GET['year'];
     if ($year == "") {
         $year = $d["year"];
     }
     if (isset($_GET['year']) && isset($_GET['month']) && isset($_GET['day'])) {
         $title .= L("journal", "tpl", $year . $month . $day);
         setvar("date_line", $year . "-" . $month . "-" . $day);
     }
     $viewhelper->setTitle($title);
     setvar("Calendar", $cal->getMonthView($month, $year));
     $cache_id = $year . $month . $day;
     //end cal
     render("news/index");
 }
开发者ID:reboxhost,项目名称:phpb2b,代码行数:33,代码来源:news_controller.php

示例2: calendar

	/**
	 * возвращает календарь. хтмл.
	 */
	public function calendar()
	{
		$this->__loadLib("calendar.php");
		$this->__implement("calendar");

		$year  = getRequest('year') ? (int) getRequest('year') : date('Y');
		$month = getRequest('month') ? (int) getRequest('month') : date('m');


		$calendar = new Calendar();

		$lang_id = cmsController::getInstance()->getCurrentLang()->getId();
		$lang = langsCollection::getInstance()->getLang($lang_id);

		if ($lang->getPrefix() == "ru")
		{
			$calendar->setMonthNames(array("Январь", "Февраль", "Март", "Апрель", "Май", "Июнь",
							"Июль", "Август", "Сентябрь", "Октябрь", "Ноябрь", "Декабрь"));
			$calendar->setDayNames(array("Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"));
			$calendar->setStartDay(1);
		}

		$result = $calendar->getMonthView($month, $year);

		return $result;

	}
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:30,代码来源:class.php

示例3: display_page_content


//.........这里部分代码省略.........
						}
						else
						{
							$("table.calendarTable td a:not(." + selected + ")").hide();
							$("." + selected).show();
						}
					});
				});
				//]]>
			</script>
			
		<?php 
    if ($event_id != "") {
        $event = Events::FindById($event_id);
        $cal = new Calendar();
        echo $cal->getMiniMonthView("events", "calendar", $month, $year, $day, $event_id);
        ?>
			
			<div class="event_details">
				<h1><?php 
        echo $event->title;
        ?>
</h1>
				<h3><?php 
        echo $event->getDateRangeString();
        ?>
</h3>

				<div class="event_description">
					<?php 
        echo $event->getDescription();
        ?>
					
				</div>
			</div>
			
		<?php 
    } else {
        if ($day != "") {
            $event = Events::FindAllForDate($day, $month, $year);
            $cal = new Calendar();
            echo $cal->getMiniMonthView("events", "calendar", $month, $year, $day, $event_id);
            if (substr($day, 0, 1) == "0") {
                $properday = substr($day, 1, 1);
            } else {
                $properday = $day;
            }
            echo "\t\t\t<h2>Events for " . getFullMonthName($month) . " " . $properday . ", " . $year . "</h2>\n";
            foreach ($event as $theevent) {
                ?>
		
			<div class="event_details">
				<h1><?php 
                echo $theevent->title;
                ?>
</h1>
				<h3><?php 
                echo $theevent->getDateRangeString();
                ?>
</h3>
				
				<div class="event_description">
					<?php 
                echo chopText($theevent->getDescription(true), 100);
                ?>
				</div>
				<a href="<?php 
                echo get_link("/events/calendar/{$year}/{$month}/{$day}/{$theevent->id}");
                ?>
">Read More</a>
			</div>
		<?php 
            }
        } else {
            ?>
			
			<p>Below is our Event Calendar engine, which displays all the past and future events for your website. Use the double arrows to go back or forward in time and view previous or upcoming months. Click on any event to find out more about it. Notice how we can handle recurring events &ndash; repetitive events every week, every first day, second, third, or last. </p>
			
			<select name="eventtype" id="eventtype">
				<?php 
            echo "<option value='All' selected>All Events</option>";
            foreach ($event_types as $event_type) {
                echo "<option value='{$event_type->slug()}' ";
                echo ">{$event_type->name}</option>\r\n";
            }
            ?>
			</select>
			<p>&nbsp;</p>

<?php 
            $cal = new Calendar();
            if ($month != "" && $year != "") {
                echo $cal->getMonthView($month, $year);
            } else {
                echo $cal->getCurrentMonthView();
            }
        }
    }
    // end the if statement
}
开发者ID:highchair,项目名称:hcd-trunk,代码行数:101,代码来源:events_calendar.php

示例4: Newses

uses("news", "newstype");
$news = new Newses();
$newstype = new Newstypes();
$title = L("industry_info", "tpl");
//cal
require "../libraries/calendar.class.php";
$cal = new Calendar();
$cal->setMonthNames(explode(",", L("month_unit", "tpl")));
$cal->setDayNames(explode(",", L("week_unit", "tpl")));
$d = getdate(time());
$day = $_GET['day'];
if ($day == "") {
    $day = $d['mday'];
}
$month = $_GET['month'];
if ($month == "") {
    $month = $d["mon"];
}
$year = $_GET['year'];
if ($year == "") {
    $year = $d["year"];
}
if (isset($_GET['year']) && isset($_GET['month']) && isset($_GET['day'])) {
    $title .= L("journal", "tpl", $year . $month . $day);
    setvar("date_line", $year . "-" . $month . "-" . $day);
}
$viewhelper->setTitle($title);
setvar("Calendar", $cal->getMonthView($month, $year));
$cache_id = $year . $month . $day;
//end cal
render("news/index");
开发者ID:renduples,项目名称:alibtob,代码行数:31,代码来源:index.php

示例5: getDayList

 private function getDayList(array $options, array $query)
 {
     $result = '';
     $instance = $this->host;
     $taglist = $this->getTagList($query);
     $root = $options['root'];
     $year = $options['year'];
     $month = $options['month'];
     $url = bebop_split_url();
     $sql = "SELECT DAY(`n`.`created`) AS `day`, COUNT(*) AS `count` " . "FROM `node` `n` WHERE `n`.`id` IN " . "(SELECT `nid` FROM `node__rel` WHERE `tid` IN ({$taglist})) " . "AND YEAR(`n`.`created`) = :year AND MONTH(`n`.`created`) = :month " . "AND `n`.`published` = 1 " . "AND `n`.`deleted` = 0 " . "GROUP BY `day` ORDER BY `day`";
     // Список задействованных дней.
     // FIXME: publishing
     $days = $this->ctx->db->getResultsKV("day", "count", $sql, array(':year' => $year, ':month' => $month));
     // Список месяцев.
     $months = array('Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь');
     // Получаем карту этого месяца.
     $cal = new Calendar();
     $map = $cal->getMonthView($month, $year);
     $result = "<table class='calendar' id='{$instance}-calendar'><tr>";
     // Предыдущий месяц.
     $tmp = $url;
     if (--$tmp['args'][$instance]['month'] == 0) {
         $tmp['args'][$instance]['year']--;
         $tmp['args'][$instance]['month'] = 12;
     }
     $result .= "<th class='prev'><a href='" . bebop_combine_url($tmp) . "' title='{$months[$tmp['args'][$instance]['month'] - 1]}'><span>&larr;</span></a></th>";
     // Текущий месяц.
     $result .= "<th colspan='5' class='current'><span>{$months[$month - 1]}</span></th>";
     // Следующий месяц.
     $tmp = $url;
     if (++$tmp['args'][$instance]['month'] == 13) {
         $tmp['args'][$instance]['year']++;
         $tmp['args'][$instance]['month'] = 1;
     }
     $result .= "<th class='next'><a href='" . bebop_combine_url($tmp) . "' title='{$months[$tmp['args'][$instance]['month'] - 1]}'><span>&rarr;</span></a></th></tr>";
     // Недели.
     foreach ($map as $week) {
         $result .= "<tr>";
         foreach ($week as $day) {
             $result .= "<td>";
             if (empty($day)) {
                 $result .= "&nbsp;";
             } elseif (empty($days[$day])) {
                 $result .= $day;
             } else {
                 $url['args'][$instance]['day'] = $day;
                 $url['args'][$instance]['page'] = null;
                 $result .= "<a href='" . bebop_combine_url($url) . "'>{$day}</a>";
             }
             $result .= "</td>";
         }
         $result .= "</tr>";
     }
     $result .= "</table>";
     return $result;
 }
开发者ID:umonkey,项目名称:molinos-cms,代码行数:56,代码来源:widget.archive.php


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