<?php
/*=======================================================================
| UberCMS - Advanced Website and Content Management System for uberEmu
| #######################################################################
| Copyright (c) 2010, Roy 'Meth0d'
| http://www.meth0d.org
| #######################################################################
| This program is free software: you can redistribute it and/or modify
| it under the terms of the GNU General Public License as published by
| the Free Software Foundation, either version 3 of the License, or
| (at your option) any later version.
| #######################################################################
| This program is distributed in the hope that it will be useful,
| but WITHOUT ANY WARRANTY; without even the implied warranty of
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
| GNU General Public License for more details.
\======================================================================*/

/*
Hotel Stream System
Fully Programmed by Lukadora
http://funemu.hopto.org
*/

require_once "global.php";
include "/stream-files/css.php";

if (!LOGGED_IN)
{
	header("Location: " . WWW . "/");
	exit;
}
if (isset($_GET['mode']))
{
$mode = $_GET['mode'];
}
else
{
$mode = 'default';
}

// Holt wichtige Infos für den Stream

$uname = $users->GetUserVar(USER_ID, 'username');
$uid = $users->GetUserVar(USER_ID, 'id');
$ulook = $users->GetUserVar(USER_ID, 'look');
$ustream = $users->GetUserVar(USER_ID, 'stream_active');

if (isset($_GET['user']))
{
	$mode = "username";
	$suser = $users->Name2Id($_GET['user']);
	$sid = $suser;
	$sname = $users->GetUserVar($sid, 'username');
	$slook = $users->GetUserVar($sid, 'look');
	$sstream = $users->GetUserVar($sid, 'stream_active');
}

	$getData = dbquery("SELECT * FROM stream ORDER BY timestamp DESC LIMIT 1");
	
	if (mysql_num_rows($getData) > 0)
	{
		$articleData = mysql_fetch_assoc($getData);
		
		$eid = $articleData['userid'];
		$etype = clean($articleData['streamtype']);
		$eextradata = clean($articleData['extradata']);
		$eextradata2 = clean($articleData['extradata2']);
	}
// Initialize template system
{
?>
<head> 
<meta http-equiv="content-type" content="text/html; charset=utf-8"> 
<title>Hotel Stream</title> 
 
<script type="text/javascript"> 
var andSoItBegins = (new Date()).getTime();
var ad_keywords = "";
document.habboLoggedIn = true;
var habboName = "Lukadora";
var habboReqPath = "%www%/";
var habboStaticFilePath = "http://fubbo.net/images.fubbo.net/habboweb/63_1dc60c6d6ea6e089c6893ab4e0541ee0/160b/web-gallery";
var habboImagerUrl = "http://www.habbo.co.uk/habbo-imaging/";
var habboPartner = "";
var habboDefaultClientPopupUrl = "%www%//client";
window.name = "habboMain";
if (typeof HabboClient != "undefined") { HabboClient.windowName = "uberClientWnd"; }
</script> 

<link rel="shortcut icon" href="http://images.habbo.com/habboweb/63_1dc60c6d6ea6e089c6893ab4e0541ee0/160b/web-gallery/v2/favicon.ico" type="image/vnd.microsoft.icon"> 
<script src="%www%//web-gallery/static/js/libs2.js" type="text/javascript"></script>
<script src="%www%//web-gallery/static/js/visual.js" type="text/javascript"></script>
<script src="%www%//web-gallery/static/js/libs.js" type="text/javascript"></script>
<script src="%www%//web-gallery/static/js/common.js" type="text/javascript"></script>
<script src="%www%//web-gallery/static/js/fullcontent.js" type="text/javascript"></script>
<link rel="stylesheet" href="%www%//web-gallery/v2/styles/style.css" type="text/css">
<link rel="stylesheet" href="%www%//web-gallery/v2/styles/buttons.css" type="text/css">
<link rel="stylesheet" href="%www%//web-gallery/v2/styles/boxes.css" type="text/css">
<link rel="stylesheet" href="%www%//web-gallery/v2/styles/tooltips.css" type="text/css">
<link rel="stylesheet" href="%www%//web-gallery/v2/styles/personal.css" type="text/css">
<script src="%www%//web-gallery/static/js/habboclub.js" type="text/javascript"></script>
<link rel="stylesheet" href="%www%//web-gallery/v2/styles/minimail.css" type="text/css">
<link rel="stylesheet" href="%www%//web-gallery/styles/myhabbo/control.textarea.css" type="text/css">
<script src="%www%//web-gallery/static/js/minimail.js" type="text/javascript"></script>
<!-- Uber style overrides --> 
<style type="text/css"> 
.header, .header a, #table_header a, #top-right, #top-right a, #top-menu a.tab, #user_chat h1 span, #user_chat #end_session {
color: #2A2A2A;
}
screen.css:1
a {
color: #1A6690;
cursor: pointer;
}

