<?php


include('global.php');
include('INC/class.session.php');
include('INC/class.articles.php');
$email = $myrow['mail'];

mysql_query("UPDATE users SET ip_last = '".$remote_ip."' WHERE username = '".$myrow['username']."'"); 

if($_GET['do'] == "RemoveFeedItem" && is_numeric($_GET['key'])){ // ex. me.php?do=RemoveFeedItem&key=5
    mysql_query("DELETE FROM cms_alerts WHERE userid = '".$my_id."' AND id = '".$_GET['key']."' ORDER BY id ASC LIMIT 1") or die(mysql_error());
}

$pagename = $name;
$pageid = "1";

// Header for minimail
$messages = mysql_query("SELECT COUNT(*) FROM cms_minimail WHERE to_id = '".$my_id."'") or $messages = 0;
header("X-JSON: {\"totalMessages\":".$messages."}");

include('templates/community_subheader.php');
include('templates/community_header.php');

// Query tags
$fetch_tags = mysql_query("SELECT tag,id FROM user_tags WHERE user_id = '".$my_id."' LIMIT 20") or die(mysql_error());
$tags_num = mysql_num_rows($fetch_tags);

	
	// Create the random tag questions array
	$randomq[] = "Quelle est votre &eacute;mission pr&eacute;f&eacute;r&eacute;e?";
	$randomq[] = "Qui est votre acteur pr&eacute;f&eacute;r&eacute;?";
	$randomq[] = "Qui est votre actrice pr&eacute;f&eacute;r&eacute;e?";
	$randomq[] = "Avez-vous un surnom?";
	$randomq[] = "Quelle est votre chanson pr&eacute;f&eacute;r&eacute;e?";
	$randomq[] = "Comment vous d&eacute;cririez-vous?";
	$randomq[] = "Quel est votre groupe pr&eacute;f&eacute;r&eacute;?";
	$randomq[] = "Quelle est votre BD pr&eacute;f&eacute;r&eacute;e?";
	$randomq[] = "Quels sont vous aimez?";
	$randomq[] = "Quel est votre plat pr&eacute;f&eacute;r&eacute;?";
	$randomq[] = "Quel sport vous jouez?";
	$randomq[] = "Qui &eacute;tait votre premier amour?";
	$randomq[] = "Quel est votre film pr&eacute;f&eacute;r&eacute;?";
	$randomq[] = "Chats, chiens, ou quelque chose de plus exotique?";
	$randomq[] = "Quelle est votre couleur pr&eacute;f&eacute;r&eacute;e?";

// Select a random question from the array above
srand ((double) microtime() * 1000000);
$chosen = rand(0,count($randomq)-1);

// Appoint the variable
$tag_question = $randomq[$chosen];

?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<div id="container">
	<div id="content">
    <div id="column1" class="column">
				<div class="habblet-container ">

						<div id="new-personal-info" style="background-image:url(./web-gallery/v2/images/personal_info/hotel_views/htlview_hiver2011.png)" />

		<div class="enter-hotel-btn">			
