Advertisement
salahzar

slider

Aug 28th, 2011
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.53 KB | None | 0 0
  1. <?
  2. header('Content-type: text/html; charset=utf-8');
  3. // ?file=filename&page=1
  4. include "textile.php";
  5.  
  6. $file=$_GET['file'];
  7. $page=$_GET['page'];
  8. $chat=$_GET['chat'];
  9. $content=file($file, FILE_IGNORE_NEW_LINES);
  10. $cnt=0;
  11. $header=$content[$cnt++];
  12. for($i=0;$i<$page;$i++)
  13. {
  14.     $title=$content[$cnt++];
  15.     $text="";
  16.     while ( ($line=$content[$cnt++]) != "*****")
  17.     {
  18.         $text.=$line."\n";
  19.     }
  20.     // $img=$content[$cnt++];
  21. }
  22. $t=new Textile();
  23. $text=$t->TextileThis($text);
  24. if($chat=="1")
  25. {
  26.  
  27. $search = array('@<script[^>]*?>.*?</script>@si', // Strip out javascript
  28. '@<style[^>]*?>.*?</style>@siU', // Strip style tags properly
  29. '@<[?]php[^>].*?[?]>@si', //scripts php
  30. '@<[?][^>].*?[?]>@si', //scripts php
  31. '@<[\/\!]*?[^<>]*?>@si', // Strip out HTML tags
  32. '@<![\s\S]*?--[ \t\n\r]*>@' // Strip multi-line comments including CDATA
  33. );
  34. $text = preg_replace($search, '', $text);
  35.    
  36.  
  37. $text = str_replace("\t", " ", $text);
  38. $text = str_replace("&#8220;", "'", $text);
  39. $text = str_replace("&#8221;", "'", $text);
  40. $text = str_replace("&#8217;", "'", $text);
  41. $text = str_replace("&#8230;", "...", $text);
  42.  
  43.  
  44.      
  45.     echo "$header - Slide $page\n$title\n$text";
  46.     die();
  47. }
  48. ?>
  49. <h1><?=$header ?> - Slide <?=$page?> <? $next=$page+1; $prev=$page-1; ?>
  50. <a href="<?=$_SERVER['PHP_SELF']."?file=".$file.'&page='.$prev?>">Prev</a>
  51. <a href="<?=$_SERVER['PHP_SELF']."?file=".$file.'&page='.$next?>">Next</a>
  52. <a href="<?=$_SERVER['PHP_SELF']."?file=".$file.'&page='.$page?>">Refresh</a>
  53.  
  54.  
  55. </h1>
  56.     <h2 align=center><?=$title?></h2>
  57.  
  58. <? echo $text; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement