<?php
/*===================================================+ 
|| # HoloCMS - Website and Content Management System
|+===================================================+ 
|| # Copyright © 2012 DnT [Tutti i diritti riservati]
|| # http://dnt.webnet32.com/
|+===================================================+ 
|| # DnT HoloCMS v2 - Created By Donatello (DnT)
|| # http://code.google.com/p/dnt-project/downloads/list
|+===================================================*/ 


$allow_guests = true;

include('core.php');
include('includes/session.php');

$key = FilterText($_GET['habbletKey']);

if($_GET['redirect'] != ''){

header("LOCATION: http://". $_GET['redirect'] ."");

}
if($_REQUEST['habbletKey'] == "externalLink")
{

?>
<?php
$target = explode('/', $_POST['url']);
$mytarg = array_reverse(explode('/', $_POST['url']));
?>
<div class="habblet-container ">		
	<div id="external-link-container">
	</br>
<h2><img src="/web-gallery/v2/images/registration/warning_sign.png"/> Annuncio di Sicurezza</h2>
<p>Stai per uscire da <?php echo $shortname ?>. Per la sicurezza e la privacy del tuo Account, ricordati di non inserire MAI la tua Password in alcun altro sito che non sia quello originale <?php echo $shortname ?>. Accertati inoltre di scaricare programmi sicuri da siti Internet affidabili.</p>
    <p><strong><?php echo $_POST["url"];?></strong></p>

<p class="clearfix" style="padding: 0">
    <a href="#" class="new-button" onclick="ExternalClickHandler.clickCancel('<?php echo $path; ?>/cproxy.php?redirect=<?php echo $_POST["url"];?>', '1'); return false;"><b>Annulla</b><i></i></a>
        <a href="#" class="new-button red-button" onclick="ExternalClickHandler.clickContinue('<?php echo $path; ?>/cproxy.php?redirect=<?php echo $_POST["url"];?>', '1'); return false;"><b>Continua su <?php echo $target[0]; ?></b><i></i></a>
</p>
</div>
	
	
</div>
<!-- dependencies

-->   



<?php
}
if($_REQUEST['habbletKey'] == "news")
{
	?>

<div class="habblet-container ">		
	<div id="news-habblet-container">
  <div class="title">
    <div class="habblet-close"></div>
    <div>Novità di <?php echo $shortname ?> Italia</div>
  </div>
  <div class="content-container">
    <div id="news-articles">
      <ul id="news-articlelist" class="articlelist" style="display: none">
    <?php
	$getnews = mysql_query("SELECT * FROM cms_news ORDER BY num DESC LIMIT 10");
	$i = 0;
	while($news = mysql_fetch_array($getnews))
	{
		if(($i%2) == 0)
		{
		?>
        <li class="even">
          <div class="news-title"><?php echo $news['title'];?></div>
          <div class="news-summary"><?php echo $news['short_story'];?></div>
          <div class="newsitem-date"><?php echo $news['date'];?></div>
          <div id="article-body-text-<?php echo $news['num'];?>" class="article-body-text" style="display: none">
	        <?php echo preg_replace('/%habboname%/', $myrow['username'], $news['story']);?>
          </div>
          <div class="clearfix">
            <a href="#" class="article-toggle" id="article-title-<?php echo $news['num'];?>">Leggi »</a>
          </div>
        </li>
        <?php
		}
		else
		{
		?>
        <li class="odd">
          <div class="news-title"><?php echo $news['title'];?></div>
          <div class="news-summary"><?php echo $news['short_story'];?></div>
          <div class="newsitem-date"><?php echo $news['date'];?></div>
          <div id="article-body-text-<?php echo $news['num'];?>" class="article-body-text" style="display: none">
	        <?php echo preg_replace('/%habboname%/', $myrow['username'], $news['story']);?>
          </div>
          <div class="clearfix">
            <a href="#" class="article-toggle" id="article-title-<?php echo $news['num'];?>">Leggi »</a>
          </div>
		  
        </li>
        <?php
		}
		$i++;
	}
	?>
      </ul>
    </div>
  </div>
  <div class="news-footer"></div>
</div>
<script type="text/javascript">    
    L10N.put("news.promo.readmore", "Leggi »").put("news.promo.close", "Chiudi");
    News.init(true);
</script>	
	
</div>

<!-- dependencies
<link rel="stylesheet" href="http://raikas77.webnet32.com/web-gallery/static/styles/news.css" type="text/css" />
<script src="http://raikas77.webnet32.com/web-gallery/static/js/news.js" type="text/javascript"></script>
-->   

    <?php
}
if($_REQUEST['habbletKey'] == "credits")
{
	?>

<div class="habblet-container ">		
			<div class="cbb clearfix blue ">
			<h2 class="title"><?php echo $shortname ?> Crediti
			<span class="habblet-close" style="visibility: visible; "></span></h2>
			
			<div style="padding: 15px;">

				<p>
					<b>In <?php echo $shortname ?> i crediti sono Gratis!</b><br />
					I crediti sono e saranno sempre gratis in <?php echo $shortname ?> ! Dai una occhiata allala <a href="/credits.php" target="_new"><?php echo $shortname ?>: Crediti</a>
                                        Per avere altre informazioni su come avere dei crediti.
				</p>
			
				<p style="float: left; vertical-align: middle; padding: 5px; font-size: 80%;">
					Il Borsellino sarà ricaricato di <b>3000 crediti</b> ogni 3 ore e di <b>1000 pixel</b> ogni ora. Questo assicura che tutti gli utenti avranno crediti. <br>
					I crediti in <?php echo $shortname ?> sono <b>Gratis!</b>
				</p>
			
				<div style="clear: left;"></div>						
				
			</div>
		
		</div>
	</div>

	<!-- dependencies
	<link rel="stylesheet" href="http://images.habbo.com/habboweb/63_1dc60c6d6ea6e089c6893ab4e0541ee0/1232/web-gallery/styles/newcredits.css" type="text/css" />
	<link rel="stylesheet" href="../web-gallery/v2/styles/style.css" type="text/css" />
	<link rel="stylesheet" href="../web-gallery/v2/styles/common.css" type="text/css" />
	<script src="http://images.habbo.com/habboweb/63_1dc60c6d6ea6e089c6893ab4e0541ee0/1232/web-gallery/static/js/newcredits.js" type="text/javascript"></script>
	<script src="../web-gallery/v2/styles/common.js" type="text/javascript"></script>
	-->
	
 
 
<?php
}
if($_REQUEST['habbletKey'] == "avatars")
{

	$do = (FilterText($_GET['do']));
$email = $myrow['mail'];
$users = mysql_query("SELECT * FROM users WHERE mail = '$email' LIMIT 1");

?>

<div id="container">

    <div id="select-avatar">

	<div class="pick-avatar-container clearfix">

        <div class="title">

            <span class="habblet-close" style="visibility: visible; "></span>


            <h1>Scegli il tuo personaggio</h1>

        </div>

		<div id="content">

            <div id="user-info">

                  <img src="https://ssl.facebook.com/pics/q_silhouette.gif"/>

              <div>

                  <div id="name"><?php echo htmlspecialchars(mysql_result(mysql_query("SELECT username FROM users WHERE mail = '".mysql_real_escape_string($myrow['mail'])."'"), 0)); ?></div>

                  <a href="/me.php" id="logout">Torna in hotel</a>

                 <a href="/identity/settings.php" id="manage-account">Impostazioni Account</a> 

              </div>



            </div>

            <div id="first-avatar">

                    <img src="http://www.habbo.it/habbo-imaging/avatarimage?figure=<?php echo $myrow['look']; ?>&size=b&direction=3&head_direction=3&gesture=sml" width="64" height="110"/>

                    <div id="first-avatar-info">

                        <div class="first-avatar-name"><?php echo $myrow['username']; ?></div>

                        <div class="first-avatar-lastonline">Ultimo accesso: <span title=""><?php echo date("d.m.y", $myrow['last_online']); ?></span></div>

                        <a id="first-avatar-play-link" href="/me">

                            

                        </a>

                    </div>

            </div>


            <div class="other-avatars">

                  <ul>
					<?php 
					$LOL = mysql_query("SELECT * FROM users WHERE mail = '".$myrow['mail']."' AND username NOT LIKE '".mysql_real_escape_string($myrow['username'])."'");
					$BOOL = false;
					while($ROW = mysql_fetch_array($LOL))
					{
						
						?>
						<li class="<?php if(!$BOOL) { $BOOL = true; echo "even"; } else { $BOOL = false; }?>">

                      <img src="http://www.habbo.it/habbo-imaging/avatarimage?figure=<?php echo $ROW['look']; ?>&size=s&direction=4&head_direction=4&gesture=sml" width="33" height="56"/>

                      <div class="avatar-info">

                        <div class="avatar-info-container">

                          <div class="avatar-name"><?php echo $ROW['username']; ?></div>

	            	      <div class="avatar-lastonline">Ultimo accesso: <span title="20.02.12 23:55"><?php echo date("d.m.y", $ROW['last_online']); ?></span></div>

                        </div>

                          <div class="avatar-select"><a href="/check_avatar.php?name=<?php echo $ROW['username']; ?>"><b>Gioca</b><i></i></a></div>

                      </div>

                    </li>
					<?php
					
					}
					?>
                    

                  </ul>

            </div>

        </div>

    </div>

    <div class="pick-avatar-container-bottom"></div>

  </div>
   <script type="text/javascript">
        Embed.decorateFooterLinks();
    </script>
</div>

<!-- dependencies
<link rel="stylesheet" href="/web-gallery/static/styles/common.css" type="text/css" />
<link rel="stylesheet" href="/web-gallery/static/styles/avatarselection.css" type="text/css" />
-->
<?php } ?>