<?php if(HabboCMSTEXT(getContent('hotel-enabled'), true) !== "0"){ ?>
		<div class="closed enter-btn">
				<span>Hotel en maintenance</span>
			<b></b>
		</div>
<?php } else { ?>
		<div class="open enter-btn"> 

				<a href="<?php echo $path; ?>/client" target="client" onclick="openOrFocusHabbo(this); return false;">Entrer dans <?php echo $sitename; ?><i></i></a>
			<b></b>
		</div>
<?php } ?>
	</div>

	<div id="habbo-plate">
		<a href="profile.php?tab=1">
        <?PHP if($myrow['motto'] == "crikey") { ?>
				<img alt="<?php echo $name; ?>" src="http://img4.cdn1.habbo.com/c_images/stickers/sticker_croco.gif" style="margin-top: 57px"/>
				<?PHP } else { ?>
			<img alt="<?php echo $name; ?>" src="http://www.habbo.co.uk/habbo-imaging/avatarimage?figure=<?php echo $myrow['look']; ?>&size=b&direction=3&head_direction=3&gesture=sml" width="64" height="110" /><?PHP } ?>
		</a>
	</div>

	<div id="habbo-info">
		<div id="motto-container" class="clearfix">
			<strong><?php echo $name; ?>:</strong>
			<div>
				<span title="Quelle est ton humeur du jour?"><?php if(!empty($myrow['motto'])){ echo utf8_decode($myrow['motto']); } else { echo "Quelle est ton humeur du jour?"; } ?></span>
				<p style="display: none"><input type="text" length="30" name="motto" value="<?php echo utf8_decode($myrow['motto']); ?>"/></p>
			</div>
		</div>
		<div id="motto-links" style="display: none"><a href="#" id="motto-cancel">Annuler</a></div>
	</div>

	<ul id="link-bar" class="clearfix">
		<li class="credits">
			<a href="credits"><?php echo $myrow['credits']; ?></a> Cr&eacute;dits
		</li>
		<li class="vipclub">
            <span id="clubdaysleft" <?php if(!getHC($my_id) && !getVIP($my_id)){ ?>style="display:none"<?php } ?>>
                <a href="vipclub"><?php echo getClubDays($my_id); ?></a>
                Jour(s) <?php if(getVIP($my_id)){ ?>VIP<?php } else { ?>HC<?php } ?> restant(s)
            </span>
            <span id="vipclub" <?php if(getHC($my_id) || getVIP($my_id)){ ?>style="display:none"<?php } ?>>
                <a href="./vipclub">Adhère au VIP Club &raquo;</a>
            </span>

		</li>
        <li class="vip">
			<a href="piks"><?php echo $piks; ?></a> Flocons
        </li>
        
        <li class="activitypoints ">
			<a href="pixels"><?php echo $myrow['activity_points']; ?></a> Pixels
		</li>

	</ul>

    <div id="habbo-feed">
        <ul id="feed-items">


<?php


if($user_rank > 5){
    $alerts = mysql_evaluate("SELECT COUNT(*) FROM site_help WHERE picked_up = '0'");
    if($alerts > 0){
            echo "            <li class=\"small\" id=\"feed-group-discussion\">
                <strong>Staff Message</strong><br />There "; if($alerts == 1){ echo "is"; } else { echo "are"; } echo " <strong><a href='./housekeeping/index.php?p=helper' target='_self'>" . $alerts . "</a></strong> non-picked up help quer"; if($alerts > 1){ echo "ies"; } else { echo "y"; } echo ".
            </li>";
    }
}

