Код:
<?
/************************************************** **********************
* Title : Art1st Calendar *
* Author : Art1st *
* Version : 2.1 *
* Status : Freeware *
* FileName : calendar.php *
* Release date : June 12, 2003 *
* HomePage : http://art1st.far.ru (protected page) *
* eMail : art1st@freemail.ru *
* Description : Simple calendar with some function *
* Requirements : PHP 3 or higher *
* Thanks To : State University of Management (Moscow) *
************************************************** ***********************
* Âûçîâ ñêðèïòà : *
* Ïðîñòî êàëåíäàðü íà òåêóùèé ìåñÿö - calendar.php *
* Êàëåíäàðü íà ëþáîé ìåñÿö - *
* calendar.php?month=íîìåð ìåñÿöà-íîìåð ãîäà *
* íàïðèìåð, "calendar.php?month=6-2003" *
************************************************** **********************/
/************************************************** **********************
* Àäîïòàöèÿ è ìîäåðíèçàöèÿ ê PHP-NUKE by Soniks http://mynuke.ru *
************************************************** **********************/
if (eregi("block-calendar.php", $_SERVER['PHP_SELF'])) {
Header("Location: index.php");
die();
}
//Èíäèâèäóàëüíûå íàñòðîéêè ñêðèïòà
$ac_font_size = "10"; //Ðàçìåð øðèôòà (òîëüêî ÷èñëî)
$ac_font_color = "black"; //Öâåò øðèôòà (â ëþáîì ïðåäñòàâëåíèè: íàçâàíèå, RGB, etc. [html-ôîðìàò])
$ac_main_color = "white"; //Îñíîâíîé öâåò êàëåíäàðÿ (Îáû÷íûå äíè) (àíàëîãè÷íî öâåòó øðèôòà)
$ac_second_color = "c0c2c3"; //Âòîðîñòåïåííûé öâåò êàëåíäàðÿ (àíàëîãè÷íî öâåòó øðèôòà)
// (Òåêóùèé äåíü, çàãîëîâîê êàëåíäàðÿ)
$ac_holiday_color = "red"; //Öâåò âûõîäíîãî äíÿ
$ac_navigator = true; //Âûâîä ñòðîêè íàâèãàöèè ïî ìåñÿöàì (true/false)
$two_item = false; //Âûâîäèòü ðàçðÿä ÷èñëà êàê 01, 02, 03, .. (true), èëè 1,2,3, .. (false)
//Ìàññèâ íàçâàíèé ìåñÿöåâ
$mon_name = array
(
"ßíâàðü","Ôåâðàëü","Ìàðò","Àïðåëü","Ìàé","Èþíü",
"Èþëü","Àâãóñò","Ñåíòÿáðü","Îêòÿáðü","Íîÿáðü","Äåêàáðü"
);
//Ìàññèâ ïðîäîëæèòåëüíîñòåé ìåñÿöåâ
$nod = array (31,28,31,30,31,30,31,31,30,31,30,31);
//Îïðåäåëåíèå ìåñÿöà è ãîäà äëÿ êàëåíäàðÿ
$month=$_GET['month'];
if (!isset($month) or $month =="now")
{
$ac_month = date("n");
$ac_year = date("Y");
$ac_j_dom = date("j");
$ac_j_dow = date("w");
}
else
{
list ($ac_month,$ac_year) = explode ("-",$month);
if ($ac_year<1980) $ac_year = 1980;
if ($ac_year>2030) $ac_year = 2030;
if ($ac_month != date("n") or $ac_year != date("Y"))
{
$ac_j_dom = 1;
$ac_j_dow = date("w",mktime(0,0,0,$ac_month,1,$ac_year));
}
else
{
$ac_j_dom = date("j");
$ac_j_dow = date("w");
}
}
//Êîððåêòèðîâêà ïðîäîëæèòåëüíîñòè ôåâðàëÿ â âèñîêîñíîì ãîäó
if ($ac_year%4==0) {$nod[1]=29;}
//Îïðåäåëåíèå ïðåäûäóùèõ/ñëåäóþùèõ ìåñÿöåâ/ãîäîâ
$temp_month = $ac_month + 1;
if ($temp_month!=13)
{
$ac_month_next = "$temp_month-$ac_year";
}
else
{
$temp_year = $ac_year + 1;
$ac_month_next = "1-$temp_year";
}
$temp_month = $ac_month - 1;
if ($temp_month!=0)
{
$ac_month_prev = "$temp_month-$ac_year";
}
else
{
$temp_year = $ac_year - 1;
$ac_month_prev = "12-$temp_year";
}
$temp_year = $ac_year + 1;
$ac_year_next = "$ac_month-$temp_year";
$temp_year = $ac_year - 1;
$ac_year_prev = "$ac_month-$temp_year";
//Îïðåäåëåíèå íàçâàíèÿ ìåñÿöà
$ac_mon=$mon_name[$ac_month-1];
//Êîððåêòèðîâêà íîìåðà äíÿ íåäåëè èç çàïàäíî-åâðîïåéñêîé â ðóññêóþ
if ($ac_j_dow == 0) $ac_j_dow = 7;
//Îïðåäåëåíèå äíÿ íåäåëè ïåðâîãî äíÿ ìåñÿöà
$ac_1_dow = $ac_j_dow - ($ac_j_dom%7 - 1);
if ($ac_1_dow < 1) $ac_1_dow+=7;
if ($ac_1_dow > 7) $ac_1_dow-=7;
//Îïðåäåëåíèå ÷èñëà äíåé ìåñÿöà
$ac_nod = $nod[$ac_month-1];
//Îïðåäåëåíèå êîëè÷åñòâà íåäåëü â ìåñÿöå
$ac_now=5;
if ($ac_1_dow-1+$ac_nod<29) {$ac_now=4;}
else if ($ac_1_dow-1+$ac_nod>35) {$ac_now=6;}
//Ïðåäîòâðàùåíèå âûâîäà òåêóùåãî äíÿ äëÿ íåòåêóùåãî ìåñÿöà
if ($ac_month != date("n") or $ac_year != date("Y")) $ac_j_dom = -10;
//Âûâîä øàïêè êàëåíäàðÿ
$content = "
<a name=\"cal\"></a>
<table border=0 cellspacing=1 cellpadding=1 bgcolor=black style=\"font-size: $ac_font_size pt; color: $ac_font_color; font-family: verdana\">
<tr bgcolor=$ac_second_color>
<td colspan=7 align=center>
$ac_mon $ac_year
</td>
</tr>
<tr bgcolor=$ac_second_color>
<td>Ïí</td><td>Âò</td><td>Ñð</td><td>×ò</td><td>Ïò</td><td>Ñá</td><td>Âñ</td>
";
//Âûâîä ñîäåðæèìîãî êàëåíäàðÿ
$j=0;
for ($i=0;$i<$ac_now*7;$i++)
{
$j++;
if ($i%7==0) {$content .= "</tr>\n<tr align=center bgcolor=$ac_main_color>\n\t"; $j=0;}
if($j==5 or $j==6) { if(($i<$ac_1_dow-1)||($i>$ac_nod+$ac_1_dow-2)){ $cell = ""; } else{ $cell = "bgcolor=$ac_holiday_color";}} else {$cell = ""; }
if ($i-$ac_1_dow+2!=$ac_j_dom) {$content .= "<td $cell>";} else $content .= "<td bgcolor=$ac_second_color>";
if (($i<$ac_1_dow-1)||($i>$ac_nod+$ac_1_dow-2)) {$content .= " ";} else { if(($i-$ac_1_dow+2)<10 and $two_item) $content .= "0"; $content .= $i-$ac_1_dow+2;}
$content .= "</td>\n\t";
}
//Ñòðîêà íàâèãàöèè ïî ìåñÿöàì
if ($ac_navigator)
$content .= "
</tr>
<tr bgcolor=$ac_second_color>
<td colspan=7 align=center style=\"font-size: 8pt;\"><b>
<a href=\"?month=$ac_year_prev#cal\" title=\"Ãîä íàçàä\" style=\"color:black;text-decoration: none;\"><<</a>
<a href=\"?month=$ac_month_prev#cal\" title=\"Ìåñÿö íàçàä\" style=\"color:black;text-decoration: none;\"><</a>
<a href=\"?month=now#cal\" title=\"Òåêóùèé ìåñÿö\" style=\"color:black;text-decoration: none;\">•</a>
<a href=\"?month=$ac_month_next#cal\" title=\"Ìåñÿö âïåðåä\" style=\"color:black;text-decoration: none;\">></a>
<a href=\"?month=$ac_year_next#cal\" title=\"Ãîä âïåðåä\" style=\"color:black;text-decoration: none;\">>></a>
</b></td>
";
$content .= "
</tr>
</table>";
?>
ну так вот - дизай сайта он портит из-за того, что в правой колонке блоков теснится к левой... вот как сделать чтобы табличка календаря была посередине, либо растянута.
Подскажите что и где дописать\изменить.
Заранее спасибо.