<?php

if(!isset($_REQUEST['rep'])) {
    include_once dirname(__FILE__).'/common.php';
    header('Location: ' . URL_ROOT . "$C_default_rep/tweetwall.php" );
    exit();
}

$rep = $_REQUEST['rep'];
include_once dirname(__FILE__).'/'.$rep.'/config.php';

include_once 'common.php';

$head_logo = URL_ROOT."$rep/images/head_logo.gif";
if($translate->_('config__head_logo') != 'config__head_logo' && $translate->_('config__head_logo') != null ) {
    $head_logo = URL_ROOT."$rep/".$translate->_('config__head_logo');
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd">

<html lang="<?php echo($actual); ?>">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Tweet Wall</title>
    <meta http-equiv="X-UA-Compatible" content="IE=9" />

    <!-- FONT -->
    <link href='<?php echo(registry_url('PT-Sans_Narrow','font'))?>' rel='stylesheet' type='text/css'>
    <link href='<?php echo(registry_url('PT-Sans','font'))?>' rel='stylesheet' type='text/css'>
    
    <!-- CSS -->
    <link rel="stylesheet" href="<?php echo(registry_url('tweetcast','css'));?>" type="text/css" media="screen, projection"/>

    <!-- JAVASCRIPT -->
    <script type="text/javascript" src="<?php echo(registry_url('jquery','js'))?>"></script>
    <script type="text/javascript" src="<?php echo(registry_url('jquery-mousewheel','js'))?>"></script>
    <script type="text/javascript" src="<?php echo(registry_url('jquery-scrollto','js'))?>"></script>
    <script type="text/javascript" src="<?php echo(registry_url('underscore','js'))?>"></script>
    <script type="text/javascript" src="<?php echo(registry_url('raphael','js'))?>"></script>
    
    <script type="text/javascript">
        <?php
        if (isset($config['tracking_keywords']) && count($config['tracking_keywords'])) {
            echo "var tracking_keywords = ".json_encode($config['tracking_keywords']).';';
        } elseif (isset($config['hashtag'])) {
            echo "var tracking_keywords = ".json_encode(array($config['hashtag'])).";";
        }
        ?>

        <?php if (isset($config['js_config'])) echo $config['js_config']; ?>
    </script>
    <?php if (isset($_SESSION['SOCIAL_ACCESS_TOKEN'])) { ?>
    <script type="text/javascript" src="<?php echo(registry_url('twcx-main','js'))?>"></script>
    <?php } ?>    
  </head>
  <body class="tweetwall">

        <div id="container">

                    <div class="barre">
                <img src="<?php echo($head_logo); ?>" width="171" height="63" />
                        <form id="recherche">
                            <input autocomplete="off" class="greyed" id="inp_q" value="<?php echo $translate->_('Rechercher'); ?>" />
                            <input id="inp_submit" type="submit" />
                            <input id="inp_reset" type="reset" />
                            <div id="time_controls">
                                <div id="time_legende"></div>
                                <div id="time_scale"></div>
                                <a href="#" id="time_zoomout"></a>
                                <a href="#" id="time_zoomin"></a>
                            </div>
                            <div id="recherche_annot">
                                <?php echo $translate->_('SearchByPolemic'); ?> : <span id="rech_list_annot"></span><br />
                            </div>
                        </form>
                    </div>
            
       <?php if (isset($_SESSION['SOCIAL_ACCESS_TOKEN'])) { ?>
                
                <div id="tweetviz">
                    <ul id="tweetlist"></ul>
                    <div id="timeline"></div>
                    <div id="scrollcont">
                        <div id="scrollin"></div>
                    </div>
                </div>
                
            <?php } else {?>
                
                <p class="connect-message"><a href="<?php echo URL_ROOT.$rep; ?>/client.php?CONNECT=true"><?php echo $translate->_('You must be connected with your account to read the conversation'); ?></a></p>
                
            <?php } ?>
            </div>
        </div>
<!--        <div id="hovertweet">
            <div id="hovercontent"></div>
            <div id="hoverarrow"></div>
</div> -->
  </body>
</html>