forked from Kroc/NoNonsenseForum
-
Notifications
You must be signed in to change notification settings - Fork 0
/
thread.inc.php
186 lines (172 loc) · 8.19 KB
/
thread.inc.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
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
<?php
if (isset ($PAGES)) {
foreach ($PAGES as &$PAGE) if ($PAGE == PAGE) {
$PAGE = "<li><em>$PAGE</em></li>";
} elseif ($PAGE) {
$PAGE = "<li><a href=\"?page=$PAGE#replies\">$PAGE</a></li>";
} else {
$PAGE = '<li>…</li>';
}
$PAGES = (implode ('', $PAGES));
}
?><!DOCTYPE html>
<meta charset="utf-8" />
<!-- NoNonsense Forum v3 © Copyright (CC-BY) Kroc Camen 2011
licensed under Creative Commons Attribution 3.0 <creativecommons.org/licenses/by/3.0/deed.en_GB>
you may do whatever you want to this code as long as you give credit to Kroc Camen, <camendesign.com> -->
<title><?php echo $HEADER['TITLE'].(PAGE>1 ? ' # '.PAGE : '')?></title>
<!-- get rid of IE site compatibility button -->
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<!--[if lt IE 9]><script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
<link rel="stylesheet" href="/themes/<?php echo FORUM_THEME?>/theme.css" />
<link rel="alternate" type="application/rss+xml" href="<?php echo $HEADER['RSS']?>" />
<meta name="viewport" content="width=device-width, maximum-scale=1, user-scalable=no" />
<!-- details on using mobile favicons with thanks to <mathiasbynens.be/notes/touch-icons> -->
<link rel="shortcut icon" type="image/x-icon" href="/themes/<?php echo FORUM_THEME?>/favicon.ico" sizes="16x16 24x24 32x32" />
<link rel="apple-touch-icon-precomposed" href="/themes/<?php echo FORUM_THEME?>/touch.png" />
<!-- Microsoft’s insane IE9 pinned site syntax: <msdn.microsoft.com/library/gg131029> -->
<meta name="application-name" content="<?php echo PATH ? safeString(PATH) : safeString(FORUM_NAME)?>" />
<meta name="msapplication-starturl" content="<?php echo FORUM_URL?>" />
<meta name="msapplication-window" content="width=1024;height=600" />
<meta name="msapplication-navbutton-color" content="#222" />
<body>
<!-- =================================================================================================================== -->
<!-- original 'Grayscale' theme by Jon Gjengset <thesquareplanet.com>,
greyscale theme by Kroc Camen, please modify to suit your needs -->
<header id="mast">
<h1><a href="/"><?php echo safeHTML(FORUM_NAME)?></a></h1>
<form id="search" method="get" action="http://google.com/search"><!--
--><input type="hidden" name="as_sitesearch" value="<?php echo safeString($_SERVER['HTTP_HOST'])?>" /><!--
--><input id="query" type="search" name="as_q" placeholder="Google Search…" /><!--
--><input id="go" type="image" src="/themes/<?php echo FORUM_THEME?>/icons/go.png" value="Search" width="20" height="20" /><!--
--></form>
<nav><p>
<a id="add" href="#reply">Reply</a>
<a id="rss" href="<?php echo $HEADER['RSS']?>">RSS</a>
</p><p>
<a id="index" href="/">Index</a><?php if (PATH): ?> » <a href="<?php echo PATH_URL?>"><?php echo PATH?></a><?php endif; ?>
</p></nav>
</header>
<!-- =================================================================================================================== -->
<section id="post">
<h1 id="<?php echo $POST['ID']?>"><?php echo $POST['TITLE']?></h1>
<article class="op<?php echo $POST['MOD'] ? ' mod' : ''?>">
<header>
<a class="ui append" rel="noindex nofollow" href="<?php echo $POST['APPEND_URL']?>">append</a>
<a class="ui delete" rel="noindex nofollow" href="<?php echo $POST['DELETE_URL']?>">delete</a>
<time datetime="<?php echo $POST['DATETIME']?>" pubdate><?php echo $POST['TIME']?></time>
<b<?php echo $POST['MOD']?' class="mod"':''?>><?php echo $POST['AUTHOR']?></b>
</header>
<?php echo $POST['TEXT']?>
</article>
</section>
<?php if (isset ($POSTS)): ?>
<section id="replies">
<h1>Replies</h1>
<nav><ol class="pages"><?php echo $PAGES?></ol></nav>
<?php foreach ($POSTS as $POST): ?>
<article id="<?php echo $POST['ID']?>" class="<?php echo implode(' ',array_filter(array($POST['DELETED'],$POST['OP'],$POST['MOD'])))?>">
<header>
<?php if (!$POST['DELETED']): ?><a class="ui append" rel="noindex nofollow" href="<?php echo $POST['APPEND_URL']?>">append</a>
<a class="ui delete" rel="noindex nofollow" href="<?php echo $POST['DELETE_URL']?>">delete</a><?php endif;?>
<time datetime="<?php echo $POST['DATETIME']?>" pubdate><?php echo $POST['TIME']?></time>
<a href="?page=<?php echo PAGE?>#<?php echo $POST['ID']?>">#<?php echo $POST['NO']?>.</a>
<b<?php echo $POST['MOD']?' class="mod"':''?>><?php echo $POST['AUTHOR']?></b>
</header>
<?php echo $POST['TEXT']?>
</article>
<?php endforeach; ?>
<nav><ol class="pages"><?php echo $PAGES?></ol></nav>
</section>
<?php endif; ?>
<!-- =================================================================================================================== -->
<section id="reply">
<h1>Reply</h1>
<form method="post" action="#reply" enctype="application/x-www-form-urlencoded;charset=utf-8" autocomplete="on">
<?php if (FORUM_ENABLED): ?>
<div id="rightcol">
<p id="puser">
<label for="user">Name:</label>
<input name="username" id="user" type="text" size="28" tabindex="2"
maxlength="<?php echo SIZE_NAME?>" required autocomplete="on"
placeholder="Your name" value="<?php echo $FORM['NAME']?>" />
</p><p id="ppass">
<label for="pass">Password:</label>
<input name="password" id="pass" type="password" size="28" tabindex="3"
maxlength="<?php echo SIZE_PASS?>" required autocomplete="on"
placeholder="A password to keep your name" value="<?php echo $FORM['PASS']?>" />
</p><p id="pemail">
<label class="email">Email:</label>
<input name="email" type="text" value="example@abc.com" tabindex="0"
required autocomplete="off" />
(Leave this as-is, it’s a trap!)
</p>
<?php switch ($FORM['ERROR']):
case ERROR_NONE: ?>
<p id="ok">There is no need to “register”, just enter the same name + password of your choice every time.</p>
<?php break;
case ERROR_NAME: ?>
<p id="error">Enter a name. You’ll need to use this with the password each time.</p>
<?php break;
case ERROR_PASS: ?>
<p id="error">Enter a password. It’s so you can re-use your name each time.</p>
<?php break;
case ERROR_TEXT: ?>
<p id="error">Well, write a message!</p>
<?php break;
case ERROR_AUTH: ?>
<p id="error">That name is taken. Provide the password for it, or choose another name. (password typo?)</p>
<?php endswitch; ?>
<p id="markup">
Pro tip: Use <a href="/markup.txt">markup</a> to add links, quotes and more.
</p>
</div><div id="leftcol">
<p id="ptext">
<label for="text">Message:</label>
<div id="wtext">
<textarea name="text" id="text" cols="40" rows="14" tabindex="1"
maxlength="<?php echo SIZE_TEXT?>" required placeholder="Type your message here…"
><?php echo $FORM['TEXT']?></textarea>
</div>
</p>
</div>
<p id="psubmit"><label for="submit">Submit
<input id="submit" name="submit" type="image" src="/themes/<?php echo FORUM_THEME?>/icons/submit.png"
width="40" height="40" tabindex="4" value=">" />
</label></p>
<?php else: ?>
<p id="error">Sorry, posting is currently disabled.</p>
<?php endif; ?>
</form>
</section>
<!-- =================================================================================================================== -->
<div id="mods">
<?php if (!empty ($MODS['LOCAL'])): ?>
<p>
Moderators for this sub-forum:
<b class="mod"><?php echo implode ('</b>, <b class="mod">', array_map ('safeHTML', $MODS['LOCAL']))?></b>
</p>
<?php endif; ?>
<?php if (!empty ($MODS['GLOBAL'])): ?>
<p>
Your friendly neighbourhood moderators:
<b class="mod"><?php echo implode ('</b>, <b class="mod">', array_map ('safeHTML', $MODS['GLOBAL']))?></b>
</p>
<?php endif; ?>
</div>
<footer><p>
Powered by <a href="http://camendesign.com/nononsense_forum">NoNonsense Forum</a><br />
© Kroc Camen of <a href="http://camendesign.com">Camen Design</a>
</p></footer>
<div id="grid"></div>
<script>
//in iOS tapping a label doesn't click the related input element, we'll add this back in using JavaScript
if (document.getElementsByTagName !== undefined) {
var labels = document.getElementsByTagName ("label");
for (i=0; i<labels.length; i++) if (labels[i].getAttribute ("for")) labels[i].onclick = function (){
document.getElementById (this.getAttribute ("for")).click ();
}
}
</script>
<!-- page generated in: <?php echo round (microtime (true) - START, 3)?>s -->
</body>