summaryrefslogtreecommitdiffstats
path: root/paste/include
diff options
context:
space:
mode:
Diffstat (limited to 'paste/include')
-rw-r--r--paste/include/pastify.inc25
1 files changed, 15 insertions, 10 deletions
diff --git a/paste/include/pastify.inc b/paste/include/pastify.inc
index e5a0508..328c1bf 100644
--- a/paste/include/pastify.inc
+++ b/paste/include/pastify.inc
@@ -35,31 +35,36 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
require_once("geshi.php");
-function PastifyText($text, $language, $desc)
+function PastifyText($text, $language, $desc, $get_url, $remove_url)
{
+ global $config;
+
$plaintext = $text;
# Do the actual syntax highlighting
$geshi = new GeSHi($text, $language);
+ $geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS);
+ $geshi->set_header_type(GESHI_HEADER_PRE_TABLE);
+
+ $geshi->set_footer_content('<div style="font-size: 0.5em; color: #DDD; text-align: center;">Rendered in {TIME}s with GeSHi {VERSION}</div>');
+ $geshi->set_overall_style('width: 100%;');
+
$output = $geshi->parse_code();
$html = <<<EOH
<html>
<head>
-<link rel="stylesheet" type="text/css" href="paste.css"/>
+<link rel="stylesheet" type="text/css" href="${config['site_path']}paste.css"/>
<meta name="robots" content="noarchive"/>
<title>Pasted code - $desc</title>
</head>
-<div style="border-bottom: 2px solid gray;">
+<div style="border-bottom: 2px solid #AAA; margin-bottom: 1em;">
<table border="0" cellpadding="1" cellspacing="2" width="100%">
<tr>
- <td><small>Pasted as <b>$language</b> <span id="controls">[<a href="={remove-paste-url}">Remove this paste</a> ]</span></small></td>
-</tr>
-<tr>
- <td><small>Description: $desc</small></td>
-</tr>
-<tr>
- <td><small>URL: ={this-paste-url}</small></td>
+ <td style="color: #888; font-family: monospace;" width="100%">$desc ($language)</td>
+ <td class="control" nowrap="nowrap">[ <a href="${config['site_domain']}${config['site_path']}">New</a> ]</td>
+ <td class="control" nowrap="nowrap">[ <a href="$get_url">Link</a> ]</td>
+ <td class="control" nowrap="nowrap">[ <a href="$remove_url">Remove</a> ]</td>
</tr>
</table>
</div>