Mam problem z panelem urodziny wykrywa kto
ma urodziny w miesiacu ale jak juz przyjdzie dzien w ktorym dany user ma urodziny nie pokazuje tego albo czasem o dziwo pokazuje wszystkich którzy maja w miesiacu nie wiem co z tym fantem robic i dlatego prosze was o pomoc oto kod:
bday_panel.php
<?php
if (file_exists(INFUSIONS."bday_panel/locale/".$settings['locale'].".php")) {
include INFUSIONS."bday_panel/locale/".$settings['locale'].".php";
} else {
include INFUSIONS."bday_panel/locale/English.php";
}
$thisdate = "____-".date("m")."-__";
if (date("m") == "01") { $mnd = "".$locale['bp_001'].""; }
elseif (date("m") == "02") { $mnd = "".$locale['bp_002'].""; }
elseif (date("m") == "03") { $mnd = "".$locale['bp_003'].""; }
elseif (date("m") == "04") { $mnd = "".$locale['bp_004'].""; }
elseif (date("m") == "05") { $mnd = "".$locale['bp_005'].""; }
elseif (date("m") == "06") { $mnd = "".$locale['bp_006'].""; }
elseif (date("m") == "07") { $mnd = "".$locale['bp_007'].""; }
elseif (date("m") == "08") { $mnd = "".$locale['bp_008'].""; }
elseif (date("m") == "09") { $mnd = "".$locale['bp_009'].""; }
elseif (date("m") == "10") { $mnd = "".$locale['bp_010'].""; }
elseif (date("m") == "11") { $mnd = "".$locale['bp_011'].""; }
elseif (date("m") == "12") { $mnd = "".$locale['bp_012'].""; }
$result = dbquery("SELECT * FROM ".DB_USERS." WHERE user_birthdate like '$thisdate' ORDER BY user_birthdate DESC");
if (date("m") == "01") { $img = "<img src='".INFUSIONS."bday_panel/images/01.gif' width='43' height='45' border='0' alt='' />"; }
elseif (date("m") == "02") { $img = "<img src='".INFUSIONS."bday_panel/images/02.gif' width='43' height='45' border='0' alt='' />"; }
elseif (date("m") == "03") { $img = "<img src='".INFUSIONS."bday_panel/images/03.gif' width='43' height='45' border='0' alt='' />"; }
elseif (date("m") == "04") { $img = "<img src='".INFUSIONS."bday_panel/images/04.gif' width='43' height='45' border='0' alt='' />"; }
elseif (date("m") == "05") { $img = "<img src='".INFUSIONS."bday_panel/images/05.gif' width='43' height='45' border='0' alt='' />"; }
elseif (date("m") == "06") { $img = "<img src='".INFUSIONS."bday_panel/images/06.gif' width='43' height='45' border='0' alt='' />"; }
elseif (date("m") == "07") { $img = "<img src='".INFUSIONS."bday_panel/images/07.gif' width='43' height='45' border='0' alt='' />"; }
elseif (date("m") == "08") { $img = "<img src='".INFUSIONS."bday_panel/images/08.gif' width='43' height='45' border='0' alt='' />"; }
elseif (date("m") == "09") { $img = "<img src='".INFUSIONS."bday_panel/images/09.gif' width='43' height='45' border='0' alt='' />"; }
elseif (date("m") == "10") { $img = "<img src='".INFUSIONS."bday_panel/images/10.gif' width='43' height='45' border='0' alt='' />"; }
elseif (date("m") == "11") { $img = "<img src='".INFUSIONS."bday_panel/images/11.gif' width='120' height='60' border='0' alt='' />"; }
elseif (date("m") == "12") { $img = "<img src='".INFUSIONS."bday_panel/images/12.gif' width='43' height='45' border='0' alt='' />"; }
openside("".$locale['bp_100']." {$mnd}", "on");
echo "<div align='center'>$img</div><br />\n";
if (dbrows($result) == 0) {
echo "".$locale['bp_101']." {$mnd}";
}
echo "<div align='center'>".$locale['bp_016']."</div><br />\n";
while ($db = dbarray($result)) {
//My New Code
$newdate = explode ("-", $db['user_birthdate']);
$date = $newdate;
$now = date("Y-m-d");
$yr = date("Y");
$age = substr($now, 0, 4) - substr($db['user_birthdate'], 0, 4);
if ($date[2] == date("d")) {
$present = "<img src='".INFUSIONS."bday_panel/images/birthday.gif' width='50' height='50' alt='' border='0' />\n";
} else {
$present = "";
}
//End new code
$thistime = time() - mktime(0,0,0,$date['1'],$date['2'],$date['0']);
echo "".$date[1]."/".$date[2]."".$locale['bp_017']."<a href='".BASEDIR."profile.php?lookup=".$db['user_id']."' title='".$db['user_name']."'>".$db['user_name']."</a><br />";
}
$result = dbquery("SELECT * FROM ".DB_USERS." WHERE user_birthdate like '$thisdate' ORDER BY user_birthdate DESC");
if ($present != "") {
echo "<br /><div align='center'>".$locale['bp_018']."</div><br />\n";
} else {
echo "<br />";
}
while ($db = dbarray($result)) {
//My New Code
$newdate = explode ("-", $db['user_birthdate']);
$date = $newdate;
$now = date("Y-m-d");
$yr = date("Y");
$age = substr($now, 0, 4) - substr($db['user_birthdate'], 0, 4);
$thistime = time() - mktime(0,0,0,$date['1'],$date['2'],$date['0']);
//End new code
if ($present != "") {
if($db['user_avatar'] == "noimage.gif") {
$avatar = "<img src='".IMAGES."noimage.gif' border='0' width='50' height='50' alt='' />\n";
} else {
$avatar = "<img src='".IMAGES."avatars/".$db['user_avatar']."' alt='".$db['user_name']."' border='0' width='50' height='50' />\n";
echo "<table width='100%' border='0'><tr>";
echo "<td>$avatar</td><td valign='middle' align='right'>".$present."</td></tr>\n";
echo "<tr><td colspan='2'>".$locale['bp_013']."<a href='".BASEDIR."profile.php?lookup=".$db['user_id']."' title='".$db['user_name']."'>".$db['user_name']."</a></td></tr>\n";
echo "<tr><td colspan='2'>".$locale['bp_019']."<a href='".BASEDIR."messages.php?msg_send=".$db['user_id']."' title='".$db['user_name']."'>".$db['user_name']."</a></td></tr>\n";
echo "<tr><td colspan='2'>".$locale['bp_014']."<b>".$age."</b>".$locale['bp_015']."</td></tr>\n";
echo "<tr><td colspan='2'><br /></td>\n";
echo "</tr></table>\n";
}
}
}
closeside();
?>
Oraz plik English.php
<?php
// Bday Panel v2.02
$locale['bp_100'] = "Urodziny";
$locale['bp_101'] = "Nikt nie obchodzi urodzin";
// Monhts
$locale['bp_001'] = "Styczen";
$locale['bp_002'] = "Luty";
$locale['bp_003'] = "Marzec";
$locale['bp_004'] = "Kwiecien";
$locale['bp_005'] = "Maj";
$locale['bp_006'] = "Czerwiec";
$locale['bp_007'] = "Lipiec";
$locale['bp_008'] = "Sierpien";
$locale['bp_009'] = "Wrzesien";
$locale['bp_010'] = "Pazdziernik";
$locale['bp_011'] = "Listopad";
$locale['bp_012'] = "Grudzien";
$locale['bp_013'] = "Dzi¶ ";
$locale['bp_014'] = " Obchodzi ";
$locale['bp_015'] = " urodziny. ";
$locale['bp_016'] = "<b>Urodziny biez±cy miesi±c</b>";
$locale['bp_017'] = " - ";
$locale['bp_018'] = "<b>Dzi¶ urodziny</b>";
$locale['bp_019'] = "<b>Wy¶lij zyczenia:</b><br>";
?>
Wiadomość doklejona:
Prosiłbym o szybką pomoc z tym powyzej
Edytowane przez Mateusz16611 dnia 11.11.2009 13:10:21
|