|
|
·
Skindario
Buscar en el Foro Buscar Tags
Portal
Foro
Usuario
Foro
Normas
RSS
Etiquetas
Avatares
Rangos
Eventos
Staff
Entrevistas
Noticias
Caretos
F.A.Q
Subforos Privados
Estadisticas
Estadisticas
Usuarios
OnLine
Actividad
Funciones
Favoritos
P. Inicio
Imprimir
Buscar
Afiliados
¿Tu Web Aquí?
Comunidad ESDLA
Foros DWP
Websmasters Foro
Mundo Deluxe
Photosherox
Descargas-V
Enlázanos

i
Calendario
 
Portal · Foros · Zona Biblioteca · PHP
Noticias · Buscar · Tags · Imágenes · Usuarios · Fisgona
Autor Mensaje 
EffectedCard
Administrador
Administrador

Haz clic para ver el perfil del usuario

Usuario PRO Usuario PRO
Mensajes: 9.272
Desde: 16/Oct/2004
#1 ·
Calendario

Esta en ingles, no es muy dificil de traducir


Codigo PHP:

<?PHP
##InstaCalendar
##Written by Marcos Ojeda 11.July.2000
#Fill in default,today values accordingly as well as font...
#$month can be changed, but not $textmonth
## "Remember who loves you, baby!" --Kojack
$fontfamily = isset($fontfamily) ? $fontfamily : "Tahoma, Geneva, sans-serif";
$defaultfontcolor = isset($defaultfontcolor) ? $defaultfontcolor : "#000000";
$defaultbgcolor = isset($defaultbgcolor) ? $defaultbgcolor : "#FFFFFF";
$todayfontcolor = isset($todayfontcolor) ? $todayfontcolor : "#FFFFFF";
$todaybgcolor = isset($todaybgcolor) ? $todaybgcolor : "#CC0000";
$monthcolor = isset($monthcolor) ? $monthcolor : "#333399";

$relfontsize = isset($relfontsize) ? $relfontsize : "1";
$cssfontsize = isset($cssfontsize) ? $cssfontsize : "8pt";

$month = (isset($month)) ? $month : date("n",time());
$monthnames = array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
$textmonth = $monthnames[$month - 1];
$year = (isset($year)) ? $year : date("Y",time());
$today = (isset($today))? $today : date("j", time()); ## Make $today really big to avoid hilite
$today = ($month == date("n",time())) ? $today : 32;
if ( ((
$month < 8) && ($month % 2 == 1)) || (($month > 7) && ($month % 2 == 0)) )
$days = 31;
if ( ((
$month < 8) && ($month % 2 == 0)) || (($month > 7) && ($month % 2 == 1)) )
$days = 30;
if (
$month == 2)
$days = (date("L",time())) ? 29 : 28;

$dayone = date("w",mktime(1,1,1,$month,1,$year));
$daylast = date("w",mktime(1,1,1,$month,$days,$year));
?>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td bgcolor="<?PHP echo $defaultbgcolor ?>" colspan="7" valign="middle" align="center"><font color="<?php echo $monthcolor ?>" face="Arial, Helvetica, sans-serif" size="3"><b><?PHP echo $textmonth ?></b></font></td>
</tr>
<tr>
<td bgcolor="<?PHP echo $defaultbgcolor ?>" valign="middle" align="center" width="15%"><font face="<?PHP echo $fontfamily ?>" size="1"><b>Sun</b></font></td>
<td bgcolor="<?PHP echo $defaultbgcolor ?>" valign="middle" align="center" width="14%"><font face="<?PHP echo $fontfamily ?>" size="1"><b>Mon</b></font></td>
<td bgcolor="<?PHP echo $defaultbgcolor ?>" valign="middle" align="center" width="14%"><font face="<?PHP echo $fontfamily ?>" size="1"><b>Tue</b></font></td>
<td bgcolor="<?PHP echo $defaultbgcolor ?>" valign="middle" align="center" width="14%"><font face="<?PHP echo $fontfamily ?>" size="1"><b>Wed</b></font></td>
<td bgcolor="<?PHP echo $defaultbgcolor ?>" valign="middle" align="center" width="14%"><font face="<?PHP echo $fontfamily ?>" size="1"><b>Thu</b></font></td>
<td bgcolor="<?PHP echo $defaultbgcolor ?>" valign="middle" align="center" width="14%"><font face="<?PHP echo $fontfamily ?>" size="1"><b>Fri</b></font></td>
<td bgcolor="<?PHP echo $defaultbgcolor ?>" valign="middle" align="center" width="15%"><font face="<?PHP echo $fontfamily ?>" size="1"><b>Sat</b></font></td>
</tr>
<?PHP
if($dayone != 0)
$span1 = $dayone;
if(
6 - $daylast != 0)
$span2 = 6 - $daylast;

for(
$i = 1; $i <= $days; $i++):
$dayofweek = date("w",mktime(1,1,1,$month,$i,$year));
$width = "14%";

if(
$dayofweek == 0 || $dayofweek == 6)
$width = "15%";