$tmp = mysql_query("SELECT * FROM cms_alerts WHERE template = '3'") or die(mysql_error());
$alerts = mysql_num_rows($tmp);

    if($alerts > 0){

        $row = mysql_fetch_assoc($tmp);

        $id = $row['id'];
        $type = $row['type'];

        if($type == 1){
        $heading = "<b><font color=\"red\">Attention - </b></font>";
        } elseif($type == 2){
        $heading = "Message des " . $shortname . " Staff";
        } else {
		
        $heading = "Message des Staffs<br>";
		
        }

                if(mysql_num_rows($tmp) > 0) { ?>
                <li id="feed-item-campaign" class="contributed">
    <a href="#" class="remove-feed-item" id="remove-feed-item-<?php echo $row['id']; ?>" title="Remove notification">Fermer</a>
    <div>
            <b><?php echo $heading; ?></b><br />
			
            <?php echo $row['alert']; ?><br><br><?php echo $row['staff']; ?>, <?php echo $fonction ?>
    </div>
</li>
<?php            while($row = mysql_fetch_assoc($tmp)) {

?>
<li id="feed-item-campaign" class="contributed">
    <a href="#" class="remove-feed-item" id="remove-feed-item-<?php echo $row['id']; ?>" title="Remove notification">Fermer</a>
    <div>
            <b><?php echo $heading; ?></b><br />
            <?php echo utf8_decode($row['alert']); ?><br><br><?php echo $row['staff']; ?>, <?php echo $fonction ?>
    </div>
</li>

<?php
        }
    }
}

        $dob = $myrow['birth'];
        $bits = explode("-", $dob);
        $day = $bits[0];
        $month2 = $bits[1];
        $year2 = $bits[2];

    if($day == $today && $month2 == $month && HabboCMSTEXT(getContent('birthday-notifications'), true) == "1"){

        $age = $year - $year2;

    // If we have haxxorz that bypassed the age check (only javascript validates it), they may be like, what,
    // one year old, so instead of showing 'happy 1th birthday', we properly show 'happy 1st birthday' etc.
    if($age == 1 || $age == 21){
    $age = $age . "ans";
    } elseif($age == 2 || $age == 22){
    $age = $age . "ans";
    } elseif($age == 3 || $age = 33){
    $age = $age . "ans";
    } else {
    $age = $age . "ans";
    }
?>
<li id="feed-birthday">
    <div>
            Joyeux anniversaire <b><?php echo $myrow['username']; ?></b>! tu as d&eacute;sormais..  <?php echo $age; ?>!<br />Nous esp&eacute;rons que tu auras un grand jour aujourd'hui.
    </div>
</li>
<?php } ?>

		<?php if(showfriendsOnline($my_id) > 0){ ?>
	<li id="feed-friends">
				Tu as <strong><?php echo showfriendsOnline($my_id); ?></strong> ami(s) connect&eacute;(s).
					<span>
					<?php echo showfriendsOnline($my_id, true); ?>				
					</span>
			</li>
		<?php } ?>
		
		<!-- <?php if($myrow['tradingsetting'] == "0"){ ?>
		 <li class="small" id="feed-trading-enabled">
		Le troc est activ&eacute; <a href="<?php echo $path; ?>/profile?tab=1" title="">Clique ici pour le d&eacute;sactiv&eacute;</a></li>

		<?php } else { ?>
		<li class="small" id="feed-trading-disabled">
		Le troc est d&eacute;sactiv&eacute; <a href="<?php echo $path; ?>/profile?tab=1" title="">Clique ici pour l'activ&eacute;</a></li>
		<?php } ?> --> 
 

            <li class="small" id="feed-lastlogin">
                Derni&egrave;re connexion:
                
            </li>
            
    </div>
    <p class="last"></p>
</div>

<div class="habblet-container ">        
						<div class="cbb clearfix orange ">
<h2 class="title">A la Une
                            </h2>
                        <div id="hotcampaigns-habblet-list-container">
    <ul id="hotcampaigns-habblet-list">
<?php

$getcampaigns = mysql_query("SELECT * FROM site_hotcampaigns ORDER BY order_id ASC");
$even = 'odd';

while ($campaigns = mysql_fetch_assoc($getcampaigns))
{
	if ($even == 'odd')
	{
		$even = 'even';
	}
	else
	{
		$even = 'odd';
	}
	
	echo '<li class="' .$even. '"> 
            <div class="hotcampaign-container"> 
                <a href="' .filter($campaigns['url']). '">
				<img src="' .filter($campaigns['image_url']). '" align="left" alt="' .$campaigns['caption']. '" /></a> 
                <h3>' .html_entity_decode(nl2br(stripslashes($campaigns['caption']))). '</h3> 
                <p>' .html_entity_decode(nl2br(stripslashes($campaigns['descr']))). '</p> 
                <p class="link"><a href="' .filter($campaigns['url']). '">Voir &raquo;</a></p> 
            </div> 
        </li> ';
}

?>
</ul>
</div> 
</div>




 <div class="habblet-container ">

