yep
[handydandy.git] / showpaste.php
blob9281db5813911cc655ce60d3fedf462a4b3d20cc
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml">
3 <head>
4 <link rel="stylesheet" href="../pastebin.css" type="text/css" />
5 </head>
6 <body>
7 <?
9 include('geshi/geshi.php');
11 $pasteFile = "pastes/" . $_GET[paste] . ".txt";
12 if(file_exists($pasteFile)){
13 $file = fopen($pasteFile,'rb') or die($pasteFile.' not found');
15 $pasteContent = "";
16 while(!feof($file)){
17 $pasteContent .= fread($file,2048);
20 $language = 'php';
21 $path = 'geshi/';
23 $geshi = new GeSHi($pasteContent, $language, $path);
24 $geshi->enable_line_numbers(GESHI_NORMAL_LINE_NUMBERS);
25 $geshi->get_stylesheet();
27 echo $geshi->parse_code();
28 }else{
29 echo "Sorry. The paste doesn't exist";
33 </body>
34 </html>