Advertisement
Ceron

Forest's Stickfights

May 18th, 2012
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 6.74 KB | None | 0 0
  1. <?php
  2.     function getInfoText($filename)
  3.     {
  4.         $text = '';
  5.         if(file_exists($filename . '.txt'))
  6.         {
  7.             $filename .= '.txt';
  8.             $filehandle = fopen($filename,'r');
  9.             while(!feof($filehandle))
  10.             {
  11.                 $text .= fgets($filehandle) . '<br>';
  12.             }
  13.             fclose($filehandle);
  14.         }
  15.         else
  16.         {
  17.             $text = 'Zu ' . $filename . ' ist leider keine Information vorhanden.';
  18.         }
  19.         return $text;
  20.     }
  21. ?>
  22. <html>
  23.     <head>
  24.         <meta property="og:title" content="ForestsStickfights" />
  25.         <meta property="og:type" content="website" />
  26.         <meta property="og:url" content="http://darkmidget.da.funpic.de/forest/steff/" />
  27.         <meta property="og:image" content="http://darkmidget.da.funpic.de/forest/steff/logoSAM.png" />
  28.         <meta property="og:site_name" content="Forest&#039;s Stickfights" />
  29.         <meta property="fb:admins" content="1556201228" />
  30.         <style type="text/css">
  31.             body{
  32.                  background-color:#646464;
  33.                  padding:0px;
  34.                 }
  35.             #content{
  36.                  background-color:#999999;
  37.                  width:900px;
  38.                  height:auto;
  39.                  margin:0px auto;
  40.                  outline: 2px solid black;
  41.             }
  42.             #headline{
  43.                 margin:0px auto;
  44.                 width:850px;
  45.                 height:115;
  46.                 font-size: 40px;
  47.                 font-weight: bold;
  48.                 border-bottom: 1px solid black;
  49.                 background-image:url('stickheader2.gif');
  50.                 background-position:-55 -45;
  51.             }
  52.             #line{
  53.                 border-bottom: 3px dotted black;
  54.                 margin:10px 0px;
  55.             }
  56.             #flashcontainer{
  57.                 margin: 25px 150px;
  58.                 padding-bottom:50px;
  59.             }
  60.             select{
  61.                background: #CCC;
  62.                border: 1px solid #333;
  63.             }
  64.             .infobox{
  65.                 background-color:#555555;
  66.                 padding:10px;
  67.                 display:none;
  68.             }
  69.             .stickfight{
  70.                 margin:0px;
  71.                 width:600px;
  72.             }
  73.             img{
  74.                 position:fixed;
  75.                 right:15px;
  76.                 top:80px;
  77.             }
  78.         </style>
  79.     </head>
  80.     <body>
  81.                         <div style="float:right;margin-top:7px;position:fixed;right:15px;z-index:10;" class="fb-like" data-href="http://darkmidget.da.funpic.de/forest/steff/" data-send="false" data-layout="box_count" data-width="100" data-show-faces="true" data-colorscheme="dark" data-font="arial"></div>
  82.         <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.js"></script>
  83.         <div id="fb-root"></div>
  84.         <script>(function(d, s, id) {
  85.             var js, fjs = d.getElementsByTagName(s)[0];
  86.             if (d.getElementById(id)) return;
  87.             js = d.createElement(s); js.id = id;
  88.             js.src = "//connect.facebook.net/de_DE/all.js#xfbml=1";
  89.             fjs.parentNode.insertBefore(js, fjs);
  90.             }(document, 'script', 'facebook-jssdk'))
  91.         </script>  
  92.         <div id="content">
  93.             <div id="headline">
  94.                 <a style="float:left;margin-top:30px;display:none;">Forest's Stickfights!</a>
  95.             </div>
  96.             <div id="flashcontainer">
  97.                 <form action="">
  98.                     W&auml;hle einen Stickfight aus:
  99.                     <select id="filterSelect" name="file" onChange="showSelected()">
  100.                     <option selected>Alle</option>
  101.                     <?php
  102.                         foreach(glob("*.swf") as $filename)
  103.                         {
  104.                             $filename = explode(".",$filename);
  105.                             $filename = $filename[0];
  106.                             echo '<option>' . $filename . '</option>';
  107.                         }
  108.                     ?>
  109.                     </select>
  110.                 </form>
  111.                
  112.                 <?php
  113.                
  114.                 foreach(glob("*.swf") as $filename)
  115.                 {
  116.                     $filename = explode(".",$filename);
  117.                     $filename = $filename[0];
  118.                     $infoText = getInfoText($filename);
  119.                     echo '<div id="' . $filename . '" style="display:block;" class="stickfight" onmouseover="showInfo(\'' . $filename . '\')" onmouseout="hideInfo(\'' . $filename . '\')">';
  120.                     echo '<h2>' . $filename . '</h3>';
  121.                     echo '<object classid="CLSID:D27CDB6E-AE6D-11cf-96B8-444553540000" width="600" height="400"
  122.                          codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0">
  123.                        <param name="movie" value="'. $filename .'.swf">
  124.                        <param name="quality" value="high">
  125.                        <param name="scale" value="exactfit">
  126.                        <param name="menu" value="true">
  127.                        <param name="bgcolor" value="#FFFFFF">
  128.                        <embed src="'.$filename.'.swf" quality="high" scale="exactfit" menu="false"
  129.                               bgcolor="#FFFFFF" width="600" height="400" swLiveConnect="false"
  130.                               type="application/x-shockwave-flash"
  131.                               pluginspage="http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">
  132.                        </embed>
  133.                      </object>
  134.                       <div class="infobox" id="info' . $filename .  '">' . $infoText . '</div></div>';
  135.                 }
  136.                 ?>
  137.                 <div id="line"></div>
  138.                 <div style="margin:0px 0px;padding:0px;background-color:#333333;" class="fb-comments" data-href="http://darkmidget.da.funpic.de/forest/steff/" data-num-posts="5" data-width="600" data-colorscheme="dark"></div>
  139.             </div>
  140.         </div>
  141.         <script type="text/javascript" language="JavaScript" src="http://web101.server62.publicompserver.de/counter/utiut.php?nmjz=284586&fnzr=1"></script>
  142.         <script type="text/javascript">
  143.             var selection = document.getElementById('filterSelect');
  144.             var items = new Array();
  145.             var fadeTime = 750;
  146.             <?php
  147.                 foreach(glob("*.swf") as $item)
  148.                 {
  149.                     $item = explode(".",$item);
  150.                     $item = $item[0];
  151.                     echo 'items.push("' . $item . '");' . PHP_EOL;
  152.                 }
  153.             ?>
  154.             function wait(time)
  155.             {
  156.                 time += new Date().getTime();
  157.                 while (new Date() < time){}
  158.             }
  159.             function showAll()
  160.             {
  161.                 if(arguments[0] == true)
  162.                 {
  163.                     for(var element in items)
  164.                     {
  165.                         item = document.getElementById(items[element]);
  166.                         $(item).slideDown(fadeTime);
  167.                     }                  
  168.                 }
  169.                 else
  170.                 {
  171.                     for(var element in items)
  172.                     {
  173.                         item = document.getElementById(items[element]);
  174.                         $(item).slideUp(fadeTime);
  175.                     }
  176.                 }
  177.             }
  178.             function showSelected()
  179.             {
  180.                 //alert(selection.value);
  181.                 item = document.getElementById(selection.value);
  182.                 if(selection.value == 'Alle') showAll(true);
  183.                 else
  184.                 {
  185.                     for(var element in items)
  186.                     {
  187.                         item = document.getElementById(items[element]);
  188.                         if(items[element] != selection.value){ $(item).slideUp(0);}
  189.                         if(items[element] == selection.value){ $(item).slideDown(0);}
  190.                     }  
  191.                 }
  192.             }
  193.             function showInfo(name)
  194.             {
  195.                 //alert('Zeige:'+name);
  196.                 $('#info' + name).slideDown();
  197.             }
  198.             function hideInfo(name)
  199.             {
  200.                 //alert('Verstecke:'+name);
  201.                 $('#info' + name).slideUp();
  202.             }
  203.         </script>
  204.     </body>
  205. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement