Location: PHPKode > scripts > WH Board > wh_board/framework/rank.php
<?php

    $id = $_SESSION['user_id'];

    $sql = "SELECT
    			posts.post_id,
    			posts.post_by,
    			users.user_id,
    			users.user_name
    		FROM
    			posts
    		LEFT JOIN
    			users
    		ON
    			posts.post_by = users.user_id
    		WHERE
    			post_by = " . $id;

    $result = mysql_query($sql) OR die(mysql_error());
    $total = intval(mysql_num_rows($result));

    if($posts > $total) {

        $rank = "User";

            }else{

            $rank = "Super User";
            }

    $query = "SELECT
    			user_id,
    			user_level
    		FROM
    			users
    		WHERE
    		    user_id = " . $id;

    $getrank = mysql_query($query) OR die(mysql_error());

    while($man_row = mysql_fetch_assoc($getrank)) {

    	if($man_row['user_level'] == 0) {
    		$level = "User";

        }elseif($man_row['user_level'] == 2) {
    		$level = "Moderator";

        }elseif($man_row['user_level'] == 1) {
            $level = "Administrator";
            }

    }}

?>
Return current item: WH Board