<?php
if (!defined("IN_FUSION")) { header("Location:../index.php"); exit; }
function showexp($exp_user,$exp_posts,$exp_type) {
global $settings;
include INFUSIONS."user_info_panel/locale/".$settings['locale'].".php";
if (iMEMBER) {
$result = dbquery("SELECT user_name FROM ".DB_USERS." WHERE user_id='$exp_user'");
if (dbrows($result)) {
$data = dbarray($result); }
$posts = $exp_posts;
$comment = dbcount("(comment_id)", DB_COMMENTS, "comment_name='$exp_user'");
$rating = dbcount("(rating_id)", DB_RATINGS, "rating_user='$exp_user'");
$news = dbcount("(news_id)", DB_NEWS, "news_name='$exp_user'");
$sum = ($posts+$comment+$shoutbox+$rating+$news);
if ($sum <= "1") {$rang = "0"; $level = $locale['rank1'];}
if ($sum >= "1") {$rang = "5"; $level = $locale['rank2']; }
if ($sum >= "5") {$rang = "25"; $level = $locale['rank3']; }
if ($sum >= "25") {$rang = "50"; $level = $locale['rank4']; }
if ($sum >= "50") {$rang = "100"; $level = $locale['rank5']; }
if ($sum >= "100") {$rang = "250"; $level = $locale['rank6']; }
if ($sum >= "250") {$rang = "500"; $level = $locale['rank7']; }
if ($sum >= "500") {$rang = "1000"; $level = $locale['rank8']; }
if ($sum >= "1000") {$rang = "2000"; $level = $locale['rank9']; }
if ($sum >= "2000") {$rang = "4000"; $level = $locale['rank10']; }
if ($sum >= "4000") {$rang = "10000"; $level = $locale['rank11']; }
$poll_posts = $rang;
$opt_posts = ($poll_posts ? number_format(100 / $poll_posts * $sum) : 0);
if ($exp_type == "1") {
echo "<br>".$locale['ui06'].": <b>$level</b>";
echo "<br>".$locale['ui07']." <b>$sum/$rang [$opt_posts%]</b><br>";
echo "<table width='100%' border='0' class='line'><tr><th width='100%'>";
echo "<img src='".INFUSIONS."user_info_panel/images/line.gif' height='8' width='$opt_posts%' align='left'>";
echo "</td></tr></table>";
echo "<br>".$locale['ui08'].": <b>$posts</b>";
echo "<br>".$locale['ui09'].": <b>$shoutbox</b>";
echo "<br>".$locale['ui10'].": <b>$comment</b>";
echo "<br>".$locale['ui11'].": <b>$rating</b>";
}
}
}
?>