_photo_calendar.vm

来自「一个简单的blog系统」· VM 代码 · 共 52 行

VM
52
字号
#set($c_year=$dlog.calendar(1))
#set($c_month=$dlog.calendar(2))
#set($c_date=$dlog.calendar(3))
#set($weeks=$dlog.calendar($c_year,$c_month))
#set($logc=$PHOTO_tool.photo_counts_by_month($g_site, $g_user, $c_year,$c_month))

#set($nextYear = $c_year)
#set($lastYear = $c_year)
#set($next_m = $c_month + 1)
#set($last_m = $c_month - 1)
#if($next_m>12)
    #set($next_m=1)
    #set($nextYear=$nextYear + 1)
#end
#if($last_m<1)
    #set($last_m=12)
    #set($lastYear=$lastYear - 1)
#end
<div class="module_title"><b>$text.ui("label.calendar")</b></div>
<div class="module_content">
	<div class="mydate_title">
    	<a href="?sid=$g_site_id&amp;year=$lastYear&amp;month=$last_m" class="calendar_next">&laquo;</a>
		&nbsp;<b>${c_year}</b>&nbsp;<b>${c_month}</b>&nbsp;
		<a href="?sid=$g_site_id&amp;year=$nextYear&amp;month=$next_m" class="calendar_next">&raquo;</a>
	</div>
	<div id="mydate">
        <div><span class="mydate_calendar">$text.ui("label.calendar.7")</span></div>
    	<div><span class="mydate_calendar">$text.ui("label.calendar.1")</span></div>
    	<div><span class="mydate_calendar">$text.ui("label.calendar.2")</span></div>
    	<div><span class="mydate_calendar">$text.ui("label.calendar.3")</span></div>
    	<div><span class="mydate_calendar">$text.ui("label.calendar.4")</span></div>
    	<div><span class="mydate_calendar">$text.ui("label.calendar.5")</span></div>
    	<div><span class="mydate_calendar">$text.ui("label.calendar.6")</span></div>
    	#foreach($week in $weeks)
            #foreach($d in $week)
			#set($_css = "mydate_day")
			#if($dlog.is_today($c_year,$c_month,$d))#set($_css = "mydate_today")#end
			<div>
                #if($d > 0)
                    #set($log_count = $logc.get($d))
					#if($log_count>0)#set($_css = "mydate_aday")#end			
                    #if($log_count>0)<a class="mydate_countday" href="$dlog.root()/html/photo/?sid=${g_site_id}&amp;year=${c_year}&amp;month=${c_month}&amp;date=${d}" title="照片数:$log_count">#end                    
					<span class="$_css">${d}</span>
                    #if($log_count>0)</a>#end
                #end
            </div>
            #end
		#end
    </div>
	<div class="spacer_5"></div>
</div>
<div class="module_foot"></div>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?