web/client.php
changeset 1571 4a1e6952afe5
parent 1560 d441b50586ba
child 1573 43dc356e3ff8
equal deleted inserted replaced
1570:c175d505e40d 1571:4a1e6952afe5
     9 $rep = $_REQUEST['rep'];
     9 $rep = $_REQUEST['rep'];
    10 include_once __DIR__.'/'.$rep.'/config.php';
    10 include_once __DIR__.'/'.$rep.'/config.php';
    11 
    11 
    12 include_once 'common.php';
    12 include_once 'common.php';
    13 
    13 
    14 
       
    15 /**
    14 /**
    16  * Do we already have a valid Access Token or need to go get one?
    15  * Do we already have a valid Access Token or need to go get one?
    17  */
    16  */
    18 if (!isset($_SESSION['SOCIAL_ACCESS_TOKEN']) && isset($_GET['CONNECT']) ) {
    17 if ((!isset($_SESSION['SOCIAL_ACCESS_TOKEN'])) && isset($_GET['CONNECT']) ) {
       
    18     
    19     // /**
    19     // /**
    20     //  * Guess we need to go get one!
    20     //  * Guess we need to go get one!
    21     //  */
    21     //  */
    22     // $token = $consumer->getRequestToken();
    22     // $token = $consumer->getRequestToken();
    23     // $_SESSION['TWITTER_REQUEST_TOKEN'] = serialize($token);
    23     // $_SESSION['TWITTER_REQUEST_TOKEN'] = serialize($token);
   133     }
   133     }
   134     <?php } ?>
   134     <?php } ?>
   135     </style>
   135     </style>
   136 
   136 
   137     <script type="text/javascript">
   137     <script type="text/javascript">
       
   138         var social_login_domain = "<?php echo($_SESSION['SOCIAL_LOGIN_DOMAIN']); ?>";
       
   139         var social_access_token = "<?php echo(unserialize($_SESSION['SOCIAL_ACCESS_TOKEN'])); ?>";
       
   140         var social_network = '<?php echo($config['social_network']); ?>' || 'Twitter';
       
   141         var social_group = "<?php echo($config['group']); ?>";
   138         <?php
   142         <?php
   139         echo "var social_network = '".$config['social_network']."';";
       
   140         if (isset($config['tracking_keywords']) && count($config['tracking_keywords'])) {
   143         if (isset($config['tracking_keywords']) && count($config['tracking_keywords'])) {
   141             echo "var tracking_keywords = ".json_encode($config['tracking_keywords']).';';
   144             echo "var tracking_keywords = ".json_encode($config['tracking_keywords']).';';
   142         } elseif (isset($config['hashtag'])) {
   145         } elseif (isset($config['hashtag'])) {
   143             echo "var tracking_keywords = ".json_encode(array($config['hashtag'])).";";
   146             echo "var tracking_keywords = ".json_encode(array($config['hashtag'])).";";
   144         }
   147         }
   154                 }
   157                 }
   155             }
   158             }
   156         }
   159         }
   157     </script>
   160     </script>
   158     <?php if (isset($_SESSION['SOCIAL_ACCESS_TOKEN'])) { ?>
   161     <?php if (isset($_SESSION['SOCIAL_ACCESS_TOKEN'])) { ?>
   159     <script type="text/javascript" src="<?php echo(URL_ROOT); ?>res/js/live-polemic.js"></script>
   162     <script type="text/javascript" src="<?php echo(URL_ROOT); ?>res/js/live-polemic.js" ></script>
   160     <?php } ?>
   163     <?php } ?>
   161 
       
   162     <script type="text/javascript">
   164     <script type="text/javascript">
   163 
   165 
   164     function add_grammar(value) {
   166     function add_grammar(value) {
   165         var _st = $('#status'),
   167         var _st = $('#status'),
   166             _val = _st.val();
   168             _val = _st.val();
   266                     $("#graphFrame").attr("src", hr);
   268                     $("#graphFrame").attr("src", hr);
   267                 }
   269                 }
   268                 return false;
   270                 return false;
   269             });
   271             });
   270 
   272 
   271 
       
   272         });
   273         });
   273 
   274 
   274         // hightlight
   275         // hightlight
   275         <?php
   276         <?php
   276         $effect = "highlight";
   277         $effect = "highlight";
   280         if( isset($_REQUEST['highlight']) && !empty($_REQUEST['highlight'])) { ?>
   281         if( isset($_REQUEST['highlight']) && !empty($_REQUEST['highlight'])) { ?>
   281         $(function() {
   282         $(function() {
   282             $("<?php echo $_REQUEST['highlight'];?>").delay(1000).effect("<?php echo $effect; ?>", {}, 5000);
   283             $("<?php echo $_REQUEST['highlight'];?>").delay(1000).effect("<?php echo $effect; ?>", {}, 5000);
   283         });
   284         });
   284         <?php } ?>
   285         <?php } ?>
       
   286 
   285         //<!-- LIMIT TEXTAREA:
   287         //<!-- LIMIT TEXTAREA:
   286         // End -->
   288         // End -->
   287 
   289 
   288     </script>
   290     </script>
   289   </head>
   291   </head>
   301                     $share_url = rtrim(URL_ROOT,"/").$rep;
   303                     $share_url = rtrim(URL_ROOT,"/").$rep;
   302                     $share_description = strip_tags(preg_replace('/<\s?br\s*\\?>/i', "\n", str_replace("&nbsp;", " ", $translate->_('config__abstract'))));
   304                     $share_description = strip_tags(preg_replace('/<\s?br\s*\\?>/i', "\n", str_replace("&nbsp;", " ", $translate->_('config__abstract'))));
   303                     ?>
   305                     ?>
   304                     <!-- cf. https://sharingbuttons.io/ -->
   306                     <!-- cf. https://sharingbuttons.io/ -->
   305                     <div class="share_toolbox">
   307                     <div class="share_toolbox">
   306                         <!-- Sharingbutton Twitter -->
       
   307                         <a class="resp-sharing-button__link" href="https://twitter.com/intent/tweet/?text=<?php echo urlencode("$share_title - $share_url"); ?>&amp;url=<?php echo rawurlencode($share_url); ?>" target="_blank" rel="noopener" aria-label="">
       
   308                           <div class="resp-sharing-button resp-sharing-button--twitter resp-sharing-button--small"><div aria-hidden="true" class="resp-sharing-button__icon resp-sharing-button__icon--solid">
       
   309                             <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M23.44 4.83c-.8.37-1.5.38-2.22.02.93-.56.98-.96 1.32-2.02-.88.52-1.86.9-2.9 1.1-.82-.88-2-1.43-3.3-1.43-2.5 0-4.55 2.04-4.55 4.54 0 .36.03.7.1 1.04-3.77-.2-7.12-2-9.36-4.75-.4.67-.6 1.45-.6 2.3 0 1.56.8 2.95 2 3.77-.74-.03-1.44-.23-2.05-.57v.06c0 2.2 1.56 4.03 3.64 4.44-.67.2-1.37.2-2.06.08.58 1.8 2.26 3.12 4.25 3.16C5.78 18.1 3.37 18.74 1 18.46c2 1.3 4.4 2.04 6.97 2.04 8.35 0 12.92-6.92 12.92-12.93 0-.2 0-.4-.02-.6.9-.63 1.96-1.22 2.56-2.14z"/></svg>
       
   310                             </div>
       
   311                           </div>
       
   312                         </a>
       
   313 
       
   314                         <!-- Sharingbutton Facebook -->
       
   315                         <a class="resp-sharing-button__link" href="https://facebook.com/sharer/sharer.php?t=<?php echo rawurlencode($share_title); ?>&amp;u=<?php echo rawurlencode($share_url); ?>" target="_blank" rel="noopener" aria-label="">
       
   316                           <div class="resp-sharing-button resp-sharing-button--facebook resp-sharing-button--small"><div aria-hidden="true" class="resp-sharing-button__icon resp-sharing-button__icon--solid">
       
   317                             <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.77 7.46H14.5v-1.9c0-.9.6-1.1 1-1.1h3V.5h-4.33C10.24.5 9.5 3.44 9.5 5.32v2.15h-3v4h3v12h5v-12h3.85l.42-4z"/></svg>
       
   318                             </div>
       
   319                           </div>
       
   320                         </a>
       
   321 
       
   322                         <!-- Sharingbutton Telegram -->
       
   323                         <a class="resp-sharing-button__link" href="https://telegram.me/share/url?text=<?php echo rawurlencode("$share_description"); ?>&amp;url=<?php echo rawurlencode($share_url); ?>" target="_blank" rel="noopener" aria-label="">
       
   324                           <div class="resp-sharing-button resp-sharing-button--telegram resp-sharing-button--small"><div aria-hidden="true" class="resp-sharing-button__icon resp-sharing-button__icon--solid">
       
   325                               <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M.707 8.475C.275 8.64 0 9.508 0 9.508s.284.867.718 1.03l5.09 1.897 1.986 6.38a1.102 1.102 0 0 0 1.75.527l2.96-2.41a.405.405 0 0 1 .494-.013l5.34 3.87a1.1 1.1 0 0 0 1.046.135 1.1 1.1 0 0 0 .682-.803l3.91-18.795A1.102 1.102 0 0 0 22.5.075L.706 8.475z"/></svg>
       
   326                             </div>
       
   327                           </div>
       
   328                         </a>
       
   329 
       
   330                         <!-- Sharingbutton E-Mail -->
   308                         <!-- Sharingbutton E-Mail -->
   331                         <a class="resp-sharing-button__link" href="mailto:?subject=<?php echo rawurlencode($share_title); ?>&amp;body=<?php echo rawurlencode("$share_description - $share_url"); ?>" target="_self" rel="noopener" aria-label="">
   309                         <a class="resp-sharing-button__link" href="mailto:?subject=<?php echo rawurlencode($share_title); ?>&amp;body=<?php echo rawurlencode("$share_description - $share_url"); ?>" target="_self" rel="noopener" aria-label="">
   332                           <div class="resp-sharing-button resp-sharing-button--email resp-sharing-button--small"><div aria-hidden="true" class="resp-sharing-button__icon resp-sharing-button__icon--solid">
   310                           <div class="resp-sharing-button resp-sharing-button--email resp-sharing-button--small"><div aria-hidden="true" class="resp-sharing-button__icon resp-sharing-button__icon--solid">
   333                             <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M22 4H2C.9 4 0 4.9 0 6v12c0 1.1.9 2 2 2h20c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zM7.25 14.43l-3.5 2c-.08.05-.17.07-.25.07-.17 0-.34-.1-.43-.25-.14-.24-.06-.55.18-.68l3.5-2c.24-.14.55-.06.68.18.14.24.06.55-.18.68zm4.75.07c-.1 0-.2-.03-.27-.08l-8.5-5.5c-.23-.15-.3-.46-.15-.7.15-.22.46-.3.7-.14L12 13.4l8.23-5.32c.23-.15.54-.08.7.15.14.23.07.54-.16.7l-8.5 5.5c-.08.04-.17.07-.27.07zm8.93 1.75c-.1.16-.26.25-.43.25-.08 0-.17-.02-.25-.07l-3.5-2c-.24-.13-.32-.44-.18-.68s.44-.32.68-.18l3.5 2c.24.13.32.44.18.68z"/></svg>
   311                             <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M22 4H2C.9 4 0 4.9 0 6v12c0 1.1.9 2 2 2h20c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zM7.25 14.43l-3.5 2c-.08.05-.17.07-.25.07-.17 0-.34-.1-.43-.25-.14-.24-.06-.55.18-.68l3.5-2c.24-.14.55-.06.68.18.14.24.06.55-.18.68zm4.75.07c-.1 0-.2-.03-.27-.08l-8.5-5.5c-.23-.15-.3-.46-.15-.7.15-.22.46-.3.7-.14L12 13.4l8.23-5.32c.23-.15.54-.08.7.15.14.23.07.54-.16.7l-8.5 5.5c-.08.04-.17.07-.27.07zm8.93 1.75c-.1.16-.26.25-.43.25-.08 0-.17-.02-.25-.07l-3.5-2c-.24-.13-.32-.44-.18-.68s.44-.32.68-.18l3.5 2c.24.13.32.44.18.68z"/></svg>
   334                             </div>
   312                             </div>
   391                 <ul class="accordeon">
   369                 <ul class="accordeon">
   392                     <li class="acctitre" id="event-title">
   370                     <li class="acctitre" id="event-title">
   393                         <h3><?php echo($translate->_('config__title')); ?></h3>
   371                         <h3><?php echo($translate->_('config__title')); ?></h3>
   394                     </li>
   372                     </li>
   395                     <li class="acctexte acclimited" id="event-description">
   373                     <li class="acctexte acclimited" id="event-description">
   396                         <p><?php echo($translate->_('config__description')); ?></p>
   374                         <?php echo($translate->_('config__description')); ?>
   397                     </li>
   375                     </li>
   398                     <li class="acctitre">
   376                     <li class="acctitre">
   399                         <h3><?php echo($translate->_('keywords')); ?></h3>
   377                         <h3><?php echo($translate->_('keywords')); ?></h3>
   400                     </li>
   378                     </li>
   401                     <li>
   379                     <li>
   422                             </li>
   400                             </li>
   423                         </ul>
   401                         </ul>
   424                     </li>
   402                     </li>
   425                 </ul>
   403                 </ul>
   426                 <p id="iri_logo" style="text-align:right;">
   404                 <p id="iri_logo" style="text-align:right;">
   427                     Powered by <a href="http://www.iri.centrepompidou.fr" target="_blank"><img src="<?php echo(URL_ROOT); ?>images/logo_iri_bleu_transparent_petit.png" alt="logo IRI"/></a
   405                     Powered by <a href="http://www.iri.centrepompidou.fr" target="_blank"><img src="<?php echo(URL_ROOT); ?>images/logo_iri_bleu_transparent_petit.png" alt="logo IRI"/></a>
   428                 </p>
   406                 </p>
   429             </div>
   407             </div>
   430             <div id="colgauche">
   408             <div id="colgauche">
   431                 <div class="barre">
   409                 <div class="barre">
   432                     <img id="headlogo" src="<?php echo($head_logo); ?>" width="171" height="63" />
   410                     <img id="headlogo" src="<?php echo($head_logo); ?>" width="171" height="63" />
   449                         </li>
   427                         </li>
   450                     </ul>
   428                     </ul>
   451                     <ul class="menu">
   429                     <ul class="menu">
   452                         <li>
   430                         <li>
   453                             <a href="<?php URL_ROOT ?>client.php?lang=ja_JP" class="menuLink" >
   431                             <a href="<?php URL_ROOT ?>client.php?lang=ja_JP" class="menuLink" >
   454                                 <img src='<?php echo(URL_ROOT); ?>images/flag_jp.gif'<?php if($actual!="ja_JP"){echo("style='opacity: .5;'"); } ?> />
   432                                 <img src='<?php echo(URL_ROOT); ?>images/flag_jp.gif' <?php if($actual!="ja_JP"){echo("style='opacity: .5;'"); } ?> />
   455                                 <?php print $translate->_("Japonais"); ?>
   433                                 <?php print $translate->_("Japonais"); ?>
   456                             </a></li>
   434                             </a></li>
   457                         <li>
   435                         <li>
   458                             <a href="<?php URL_ROOT ?>client.php?lang=fr" class="menuLink">
   436                             <a href="<?php URL_ROOT ?>client.php?lang=fr" class="menuLink">
   459                                 <img src='<?php echo(URL_ROOT); ?>images/flag_fr.gif' <?php if($actual!="fr"){echo("style='opacity: .5;'"); } ?> />
   437                                 <img src='<?php echo(URL_ROOT); ?>images/flag_fr.gif' <?php if($actual!="fr"){echo("style='opacity: .5;'"); } ?> />
   479                                 $loginform  = "<div class='loginbutton'>";
   457                                 $loginform  = "<div class='loginbutton'>";
   480                                 $socialNetwork = isset($config['social_network'])?$config['social_network']:'Twitter';
   458                                 $socialNetwork = isset($config['social_network'])?$config['social_network']:'Twitter';
   481                                 if($socialNetwork === 'Twitter') {
   459                                 if($socialNetwork === 'Twitter') {
   482                                     $loginform .= "<a href='".URL_ROOT."$rep/client.php?CONNECT=true' target='_top' class='loginlink'>".$translate->_("Vous n'êtes pas connecté.")."</a>";
   460                                     $loginform .= "<a href='".URL_ROOT."$rep/client.php?CONNECT=true' target='_top' class='loginlink'>".$translate->_("Vous n'êtes pas connecté.")."</a>";
   483                                 } else {
   461                                 } else {
   484                                     $loginform .= "<form action='".URL_ROOT."$rep/client.php' method='GET' target='_top'>";
   462                                     $loginform .= "<ul>";
       
   463                                     $loginform .= "<li><form action='".URL_ROOT."$rep/client.php' method='GET' target='_top'>";
   485                                     $loginform .= "<div class='loginlink'>".$translate->_("Vous n'êtes pas connecté.")."</div>";
   464                                     $loginform .= "<div class='loginlink'>".$translate->_("Vous n'êtes pas connecté.")."</div>";
   486                                     $loginform .= "<input type='text' id='social_domain' name='CONNECT' value='mastodon.svc.iri-research.org'/>";
   465                                     $loginform .= "<input type='text' id='social_domain' name='CONNECT' value='mastodon.svc.iri-research.org'/>";
   487                                     $loginform .= "<input type='submit' value='Connect'/>";
   466                                     $loginform .= "<input type='submit' value='Connect'/>";
   488                                     $loginform .= "</form>";    
   467                                     $loginform .= "</form></li>";
       
   468                                     $loginform .= "<li>Suive l'utlisateur <code>".$config['group']."</code></li>";
       
   469 
   489                                 }
   470                                 }
   490                                 $loginform .= "</div>";
   471                                 $loginform .= "</div>";
   491                                 echo($loginform);
   472                                 echo($loginform);
   492                             } else {
   473                             } else {
   493                                 echo('<form  action="tweet.php" method="post" id="statusform" >');
   474                                 echo('<form  action="tweet.php" method="post" id="statusform" >');
   549                     </div>
   530                     </div>
   550                 </div>
   531                 </div>
   551 
   532 
   552             <?php } else {?>
   533             <?php } else {?>
   553 
   534 
   554                 <p class="connect-message"><a href="<?php echo URL_ROOT.$rep; ?>/client.php?CONNECT=mastodon.svc.iri-research.org"><?php echo $translate->_('You must be connected with your Twitter account to read the conversation'); ?></a></p>
   535                 <p class="connect-message"><a href="<?php echo URL_ROOT.$rep; ?>/client.php?CONNECT=mastodon.svc.iri-research.org"><?php echo $translate->_('You must be connected with your account to read the conversation'); ?></a></p>
   555 
   536 
   556             <?php } ?>
   537             <?php } ?>
   557 
   538 
   558             </div>
   539             </div>
   559             <?php $pad_url = $translate->_('config__pad_url');?>
   540             <?php $pad_url = $translate->_('config__pad_url');?>