pastebin - collaborative debugging tool
aerika.kpaste.net RSS


Untitled
Posted by Anonymous on Sat 7th Apr 2012 12:55
raw | new post

  1. <style>
  2. #idx {
  3. width: 100% !important;
  4. }
  5.  
  6. #idx2 {
  7. width: 100%;
  8. padding: 3px;
  9. border: 1px solid #222;
  10. background: #111;
  11. }
  12.  
  13. #idx td.center {
  14. font-size: 11px;
  15. }
  16.  
  17. table.dirlist {
  18.         border-width: 0px 0px 0px 0px;
  19.         border-spacing: 2px;
  20.         border-style: outset outset outset outset;
  21.         border-color: #111;
  22.         border-collapse: collapse;
  23.         width: 100%;
  24.         margin-left: auto;
  25.         margin-right: auto;
  26.         font-size: 8pt;
  27. }
  28.  
  29. table.dirlist th {
  30.         border-width: 1px 1px 1px 1px;
  31.         padding: 2px 2px 2px 2px;
  32.         border-style: inset inset inset inset;
  33.         border-color: #111;
  34. }
  35.  
  36. table.dirlist td {
  37.         border-bottom: 1px solid #111;
  38.         font-size: 8pt;
  39.         padding:3px;
  40. }
  41.  
  42. .proj1{
  43. background: #111;
  44. }
  45.  
  46. .proj2{
  47. background: #222;
  48. }
  49.  
  50. .titles {
  51. background: #242424;
  52. }
  53. </style>
  54.  
  55. <?php
  56. function size_readable($size, $retstring = null)
  57. {
  58.   // adapted from code at http://aidanlister.com/repos/v/function.size_readable.php
  59.  
  60.   $sizes = array('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');
  61.  
  62.   if ($retstring === null) {
  63.           $retstring = '%01.2f %s';
  64.   }
  65.  
  66.   $lastsizestring = end($sizes);
  67.  
  68.   foreach ($sizes as $sizestring) {
  69.           if ($size < 1024) {
  70.                   break;
  71.           }
  72.          
  73.           if ($sizestring != $lastsizestring) {
  74.                   $size /= 1024;
  75.           }
  76.   }
  77.  
  78.   if ($sizestring == $sizes[0]) {
  79.           $retstring = '%01d %s';
  80.   }
  81.   // Bytes aren't normally fractional
  82.  
  83.   return sprintf($retstring, $size, $sizestring);
  84. }
  85.  
  86. class D2K5_PageCallback_Comic
  87. {
  88.         public static function respond(XenForo_ControllerPublic_Abstract $controller, XenForo_ControllerResponse_Abstract &$response)
  89.         {
  90.         $response->params['srv'] = null;
  91.        
  92. $directory="/home/uploadfiles/d2k5/ftpaccounts/Emyylii12/public/Comic/";
  93. $sortOrder="newestFirst";
  94. $dcolors = array('proj1', 'proj2');
  95. $dcolors2 = array('proj2', 'proj1');
  96. $i = null;
  97. $results = array();
  98. $filehandler = opendir($directory);
  99. $nu = 0;
  100. $numfiles = 0;
  101.  
  102.        
  103.                 while ($file = readdir($filehandler)) {
  104.                    if ($file != '.' && $file != '..' && $file != '.htaccess' && $file != 'Thumbs.db' && $file != 'index.html' && $file != 'index.php' &&  $file != 'public.inf'){
  105.                            $currentModified = filectime($directory."/".$file);
  106.                            $file_names[] = $file;
  107.                            $file_dates[] = $currentModified;
  108.                            $numfiles = $numfiles + 1;
  109.                    }  
  110.                 }
  111.                 closedir($filehandler);
  112.                
  113.                
  114.         if (isset($_GET['page'])){
  115.         $lolwatpage = $_GET['page'];
  116.         }else{
  117.         $lolwatpage = $numfiles - 1;
  118.         }
  119.        
  120.         $latestcomic = $numfiles - 1;
  121.        
  122.         if($lolwatpage == -1){
  123.         $lolwatpage = 0;
  124.         }
  125.        
  126.         if($lolwatpage > $numfiles - 1){
  127.         $lolwatpage = $latestcomic;
  128.         }
  129.  
  130.         $nextcomic = $lolwatpage + 1;
  131.         $previouscomic = $lolwatpage - 1;
  132.        
  133.         $buttons = '<font style="font-size: 18pt; font-weight: bold;"><a href="/pages/comic/?page=0">First</a>&nbsp;&nbsp;&nbsp;&nbsp;';
  134.         if($lolwatpage != 0){
  135.         $buttons .= '<a href="/pages/comic/?page='.$previouscomic.'">Previous</a>&nbsp;&nbsp;&nbsp;&nbsp;';
  136.         }
  137.         if($lolwatpage != $latestcomic){
  138.         $buttons .= '<a href="/pages/comic/?page='.$nextcomic.'">Next</a>&nbsp;&nbsp;&nbsp;&nbsp;';
  139.         }
  140.         $buttons .= '<a href="/pages/comic/?page='.$latestcomic.'">Last</a></font>';
  141.         $response->params['srv'] .= $buttons;
  142.     $total_pages = ceil($numfiles - 1);
  143.     $page = intval($lolwatpage);
  144.     if ($page < 1 || $page > $total_pages) {
  145.         $page = 1;
  146.     }
  147.     $offset = ($page + 1);
  148.  
  149.             $class = ' class="active"';
  150.             $prepend = '<b>';
  151.                         $prepend2 = '</b>';
  152.  
  153.    //Sort the date array by preferred order
  154.    asort($file_dates);
  155.  
  156.                 //Match file_names array to file_dates array
  157.                 $file_names_Array = array_keys($file_dates);
  158.                 foreach ($file_names_Array as $idx => $name) $name=$file_names[$name];
  159.                 $file_dates = array_merge($file_dates);
  160.  
  161.  
  162.    $firstno = $lolwatpage;
  163.    $lastno = $firstno;
  164.    $no = 0;
  165.    foreach ($file_dates as $file_dates){
  166.      if (($no >= $firstno) && ($no <= $lastno)) {
  167.        $date = $file_dates;
  168.        $j = $file_names_Array[$no];
  169.        $file = $file_names[$j];
  170.            $ext = substr(strrchr($file, '.'), 1);
  171.                         if ($ext != null){
  172.                         if($lolwatpage != $latestcomic){
  173.                         $response->params['srv'] .= '<br/><br/><span style="font-size: 14pt; font-weight: bold;">#'.$lolwatpage.'</span><br/><a href="/pages/comic/?page='.$nextcomic.'"><img src="http://me.d2k5.com/Emyylii12/public/Comic/'.$file.'"></a><br/><br/>';
  174.                         }else{
  175.                         $response->params['srv'] .= '<br/><br/><span style="font-size: 14pt; font-weight: bold;">#'.$lolwatpage.'</span><br/><img src="http://me.d2k5.com/Emyylii12/public/Comic/'.$file.'"><br/><br/>';
  176.                         }
  177.                         }
  178.                 }
  179.                 $no = $no + 1;
  180.         }
  181.        
  182.     for ($in = 0; $in <= $total_pages; $in++) {
  183.         if ($in == $page) {
  184.             $class = ' class="active"';
  185.             $prepend = '<u>';
  186.                         $prepend2 = '</u>';
  187.         }else{
  188.             $class = '';
  189.             $prepend = '';
  190.                         $prepend2 = '';
  191.                 }
  192.                 $response->params['srv'] .= '<font size="6"><a href="/pages/comic/?page=' . $in . '"' . $class . '>' . $prepend . $in . $prepend2 ."</a></font> ";
  193.                 unset($class, $prepend);
  194.     }
  195. $response->params['srv'] .= "<br/><br/>I really felt that when we decided it would be a good idea to allow common users of this forum to have an insight into out minds and thoughts, we needed inspiration. After a lot of hard work, thinking and masturbating, we came to the decision that we would take our template from popular internet comic, Cyanide and Happiness. We hope that this small snippet of what we hope to become a well known internet series (the unique reading point being the fact that the comic is produced to such a high standard). We may think about marketing our comic in the near future, depending on response from readers (which we obviously expect to be amazing. I mean, it's D2K5, in one comic, who would not want to read that? I certainly would love to read a comic on that.)
  196. <br/><br/>
  197. We also hope that the comic brings a new sight into the life of transgender women, and we hope this comic (in particular) shows that you don't have to be a foolish man to want to play with vidya games and cocks, and also to fall down stairs, because we all fall down stairs sometimes, but it's okay because we all do it (like when you think nobody uses their smartphone on the toilet but actually people do so you don't need to feel weird about it, although if you're googling porn on it while using the toilet that's just weird.) I hope that this hasn't been too much of a read, this is just a small snippet of the full ten page report I made to go with the comic to enlighten the reader because we really hope you take some valuable life lessons away after reading it.
  198. <br/><br/>
  199. Thank you for reading.";
  200. }
  201. }

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at