Создайте любойфайл.php инклудите любому место. Под мотор 18
<?php
$daytime=date("d",$sitetime);
$montime=date("d.m",$sitetime);
$yeartime=date("d.m.Y",$sitetime);
$filtime=filemtime("local/datatmp/happyday.dat");
$filtimeday=date("d",$filtime);
if($daytime!=$filtimeday){
$dir = opendir ("local/profil");
while ($file = readdir ($dir)) {
if (ereg ("\.prof$", $file)) {
$allusers[]=$file;
}}
closedir ($dir);
clear_files("local/datatmp/happyday.dat");
foreach($allusers as $value){
$tex = file("local/profil/$value");
$data = explode(":||:",$tex[0]);
$data_uzer=substr($data[18],0,5);
if($montime==$data_uzer){
$dat_happy.=$data[0].'|';
}}
$fp = fopen("local/datatmp/happyday.dat","a+");
flock ($fp,LOCK_EX);
fputs($fp,$dat_happy);
fflush ($fp);
flock ($fp,LOCK_UN);
fclose($fp);
chmod ($fp, 0666);
chmod ("local/datatmp/happyday.dat", 0666);
}
echo'Ден рождение: ';
$happyuser = file_get_contents("local/datatmp/happyday.dat");
$arr_happy= explode("|",$happyuser);
$counthappy=count($arr_happy)-1;
if($counthappy>0){
echo'<font color="#FF0000">'.(int)$counthappy.'</font> чел.<br/>';
}else{
echo'<font color="#FF0000">нето!</font><br/>';
}
foreach($arr_happy as $key=>$value){
if($value!=""){
if($key==0){
echo '<a href="pages/anketa.php?uz='.check($value).'&'.SID.'"><blink>'.nickname(check($value)).'</blink></a>';
}else{
echo ', <a href="pages/anketa.php?uz='.check($value).'&'.SID.'"><blink>'.nickname(check($value)).'</blink></a>';
}}}
?>
Изменил: Мансур (05.07.2010 / 23:26)