Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge remote-tracking branch 'upstream/master'

Conflicts:
	lib/functions.php
  • Loading branch information...
commit 90ba93b48392efa925431deea753f4638599b218 2 parents fab3261 + 880bdba
@fyra authored
View
2  .htaccess
@@ -1,4 +1,4 @@
-# NoNonsense Forum v17 © Copyright (CC-BY) Kroc Camen 2012
+# NoNonsense Forum v18 © Copyright (CC-BY) Kroc Camen 2012
# licenced 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>
View
10 HISTORY.txt
@@ -1,3 +1,13 @@
+v18 05.MAR.12
+* 'delete.html' had been missing for some time!
+* The sticky-thread icon had been missing for an equally long time
+* Mods and member's list not showing in the footer
+* Sub-forum lock icon positioning fixed
+* Improved URL parsing involving speech marks
+* IDN (unicode) URLs
+* Error message if inadequate PHP version
+* If a mod / member of a locked forum, the warning message is no longer shown
+
v17 05.FEB.12
* Referring to people with '@name' will now link to the latest reply in the thread by that person
* Fixed issue with replying to a locked thread removing the lock
View
2  LICENCE.txt
@@ -1,4 +1,4 @@
-NoNonsense Forum v17 © Copyright (CC-BY) Kroc Camen 2012
+NoNonsense Forum v18 © Copyright (CC-BY) Kroc Camen 2012
========================================================
The PHP / HTML / CSS and other resources of this project are licensed
under a Creative Commons 3.0 Attribution Unported licence (unless
View
2  README.txt
@@ -1,4 +1,4 @@
-NoNonsense Forum v17 © Copyright (CC-BY) Kroc Camen 2012
+NoNonsense Forum v18 © Copyright (CC-BY) Kroc Camen 2012
========================================================================
A simple forum that focuses on discussion and simplicity.
http://camendesign.com/nononsense_forum
View
2  config.default.php
@@ -1,6 +1,6 @@
<?php //site configuration defaults
/* ====================================================================================================================== */
-/* NoNonsense Forum v17 © Copyright (CC-BY) Kroc Camen 2012
+/* NoNonsense Forum v18 © Copyright (CC-BY) Kroc Camen 2012
licenced 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>
*/
View
12 index.php
@@ -1,6 +1,6 @@
<?php //display the index of threads in a folder
/* ====================================================================================================================== */
-/* NoNonsense Forum v17 © Copyright (CC-BY) Kroc Camen 2012
+/* NoNonsense Forum v18 © Copyright (CC-BY) Kroc Camen 2012
licenced 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>
*/
@@ -90,9 +90,9 @@
//remove the "add thread" link and anything else (like the input form) related to posting
'#nnf_add, #nnf_new-form' => !CAN_POST,
//if the forum is not thread-locked (only mods can post, anybody can reply) then remove the warning message
- '.nnf_forum-lock-threads' => FORUM_LOCK != 'threads',
+ '.nnf_forum-lock-threads' => FORUM_LOCK != 'threads' || IS_MOD,
//if the forum is not post-locked (only mods can post / reply) then remove the warning message
- '.nnf_forum-lock-posts' => FORUM_LOCK != 'posts'
+ '.nnf_forum-lock-posts' => FORUM_LOCK != 'posts' || IS_MOD || IS_MEMBER
));
//an 'about.html' file can be provided to add a description or other custom HTML to the forum / sub-forum
@@ -210,8 +210,6 @@
) {
//is the thread sticky?
if (in_array ($file, $stickies)) $item->addClass ('.', 'sticky');
- //if the thread isn’t locked, remove the lock icon
- if (!$xml->channel->xpath ("category[.='locked']")) $item->remove ('.nnf_thread-locked');
//get the last post in the thread
$last = &$xml->channel->item[0];
@@ -234,8 +232,12 @@
//last post author
'.nnf_thread-author' => $last->author
))->remove (array (
+ //if the thread isn’t locked, remove the lock icon
+ '.nnf_thread-locked' => !$xml->channel->xpath ("category[.='locked']"),
//if the thread is not sticky, remove the sticky icon
'.nnf_thread-sticky' => !in_array ($file, $stickies)
+ //the lock-icon takes precedence over the sticky icon
+ || $xml->channel->xpath ("category[.='locked']")
));
//is the last post author a mod?
View
2  lib/domtemplate.php
@@ -1,6 +1,6 @@
<?php //DOM-based templating engine: <camendesign.com/dom_templating>
/* ====================================================================================================================== */
-/* NoNonsense Forum v17 © Copyright (CC-BY) Kroc Camen 2012
+/* NoNonsense Forum v18 © Copyright (CC-BY) Kroc Camen 2012
licenced 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>
*/
View
32 lib/functions.php
@@ -1,6 +1,6 @@
<?php //shared functions
/* ====================================================================================================================== */
-/* NoNonsense Forum v17 © Copyright (CC-BY) Kroc Camen 2012
+/* NoNonsense Forum v18 © Copyright (CC-BY) Kroc Camen 2012
licenced 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>
*/
@@ -166,21 +166,21 @@ function formatText ($text, $rss=NULL) {
//find full URLs and turn into HTML hyperlinks. we also detect e-mail addresses automatically
while (preg_match (
'/(?:
- ((?:(?:http|ftp)s?|irc)?:\/\/) # $1 = protocol
- ( # $2 = friendly URL (no protocol)
- #[^\p{Z}\p{C}\/] matches not "separator", "other" and forwardslash
- [^\p{Z}\p{C}\/]{1,} # domain name
- )(\/)? # $3 = slash is excluded from friendly URL
- (?(3)( # $4 = folders and filename, relative URL
- (?> # folders and filename
- "(?!\/?&gt;|\s|$)| # ignore the end of an HTML hyperlink
- \)(?![:\.,"”»]?(?:\s|$))| # ignore brackets on end with punctuation
- [:\.,”»](?!\s|$)| # ignore various characters on the end
- [^\s:)\.,"”»] # the rest, including bookmark
+ ((?:(?:http|ftp)s?|irc)?:\/\/) # $1 = protocol
+ | ([a-z0-9\._%+\-]+@) # $2 = email name
+ )?( # $3 = friendly URL (no protocol)
+ [^\p{Z}\p{C}\.\/&\x{23}@"”»]+ # domain name (not "separator", "other" and slash)
+ (?:\.[^\p{Z}\p{C}\.\/&\x{23}@"”»]+)+ # top-level domain
+ )(?(2)| # email ends here
+ (\/)? # $4 = slash is excluded from friendly URL
+ (?(4)( # $5 = folders and filename, relative URL
+ (?> # folders and filename
+ "(?!\/?&gt;|\s|$)| # ignore the end of an HTML hyperlink
+ \)(?![:\.,"”»]?(?:\s|$))| # ignore brackets on end with punctuation
+ [:\.,”»](?!\s|$)| # ignore various characters on the end
+ [^\s:)\.,"”»] # the rest, including bookmark
)*
)?)
- |
- ([a-z0-9\._%+\-]+@[^\p{Z}\p{C}\/]{1,}) # $5 = e-mail
)/xiu',
//capture the starting point of the match, so that `$m[x][0]` is the text and $m[x][1] is the offset
$text, $m, PREG_OFFSET_CAPTURE,
@@ -190,11 +190,11 @@ function formatText ($text, $rss=NULL) {
//replace the URL in the source text with a hyperlinked version:
)) $text = substr_replace ($text, $replace =
- '<a href="'.(@$m[5][0] ? 'mailto:'.$m[5][0] //is this an e-mail address?
+ '<a href="'.(@$m[2][0] ? 'mailto:'.$m[2][0] //is this an e-mail address?
: ($m[1][0] ? $m[1][0] : 'http://')) //has a protocol been given?
//rest of the URL [domain . slash . everything-else]
//(encode double-quotes without double-encoding existing ampersands; this is the PHP5.2.3 requirement)
- .htmlspecialchars ($m[2][0].@$m[3][0].@$m[4][0], ENT_COMPAT, 'UTF-8', false).'" rel="nofollow">'
+ .htmlspecialchars ($m[3][0].@$m[4][0].@$m[5][0], ENT_COMPAT, 'UTF-8', false).'" rel="nofollow">'
.$m[0][0].'</a>',
//where to substitute
$m[0][1], strlen ($m[0][0])
View
7 start.php
@@ -1,10 +1,15 @@
<?php //bootstraps the forum
/* ====================================================================================================================== */
-/* NoNonsense Forum v17 © Copyright (CC-BY) Kroc Camen 2012
+/* NoNonsense Forum v18 © Copyright (CC-BY) Kroc Camen 2012
licenced 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>
*/
+//correct PHP version?
+if (version_compare (PHP_VERSION, '5.2.3') < 0) die (
+ 'PHP version 5.2.3 or greater required, yours is: '.PHP_VERSION
+);
+
//is the htaccess working properly?
//(.htaccess sets this variable for us)
if (!@$_SERVER['HTTP_HTACCESS']) die (
View
2  themes/greyscale/append.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html><head>
<meta charset="utf-8" />
- <!-- NoNonsense Forum v17 © Copyright (CC-BY) Kroc Camen 2012
+ <!-- NoNonsense Forum v18 © Copyright (CC-BY) Kroc Camen 2012
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>Append to Thread Title</title>
View
6 themes/greyscale/delete.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
-<html lang="en"><head>
+<html><head>
<meta charset="utf-8" />
- <!-- NoNonsense Forum v17 © Copyright (CC-BY) Kroc Camen 2012
+ <!-- NoNonsense Forum v18 © Copyright (CC-BY) Kroc Camen 2012
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>Delete Thread Title?</title>
@@ -84,7 +84,7 @@
<li>Only posts on the last page of the thread can be removed completely (so as to not break permalinks)</li>
</ul></div>
- <p id="psubmit"><label for="submit"><span>Delete</span>
+ <p id="psubmit"><label for="submit">Delete
<input id="submit" name="submit" type="image" src="/themes/greyscale/img/submit.png"
width="40" height="40" tabindex="4" alt="&gt;" />
</label></p>
View
2  themes/greyscale/index.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html><head>
<meta charset="utf-8" />
- <!-- NoNonsense Forum v17 © Copyright (CC-BY) Kroc Camen 2011
+ <!-- NoNonsense Forum v18 © 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>NoNonsense Forum</title>
View
2  themes/greyscale/theme.config.default.php
@@ -1,6 +1,6 @@
<?php //theme configuration defaults
/* ====================================================================================================================== */
-/* NoNonsense Forum v17 © Copyright (CC-BY) Kroc Camen 2012
+/* NoNonsense Forum v18 © Copyright (CC-BY) Kroc Camen 2012
licenced 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>
*/
View
2  themes/greyscale/theme.css
@@ -1,4 +1,4 @@
-/* NoNonsense Forum v17 © Copyright (CC-BY) Kroc Camen 2012
+/* NoNonsense Forum v18 © Copyright (CC-BY) Kroc Camen 2012
licenced 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> */
/* ====================================================================================================================== */
View
2  themes/greyscale/thread.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html><head>
<meta charset="utf-8" />
- <!-- NoNonsense Forum v17 © Copyright (CC-BY) Kroc Camen 2012
+ <!-- NoNonsense Forum v18 © Copyright (CC-BY) Kroc Camen 2012
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>Thread Title</title>
View
2  thread.php
@@ -1,6 +1,6 @@
<?php //display a particular thread’s contents
/* ====================================================================================================================== */
-/* NoNonsense Forum v17 © Copyright (CC-BY) Kroc Camen 2012
+/* NoNonsense Forum v18 © Copyright (CC-BY) Kroc Camen 2012
licenced 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>
*/
Please sign in to comment.
Something went wrong with that request. Please try again.