вопрос
Здравствуйте, подскажите как будет правильно выглядеть код,
нужно чтобы:
если $rating_progr > 100 // если рейтинг больше 100
Тогда $rating_progr = $user_rating - 100"; //тогда
нужно чтобы:
если $rating_progr > 100 // если рейтинг больше 100
Тогда $rating_progr = $user_rating - 100"; //тогда
$user_rating = $row['repa'] + $row['news_num'] + $row['comm_num'];
if( $row['foto'] ) {
$user_rating = $user_rating + 35;}
if( $row['fullname'] ) {
$user_rating = $user_rating + 15;}
if( $row['icq'] ) {
$user_rating = $user_rating + 20;}
if( $row['name'] ) {
$user_rating = $user_rating + 20;}
if( $row['land'] ) {
$user_rating = $user_rating + 20;}
if( $row['info'] ) {
$user_rating = $user_rating + 20;}
$numr = 50;
{if ($user_rating > $numr)
{$rating_progr = $user_rating - $numr;
$numr = $numr + 100;}}
if ($rating_progr < 100) {
echo "$rating_progr = $user_rating - 100";
}
if ($user_rating < 101)
{$rate_color = "/engine/modules/reputation/repbg1.png";}
if ($user_rating >= 101 && $user_rating < 200)
{$rate_color = "/engine/modules/reputation/repbg2.png";}
if ($user_rating >= 200 && $user_rating < 300)
{$rate_color = "/engine/modules/reputation/repbg3.png";}
if ($user_rating >= 300 && $user_rating < 400)
{$rate_color = "/engine/modules/reputation/repbg4.png";}
if ($user_rating >= 400 && $user_rating < 500)
{$rate_color = "/engine/modules/reputation/repbg5.png";}
if ($user_rating >= 500 && $user_rating < 600)
{$rate_color = "/engine/modules/reputation/repbg6.png";}
if ($user_rating >= 600)
{$rate_color = "/engine/modules/reputation/repbg1.png";}
$rating_bar = "<div style=\"text-align:center;height:15px;width:170px;background: url('/engine/modules/reputation/repbg1.png') repeat-x;padding:0px;overflow:hidden;border:solid 1px #dcdcdc;\"><div style=\"text-align:center;float:left;height:15px;width:$rating_progr%;max-width:170px;background:url('$rate_color') repeat-x;\"><div style=\"color: #000;width: 170px;text-align: center;padding-top: 0px;z-index: 2; line-height: 16px;\">$user_rating%</div></div></div>";
$tpl->set( '{2vis_bar}', $rating_bar );