if(
$i == $today):
$fontcolor = $todayfontcolor;
$bgcellcolor = $todaybgcolor;
endif;
if(
$i != $today):
$fontcolor = $defaultfontcolor;
$bgcellcolor = $defaultbgcolor;
endif;

# if($i == putdayhere): #use this for *special* days of the month, can be set ahead as well w/ &&...
# $fontcolor = puthexcolorhere;
# $bgcellcolor = puthexcolorhere;
# endif;

if($i == 1 || $dayofweek == 0):
echo
" <tr bgcolor="$defaultbgcolor">
"
;
if(
$span1 > 0 && $i == 1)
echo
" <td align="left" bgcolor="$defaultbgcolor" colspan="$span1"><font face="null" size="1"> </font></td>
"
;
endif;
/*Save this until supported
<td valign="middle" align="center" width="<?PHP echo $width ?>" style="background:<?PHP echo $bgcellcolor ?>;font-family:<?PHP echo $fontfamily ?>;color:<?PHP echo $fontcolor ?>;font-size:7pt"><?PHP echo $i ?></td>
*/
?>
<td bgcolor="<?PHP echo $bgcellcolor ?>" valign="middle" align="center" width="<?PHP echo $width ?>"><font color="<?PHP echo $fontcolor ?>" face="<?PHP echo $fontfamily ?>" size="1"><?PHP echo $i ?></font></td>
<?PHP
if($i == $days):
if(
$span2 > 0)
echo
" <td align="left" bgcolor="$defaultbgcolor" colspan="$span2"><font face="null" size="1"> </font></td>
"
;
endif;
if(
$dayofweek == 6 || $i == $days):
echo
" </tr>
"
;
endif;
endfor;
?>
</table>




Editar la apariencia con:
$fontfamily = isset($fontfamily) ? $fontfamily : "Tahoma, Geneva, sans-serif";
$defaultfontcolor = isset($defaultfontcolor) ? $defaultfontcolor : "#000000";
$defaultbgcolor = isset($defaultbgcolor) ? $defaultbgcolor : "#FFFFFF";
$todayfontcolor = isset($todayfontcolor) ? $todayfontcolor : "#FFFFFF";
$todaybgcolor = isset($todaybgcolor) ? $todaybgcolor : "#CC0000";
$monthcolor = isset($monthcolor) ? $monthcolor : "#333399";

$relfontsize = isset($relfontsize) ? $relfontsize : "1";
$cssfontsize = isset($cssfontsize) ? $cssfontsize : "8pt";




Traducir meses:
$monthnames = array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");





Traducir dias (estan abreviados):
<td bgcolor="<?PHP echo $defaultbgcolor ?>" valign="middle" align="center" width="15%"><font face="<?PHP echo $fontfamily ?>" size="1"><b>Sun</b></font></td>
<td bgcolor="<?PHP echo $defaultbgcolor ?>" valign="middle" align="center" width="14%"><font face="<?PHP echo $fontfamily ?>" size="1"><b>Mon</b></font></td>
<td bgcolor="<?PHP echo $defaultbgcolor ?>" valign="middle" align="center" width="14%"><font face="<?PHP echo $fontfamily ?>" size="1"><b>Tue</b></font></td>
<td bgcolor="<?PHP echo $defaultbgcolor ?>" valign="middle" align="center" width="14%"><font face="<?PHP echo $fontfamily ?>" size="1"><b>Wed</b></font></td>
<td bgcolor="<?PHP echo $defaultbgcolor ?>" valign="middle" align="center" width="14%"><font face="<?PHP echo $fontfamily ?>" size="1"><b>Thu</b></font></td>
<td bgcolor="<?PHP echo $defaultbgcolor ?>" valign="middle" align="center" width="14%"><font face="<?PHP echo $fontfamily ?>" size="1"><b>Fri</b></font></td>
<td bgcolor="<?PHP echo $defaultbgcolor ?>" valign="middle" align="center" width="15%"><font face="<?PHP echo $fontfamily ?>" size="1"><b>Sat</b></font></td>

27/Jul/2005 17:04 GMT+1
Haz clic para ir al tema anterior Haz clic para ir al tema siguiente
Portal · Foros · Zona Biblioteca · PHP
Temas similares
Asunto Autor#VisitasÚltima respuesta
Calendario07/Jun/2007, 16:16
Nigellus
0483No hay respuestas
Opciones:
Versión imprimible del tema
Subscríbete a este tema
Date de baja de este tema
Ir al subforo:  

TU NO PUEDES Escribir nuevos temas en este foro
TU NO PUEDES Responder a los temas en este foro
TU NO PUEDES Editar tus propios mensajes en este foro
TU NO PUEDES Borrar tus propios mensajes en este foro
Todas las fechas y horas son GMT+1. Ahora son las 21:35

Afiliados Plus
Skindario - Soporte Webmasters, Diseño Grafico, Miarroba, Rol + RPG y Mucho Mas TuarrobaGames - Emuladores, Roms, Juegos y RPG TuarrobaEbooks - Ebooks en castellano y Audiolibros Websmasters foro MundoDeluxe Photosherox - Diseñando & Aprendiendo
¿Tu Web Aquí?
Admin: EffectedCard - Skindario, foro soporte de Tuarroba desde el 16/10/04