#header-container { background-color: #B8DBEB; }
h1 a { height: 49px !important; width: 200px !important; background-image: url('http://fubbo.net/images/logo.gif') !important; }
#navi .viptab a { background-image: url('http://fubbo.net/images/tabs2.png'); background-position: -10px -84px; }
#navi .viptab span { background-image: url('http://fubbo.net/images/tabs2.png'); background-position: -4px -84px; }
#navi .viptab:hover a { background-image: url('http://fubbo.net/images/tabs2.png'); background-position: -10px -112px; }
#navi .viptab:hover span { background-image: url(http://fubbo.net'/images/tabs2.png'); background-position: -4px -112px; }
</style> 

<body style="background:#B6E2EB">
<div id="page">
    <div id="top">
      <div id="header">
        <div id="top-right"><a href="%www%/me"><?php echo $uname ?></a></div>
        <div id="header_container">
    <table id="table_header"><tbody><tr>
      <td><a href="http://www.habbo.de" target="_blank" title=""><img alt="" id="logo" src="http://www.habbotimes.net/site/scripts/fontgenerator/font.php?font=7&text=stream"></a>&nbsp;</td>
      <td><img alt="" id="logo-delimiter" src="https://assets.zendesk.com/images/logo-delimiter.png?1315770226">&nbsp;</td>
      <td><a href="/stream"><?php if($mode == "me") { ?>Mein Stream<?php } else { ?>Hotel Stream<?php } ?></a></td>
    </tr></tbody></table>
</div>

      </div>

      <div id="top-menu-background">
        <div id="top-menu">
          <ul id="green" style="width: 100%;">
            <li class="clazz tab_home first active"><a href="/stream" class="tab">Home</a></li><li class="main tab_forums first" data-tracking-activity="FAQ"></li>
            
          </ul>
        </div>
      </div>
    </div>

    

<div id="container" class="clearfix">

  <div id="flash">
</div>



  

  <div id="flash_messages">
    



<script type="text/javascript">
</script>

  </div>

  

  <div id="contentwrapper">
    <div id="contentcolumn">
      



  <div id="solution_suggestion">
<div class="content content_green"><div class="green_box_top"><div class="box box_top"></div></div>    <h2 id="search_box">Usernamen suchen</h2>
    <form id="suggest_form" action="#">
      <input id="user" name="user" type="text"><input class="button search" id="suggestion_submit" name="commit" type="submit" href="/steam/user/user" value="Suche">
    </form>

      <div id="topic_search_loading"></div>
<div id="topic_search" style="display:none;">
  <div class="frame" style="margin-top: 15px; padding-bottom: 20px;">
    <div id="topic_search_result"></div>
    <div id="show_more_results" class="show_more_bar">
      <img alt="Ajax_loader_small" class="progress" src="https://assets.zendesk.com/images/ajax_loader_small.gif?1315770226" style="display:none;">
      <b><a href="/home?page=2">Mehr</a></b>
    </div>


    <h2 style="margin-top: 5px; padding-top: 12px; border-top: 1px dashed #EEE;">Sie haben nicht gefunden nach was suchen Sie?</h2>



    <div class="deflect tickets" id="ticket-deflect">
      <h3>In Kontakt treten</h3>
      <ul><li><a href="/anonymous_requests/new">Füllen Sie bitte das Anfrageformular aus</a></li></ul>
    </div>

    <div style="clear:both;"></div>
  </div>
</div>

<div class="green_box_bottom"><div class="box box_bottom"></div></div></div><div class="box_bottom_clear">&nbsp;</div></div>



  <div id="content_entries">
<div class="content content_grey"><div class="grey_box_top"><div class="box box_top"></div></div>    

	<?php if ($mode == "me") { ?>
	    <p class="forum-nav">
      <a href="/stream/">Alle</a>
    <span class="delim">|</span>
    Mein Stream
  </p>
  </p>
  <?php } else { ?>
      <p class="forum-nav">
      Alle
    <span class="delim">|</span>
    <a href="/stream/mystream">Mein Stream</a>
  <?php } ?>


    

    <div class="frame columns">
          <div class="">
              
            




    
<div class="column left" id="forum_222331" data-forum_id="222331" data-forum_path="/forums/222331-aktuelles">