<?php /* Minimail */ ?>
<div class="habblet-container minimail" id="mail">
                        <div class="cbb clearfix blue ">

                            <h2 class="title">Mes Messages
                            </h2>
                        <div id="minimail">
    <div class="minimail-contents">
		<?php
		$bypass = true;
		$page = "inbox";
		include('./minimail/loadMessage.php');
		?>
	    </div>
		<div id="message-compose-wait"></div>
	    <form style="display: none" id="message-compose">
	        <div>Destinataire</div>
	        <div id="message-recipients-container" class="input-text" style="width: 426px; margin-bottom: 1em">
	        	<input type="text" value="" id="message-recipients" />
	        	<div class="autocomplete" id="message-recipients-auto">
	        		<div class="default" style="display: none;">Tape le nom de ton ami:</div>
	        		<ul class="feed" style="display: none;"></ul>

	        	</div>
	        </div>
	        <div>Sujet<br/>
	        <input type="text" style="margin: 5px 0" id="message-subject" class="message-text" maxlength="100" tabindex="2" />
	        </div>
	        <div>Message<br/>
	        <textarea style="margin: 5px 0" rows="5" cols="10" id="message-body" class="message-text" tabindex="3"></textarea>

	        </div>
	        <div class="new-buttons clearfix">
	            <a href="#" class="new-button preview"><b>Pr&eacute;voir</b><i></i></a>
	            <a href="#" class="new-button send"><b>Envoyer</b><i></i></a>
	        </div>
	    </form>
	</div>
		<?php
		$sql = mysql_query("SELECT * FROM messenger_friendships WHERE user_one_id = '".$my_id."' OR user_two_id = '".$my_id."'") or die(mysql_error());
		$count = mysql_num_rows($sql); 
		$sql = mysql_query("SELECT * FROM cms_minimail WHERE to_id = '".$myrow['id']."' OR senderid = '".$myrow['id']."'") or die(mysql_error());
		$mescount = mysql_num_rows($sql); 
		?>
		<script type="text/javascript">
		L10N.put("minimail.compose", "Compose").put("minimail.cancel", "Quitter")
			.put("bbcode.colors.red", "Red").put("bbcode.colors.orange", "Orange")
	    	.put("bbcode.colors.yellow", "Yellow").put("bbcode.colors.green", "Green")
	    	.put("bbcode.colors.cyan", "Cyan").put("bbcode.colors.blue", "Blue")
	    	.put("bbcode.colors.gray", "Gray").put("bbcode.colors.black", "Black")
	    	.put("minimail.empty_body.confirm", "Are you sure you want to send the message with an empty body?")
	    	.put("bbcode.colors.label", "Color").put("linktool.find.label", " ")
	    	.put("linktool.scope.habbos", "<?php echo $shortname; ?>s").put("linktool.scope.rooms", "Rooms")
	    	.put("linktool.scope.groups", "Groups").put("minimail.report.title", "Report message to moderators");

	    L10N.put("date.pretty.just_now", "just now");
	    L10N.put("date.pretty.one_minute_ago", "1 minute ago");
	    L10N.put("date.pretty.minutes_ago", "{0} minutes ago");
	    L10N.put("date.pretty.one_hour_ago", "1 hour ago");
	    L10N.put("date.pretty.hours_ago", "{0} hours ago");
	    L10N.put("date.pretty.yesterday", "yesterday");
	    L10N.put("date.pretty.days_ago", "{0} days ago");
	    L10N.put("date.pretty.one_week_ago", "1 week ago");
	    L10N.put("date.pretty.weeks_ago", "{0} weeks ago");
		new MiniMail({ pageSize: 10,
		   total: <?php echo $mescount; ?>,
		   friendCount: <?php echo $count; ?>,
		   maxRecipients: 50,
		   messageMaxLength: 20,
		   bodyMaxLength: 4096,
		   secondLevel: <?php if($count = 0){ echo "true"; }else{ echo "false"; } ?>});
	</script>
	</div></div>
    <script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script>

<script type="text/javascript">
    HabboView.add(function() {
        L10N.put("personal_info.motto_editor.spamming", "Don\'t spam me, bro!");
        PersonalInfo.init("");
    });
</script>


                </div>
                <script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script>

				</div>
				<script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script>



