Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- header('Content-type: text/html; charset=utf-8');
- // ?file=filename&page=1
- include "textile.php";
- $file=$_GET['file'];
- $page=$_GET['page'];
- $chat=$_GET['chat'];
- $content=file($file, FILE_IGNORE_NEW_LINES);
- $cnt=0;
- $header=$content[$cnt++];
- for($i=0;$i<$page;$i++)
- {
- $title=$content[$cnt++];
- $text="";
- while ( ($line=$content[$cnt++]) != "*****")
- {
- $text.=$line."\n";
- }
- // $img=$content[$cnt++];
- }
- $t=new Textile();
- $text=$t->TextileThis($text);
- if($chat=="1")
- {
- $search = array('@<script[^>]*?>.*?</script>@si', // Strip out javascript
- '@<style[^>]*?>.*?</style>@siU', // Strip style tags properly
- '@<[?]php[^>].*?[?]>@si', //scripts php
- '@<[?][^>].*?[?]>@si', //scripts php
- '@<[\/\!]*?[^<>]*?>@si', // Strip out HTML tags
- '@<![\s\S]*?--[ \t\n\r]*>@' // Strip multi-line comments including CDATA
- );
- $text = preg_replace($search, '', $text);
- $text = str_replace("\t", " ", $text);
- $text = str_replace("“", "'", $text);
- $text = str_replace("”", "'", $text);
- $text = str_replace("’", "'", $text);
- $text = str_replace("…", "...", $text);
- echo "$header - Slide $page\n$title\n$text";
- die();
- }
- ?>
- <h1><?=$header ?> - Slide <?=$page?> <? $next=$page+1; $prev=$page-1; ?>
- <a href="<?=$_SERVER['PHP_SELF']."?file=".$file.'&page='.$prev?>">Prev</a>
- <a href="<?=$_SERVER['PHP_SELF']."?file=".$file.'&page='.$next?>">Next</a>
- <a href="<?=$_SERVER['PHP_SELF']."?file=".$file.'&page='.$page?>">Refresh</a>
- </h1>
- <h2 align=center><?=$title?></h2>
- <? echo $text; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement