metulj
Super moderator Principal · 1,726 posts
18 years ago
#8
function getstarsign($date){
list($year,$month,$day)=explode("-",$date);
i put that in core and
this in the profiles it shows the wrong sign for the user
$star = mysql_fetch_array(mysql_query("SELECT birthday FROM ibwf_users WHERE id='".$who."'"));
echo "Star Sign: ".getstarsign($star[0]);
this works 100%
function getstarsign($date){
list($year,$month,$day)=explode("-",$date);
if(($month=="01" && $day>20)||($month=="02" && $day<19)){
return "<img src=\"images/Aquarius.gif\" alt=\"Aquarius\"/>";
}else if(($month=="02" && $day>18)||($month=="03" && $day<21)){
return "<img src=\"images/Pisces.gif\" alt=\"Pisces\"/>";
}else if(($month=="03" && $day>20)||($month=="04" && $day<20)){
return "<img src=\"images/Aries.gif\" alt=\"Aries\"/>";
}else if(($month=="04" && $day>19)||($month=="05" && $day<21)){
return "<img src=\"images/Taurus.gif\" alt=\"Taurus\"/>";
}else if(($month=="05" && $day>20)||($month=="06" && $day<22)){
return "<img src=\"images/Gemini.gif\" alt=\"Gemini\"/>";
}else if(($month=="06" && $day>21)||($month=="07" && $day<23)){
return "<img src=\"images/Cancer.gif\" alt=\"Cancer\"/>";
}else if(($month=="07" && $day>22)||($month=="08" && $day<23)){
return "<img src=\"images/Leo.gif\" alt=\"Leo\"/>";
}else if(($month=="08" && $day>22)||($month=="09" && $day<23)){
return "<img src=\"images/Virgo.gif\" alt=\"Virgo\"/>";
}else if(($month=="09" && $day>22)||($month=="10" && $day<24)){
return "<img src=\"images/Libra.gif\" alt=\"Libra\"/>";
}else if(($month=="10" && $day>23)||($month=="11" && $day<23)){
return "<img src=\"images/Scorpio.gif\" alt=\"Scorpio\"/>";
}else if(($month=="11" && $day>22)||($month=="12" && $day<22)){
return "<img src=\"images/Sagittarius.gif\" alt=\"Sagittarius\"/>";
}else if(($month=="12" && $day>21)||($month=="01" && $day<21)){
return "<img src=\"images/Capricorn.gif\" alt=\"Capricorn\"/>";
}else {
return "<img src=\"images/nodate.gif\" alt=\"?\"/>";
}
}
usage
$brt = mysql_fetch_array(mysql_query("SELECT birthday FROM ibwf_users WHERE id='".$who."'"));
echo "<img src=\"images/right.gif\" alt=\"*\"/>Zodiac: ".getstarsign($brt[0]);
echo "
";
p.s. find your own images...
else just replace
<img src=\"images/Capricorn.gif\" alt=\"Capricorn\"/>
to Capricorn... etc
It's better to keep your mouth shut and give the impression that you're stupid, than to open it and remove all doubt.
ⓣⓗⓔ ⓠⓤⓘⓔⓣⓔⓡ ⓨⓞⓤ ⓑⓔ©ⓞⓜⓔ, ⓣⓗⓔ ⓜⓞⓡⓔ ⓨⓞⓤ ⓐⓡⓔ ⓐⓑⓛⓔ ⓣⓞ ⓗⓔⓐⓡ !
ιη тнєσяу, тнє ρяα¢тι¢є ιѕ α яєѕυℓт σƒ тнє тнєσяу, вυт ιη ρяα¢тι¢є ιѕ тнє σρρσѕιтє.
キノgんイノ刀g 4 ア乇ムc乇 ノ丂 レノズ乇 キucズノ刀g 4 √ノ尺gノ刀ノイリ!