Location: PHPKode > projects > WH Community > wh_community/profile.php
<?php require('layout/header.php'); ?>

<div id="content_wrapper">
    <div class="content"><?php

		if((isset($_GET['user_id'])) && (is_numeric($_GET['user_id']))) {
		
		$id = mysql_real_escape_string($_GET['user_id']);
		$id = intval($_GET['user_id']);

			}else{
			
			echo '<p align="center" class="false">' . $lang['invalid_id'] . '!</p>';
			exit();
			}
		
        $check = "SELECT
                      user_id
                      FROM
        			  users
        		  WHERE
        			  user_id = " . $id;
        
        $rescheck = mysql_query($check) OR die(mysql_error());
        $rowcheck = mysql_fetch_assoc($rescheck);

		if(!$rowcheck) {
		
		echo '<p class="false">' . $lang['id_not_exist'] . '!</p>';

		}else{
		
		echo '<table align="center" class="usertable">
		      <tr>
		      <td colspan="2"><h1>' . $lang['user_profile'] . '</h1>
              <img src="images/profile/card.png"></td>
		      <td rowspan="19" valign="top" width="200"><br>';
		
		$sql_a = "SELECT
						user_id,
						user_name,
						user_avatar
					FROM
						users
					WHERE
						user_id = " . $id;
			
			$result_a = mysql_query($sql_a) OR die(mysql_error());
			$row_a = mysql_fetch_assoc($result_a);
		
		if($row_a['user_avatar']=='') {
		
		echo '<br>';
		
    		}else{
    		
    		echo '<p align="right"><img src="images/avatars/' . htmlentities($row_a['user_avatar'], ENT_QUOTES) . '" border="1" style="border-color: #CCCCCC; border-width: 1px; border-style: solid;"></p><br>';
    		}
		
		echo '<p align="right"><a href="read_gb.php?user_id=' . $id . '" class="css_button">' . htmlentities($row_a['user_name'], ENT_QUOTES) . '&acute;s ' . $lang['guestbook'] . '</a></p>';
		
		include_once('functions/messagebox.php');
		
		$tweet_sql = mysql_query("SELECT * FROM messagebox WHERE msg_id2 = '" . $id . "' ORDER BY msg_id DESC LIMIT 2") OR die(mysql_error());
		$timeline='';
		
		if(intval(mysql_num_rows($tweet_sql)) == 0) {
				
		echo '';
		
    		}else{
    		
    		while($row=mysql_fetch_assoc($tweet_sql)) {
    		
    			$timeline.=formatTweet($row['message'],$row['date']);
    			}
		
		echo '<div id="profil-container">
		      <p align="right"><span class="blue">Message Timeline &#8226;</span></p>
		      <ul class="statuses">' . $timeline . '</ul>
		      </div>';
		
		echo '<p align="right">[ <a href="read_msg.php?user_id=' . $id . '">' . $lang['more'] . '</a> ]</p>';
		}
		
		echo '</td></tr>';
			
			$sql = "SELECT
						user_name,
						user_level,
						user_email,
						user_showmail,
						user_date,
						user_status,
						user_visits,
						user_sex,
						user_bday,
						user_homepage,
						user_icq,
						user_live,
						user_skype,
						user_facebook,
						user_twitter,
						user_about
					FROM
						users
					WHERE
						user_id = " . $id;
			
			$result = mysql_query($sql) OR die(mysql_error());
			$row = mysql_fetch_assoc($result);
		
		if(!$row) {
		
		echo '<tr><td><p class="false">' . $lang['no_selected_user'] . '.</p>
		      <p>' . $lang['choose_user_list'] . ' <a href="userlist.php">' . $lang['user_list'] . '</a></p><br></td></tr>';
		
    		  }else{
    		  
    		  include_once('functions/bbcode.php');
    		  include_once('functions/badwords.php');
		
		echo '<tr>
		      <td width="180" height="25"><span class="blue">User Name</span></td>
		      <td>' . htmlentities($row['user_name'], ENT_QUOTES) . ' '; if($row['user_sex']=='male') {
			      echo '&#9794;';
		      }elseif ($row['user_sex']=='female') {
			      echo '&#9792;'; }
		echo '</td>
		      </tr>
		      <tr>
		      <td width="180" height="25"><span class="blue">' . $lang['last_signin'] . '</span></td>
		      <td>'; if($row['user_status'] > 0) {
			
			  if($language == "de") {
                  echo date('d.m.Y', strtotime($row['user_status']));

              }elseif($language == "en") {
                  echo date('Y-m-d', strtotime($row['user_status'])); }
		
		      }else{
		      
		echo '<span class="admin">' . $lang['no_signins'] . '</span>'; }
		
        echo '</td>
		      </tr>
		      <tr>
		      <td width="180" height="25"><span class="blue">' . $lang['number_of_signins'] . '</span></td>
		      <td>'; if($row['user_visits'] > 0) {
			      echo '' . htmlentities($row['user_visits'], ENT_QUOTES) . '';
		      }else{
			      echo '<span class="admin">' . $lang['no_signins'] . '</span>'; }
		
        echo '</td>
		      </tr>
		      <tr>
		      <td width="180" height="25"><span class="blue">' . $lang['sex'] . '</span></td>
		      <td>'; if($row['user_sex']=='male') {
			      echo '' . $lang['male'] . '';
		      }elseif ($row['user_sex']=='female') {
			      echo '' . $lang['female'] . ''; }
	   	
        echo '</td>
		      </tr>
		      <tr>
		      <td width="180" height="25"><span class="blue">' . $lang['birthday'] . '</span></td>
		      <td>'; if($row['user_bday'] > 0) {
			
              if($language == "de") {
                  echo date('d.m.Y', strtotime($row['user_bday']));
            
              }elseif($language == "en") {
                  echo date('Y-m-d', strtotime($row['user_bday'])); }
			
		      }else{
		echo ''; }
		echo '</td>
		      </tr>
		      <tr>
		      <td width="180" height="25"><span class="blue">User Level</span></td>
		      <td>'; if($row['user_level']==0) {
			      echo '<span class="user">User</span>';
		      }elseif ($row['user_level']==2) {
			     echo '<span class="mod">Moderator</span>';
		      }elseif ($row['user_level']==1) {
			      echo '<span class="admin">Administrator</span>'; }
		
        echo '</td>
		      </tr>
		      <tr>
		      <td width="180" height="25"><span class="blue">' . $lang['email_adress'] . '</span></td>';
		      if($row['user_showmail']==1)
		echo '<td><a href="mailto:' . htmlentities($row['user_email'], ENT_QUOTES) . '">' . htmlentities($row['user_email'], ENT_QUOTES) . '</a></td>';
		echo '</tr>
		      <tr>
		      <td width="180" height="25"><span class="blue">' . $lang['register_date'] . '</span></td>
		      <td>';
        
              if($language == "de") {
                  echo date('d.m.Y', strtotime($row['user_date']));
    
              }elseif($language == "en") {
                  echo date('Y-m-d', strtotime($row['user_date'])); }
        
        echo '</td>
		      </tr>
		      <tr>
		      <td width="180" height="25"><span class="blue">' . $lang['homepage'] . '</span></td>
		      <td><a href="' . htmlentities($row['user_homepage'], ENT_QUOTES) . '" target="_blank">' . htmlentities($row['user_homepage'], ENT_QUOTES) . '</a></td>
		      </tr>
		      <tr>
		      <td width="180" height="25"><span class="blue">ICQ</span></td>
		      <td>' . htmlentities($row['user_icq'], ENT_QUOTES) . '</td>
		      </tr>
		      <tr>
		      <td width="180" height="25"><span class="blue">Live-ID</span></td>
		      <td>' . htmlentities($row['user_live'], ENT_QUOTES) . '</td>
		      </tr>
		      <tr>
		      <td width="180" height="25"><span class="blue">Skype</span></td>
		      <td>' . htmlentities($row['user_skype'], ENT_QUOTES) . '</td>
		      </tr>
		      <tr>
		      <td width="180" height="25"><span class="blue">Facebook</span></td>
		      <td><a href="' . htmlentities($row['user_facebook'], ENT_QUOTES) . '" target="_blank">' . htmlentities($row['user_facebook'], ENT_QUOTES) . '</a></td>
		      </tr>
		      <tr>
		      <td width="180" height="25"><span class="blue">Twitter</span></td>
		      <td><a href="' . htmlentities($row['user_twitter'], ENT_QUOTES) . '" target="_blank">' . htmlentities($row['user_twitter'], ENT_QUOTES) . '</a></td>
		      </tr>
		      <tr>
		      <td width="180" valign="top"><span class="blue">' . $lang['about_me'] . '</span></td>
		      <td valign="top">' . parseBBCode2HTML(delBad(nl2br(stripslashes(strip_tags($row['user_about']))))) . '<br><br></td>
		      </tr>';
		      }
		}
		
		echo '</table></table>';
		
		echo '<div class="spacer_div">&nbsp;</div>';

		?>
    </div>
</div>

<div id="infobox_wrapper">
    <div class="infobox">
        <?php include('layout/infobox.php'); ?>
    </div>
</div>

<?php require('layout/footer.php'); ?>
Return current item: WH Community