Обучение/Помощь новичкам | мужской и женский аватар
DELETED
Автор
27 ноября 2017, в 17:42
Delete
Нужно что бы у каждого пола был свой аватар у мужчин называется male.png, у женщин female.png
Вот код
echo "<td>";
if(!empty($profile['avatar'])){
echo "<center><img src='/images/avatars/$profile[avatar]' style='max-width:180px; max-height:200px;'></center>";
}else{
echo "<center><img src='/images/avatars/noavatar.png' style='max-width:180px; max-height:200px;'></center>";
}
echo "</td>";
echo "<td style='vertical-align:top;'>";
________
посл. ред. 27.11.2017 в 17:43; всего 1 раз(а); by TATARIN
if($pol = 0){
echo "<center><img src='/images/avatars/$profile[avatar]' style='max-width:180px; max-height:200px;'></center>";
}else{
echo "<center><img src='/images/avatars/noavatar.png' style='max-width:180px; max-height:200px;'></center>";
}else
if($pol= 1){
echo "<center><img src='/images/avatars/$profile[avatar]' style='max-width:180px; max-height:200px;'></center>";
}else{
echo "<center><img src='/images/avatars/noavatar.png' style='max-width:180px; max-height:200px;'></center>";
}
echo "<center><img src='/images/avatars/$profile[avatar]' style='max-width:180px; max-height:200px;'></center>";
}else{
echo "<center><img src='/images/avatars/noavatar.png' style='max-width:180px; max-height:200px;'></center>";
}else
if($pol= 1){
echo "<center><img src='/images/avatars/$profile[avatar]' style='max-width:180px; max-height:200px;'></center>";
}else{
echo "<center><img src='/images/avatars/noavatar.png' style='max-width:180px; max-height:200px;'></center>";
}
TATARIN ,
echo "<td>";
if(!empty($profile['avatar'] == m)){
echo "<center><img src='/images/avatars/male.png' style='max-width:180px; max-height:200px;'></center>";
}else{
echo "<center><img src='/images/avatars/female.png' style='max-width:180px; max-height:200px;'></center>";
}
echo "</td>";
echo "<td style='vertical-align:top;'>";
echo "<td>";
if(!empty($profile['avatar'] == m)){
echo "<center><img src='/images/avatars/male.png' style='max-width:180px; max-height:200px;'></center>";
}else{
echo "<center><img src='/images/avatars/female.png' style='max-width:180px; max-height:200px;'></center>";
}
echo "</td>";
echo "<td style='vertical-align:top;'>";
Jack Daniels , А чему $pol равен?
TATARIN , переиминуй аватары в m.png и w.png и сделай так:
Самый не муторный вариант
________
посл. ред. 27.11.2017 в 18:17; всего 1 раз(а); by MySqli
<?php
echo "<td>";
if(!empty($profile['avatar'])){
echo "<center><img src='/images/avatars/$profile[avatar]' style='max-width:180px; max-height:200px;'></center>";
}else{
echo "<center><img src='/images/avatars/$profile[sex].png' style='max-width:180px; max-height:200px;'></center>";
}
echo "</td>";
echo "<td style='vertical-align:top;'>";
?> Самый не муторный вариант
________
посл. ред. 27.11.2017 в 18:17; всего 1 раз(а); by MySqli