;
$theYear_RecCalendar = date("Y");
if (isset($_GET["Year"])) {
$theYear_RecCalendar = (get_magic_quotes_gpc()) ? $_GET["Year"] : addslashes($_GET["Year"]);
}
$theMonth_RecCalendar = date("m");
if (isset($_GET["Month"])) {
$theMonth_RecCalendar = (get_magic_quotes_gpc()) ? $_GET["Month"] : addslashes($_GET["Month"]);
}
mysql_select_db($database_connData, $connData);
$query_RecCalendar = sprintf("SELECT * FROM blogmessages WHERE blog_date LIKE '%s-%s%%' ORDER BY blog_date ASC", $theYear_RecCalendar,$theMonth_RecCalendar);
$RecCalendar = mysql_query($query_RecCalendar, $connData) or die(mysql_error());
$row_RecCalendar = mysql_fetch_assoc($RecCalendar);
$totalRows_RecCalendar = mysql_num_rows($RecCalendar);
$timestamp = mktime(0, 0, 0, $theMonth_RecCalendar, 1, $theYear_RecCalendar);
//计算该月的第一天为星期几,整个月有几天
$first_wday = date("w", $timestamp);
$day_of_month = date("t", $timestamp);
//上个月下个月
$prev_mon = ($theMonth_RecCalendar == 1) ? 12 : $theMonth_RecCalendar-1;
$next_mon = ($theMonth_RecCalendar == 12) ? 1 : $theMonth_RecCalendar+1;
$prev_mon = ($prev_mon < 10) ? "0".strval($prev_mon) : strval($prev_mon);
$prev_year = ($theMonth_RecCalendar == 1) ? $theYear_RecCalendar-1 : $theYear_RecCalendar;
$next_mon = ($next_mon < 10) ? "0".strval($next_mon) : strval($next_mon);
$next_year = ($theMonth_RecCalendar == 12) ? $theYear_RecCalendar+1 : $theYear_RecCalendar;
do {
$dayNum = substr($row_RecCalendar['blog_date'],8,2);
if(!isset($aday[$dayNum])){
$aday[$dayNum] = 1;
}else{
$aday[$dayNum]++;
}
} while ($row_RecCalendar = mysql_fetch_assoc($RecCalendar));
mysql_free_result($RecCalendar);
$queryString_RecBlog = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_RecBlog") == false &&
stristr($param, "totalRows_RecBlog") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_RecBlog = "&" . htmlentities(implode("&", $newParams));
}
}
$queryString_RecBlog = sprintf("&totalRows_RecBlog=%d%s", $totalRows_RecBlog, $queryString_RecBlog);
$MM_paramName = "";
// *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters
// create the list of parameters which should not be maintained
$MM_removeList = "&index=";
if ($MM_paramName != "") $MM_removeList .= "&".strtolower($MM_paramName)."=";
$MM_keepURL="";
$MM_keepForm="";
$MM_keepBoth="";
$MM_keepNone="";
// add the URL parameters to the MM_keepURL string
reset ($HTTP_GET_VARS);
while (list ($key, $val) = each ($HTTP_GET_VARS)) {
$nextItem = "&".strtolower($key)."=";
if (!stristr($MM_removeList, $nextItem)) {
$MM_keepURL .= "&".$key."=".urlencode($val);
}
}
// add the Form parameters to the MM_keepURL string
if(isset($HTTP_POST_VARS)){
reset ($HTTP_POST_VARS);
while (list ($key, $val) = each ($HTTP_POST_VARS)) {
$nextItem = "&".strtolower($key)."=";
if (!stristr($MM_removeList, $nextItem)) {
$MM_keepForm .= "&".$key."=".urlencode($val);
}
}
}
// create the Form + URL string and remove the intial '&' from each of the strings
$MM_keepBoth = $MM_keepURL."&".$MM_keepForm;
if (strlen($MM_keepBoth) > 0) $MM_keepBoth = substr($MM_keepBoth, 1);
if (strlen($MM_keepURL) > 0) $MM_keepURL = substr($MM_keepURL, 1);
if (strlen($MM_keepForm) > 0) $MM_keepForm = substr($MM_keepForm, 1);
//织梦平台 http://www.e-dreamer.idv.tw 分享是成长的开始
//函数功能:捕获字符串显示
function cut_str($str,$maxlen, $suffix = "...") {
if($maxlen<=0) return $str;
if(ereg("\[re\]",$str)) $len=$len+4;
if($maxlen >= strlen($str)) return $str;
$klen = $maxlen - 1;
while(ord($str[$klen]) & 0x80) $klen--;
return substr($str, 0, $maxlen - (($maxlen + $klen + 1) % 2)).$suffix;
}
?><!DOCTYPE html PUBLIC "-//W3C//DTD X
HTML 1.0 Transiti