forked from corneyflorex/TaskBoard
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlayout.php
More file actions
377 lines (317 loc) · 14.5 KB
/
layout.php
File metadata and controls
377 lines (317 loc) · 14.5 KB
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title> TaskBoard</title>
<style type="text/css">
.center
{
margin:auto;
width:300px;
}
/* Reset */
* { margin:0px; padding:0px; }
html, body { height:100%; }
p { margin:0.5em; }
ul li { margin-left:3em; }
/* Styling */
body { font-family: Arial, "Sans-Serif", "Sans Serif"; font-size:14px; background-color:black; color:#F5F5F5; }
button{border-radius: 10px; background-color: rgb(13, 72, 90); border-color: rgb(104, 128, 210);}
/*Standard Black Box for any non list content*/
.blackbox { padding:10px;border: 1px solid gray; background-color:#000000; border-radius: 3px; color:#F5F5F5;}
.greybox { padding:10px;border: 1px solid gray; background-color:#ababab; border-radius: 3px; color: #515151;}
/*Header*/
#header { margin-top:10px;background-color:#7d7d7d;}
/*SVG BG*/
#svgBackground {
position: absolute;
left: 0px;
right: 0px;
top: 0px;
bottom: 0px;
overflow: hidden;
z-index: 1
}
.contentBox{
position: absolute;
left: 0px;
right: 0px;
top: 0px;
bottom: 0px;
overflow: auto;
z-index: 2
}
/* Elements */
.tasklist {border-bottom-width:0px; width:100%; border-radius: 10px;}
.tasklist .task{
border-bottom: 1px solid gray;
border-radius: 10px;
background-color:#ababab;
}
.tasklist .task0{
/*border-bottom: 2px solid gray;*/
padding:10px;
color: #515151;
background-color:#ababab;
border-radius: 10px;
/*border-bottom:2px;*/
}
.tasklist .task0 .title { display:block; font-weight:bold; }
.tasklist .task0 .message { font-size:0.9em; }
.tasklist .task1{
/*border-bottom: 2px solid gray;*/
padding:10px;
color: #515151;
background-color:#e1e1e1;
border-radius: 10px;
/*border-bottom:2px;*/
}
.tasklist .task1 .title { display:block; font-weight:bold; }
.tasklist .task1 .message { font-size:0.9em; }
.task0 a:link,.task1 a:link {color: #515151; text-decoration: underline; }
.task0 a:active,.task1 a:active {color: #515151; text-decoration: underline; }
.task0 a:visited,.task1 a:visited {color: #515151; text-decoration: underline; }
.task0 a:hover,.task1 a:hover {color: #66FFFF; text-decoration: none; }
/* LINKS */
a:link {color: #FFFFFF; text-decoration: underline; }
a:active {color: #FFFFFF; text-decoration: underline; }
a:visited {color: #FFFFFF; text-decoration: underline; }
a:hover {color: #66FFFF; text-decoration: none; }
</style>
<script type="text/javascript">
// Autoupdate
// Global Tracker Vars
//prev content
prev_content = "";
//number of tries
tries = 20;
function autoUpdate(){
var xmlhttp;
if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
} else {// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
<?php
if ( in_array("tasksView", $mode) or in_array("tasksList", $mode) ) {
if ( in_array("tasksView", $mode) ){
$DivLoc = "commentDIV";
} else if ( in_array("tasksList", $mode) ){
$DivLoc = "taskDIV";
}
?>
// Function to run on receive.
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200){
if(prev_content != xmlhttp.responseText){
document.getElementById("<?php echo $DivLoc ?>").innerHTML=xmlhttp.responseText;
// save new content to track it
prev_content = xmlhttp.responseText;
// track more often
t=setTimeout('autoUpdate()',1000*3);
tries = 0;
} else {
tries ++;
document.getElementById("stopAutoUpdateButton").innerHTML = "Refresh Now - tries:"+tries;
if (tries>60){
t=setTimeout('autoUpdate()',1000*60*5);
} else if (tries>20) {
t=setTimeout('autoUpdate()',1000*30);
} else if (tries>10){
t=setTimeout('autoUpdate()',1000*10);
}else{
t=setTimeout('autoUpdate()',1000*5);
}
}
}
}
<?php
if ( in_array("tasksView", $mode) ){
?>
xmlhttp.open("POST","?q=/ajaxcomments/",true);
xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
randomLargeNumber=Math.floor(Math.random()*10000000);
xmlhttp.send("taskid=<?php echo $taskid; ?>&sid="+Math.random());
<?php
} else if ( in_array("tasksList", $mode) ){
?>
xmlhttp.open("POST","?q=/ajaxtasks/",true);
xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
randomLargeNumber=Math.floor(Math.random()*10000000);
xmlhttp.send("tags=<?php echo $tagslist; ?>&sid="+Math.random());
<?php
}
?>
<?php } ?>
}
// Time and date in local and UTC
function startTime(){
dateObject=new Date();
//[local to UTC offset(minutes) -> converted to msec] + [msec since Jan 1 1970 (locally)]
local = dateObject.getTime();
utc = dateObject.getTimezoneOffset()*60*1000 + dateObject.getTime();
//milisec to string
utctime = new Date(utc);
localtime = new Date(local);
//Update the clock display
document.getElementById('utcDate').innerHTML=
"<b>UTC DATE: </b>"+utctime.toLocaleDateString();
document.getElementById('utcTime').innerHTML=
"<b>UTC TIME: </b>"+utctime.toLocaleTimeString();
document.getElementById('localTime').innerHTML=
"<b>CUR TIME: </b>"+localtime.toLocaleTimeString();
t=setTimeout('startTime()',500);
}
</script>
</head>
<body onload="startTime();autoUpdate();">
<!--THIS IS THE BACKGROUND SVG DO NOT REMOVE-->
<div id="svgBackground">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="-2794 0 3818 1880" style="width:100%; height:100%; position:absolute; top:0px; left:0px; z-index:-1;" >
<g>
<path style="fill:#0D001A;stroke:#66FFFF;stroke-width:3" d="M814 679l-76 32 -19 -23 69 -32 26 23zm-104 59l-59 96 -95 49 -27 -32 95 -53 32 -93 54 33zm-14 204l-31 23 -28 -87 19 5 40 59zm51 378l-191 -40 -6 -68 179 45 18 63zm272 370l-67 82 -32 -4 -9 -47 83 -90 -34 -51 19 -28 32 47 8 91zm-514 -488l-36 63 -31 -4 31 -72 36 13zm-67 -13l-38 72 -68 -18 5 -54 59 -59 42 59zm586 -702l-127 14 4 45 -76 100 -15 -91 42 -54 -146 14 -86 45 -11 37 61 -14 4 86 -41 4 -13 42 -83 55 13 36 -53 36 -19 -63 -36 19 9 127 -155 90 41 60 -68 40 -28 -53 -14 4 14 59 55 36 -19 19 -36 -10 9 28 32 4 18 55 83 31 4 28 -95 -17 -133 -146 55 4 -78 -169 0 -46 -22 0 -10 42 -76 59 0 55 -60 17 -37 -104 -26 -8 4 -61 -219 -40 36 59 37 -13 41 40 -41 51 -96 36 -100 -192 -27 0 -4 37 67 136 51 38 78 -6 -141 205 17 18 6 68 -42 32 -5 51 -109 132 -87 -5 -77 -210 24 -32 0 -54 -65 -77 27 -18 -63 -41 -127 -4 -74 -65 -4 -140 164 -142 91 -8 23 26 -5 23 73 23 36 -32 28 23 99 5 19 -19 0 -55 -41 55 -54 -73 9 73 -51 -37 -9 -54 -61 -71 -11 12 49 68 -32 45 -13 -54 -55 -41 -31 28 -19 -10 -104 97 -37 -102 73 5 13 -32 -27 -28 46 -36 27 -4 51 -46 -14 -36 27 -13 18 27 92 -5 4 -26 100 -38 -18 -22 -63 22 -19 -40 46 -36 -27 -28 -59 77 21 18 -4 47 -59 17 -14 -36 -63 8 4 -54 104 -140 115 -28 172 40 -31 47 -68 -6 45 46 132 -87 87 0 -59 -67 68 -70 95 -40 14 32 -90 32 -51 54 104 64 -17 -32 63 -55 114 28 17 -36 206 -78 141 31 -104 60 323 33 55 -55 26 49 156 14 45 24 127 -15 0 173zm-227 1021l-78 145 -63 -5 -123 -91 -4 23 -151 31 18 -63 -32 -13 0 -78 197 -127 90 59 5 -50 27 -4 114 173zm-1604 -921l-4 38 -64 0 20 -38 -42 -45 31 -32 19 45 40 32zm-127 -172l-82 59 -49 -73 91 -23 40 37zm258 394l-28 -10 17 -27 11 37zm-276 -727l-54 46 -10 114 -82 127 -131 40 -32 78 -59 -4 -68 -105 -27 -141 -55 -41 -60 19 -31 -42 99 -123 410 -50 100 82zm65 520l-28 31 -31 -28 26 -45 33 42zm605 756l-41 131 -59 -41 17 -59 59 -46 24 15zm-1294 -402l-36 -18 0 -32 36 50zm133 87l-23 9 -114 -41 8 -23 129 55zm-160 -68l-9 28 -70 -15 7 -34 72 21zm428 318l-36 42 -10 82 -277 296c10,17 13,37 9,59l-36 36 32 40 -28 32 -72 -81 0 -132 45 -260 -60 -28 -63 -158 27 -41 0 -46 -63 0 -28 -55 -36 4 -128 -72 -41 -50 -50 0 -137 -182 6 -91 -47 -68 -31 9 -23 -46 27 4 -68 -72 -90 -14 -220 109 78 -76 -55 -42 -23 -155 91 -46 437 46 -82 -59 19 -78 437 -167 169 8 -150 169 199 163 -63 68 -119 -21 15 -74 -42 0 -18 51 13 44 -90 -8 -47 63 33 27 64 19 59 68 22 -68 -13 -14 0 -68 141 23 114 137 -160 91 0 49 -28 -4 -27 27 6 36 -65 55 19 60 -32 0 -27 -41 -100 0 -38 68 38 36 17 0 36 -22 24 13 -9 51 36 4 9 55 65 0 63 -27 45 17 85 3 6 56 69 0 8 65 47 0 122 81zm-1411 -869l-137 -4 -32 13 36 36 -75 18 0 -173 185 74 23 36zm191 579l-18 32 -63 -42 -42 22 -100 -59 9 -27 114 46 44 -23 56 51zm-255 -106l-50 32 -27 -59 77 27zm514 588l-27 27 -41 -27 28 -28 40 28zm-72 -41l-32 18 -42 -28 32 -40 42 50zm2050 -698l-5 -37 -23 3 3 37 25 -3zm-82 59l-30 -59 25 -34 -13 -14 -26 20 6 97 38 -10zm-141 -61l-33 -53 -31 -6 2 24 -27 3 -23 -30 -41 51 8 32 36 -28 28 0 81 7z" id="43381528"/>
</g>
</svg>
<div>
<!--END OF THIS IS THE BACKGROUND SVG DO NOT REMOVE-->
<div class="contentBox">
<div class="center">
<?php if($__debug) echo "<div style='width:100%;background-color:darkred;'>This is a development preview of TaskBoard. <br/>
Please help out with making it better by contributing to <a href='https://github.com/corneyflorex/TaskBoard'>here</a> </div>"?>
<?php if (in_array("tasksList", $mode)) {echo __tagPageMessage($mode,$tags,$__tagPageArray); }?>
<div id='header' class='greybox'>
<!--Title or logo & Navigation links-->
<b><a href="?"><font size="5">TASKBOARD</font></a> </b>| <a href="?q=/tasks/search">Search</a> | <a href="?q=/tasks/new">New task</a>
<!--Title or logo-->
<!-- Perm Tags Board -->
<div id="tagcloud">
Boards:
<?php
if(!empty($__defaultTags) and isset($__defaultTags)){
foreach($__defaultTags as $tag){
?>
<a href="?q=/tags/<?php echo htmlentities(stripslashes($tag)); ?>" "><?php echo $tag ; ?></a>
<?php
}
}?>
</div>
<!---->
<!--Most commonly accessed tags this week-->
<div id="tagcloud">
Top Tags:
<?php foreach($top_tags as $tag){ ?>
<a href="?q=/tags/<?php echo htmlentities(stripslashes($tag['label'])); ?>" title="Count: <?php echo htmlentities(stripslashes($tag['count'])); ?>"><?php echo substr( htmlentities(stripslashes(htmlentities($tag['label']))) ,0,10) ; ?></a>
<?php } ?>
</div>
<!--Most commonly accessed tags this week-->
</div>
<!--TaskView-->
<?php if (in_array("tasksView", $mode)) { ?>
<div class="tasklist">
<?php foreach($tasks as $task){ ?>
<div class="task1">
<?php echo __prettyTripFormatter($task['tripcode']);?>
<span class="title"><?php echo htmlentities(stripslashes($task['title'])); ?> </span>
<span><?php echo date('F j, Y, g:i a', $task['created']);?></span>
<span class="message"><?php echo nl2br(__encodeTextStyle(htmlentities(stripslashes($task['message'])))); ?></span>
</div>
<div class="task1">
<a href="http://tinychat.com/<?php echo md5($task['message']);?>" target="_blank">Conference via TinyChat - click here</a>
</div>
<div class="greybox" id="add_comment">
Add Your Message Here:
<form name="add_comment" action="?q=/tasks/comment/<?php echo $task['task_id']; ?>" method="post" enctype='multipart/form-data'>
<textarea id="comment" name="comment"></textarea>
<input type="hidden" name="taskID" value="<?php echo $task['task_id']; ?>"><br/>
Passfile (Optional): <INPUT type='file' name='keyfile' />
Password: <INPUT type='text' name='password' >
<input type="submit" value="Submit" />
</form>
</div>
<div id="commentDIV" >
<?php echo __commentDisplay($comments);?>
</div>
</br>
<div class="greybox">
Task Administration
<FORM action='?q=/tasks/delete' method='post' enctype='multipart/form-data'>
<input type="hidden" name="taskID" value="<?php echo $task['task_id']; ?>">
KeyFile:<input type='file' name='keyfile' />
Password: <INPUT type='text' name='password' value=''>
<INPUT type='submit' value='delete task'>
</FORM>
</div>
<?php } ?>
</div>
<?php } ?>
<!--TaskView-->
<!--List of task-->
<?php if (in_array("tasksList", $mode)) { ?>
<div style="text-align:center"class="greybox">
<?php if (!empty($tags)){?>
<a href="?q=/tasks/new&tag=<?php echo $tags[0];?>">Create New '<?php echo $tags[0];?>' Task</a>
<?php } else {?>
<a href="?q=/tasks/new">Post new task here</a>
<?php }?>
</div>
<div id="taskDIV" class="tasklist">
<?php echo __taskDisplay($tasks);?>
</div>
<?php } ?>
<!--List of task-->
<!--Search by tag-->
<?php if (in_array("tagSearch", $mode)) { ?>
</br>
<div class="greybox">
Tag Search:
</br>
(Tags seperated by spaces)
</br>
<FORM action='?q=/tasks/search' method='post'>
<INPUT type='text' name='tags' value=''><INPUT type='submit' value='Tag Search'>
</FORM>
</div>
<?php } ?>
<!--Search by tag-->
<!--Submit field-->
<?php if (in_array("submitForm", $mode)) { ?>
</br>
<div class="greybox">
New Task Submission Form:
</br>
<FORM action='?q=/tasks/submitnew' method='post' enctype='multipart/form-data'>
<P>
Title*:<BR> <INPUT type='text' name='title'value=''><BR>
Message*:</BR> <textarea class='' rows=5 name='message'></textarea><BR>
Tags:<BR><INPUT type='text' name='tags' value='<?php if(isset($_GET['tag'])){echo $_GET['tag'];}?>'><BR>
KEYFILE OR PASSWORD(OPTIONAL):<BR>
<label for='file'>KeyFile:</label><input type='file' name='keyfile' />
<label>Password:</label><INPUT type='text' name='password'value=''><BR>
<INPUT type='submit' value='Send'> <INPUT type='reset'>
</P>
</FORM>
</br>
Note: Tags are seperated by spaces e.g."cat hat cake"
</div>
<?php } ?>
<!--Submit field-->
</br>
<!--JAVASCRIPT CLOCK-->
<div class="greybox" id="utcDate"></div>
<div class="greybox" id="utcTime"></div>
<div class="greybox" id="localTime"></div>
<!--JAVASCRIPT CLOCK-->
</br>
<button id="stopAutoUpdateButton" onclick="tries=0;">Refresh Now</button>
<!--QR CODE - To help encourage acesses by mobile phone-->
<div class="blackbox">
<center>
<b>SCAN ME </b> <a href="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"];?>">QR Code Image<a>
| <a href='./anonregkit.php'>AnonRegKit</a>
</center>
</div>
<!--QR CODE - To help encourage acesses by mobile phone-->
</div>
</div>
</body>
</html>