<?php /* Events  */ ?>
<?php
$res = mysql_query("show table status like 'events'")
or die(mysql_error());
$table_exists = mysql_num_rows($res) == 1;
if($table_exists == 1){ ?>
<div class="habblet-container ">		
						<div class="cbb clearfix darkred ">
	
							<h2 class="title">Events
							</h2>
						<div id="current-events">
	<div class="category-selector">
	<p>Browse latest events by their category</p>
	<select id="event-category">
		<option value="1">Parties &amp; Music</option>
		<option value="2">Trading</option>
		<option value="3">Games</option>
		<option value="4"><? echo $shortname; ?> Guides</option>
		<option value="5">Debates &amp; Discussion</option>
		<option value="6">Grand Openings</option>
		<option value="7">Dating</option>
		<option value="8">Jobs</option>
		<option value="9">Group Events</option>
		<option value="10">Performance</option>
		<option value="11">Help Desk</option>
	</select>
	</div>
	<div id="event-list">
<ul class="habblet-list">
<?php
$getem = mysql_query("SELECT * FROM events WHERE category = '1'");
while ($row = mysql_fetch_assoc($getem)) {
	$roomrow = mysql_fetch_assoc(mysql_query("SELECT * FROM rooms WHERE id = '".$row['roomid']."'"));
	$userrow = mysql_fetch_assoc(mysql_query("SELECT * FROM users WHERE id = '".$row['userid']."'"));
	$i++;

	if(IsEven($i)){
		$even = "odd";
	} else {
		$even = "even";
	}

	// Calculate percentage
	if($roomrow['incnt_max'] == 0){ $roomrow['incnt_max'] = 1; }
	$data[$i] = ($roomrow['incnt_now'] / $roomrow['incnt_max']) * 100;

	// Base room icon based on this - percantage levels may not be habbolike
	if($data[$i] == 99 || $data[$i] > 99){
		$room_fill = 5;
	} elseif($data[$i] > 65){
		$room_fill = 4;
	} elseif($data[$i] > 32){
		$room_fill = 3;
	} elseif($data[$i] > 0){
		$room_fill = 2;
	} elseif($data[$i] < 1){
		$room_fill = 1;
	}

	printf("<li class=\"%s room-occupancy-%s\" roomid=\"%s\">
<div title=\"Go to the room where this event is held\">
	<span class=\"event-name\"><a href=\"./client.php?forwardId=2&amp;roomId=%s\" onclick=\"HabboClient.roomForward(this, '%s', 'private'); return false;\">%s</a></span>
	<span class=\"event-owner\"> by <a href=\"/user_profile.php?id=%s\">%s</a></span>
	<p>%s (<span class=\"event-date\">%s</span>)</p>
</div>
</li>", $even, $room_fill, $row['roomid'], $row['roomid'], $row['roomid'], $row['name'], $row['userid'], $userrow['name'], $row['description'], $row['date']);
}
?>
</ul>
	</div>
</div>
<script type="text/javascript">
	document.observe('dom:loaded', function() {
		CurrentRoomEvents.init();
	});
</script>
	
						
					</div>
				</div>
				<script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script>
<?php } ?>

</div></div>
				<script type='text/javascript'>if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script>
<div id="column2" class="column">
				<div class="habblet-container news-promo">
						<div class="cbb clearfix notitle ">


						<div id="newspromo">
        <div id="topstories">
	        <div class="topstory" style="background-image: url(<?php echo $news_1_topstory_image; ?>)">
	            <h4>Derni&egrave;re infos</a></h4>
	            <h3><a href="<?php echo $path; ?>/news?view=<?php echo $news_1_link; ?>-<?php echo $news_1_seo; ?>"><?php echo stripslashes($news_1_title); ?></a></h3>
	            <p class="summary">
	            <?php echo stripslashes($news_1_snippet); ?>
	            </p>
	            <p>
	                <a href="<?php echo $path; ?>/news?view=<?php echo $news_1_link; ?>-<?php echo $news_1_seo; ?>">En savoir plus &raquo;</a>
	            </p>
	        </div>
	        <div class="topstory" style="background-image: url(<?php echo $news_2_topstory_image; ?>); display: none">
	            <h4>Derni&egrave;re infos</h4>
	            <h3><a href="<?php echo $path; ?>/news?view=<?php echo $news_2_link; ?>-<?php echo $news_2_seo; ?>"><?php echo stripslashes($news_2_title); ?></a></h3>
	            <p class="summary">
	            <?php echo stripslashes($news_2_snippet); ?>
	            </p>
	            <p>
	                <a href="<?php echo $path; ?>/news?view=<?php echo $news_2_link; ?>-<?php echo $news_2_seo; ?>">En savoir plus &raquo;</a>
	            </p>
</div>
	        <div class="topstory" style="background-image: url(<?php echo $news_3_topstory_image; ?>); display: none">
	            <h4>Derni&egrave;re infos</h4>
	            <h3><a href="<?php echo $path; ?>/news?view=<?php echo $news_3_link; ?>-<?php echo $news_3_seo; ?>"><?php echo stripslashes($news_3_title); ?></a></h3>
	            <p class="summary">
	            <?php echo stripslashes($news_3_snippet); ?>
	            </p>
	            <p>
	                <a href="<?php echo $path; ?>/news?view=<?php echo $news_3_link; ?>-<?php echo $news_3_seo; ?>">En savoir plus &raquo;</a>
	            </p>

				

</div>
<div id="topstories-nav" style="display: none"><a href="#" class="prev">&laquo;  Pr&eacute;c&eacute;dent</a><span>1</span> / 3<a href="#" class="next">Suivant &raquo; </a></div>
</div>
        <ul class="widelist">
            <li class="even">
                <a href="<?php echo $path; ?>/news?view=<?php echo $news_4_link; ?>-<?php echo $news_4_seo; ?>"><?php echo stripslashes($news_4_title); ?></a><div class="newsitem-date"><?php echo $news_4_datestr; ?></div>
            </li>
			   <li class="odd">
                <a href="<?php echo $path; ?>/news?view=<?php echo $news_5_link; ?>-<?php echo $news_5_seo; ?>"><?php echo stripslashes($news_5_title); ?></a><div class="newsitem-date"><?php echo $news_5_datestr; ?></div>
            </li>
            <li class="last"><a href="<?php echo $path; ?>/news">Plus d'infos &raquo;</a></li>
        </ul>
 
</div>
<script type="text/javascript">
	document.observe("dom:loaded", function() { NewsPromo.init(); });
</script>
					</div>
				</div>
<div class="habblet-container">        
						<div class="cbb clearfix red">
<h2 class="title"><span style="float: left;">EveryStyle</span> <span style="float: right; font-weight: normal; font-size: 75%;">Partenaire.</span></h2>
<center><embed type="application/x-shockwave-flash" src="http://hr-radio.z.gp/dewplayer10.swf" style="" id="Player" name="player" bgcolor="#000000" quality="high" wmode="transparent" flashvars="mp3=http://listen.radionomy.com/EveryStyleFM&autoplay=1" height="50" width="135"></embed><br>
<span style="font-weight: bold;">Envis de
l&acirc;ch&eacute; une d&eacute;dicasse en LIVE? c'est par </span><a
 style="font-weight: bold; color: rgb(255, 153, 0);"
 href="http://www.everystyle.org/dedi.html" target="_blank">ici</a><span
 style="font-weight: bold;">.</span>
</center>
                            
</div>
</div>

    <div class="habblet-container ">
                        <div class="cbb clearfix blue ">

    <div id="tab-2-2-content" >
<div id="groups-habblet-info" class="habblet-content-info">
    <h3 class="vip-title">VIP au hasard</h3>
</div>
         <div id="groups-habblet-list-container" class="habblet-list-container groups-list">

         <?php
         $ieven = 'even';
         $sqlvip = mysql_query("SELECT username FROM users WHERE vip = '1' ORDER BY rand() LIMIT 3");
         
        
         while($vip = mysql_fetch_assoc($sqlvip)) {
             if ($ieven == 'even')
	{
		$ieven = 'oldd';
	}
	else
	{
		$ieven = 'even';
	}
          echo '<div class="cadre '.$ieven.'"><p><b>' . $vip['username'] . '</b></p><a href="user_profile.php?name='.$vip['username'].'"><div class="right-icon"></div></a></div>';
         }
         ?>
</div>
    
        <a class="vip-getup" href="vipclub">Adhérer au VIP CLUB »</a>
    </div>

    <div id="groups-habblet-group-purchase-button" class="habblet-list-container"></div>

<script type="text/javascript">
    $("purchase-group-button").observe("click", function(e) { Event.stop(e); GroupPurchase.open(); });
</script>





    </div>

					</div>
  
    
    
    
			<?php /* Recommend Groups  */?>
<div class="habblet-container ">		
	<div class="cbb clearfix red ">
	<div class="box-tabs-container clearfix">
	<h2>Choix des Staff</h2>
	
    <ul class="box-tabs"> 
	<li id="tab-1-3-2" class="selected"><a href="#">Clans</a><span class="tab-spacer"></span></li>
    </ul>
	</div>
	
	    <div id="tab-1-3-2-content" >
	<div id="staffpicks-groups-habblet-list-container" class="habblet-list-container groups-list">
    <ul class="habblet-list two-cols clearfix">
	
    <?php 
	$sql = mysql_query("SELECT * FROM cms_recommended WHERE type = 'group' ORDER BY id ASC") or die(mysql_error());
    while($row = mysql_fetch_assoc($sql)) {
            $i++;

		$groupsql = mysql_query("SELECT * FROM groups_details WHERE id = '".$row['rec_id']."' LIMIT 1");
		$grouprow = mysql_fetch_assoc($groupsql);

        if(IsEven($i)){
            $even = "even left";
        } else {
            $even = "even right";
        }		
		
	
    ?>
	
           <li class="<?php echo $even; ?>" style="background-image: url(./habbo-imaging/badge.php?badge=<?php echo $grouprow['badge']; ?>.gif)">
			<?php if($grouprow['roomid'] != 0) { ?>
			<a href="client.php?forwardId=2&amp;roomId=<?php echo $grouprow['roomid']; ?>" onclick="HabboClient.roomForward(this, '<?php echo $grouprow['roomid']; ?>', 'private'); return false;" target="client" class="group-room"></a>
			<?php } ?>
            <a class="item" href="group_profile.php?id=<?php echo $grouprow['id']; ?>"><?php echo utf8_decode($grouprow['name']); ?></a>
			<?php } ?>
            </li>
    </ul>
</div>

                    </div>
                </div>
                
                <div class="habblet-container ">
						<div class="cbb clearfix green ">
<div class="box-tabs-container clearfix">
    <h2>Tags</h2>
    <ul class="box-tabs">
        <li id="tab-3-1"><a href="#">Les <?php echo $shortname ?>s aiment...</a><span class="tab-spacer"></span></li>
        <li id="tab-3-2" class="selected"><a href="#">Mes Tags</a><span class="tab-spacer"></span></li>
    </ul>
</div>
    <div id="tab-3-1-content"  style="display: none">
    		<div class="progressbar"><img src="./web-gallery/images/progress_bubbles.gif" alt="" width="29" height="6" /></div>
    		<a href="tagcloud.php?sp=plain" class="tab-ajax"></a>
    </div>
    <div id="tab-3-2-content" >
    <div id="my-tag-info" class="habblet-content-info">
        <?php if($tags_num > 19){ echo "Tu as atteint la nombre maxi de tags."; } elseif($tags_num == 0){ echo "Vous n'avez pas de tags. R&eacute;pondez &agrave; la question ci-dessous ou juste ajouter un tag de votre choix."; } elseif($tags_num < 20){ echo "Tu peux encore ajouter des tags!"; } ?>
    </div>
<div class="box-content">
    <div class="habblet" id="my-tags-list">

<?php if($tags_num > 0){
            echo "<ul class=\"tag-list make-clickable\"> ";
	while($row = mysql_fetch_assoc($fetch_tags)){
                    printf("<li><a href=\"tags.php?tag=%s\" class=\"tag\" style=\"font-size:10px\">%s</a>\n
                        <a class=\"tag-remove-link\"\n
                        title=\"Remove tag\"\n
                        href=\"#\"></a></li>\n", $row['tag'], $row['tag']);
	}
            echo "</ul>";
} ?>

<?php if($tags_num < 20){ ?>
     <form method="post" action="tags_ajax.php?key=add" onsubmit="TagHelper.addFormTagToMe();return false;" >
    <div class="add-tag-form clearfix">
		<a  class="new-button" href="./tags.php" id="add-tag-button" onclick="TagHelper.addFormTagToMe();return false;"><b>Ajouter</b><i></i></a>
        <input type="text" id="add-tag-input" maxlength="20" style="float: right"/>
        <em class="tag-question"><?php echo $tag_question; ?></em>
    </div>
    <div style="clear: both"></div>
    </form>
<?php } ?>
    </div>
</div>

<script type="text/javascript">
document.observe("dom:loaded", function() {
    TagHelper.setTexts({
        tagLimitText: "You\'ve reached the tag limit - delete one of your tags if you want to add a new one.",
        invalidTagText: "Invalid tag",
        buttonText: "OK"
    });
        TagHelper.init('21063711');
});
</script>
    </div>

					</div>
				</div>
				<script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script>
                
<div class="habblet-container ">
                        <div class="cbb clearfix blue ">
<div class="box-tabs-container clearfix">
    <h2>Clans</h2>
    <ul class="box-tabs">
        <li id="tab-2-2" class="selected"><a href="#">Mes Clans</a><span class="tab-spacer"></span></li>
    </ul>
</div>
    <div id="tab-2-2-content" >
<div id="groups-habblet-info" class="habblet-content-info">
                Regarde les clans dans lesquels tu es, cr&eacute;e le tiens, ou regarde ceux des autres <?php echo $shortname ?>!
         </div>
         <div id="groups-habblet-list-container" class="habblet-list-container groups-list">
         <ul class="habblet-list two-cols clearfix">
		 <?php
$getclan = mysql_query("SELECT * FROM groups_memberships WHERE userid = '".$my_id."'");
$even = 'odd';

while ($row = mysql_fetch_assoc($getclan))
{
	if ($even == 'odd')
	{
		$even = 'even';
	}
	else
	{
		$even = 'odd';
	}
	
	$group_id = $row['groupid'];
	$check = mysql_query("SELECT * FROM groups_details WHERE id = '".$group_id."' LIMIT 1");
	$groupdata = mysql_fetch_assoc($check);
	
	echo '<li class="' .$even. '" style="background-image: url(./habbo-imaging/badge.php?badge='.$groupdata['badge'].')"><a class="item" href="group_profile.php?id='.$group_id.'">'.charset_decode_utf_8($groupdata['name']).'</a></li>';
}

?></ul>
</div>
		<div class="habblet-button-row clearfix"><a class="new-button" id="purchase-group-button" href="#"><b>Cr&eacute;er un clan</b><i></i></a></div>
    </div>

    <div id="groups-habblet-group-purchase-button" class="habblet-list-container"></div>

<script type="text/javascript">
    $("purchase-group-button").observe("click", function(e) { Event.stop(e); GroupPurchase.open(); });
</script>





    </div>

					</div>

                    
				</div>






        <script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script>	
</div>
          
</div>			  


<script type="text/javascript">
	HabboView.add(LoginFormUI.init);
</script>
<?php

include('templates/community_footer.php');

?>