Kann mir jemand helfen habe diese Geburtstags Box drauf Instaliert aber möchte nun das nur der nächste Geburtstag angezeigt wird nicht die nächsten drei sonder nur einer.:'(
<?php
//Copyright by Hannes Wunderli
//www.fast-death.com
defined ('main') or die ( 'no direct access' );
$timestamp = time();
$d = date("d",$timestamp);
$m = date("m",$timestamp);
$y = date("Y",$timestamp);
$difold1 = 400;
$difold2 = 400;
$difold3 = 400;
$abf = "SELECT * FROM prefix_userfields WHERE fid = 8";
$erg = db_query($abf);
while ($row = db_fetch_object($erg))
{
$datum = $row->val;
$exploded = explode(".", $datum);
if ($exploded["0"] < 10 )
$exploded["0"]=str_replace("0","", $exploded["0"]);
if ($exploded["1"] < 10 )
$exploded["1"]=str_replace("0","", $exploded["1"]);
$difm = $exploded["1"] - $m;
if ($difm < 0){$difm = $difm + 12;}
$difd = $exploded["0"] - $d;
if ($difd < 0)
{
if ($difm == 0)
{
$difm = 12;
}
$difm = $difm - 1;
$difd = $difd + 31;
}
$difd = $difd + ($difm * 30);
if($difd < $difold1)
{
$guser3 = $guser2;
$guser2 = $guser1;
$guser1 = $row->uid;
$gdated3 = $gdated2;
$gdated2 = $gdated1;
$gdated1 = $exploded["0"];
$gdatem3 = $gdatem2;
$gdatem2 = $gdatem1;
$gdatem1 = $exploded["1"];
$difold3 = $difold2;
$difold2 = $difold1;
$difold1 = $difd;
}
elseif($difd < $difold2)
{
$guser3 = $guser2;
$guser2 = $row->uid;
$gdated3 = $gdated2;
$gdated2 = $exploded["0"];
$gdatem3 = $gdatem2;
$gdatem2 = $exploded["1"];
$difold3 = $difold2;
$difold2 = $difd;
}
elseif($difd < $difold3)
{
$guser3 = $row->uid;
$gdated3 = $exploded["0"];
$gdatem3 = $exploded["1"];
$difold3 = $difd;
}
}
mysql_free_result($erg);
if ($m>$gdatem1){$byear1 = $y +1;}else{$byear1 = $y;}
if ($m>$gdatem2){$byear2 = $y +1;}else{$byear2 = $y;}
if ($m>$gdatem3){$byear3 = $y +1;}else{$byear3 = $y;}
$testfile = 'include/images/avatars/6_';
$testfile .= $guser1;
$testfile .= '.jpeg';
$abf2 = "SELECT * FROM prefix_user WHERE id = '$guser1'";
$erg2 = db_query($abf2);
while ($row2 = db_fetch_object($erg2))
{
$user1 = $row2->name;
}
mysql_free_result($erg2);
$abf3 = "SELECT * FROM prefix_user WHERE id = '$guser2'";
$erg3 = db_query($abf3);
while ($row3 = db_fetch_object($erg3))
{
$user2 = $row3->name;
}
mysql_free_result($erg3);
$abf4 = "SELECT * FROM prefix_user WHERE id = '$guser3'";
$erg4 = db_query($abf4);
while ($row4 = db_fetch_object($erg4))
{
$user3 = $row4->name;
}
mysql_free_result($erg4);
echo'<table width="100%" cellspacing="0" cellpadding="0" height="13">';
if($difold1 == 0)
{
echo'
<tr><td><p align="center">Heute hat</p><p align="center"><a class="box" href="?m=user&um=6&uid='.$guser1.'">'.$user1.'</a></p><p align="center">Geburtstag</p><p align="center"><img border="0" src="include/images/birthday.gif"></p></td></tr>';
}
else
{
echo'
<tr><td><p align="center">Am '.$gdated1.'.'.$gdatem1.'.'.$byear1.' hat</p><p align="center"><a class="box" href="?m=user&um=6&uid='.$guser1.'">'.$user1.'</a></p><p align="center">Geburtstag</p>';
if (file_exists($testfile))
{
echo '<p align="center"><img border="0" src="include/images/avatars/6_'.$guser1.'.jpeg"></p>';
}
}
echo'<hr></hr>';
if($difold2 == 0)
{
echo'
<p align="center">Heute hat</p><p align="center"><a class="box" href="?m=user&um=6&uid='.$guser2.'">'.$user2.'</a></p><p align="center">Geburtstag</p>';
}
else
{
echo'
<p align="center">Am '.$gdated2.'.'.$gdatem2.'.'.$byear2.' hat</p><p align="center"><a class="box" href="?m=user&um=6&uid='.$guser2.'">'.$user2.'</a></p><p align="center">Geburtstag</p>';
}
echo'<hr></hr>';
if($difold3 == 0)
{
echo'
<p align="center">Heute hat</p><p align="center"><a class="box" href="?m=user&um=6&uid='.$guser3.'">'.$user3.'</a></p><p align="center">Geburtstag</p>';
}
else
{
echo'
<p align="center">Am '.$gdated3.'.'.$gdatem3.'.'.$byear3.' hat</p><p align="center"><a class="box" href="?m=user&um=6&uid='.$guser3.'">'.$user3.'</a></p><p align="center">Geburtstag</p>';
}
echo'<hr></hr>';
echo'</tr></td></table>';
?>
währe gut wenn es mir einer gut erklären kann den habe null Plan von php, ist schon ein Wunder das ich ne HP instalieren konnte die nun auch einigermaßen gut aussieht!
hier mal zun gucken:
tripplexcrew.tr.funpic.de/index.php
Danke schon im vorraus!
Ich bin nicht dumm ich weiß nur nicht viel über php, html und webdesign!