</div>

    <div style="clear:both; height:0px;">&nbsp;</div>


          </div>
          <div class="">
              
  <div class="category-header">
    <h2><a href="#">Streams des Hotels</a></h2>
  </div>
	<?php if($mode == "username") { ?>
            <?php
			$q = "SELECT * FROM stream WHERE userid = '".$sid."' ORDER BY timestamp DESC LIMIT 50";
			$getStreams = dbquery($q);
			while ($a = mysql_fetch_assoc($getStreams))
			{
					$aid = $a['userid'];
					$atype = clean($a['streamtype']);
					$aextradata = clean($a['extradata']);
					$aextradata2 = clean($a['extradata2']);
					$aname = $users->GetUserVar($aid, 'username');
					$alook = $users->GetUserVar($aid, 'look');
			?>
			<div style="<?php if ($atype == "badge") { ?>height:170px; <?php } else { ?>height:120px;<?php } ?> background: url(http://www.habbo.de/habbo-imaging/avatarimage?figure=<?php echo $alook ?>) no-repeat;">
			<h2 style="padding-left:70px;"><?php echo $aname ?></h2>
			<?php if ($atype == "mission") { ?>
			<h3 style="padding-left:70px;">hat eine neue Mission: <?php echo $aextradata ?></h3>
			<?php } else if ($atype == "badge") { ?>
			<h3 style="padding-left:70px;">hat ein neues Badge erhalten</h3>
			<div style="background: url(http://images.lukadora.dehttp://images.lukadora.de/swf/c_images/Quests/ach_receive_star.png) no-repeat; background-position:70px 0px; padding-left:70px; width:109px; height:109px;">
			<img style="padding-top:30px; padding-left:30px;" src="http://images.lukadora.de/swf/c_images/album1584/<?php echo $aextradata ?>.gif">
			</div>
			<?php } ?>
			</div>
			
			
			<?php
			}
			
			?>
	<?php } else if ($mode == "me") { ?>
			            <?php
			$q = "SELECT * FROM stream WHERE userid = '".$uid."'ORDER BY timestamp DESC";
			$getStreams = dbquery($q);
			while ($a = mysql_fetch_assoc($getStreams))
			{
					$aid = $a['userid'];
					$atype = clean($a['streamtype']);
					$aextradata = clean($a['extradata']);
					$aextradata2 = clean($a['extradata2']);
					$aname = $users->GetUserVar($aid, 'username');
					$alook = $users->GetUserVar($aid, 'look');
			?>
			<div style="<?php if ($atype == "badge") { ?>height:170px; <?php } else { ?>height:120px;<?php } ?> background: url(http://www.habbo.de/habbo-imaging/avatarimage?figure=<?php echo $alook ?>) no-repeat;">
			<h2 style="padding-left:70px;"><?php echo $aname ?></h2>
			<?php if ($atype == "mission") { ?>
			<h3 style="padding-left:70px;">hat eine neue Mission: <?php echo $aextradata ?></h3>
			<?php } else if ($atype == "badge") { ?>
			<h3 style="padding-left:70px;">hat ein neues Badge erhalten</h3>
			<div style="background: url(http://images.lukadora.de/swf/c_images/Quests/ach_receive_star.png) no-repeat; background-position:70px 0px; padding-left:70px; width:109px; height:109px;">
			<img style="padding-top:30px; padding-left:30px;" src="http://images.lukadora.de/swf/c_images/album1584/<?php echo $aextradata ?>.gif">
			</div>
			<?php } ?>
			</div>
			
			
			<?php
			}
			
			?>
	<?php } else { ?>
			            <?php
			$q = "SELECT * FROM stream ORDER BY timestamp DESC";
			$getStreams = dbquery($q);
			while ($a = mysql_fetch_assoc($getStreams))
			{
					$aid = $a['userid'];
					$atype = clean($a['streamtype']);
					$aextradata = clean($a['extradata']);
					$aextradata2 = clean($a['extradata2']);
					$aname = $users->GetUserVar($aid, 'username');
					$alook = $users->GetUserVar($aid, 'look');
			?>
			<div style="<?php if ($atype == "badge") { ?>height:170px; <?php } else { ?>height:120px;<?php } ?> background: url(http://www.habbo.de/habbo-imaging/avatarimage?figure=<?php echo $alook; ?>) no-repeat;">
			<h2 style="padding-left:70px;"><?php echo $aname; ?></h2>
			<?php if ($atype == "mission") { ?>
			<h3 style="padding-left:70px;">hat eine neue Mission: <?php echo $aextradata; ?></h3>
			<?php } else if ($atype == "badge") { ?>
			<h3 style="padding-left:70px;">hat ein neues Badge erhalten</h3>
			<div style="background: url(http://images.lukadora.de/swf/c_images/Quests/ach_receive_star.png) no-repeat; background-position:70px 0px; padding-left:70px; width:109px; height:109px;">
			<img style="padding-top:30px; padding-left:30px;" src="http://images.lukadora.de/swf/c_images/album1584/<?php echo $aextradata; ?>.gif">
			</div>
			<?php } ?>
			</div>
			
			
			<?php
			}
			
			?>
	<?php } ?>



          </div>

    </div>

<div class="grey_box_bottom"><div class="box box_bottom"></div></div></div><div class="box_bottom_clear">&nbsp;</div></div>


<script type="text/javascript">
//<![CDATA[
zd.jsInitializers.push(["home/index",[]]);
//]]>
</script>



    </div>
  </div>

  <div id="sidebar">
  
<div class="widget draggable" id="widget_195433"><div class="blue_box_top"><a href="" class="widget_close_button" onclick="widgetManager.removeWidgetFromPage('home', 'index', 195433); return false;" style="display: none;" title="remove widget from this page"></a></div><div class="side-box-content">      <img src="http://images.habbo.com/c_images/article_images_us/article_newPurpleHeads2.gif" align="middle" alt="Habbo is here to Help!"><br><br>

Hey du!<br><br>

Willkommen beim Hotel Stream. Hier erf&auml;hrst du alles was im Hotel abgeht. <br><br>

</div>

</div>


  </div>
<?php } ?>