當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。