<?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2005 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------*/
if (!defined("IN_FUSION")) { header("Location:../index.php"); exit; }

function showexp($exp_user,$exp_posts,$exp_type) {
		if (iMEMBER) { 
			$posts = $exp_posts;
			
			$comment = dbcount("(comment_id)", "comments", "comment_name='$exp_user'");
			$rating = dbcount("(rating_id)", "ratings", "rating_user='$exp_user'");
			$sum = ($posts+$comment+$rating);
	

	if ($sum <= "1") {$rang = "0";$level = "Naujokas";}
	if ($sum >= "1") {$rang = "5";$level = "Pradedantysis";}
	if ($sum >= "5") {$rang = "25";$level = "Ap?ylantis";}
	if ($sum >= "25") {$rang = "50";$level = "Savas";}
	if ($sum >= "50") {$rang = "100";$level = "Draugas";}
	if ($sum >= "100") {$rang = "250";$level = "Geradarys";}
	if ($sum >= "250") {$rang = "500";$level = "Puikusis";}
	if ($sum >= "500") {$rang = "1000";$level = "Dar tokio lygio nėra";}
	if ($sum >= "1000") {$rang = "2000";$level = "Dar tokio lygio nėra";}
	if ($sum >= "2000") {$rang = "4000";$level = "Dar tokio lygio nėra";}
	if ($sum >= "4000") {$rang = "10000";$level = "Dar tokio lygio nėra";}
	$poll_posts = $rang;
	$opt_posts = ($poll_posts ? number_format(100 / $poll_posts * $sum) : 0);
	
		if ($exp_type == "1") { 
echo"<br>Lygis: <b>$level</b>
<br>Praeita: $opt_posts%</b>
<br>

	<table width='90%' border='1' class='line'><tr><th width='90%'> 
	<img src='".IMAGES."line.gif' title='Procentine linija' height='8' width='$opt_posts%' align='left' >
	</td></tr></table>

<br>Prane?imų forume: <b>$posts</b>
<br>Reitingavimų: <b>$rating</b>
<br>Komentarų: <b>$comment</b>";

		}

	}
}

?>