web/client_live.php
changeset 248 ffb0a6d08000
parent 247 e6b328970ee8
parent 239 66ac54f9dbf6
child 249 b31aef9365a8
equal deleted inserted replaced
247:e6b328970ee8 248:ffb0a6d08000
     1 <?php
       
     2 
       
     3 /**
       
     4  * include some common code (like we did in the 90s)
       
     5  * People still do this? ;)
       
     6  */
       
     7 include_once './common.php';
       
     8 
       
     9 /**
       
    10  * Do we already have a valid Access Token or need to go get one?
       
    11  */
       
    12 if (!isset($_SESSION['TWITTER_ACCESS_TOKEN']) && isset($_GET['CONNECT']) ) {
       
    13     /**
       
    14      * Guess we need to go get one!
       
    15      */
       
    16     $token = $consumer->getRequestToken();
       
    17     $_SESSION['TWITTER_REQUEST_TOKEN'] = serialize($token);
       
    18 
       
    19     /**
       
    20      * Now redirect user to Twitter site so they can log in and
       
    21      * approve our access
       
    22      */
       
    23     $consumer->redirect();
       
    24 }
       
    25 
       
    26 /* CLIENT VAR LIVE */
       
    27 
       
    28 $C_hashtag= "#THD12";
       
    29 $C_link  = "http://www.portailthd.fr/";
       
    30 $C_title = "Bilan du projet Plateforme THD";
       
    31 $C_REP   = "thd/";
       
    32 $C_description  = "12 mai 2011<br/>
       
    33 Centre Pompidou<br/>
       
    34 <br/>
       
    35 Les acteurs de la plateforme THD et les organismes qui ont soutenu le projet se retrouvent le 12 mai 2011 pour faire le bilan de trois années d’actions prospectives et d’études d’usages autour de plus de 30 expérimentations de nouveaux services.
       
    36 ";
       
    37 
       
    38 $C_partenaires  = "
       
    39 		 <a href='http://www.iri.centrepompidou.fr/' class='footerLink' target='_blank'>
       
    40  IRI </a>
       
    41 		 |  <a href='http://www.capdigital.com/' class='footerLink' target='_blank'>Cap Digital</a>
       
    42 		 |  <a href='http://www.portailthd.fr/' class='footerLink' target='_blank'>Portail THD</a>";
       
    43 
       
    44 ?>
       
    45 
       
    46 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
       
    47    "http://www.w3.org/TR/html4/strict.dtd">
       
    48 
       
    49 <html lang="<?php echo($actual); ?>">
       
    50   <head>
       
    51     <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
       
    52     <title>Bilan du projet Plateforme THD</title>
       
    53 	<meta http-equiv="X-UA-Compatible" content="IE=8" /> 
       
    54 
       
    55     <!-- Framework CSS -->
       
    56     <link rel="stylesheet" href="res/blueprint/screen.css" type="text/css" media="screen, projection">
       
    57     <link rel="stylesheet" href="res/blueprint/print.css" type="text/css" media="print">
       
    58     <!--[if lt IE 8]><link rel="stylesheet" href="blueprint/ie.css" type="text/css" media="screen, projection"><![endif]-->
       
    59 	<link rel="stylesheet" href="res/blueprint/plugins/fancy-type/screen.css" type="text/css" media="screen, projection">
       
    60 	<link rel="stylesheet" href="res/css/custom.css" type="text/css" media="screen, projection">
       
    61 	<link rel="stylesheet" type="text/css" href="res/jquery.fancybox/fancybox/jquery.fancybox-1.3.4.css" media="screen">
       
    62 	<link rel="stylesheet" type="text/css" href="res/niceforms/niceforms-custom.css" media="screen" >
       
    63 
       
    64 	<!-- JAVASCRIPT --> 
       
    65 	<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
       
    66 	<script type="text/javascript" src="res/jquery.fancybox/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
       
    67 	<script type="text/javascript" src="res/metadataplayer/res/js/jquery.tools.min.js"></script>
       
    68 	<script type="text/javascript" src="res/niceforms/niceforms.js"></script>
       
    69 	<script src="http://widgets.twimg.com/j/2/widget.js"></script>
       
    70 	
       
    71 	<!-- FONT -->
       
    72 	<link href='http://fonts.googleapis.com/css?family=PT+Sans+Narrow&subset=latin' rel='stylesheet' type='text/css'>
       
    73 	<link href='http://fonts.googleapis.com/css?family=PT+Sans&subset=latin' rel='stylesheet' type='text/css'>
       
    74 	<link href='http://fonts.googleapis.com/css?family=Geo&subset=latin' rel='stylesheet' type='text/css'>
       
    75 
       
    76 	<script type="text/javascript">	
       
    77 	$(document).ready(function() {
       
    78 
       
    79 			doTimer();
       
    80 			//$("txt").hide();
       
    81 			$(".loginbutton").click(function() {
       
    82 				document.location.href="<?php URL_ROOT ?>?CONNECT=true";
       
    83 			});
       
    84 			$("#IDENTIFIER").click(function() {
       
    85 				document.location.href="<?php URL_ROOT ?>?CONNECT=true";
       
    86 			});
       
    87 			
       
    88 			$("#messageSuccess").hide();
       
    89 			$("#messageFailed").hide();
       
    90 			$("#txt").hide();
       
    91 			
       
    92 			// BUTTONS
       
    93 			$("#positive").click(function(){
       
    94 				var MyValue = $('#status').attr("value");
       
    95 				 $('#status').attr("value",MyValue+"++ ");
       
    96 			});
       
    97 			$("#negative").click(function(){
       
    98 				var MyValue = $('#status').attr("value");
       
    99 				$('#status').attr("value",MyValue+"-- ");
       
   100 			});
       
   101 			$("#reference").click(function(){
       
   102 				var MyValue = $('#status').attr("value");
       
   103 				$('#status').attr("value",MyValue+"== ");
       
   104 			});
       
   105 			$("#question").click(function(){
       
   106 				var MyValue = $('#status').attr("value");
       
   107 				$('#status').attr("value",MyValue+"?? ");
       
   108 			});
       
   109 			
       
   110 			// SEND TWEETS 
       
   111 			$("#sendTweet").click(function(){
       
   112 				var MyStatus = $('#status').attr("value");
       
   113 				$.post('tweet_ajax.php', {status:MyStatus}
       
   114 				,function(data) {
       
   115 				
       
   116 					if(data=="true"){
       
   117 						$("#messageSuccess").show('fast');
       
   118 						$("#messageSuccess").delay(800).hide('slow');
       
   119 						$('#status').attr("value","#THD12");
       
   120 					}else{
       
   121 						$("#error").text(data);
       
   122 						$("#messageFailed").show('fast');
       
   123 						$("#messageFailed").delay(800).hide('slow');
       
   124 					}
       
   125 					
       
   126 				});
       
   127 				
       
   128 			});			
       
   129 			
       
   130 			$(".timeFrame").tooltip();
       
   131 			/*
       
   132 			*   Lightbox button 
       
   133 			*/
       
   134 			$("#About").fancybox({
       
   135 				'titlePosition'		: 'inside',
       
   136 				'transitionIn'		: 'none',
       
   137 				'transitionOut'		: 'none',
       
   138 				'enableEscapeButton': 'none',
       
   139 				'margin' 			: 1,
       
   140 				'padding' 			: 0
       
   141 			}<?php if (!isset($_SESSION['TWITTER_ACCESS_TOKEN'])){echo(").trigger('click');");}else{echo(");");} ?>
       
   142 			
       
   143 			
       
   144 			$("#Program").fancybox({
       
   145 				'width'				: '75%',
       
   146 				'height'			: '75%',
       
   147 				'autoScale'			: false,
       
   148 				'transitionIn'		: 'none',
       
   149 				'transitionOut'		: 'none',
       
   150 				'type'				: 'iframe'
       
   151 			});
       
   152 
       
   153 			$("#Video_ldt").fancybox({
       
   154 				'width'				: 1021,
       
   155 				'height'			: 661,
       
   156 				'autoScale'			: false,
       
   157 				'transitionIn'		: 'none',
       
   158 				'transitionOut'		: 'none',
       
   159 				'type'				: 'iframe'
       
   160 			});
       
   161 			
       
   162 			$("#ACCES").click(function() {
       
   163 				$.fancybox.close();
       
   164 			});
       
   165 			
       
   166 			// Buttons 
       
   167 			
       
   168 		
       
   169 		});
       
   170 		
       
   171 		
       
   172 		<!-- LIMIT TEXTAREA:
       
   173 		function imposemax(Object)
       
   174 		{
       
   175 		  return (Object.value.length <= 140);
       
   176 		}
       
   177 		// End -->
       
   178 		
       
   179 		<!-- TIMER 
       
   180 		var c=0;
       
   181 		var t;
       
   182 		var timer_is_on=0;
       
   183 
       
   184 		function timedCount()
       
   185 		{
       
   186 			document.getElementById('txt').value=c;
       
   187 			c = c+1;
       
   188 			t = window.setTimeout("timedCount()",1000);
       
   189 			$(".twtr-ft").hide();
       
   190 			$(".twtr-hd").hide();
       
   191 			//twtr-tweet
       
   192 			$(".twtr-tweet").each(colorTweetings);
       
   193 		
       
   194 		}
       
   195 
       
   196 		function colorTweetings (){
       
   197 				var tweettemp = $(this).html();
       
   198 				if (tweettemp.search(/\x3F\x3F/)!=-1){
       
   199 					 $(this).css({'background-color': '#bfdbec','color':"#000"});
       
   200 				}
       
   201 				if (tweettemp.search(/\x2B\x2B/)!=-1){
       
   202 					 $(this).css({'background-color': '#c5e7cd','color':"#fff"});
       
   203 				}
       
   204 				if (tweettemp.search(/\x2D\x2D/)!=-1){
       
   205 					 $(this).css({'background-color': '#f6ced0','color':"#fff"});
       
   206 				}
       
   207 				if (tweettemp.search(/\x3D\x3D/)!=-1){
       
   208 					 $(this).css({'background-color': '#ecedc1','color':"#000"});
       
   209 				}
       
   210 		};
       
   211 			
       
   212 
       
   213 		
       
   214 		function doTimer()
       
   215 		{
       
   216 		if (!timer_is_on)
       
   217 		  {
       
   218 		  timer_is_on=1;
       
   219 		  timedCount();
       
   220 		  }
       
   221 		}
       
   222 
       
   223 		function stopCount()
       
   224 		{
       
   225 			clearTimeout(t);
       
   226 			timer_is_on=0;
       
   227 		}
       
   228 		//
       
   229 		//-->
       
   230 	</script>
       
   231 	
       
   232 	<script type="text/javascript">
       
   233 	
       
   234 	  var _gaq = _gaq || [];
       
   235 	  _gaq.push(['_setAccount', 'UA-23581291-1']);
       
   236 	  _gaq.push(['_setDomainName', '.iri.centrepompidou.fr']);
       
   237 	  _gaq.push(['_trackPageview']);
       
   238 	
       
   239 	  (function() {
       
   240 	    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
       
   241 	    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
       
   242 	    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
       
   243 	  })();
       
   244 	
       
   245 	</script>
       
   246 	
       
   247   </head>
       
   248   <body>
       
   249     <div class="container">
       
   250       <img src="images/ENMI_2010_logo.gif" class="Producteur logo">
       
   251 		<div id="minilogo" style="margin-left:85px;height:5px;top:5px;"></div>
       
   252 	  <ul class="menu"> 
       
   253 	  <li class="menuUnderline"><a href="index.php" class="menuLink">
       
   254 	  	<?php print $translate->_("Accueil"); ?> </a></li>
       
   255 	  <li class="menuUnderline" ><a href="<?php echo($C_link); ?>" class="menuLink" target="_blank" id='Program'> 
       
   256 	  	<?php print $translate->_("Programme"); ?></a></li>
       
   257 	  <li ><a href="about.php" class="menuLink" >
       
   258 	  	<?php print $translate->_("A propos"); ?></a></li>
       
   259 
       
   260 	  </ul>
       
   261 	  
       
   262 	  	  <ul class="menu" > 
       
   263 	  <li class="menuUnderline"><a href="<?php URL_ROOT ?>?lang=ja_JP" class="menuLink" >
       
   264 	       <img src='images/flag_jp.gif'<?php if($actual!="ja_JP"){echo("style='opacity: .5;'"); } ?> />
       
   265 	        <?php print $translate->_("Japonais"); ?></a></li>
       
   266 	  <li class="menuUnderline"><a href="<?php URL_ROOT ?>?lang=fr" class="menuLink">
       
   267 	       <img src='images/flag_fr.gif' <?php if($actual!="fr"){echo("style='opacity: .5;'"); } ?> />
       
   268 	       <?php print $translate->_("Français"); ?></a></li>
       
   269 	  <li ><a href="<?php URL_ROOT ?>?lang=en" class="menuLink">
       
   270 	       <img src='images/flag_en.gif' <?php if($actual!="en"){echo("style='opacity: .5;'"); } ?> />
       
   271 	       <?php print $translate->_("Anglais"); ?></a></li>
       
   272 	  </ul>
       
   273 
       
   274 	  
       
   275 	  <div class="videoLive">
       
   276 		<div class="videoLivePlayer">
       
   277 			<object id="player" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" name="player" width="500" height="375"> 
       
   278 				<param name="movie" value="res/mediaplayer/player.swf" /> 
       
   279 				<param name="allowfullscreen" value="true" /> 
       
   280 				<param name="allowscriptaccess" value="always" /> 
       
   281 				<param name="wmode" value="transparent" />
       
   282 				<param name="flashvars" value="autostart=true&live=true&image=images/bgd_player_thd.png&provider=rtmp&streamer=rtmp://media.iri.centrepompidou.fr/ddc_player/&file=livestream&controlbar=none&autostart=true" /> 
       
   283 				<embed 
       
   284 					type="application/x-shockwave-flash"
       
   285 					id="player2"
       
   286 					name="player2"
       
   287 					src="res/mediaplayer/player.swf" 
       
   288 					width="500" 
       
   289 					height="375"
       
   290 					allowscriptaccess="always" 
       
   291 					allowfullscreen="true"
       
   292 					wmode="transparent"
       
   293 					flashvars="autostart=true&live=true&provider=rtmp&streamer=rtmp://media.iri.centrepompidou.fr/ddc_player/&file=livestream&image=images/bgd_player_thd.png&controlbar=none&autostart=true" 
       
   294 					
       
   295 				/> 
       
   296 			</object> 
       
   297 			
       
   298 		</div>	
       
   299 		
       
   300 	  </div>
       
   301 
       
   302 	<div class="videoLiveProgram">	
       
   303 		
       
   304 		<div class="arrowContainer">
       
   305 			<div class="arrow"> </div>
       
   306 		</div>
       
   307 		<div class="videoLiveProgramTitle">
       
   308 			<b><?php echo($C_title); ?></b></div>
       
   309 		<div class="videoLiveProgramDescription">
       
   310 			<br><?php echo($C_description); ?></div>
       
   311 		
       
   312 		
       
   313 	</div>
       
   314 	  
       
   315 	  <div class="tweetWriter">
       
   316 		<h3 class="tweetWriterTitle"><?php print $translate->_("ClientTitle1 :"); ?></h3>
       
   317 		<form  action="tweet.php" method="post" id="statusform" >
       
   318 		<?php if (!isset($_SESSION['TWITTER_ACCESS_TOKEN'])){
       
   319 				echo("<div class='loginbutton' ><a href='".URL_ROOT."?CONNECT=true' class='loginlink'>
       
   320 				".$translate->_("Vous n'êtes pas connecté.")."</a></div>");
       
   321 			  }else{
       
   322 				echo("<textarea name='status' id='status' rows='3' cols='50' onkeypress='return imposemax(this);'>".$C_hashtag."</textarea>");
       
   323 			  }
       
   324 		?>
       
   325 
       
   326 
       
   327 				<div id="messageSuccess" style="background-color:lightgreen;">
       
   328 					<?php print $translate->_("Envoyé"); ?><br><br>
       
   329 				</div>
       
   330 				
       
   331 				<div id="messageFailed" style="background-color:red;">
       
   332 					<?php print $translate->_("Erreur1"); ?><div id="error">&nbsp;</div><br/><br>
       
   333 				</div>
       
   334 
       
   335 			  
       
   336 			
       
   337 			<a class="button_w" href="#"  id="sendTweet" style="float:right;margin-right:15px;margin-left:35px;width:70px;" >
       
   338 			<span><?php print $translate->_("Envoyer"); ?></span></a> 
       
   339 			<!--<button name="s" type="button" id="sendTweet"
       
   340 					style="float:right;margin-right:15px;margin-left:35px;width:70px;"  >Envoyer</button>-->
       
   341 			<a 
       
   342 					
       
   343 					id="positive"
       
   344 					title="accord"
       
   345 					class="tweetButton">++</a>
       
   346 			<a 
       
   347 					
       
   348 					id="negative"
       
   349 					title="désaccord"
       
   350 					class="tweetButton">--</a>
       
   351 			<a
       
   352 					
       
   353 					id="reference"
       
   354 					title="reference"
       
   355 					class="tweetButton">==</a>
       
   356 			<a 
       
   357 					
       
   358 					id="question"  
       
   359 					title="question"
       
   360 					class="tweetButton"> ??</a>
       
   361 		</form>
       
   362 	  </div>
       
   363 	  
       
   364 	  <div class="tweetReader">
       
   365 			<script>
       
   366 				new TWTR.Widget({
       
   367 				  version: 2,
       
   368 				  type: 'search',
       
   369 				  search: '<?php echo($C_hashtag); ?>',
       
   370 				  interval: 1000,
       
   371 				  title: '',
       
   372 				  subject: '',
       
   373 				  width: 377,
       
   374 				  height: 450,
       
   375 				  theme: {
       
   376 					shell: {
       
   377 					  background: '#ffffff',
       
   378 					  color: '#ffffff'
       
   379 					},
       
   380 					tweets: {
       
   381 					  background: '#ffffff',
       
   382 					  color: '#444444',
       
   383 					  links: '#1985b5'
       
   384 					}
       
   385 				  },
       
   386 				  features: {
       
   387 					scrollbar: false,
       
   388 					loop: true,
       
   389 					live: true,
       
   390 					hashtags: true,
       
   391 					timestamp: true,
       
   392 					avatars: true,
       
   393 					toptweets: true,
       
   394 					behavior: 'default'
       
   395 				  }
       
   396 				}).render().start();
       
   397 			</script>
       
   398 	  </div>
       
   399 
       
   400       <div class="footer">
       
   401 		<hr>
       
   402 		 <?php 
       
   403 				echo($C_partenaires);
       
   404 				
       
   405 				if (isset($_SESSION['TWITTER_ACCESS_TOKEN'])){
       
   406 					echo("| 	<a href='clear.php'  class='footerLink'>".$translate->_("D&eacute;connexion")."</a>");
       
   407 				}
       
   408 		 ?>
       
   409 		  <input type="text" id="txt" size="3"/>
       
   410 		  
       
   411 	  </div>   
       
   412 	
       
   413 
       
   414     </div>
       
   415 	
       
   416 	<!-- LIGHTBOX --> 
       
   417 	<div style="display:none;">
       
   418 		<div id="Aboutbox" >
       
   419 		<div class="lightBorder">
       
   420 			<div class="lightTitle" style="height:45px;">&nbsp;  </div>
       
   421 			<div class="lightSubTitle"><?php print $translate->_("splatchPageTitle"); ?></div>
       
   422 			<div class="lightDescription"><?php print $translate->_("splatchPageText"); ?></div>
       
   423 			<div>
       
   424 				<br/>
       
   425 				<a class="button_b" href="#"  id="IDENTIFIER"><span><?php print $translate->_("S&apos;identifier"); ?></span></a> <br/><br/>
       
   426 				<a class="button_w" href="#"  id="ACCES"><span><?php print $translate->_("Libre accès"); ?></span></a> 
       
   427 			</div>
       
   428 		</div>
       
   429 		</div>
       
   430 	</div>
       
   431 	<!-- END LIGHTBOX -->
       
   432 
       
   433 	
       
   434   </body>
       
   435 </html>