-
Notifications
You must be signed in to change notification settings - Fork 12
/
printlayout.php
122 lines (108 loc) · 3.4 KB
/
printlayout.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" ></meta>
<meta charset="UTF-8"/>
<link rel="icon" href="favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<style type="text/css">
.center{
margin-left: auto;
margin-right: auto;
}
hr {color:sienna;}
body {background-color:Ivory;}
#wrapper, #content {
width: auto;
border: 0;
margin: 0 5%;
padding: 0;
margin-top: 3em;
float: none !important;
}
#metainfo{
margin:0.5em
}
</style>
<style media="screen" type="text/css">
#pageborder{
margin-left: auto;
margin-right: auto;
border-style:solid;
border-width:1px;
width: 210mm; min-height: 297mm;
background-color: white;
}
#wrapper, #content {
margin: 0 10%;
margin-top: 5em;
}
</style>
<style media="print" type="text/css">
* {
background-color: white !important;
background-image: none !important;
}
body {background-color:white;}
#docinfo{display:none;}
#header{display:none;}
</style>
</head>
<?php $task = $tasks[0]; //get the first displayed task entry from the array. ?>
<body >
<div id="header">
<form><input type="button" value=" Print this page "
onclick="window.print();return false;" /></form>
</div>
<div id="pageborder">
<div id="metainfo">
<span style='font-size:0.6em;' ><i><div id='OPGUID' >Created On: <?php echo substr( date('F j, Y, g:i a', $task['created']) ,0,-9);?></div></i></span>
<span style='font-size:0.6em;' ><i><div id='DOCID' >DocID(md5): <?php echo md5($task['message']); ?> </div></i></span>
</div>
<div id="content">
<?php
// Grab latest image if it exist
if($task['imagetype'] != NULL){
?>
<div style="text-align:center;margin-bottom:3em;">
<img border="0" style="max-width:100% ; max-height:60%" src="?q=/image/<?php echo $task['task_id']; ?>" alt="Pulpit rock"/>
</div>
<?php
}
?>
<div id="OP" class="task1">
<?php
$purifier = new HTMLPurifier();
$clean_html = $purifier->purify( Markdown($task['message']) );
?>
<span class="message"><?php echo nl2br($clean_html); ?></span>
</div>
</div>
</div>
<div id="docinfo">
<hr>
<h2>Doc Info:</h2>
<?php echo __prettyTripFormatter($task['tripcode']);?>
<span class="title">TITLE: <?php echo htmlentities(stripslashes($task['title']),null, 'utf-8'); ?> </span>
<br>
<span>Created: <?php echo date('F j, Y, g:i a', $task['created']);?></span>
<br>
<span style='font-size:0.6em;' ><i><div id='OPGUID' >MD5 Global ID: <?php echo md5($task['message']); ?></div></i></span>
<br>
<br>
This page is rendered via markdown <a href="http://en.wikipedia.org/wiki/Markdown"> click here for more infomation about markdown</a>
<br>
<br>
Share this paper:
<br>
<img style='width:100px' src="http://qrcode.kaywa.com/img.php?s=8&d=http%3A%2F%2F<?php if(isset($_SERVER["SERVER_NAME"]) AND isset($_SERVER["REQUEST_URI"]) )echo $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];?>"></a>
<br>
<a href="http://<?php if(isset($_SERVER["SERVER_NAME"]) AND isset($_SERVER["REQUEST_URI"]) )echo $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];?>">
http://<?php if(isset($_SERVER["SERVER_NAME"]) AND isset($_SERVER["REQUEST_URI"]) )echo $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];?>
</a>
<br>
<br>
<a href="?q=/view/<?php echo $taskid?>">back to discussion page</a>
</div>
</body>
</html>