Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 25th, 2012  |  syntax: None  |  size: 2.57 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2. $src = "";
  3. class functions{
  4.         function lister($dir){
  5.                 return scandir($dir);
  6.         }
  7.         function display(){
  8.                 $files = $this->lister("c:/xampp/htdocs");
  9.                 unset($files[0]);
  10.                 unset($files[1]);
  11.                 foreach($files as $file){
  12.                         if($file){
  13.                                 echo "<div id='item'><a href='{$file}'>{$file}</a></div>";
  14.                         }
  15.                 }
  16.         }
  17. }
  18. $func = new functions;
  19. ?>
  20. <!DOCTYPE html>
  21. <html>
  22.         <head>
  23.                 <title>List it</title>
  24.                 <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
  25.                 <script src="http://www.class.pm/files/jquery/uscrollbar/demo/js/jquery.uscrollbar.js"></script>
  26.                 <script>
  27.                         $(function(){
  28.                                 $("#full a").click(function(){
  29.                                         $('iframe#load').attr('src', this);    
  30.                                        
  31.                                         return false;
  32.                                 });
  33.                                 $("#full").uscrollbar();
  34.                         });
  35.                 </script>
  36.                 <style>
  37.                 .scrollbar-path-vertical {
  38.                         position: absolute;
  39.                         background-color: #eee;
  40.                         background-color: rgba(220,220,220,0.5);
  41.                         z-index: 100;
  42.                 }
  43.                 .scrollbar-path-vertical {
  44.                         right: 5px;
  45.                         top: 0;
  46.                         height: 100%;
  47.                         width: 10px;
  48.                 }
  49.                 .scrollbar-path-vertical {
  50.                         box-shadow: inset 1px 0px 1 rgba(0,0,0,0.1);
  51.                         -moz-box-shadow: inset 1px 0px 1 rgba(0,0,0,0.1);
  52.                         -webkit-box-shadow: inset 1px 0px 0 rgba(0,0,0,0.1);
  53.                 }
  54.                 .scrollbar-handle{
  55.                         position: relative;
  56.                         top: 0;
  57.                         left: 0;
  58.                         background-color: #000000;
  59.                 }
  60.                 .scrollbar-path-vertical .scrollbar-handle {
  61.                         height: 20%;
  62.                         width: 100%;
  63.                 }
  64.                 .scrollbar-path-vertical, .scrollbar-handle {
  65.                         -moz-border-radius: 5px;
  66.                         -webkit-border-radius: 5px;
  67.                         border-radius: 5px;
  68.                 }
  69.                 </style>
  70.                 <style>
  71.                         html, body{
  72.                                 font-family: Helvetica;
  73.                                 margin:0;
  74.                                 padding:0;
  75.                                 background-image: url("http://phpacademy.org/images/background.png");
  76.                         }
  77.                         #full{
  78.                                 position:absolute;
  79.                                 height:700px;
  80.                                 width:300px;
  81.                                 left:0;
  82.                                 overflow-y: scroll;
  83.                                 top:25px;
  84.                         }
  85.                         #preview{
  86.                                 position:absolute;
  87.                                 height:700px;
  88.                                 left:300px;
  89.                                 top:25px;
  90.                                 right:0;
  91.                                 border:1px solid black;
  92.                         }
  93.                         #item{
  94.                                 background-color:#ccc;
  95.                                 width:275px;
  96.                                 padding:3px;
  97.                                 margin:5px 5px 0px 0px;
  98.                         }
  99.                         #item:hover{
  100.                                 padding-left:15px;
  101.                         }
  102.                         #item a{
  103.                                 text-decoration: none;
  104.                                 color: rgba(0,0,0,.6);
  105.                                 font-weight: bold;
  106.                         }
  107.                         #item a:hover{
  108.                                 color: rgba(0,0,0,1);
  109.                         }
  110.                 </style>
  111.         </head>
  112.         <body>
  113.                 <div id="wrapper">
  114.                         <div id="full">
  115.                                 <?php
  116.                                         $func->display();
  117.                                 ?>
  118.                         </div>
  119.                         <div id="preview">
  120.                                 <iframe id="load" style="width:100%; height:100%;border:none;"border="0"></iframe>
  121.                         </div>
  122.                 </div>
  123.         </body>
  124. </html>