diff --git a/_sakura/changelog.json b/_sakura/changelog.json index c01b9bd..1f094ab 100644 --- a/_sakura/changelog.json +++ b/_sakura/changelog.json @@ -2743,6 +2743,27 @@ "user": "Flashwave" } + ], + + "20150915": [ + + "eminence", + { + "type": "FIX", + "change": "Fixed session cookies remaining after session dying, a more wholesome fix would require refactoring the session system so that's on the todo list now.", + "user": "Flashwave" + }, + { + "type": "FIX", + "change": "Fixed friendslisting on Settings frontpage being broken.", + "user": "Flashwave" + }, + { + "type": "FIX", + "change": "Fixed news page explosions.", + "user": "Flashwave" + } + ] } diff --git a/_sakura/components/Comments.php b/_sakura/components/Comments.php index 13ec03b..cef71ea 100644 --- a/_sakura/components/Comments.php +++ b/_sakura/components/Comments.php @@ -7,5 +7,9 @@ namespace Sakura; class Comments { - + // Constructor + public function ___construct() + { + // + } } diff --git a/_sakura/components/Session.php b/_sakura/components/Session.php new file mode 100644 index 0000000..7045745 --- /dev/null +++ b/_sakura/components/Session.php @@ -0,0 +1,24 @@ + +
+ {% if session.checkLogin %} +
+ + + +
+
+
+ + +
+
+ {% else %} +

Log in to comment!

+ {% endif %} +
+
+ +
+ diff --git a/_sakura/templates/yuuno/elements/newsPost.tpl b/_sakura/templates/yuuno/elements/newsPost.tpl index 8c28abe..2974985 100644 --- a/_sakura/templates/yuuno/elements/newsPost.tpl +++ b/_sakura/templates/yuuno/elements/newsPost.tpl @@ -1,4 +1,4 @@ -{% if not viewPost %}{{ post.title }}{% endif %} +{% if not (viewPost and postExists) %}{{ post.title }}{% endif %}
@@ -12,5 +12,5 @@
- Posted on {{ post.date|date(sakura.dateFormat) }}{% if not viewPost %} X comments{% endif %} + Posted on {{ post.date|date(sakura.dateFormat) }}{% if not (viewPost and postExists) %} X comments{% endif %}
diff --git a/_sakura/templates/yuuno/global/master.tpl b/_sakura/templates/yuuno/global/master.tpl index 896face..63bd109 100644 --- a/_sakura/templates/yuuno/global/master.tpl +++ b/_sakura/templates/yuuno/global/master.tpl @@ -248,7 +248,7 @@ {% block content %}

{{ php.self }} is now printing!

{% endblock %} -{#} +{#
diff --git a/_sakura/templates/yuuno/main/news.tpl b/_sakura/templates/yuuno/main/news.tpl index 890b65e..acf25a5 100644 --- a/_sakura/templates/yuuno/main/news.tpl +++ b/_sakura/templates/yuuno/main/news.tpl @@ -1,11 +1,11 @@ {% extends 'global/master.tpl' %} -{% set newsPosts = viewPost ? [news.getPost(postExists)] : news.getPosts(postsPerPage)[currentPage] %} +{% set newsPosts = viewPost and postExists ? [news.getPost(postExists)] : news.getPosts(postsPerPage)[currentPage] %} {% set pagination = {'page': currentPage, 'pages': news.getPosts(postsPerPage), 'urlPattern': 'SITE_NEWS_PAGE'} %} {% set title %} -{% if not newsPosts|length %}Post does not exist!{% elseif viewPost %}{{ newsPosts[0].title }}{% else %}News{% endif %} +{% if not (viewPost ? postExists : newsPosts|length) %}Post does not exist!{% elseif viewPost and postExists %}{{ newsPosts[0].title }}{% else %}News{% endif %} {% endset %} {% block title %}{{ title }}{% endblock %} @@ -21,17 +21,18 @@ {% block content %}
-
{{ title }}{% if not viewPost %}{% endif %}
- {% if newsPosts|length %} +
{{ title }}{% if not (viewPost and postExists) %}{% endif %}
+ {% if (viewPost ? postExists : newsPosts|length) %} {% for post in newsPosts %} {% include 'elements/newsPost.tpl' %} {% endfor %} - {% if not viewPost and news.getPosts(postsPerPage)|length > 1 %} + {% if not (viewPost and postExists) and news.getPosts(postsPerPage)|length > 1 %}
{% include 'elements/pagination.tpl' %}
{% endif %} + {% include 'elements/comments.tpl' %} {% else %}

The requested news post does not exist!

diff --git a/_sakura/templates/yuuno/settings/general.home.tpl b/_sakura/templates/yuuno/settings/general.home.tpl index 97485a5..acd4de2 100644 --- a/_sakura/templates/yuuno/settings/general.home.tpl +++ b/_sakura/templates/yuuno/settings/general.home.tpl @@ -30,7 +30,7 @@

Online

{% if user.getFriends(true, true, true).online %} {% for key,friend in user.getFriends(true, true, true).online %} - {{ friend.user.username }}{% if key + 1 != settings.friends.online|length %},{% endif %} + {{ friend.user.username }}{% if key + 1 != user.getFriends(true, true, true).online|length %},{% endif %} {% endfor %} {% else %}

No friends are online.

@@ -38,7 +38,7 @@

Offline

{% if user.getFriends(true, true, true).offline %} {% for key,friend in user.getFriends(true, true, true).offline %} - {{ friend.user.username }}{% if key + 1 != settings.friends.offline|length %},{% endif %} + {{ friend.user.username }}{% if key + 1 != user.getFriends(true, true, true).offline|length %},{% endif %} {% endfor %} {% else %}

No friends are offline.

diff --git a/public/.htaccess b/public/.htaccess index 6a02080..4560faa 100644 --- a/public/.htaccess +++ b/public/.htaccess @@ -30,9 +30,9 @@ RewriteRule ^p/([a-z]+)/?$ index.php?p=$1 [L,QSA] RewriteRule ^news/?$ news.php [L,QSA] RewriteRule ^news/p([0-9]+)/?$ news.php?page=$1 [L,QSA] RewriteRule ^news/([0-9]+)/?$ news.php?id=$1 [L,QSA] -RewriteRule ^news/([a-z]+)/?$ news.php?cat=$1 [L,QSA] -RewriteRule ^news/([a-z]+)/p([0-9]+)/?$ news.php?cat=$1&page=$2 [L,QSA] -RewriteRule ^news/([a-z]+)/([0-9]+)/?$ news.php?cat=$1&id=$2 [L,QSA] +RewriteRule ^news/([a-z\-]+)/?$ news.php?cat=$1 [L,QSA] +RewriteRule ^news/([a-z\-]+)/p([0-9]+)/?$ news.php?cat=$1&page=$2 [L,QSA] +RewriteRule ^news/([a-z\-]+)/([0-9]+)/?$ news.php?cat=$1&id=$2 [L,QSA] RewriteRule ^news.xml$ news.php?xml [L,QSA] # Settings diff --git a/public/content/data/yuuno/css/yuuno.css b/public/content/data/yuuno/css/yuuno.css index e4cc7d2..183f24c 100644 --- a/public/content/data/yuuno/css/yuuno.css +++ b/public/content/data/yuuno/css/yuuno.css @@ -181,7 +181,7 @@ img { max-height: 100%; } -img.default-avatar-setting { +.default-avatar-setting { max-width: 200px; max-height: 200px; border: 3px solid #EEE; @@ -591,7 +591,7 @@ a.default:active { #chatUserList > div > .avatar { width: 50px; height: 50px; - background: transparent url("/pixel.png") no-repeat scroll left center / contain; + background: transparent url("/content/pixel.png") no-repeat scroll left center / contain; border-radius: 5px; } @@ -2094,3 +2094,80 @@ textarea.inputStyling { padding: 6px 10px; border-radius: 3px; } + +/* + * Comments + */ +.comments { +} + +.comments .comment-input-section { + border-top: 1px solid #9475B2; + border-bottom: 1px solid #9475B2; +} + +.comments .comment { + display: flex; + align-items: stretch; + margin: 2px 0; +} + +.comments .comment > .comment-avatar { + height: 58px; + width: 58px; + background: url("/content/pixel.png") no-repeat scroll left center / contain; + flex-shrink: 0; + margin-right: 2px; + border-radius: 4px; + border: 1px solid #9475B2; +} + +.comments .comment > .comment-pointer { + width: 0px; + height: 0px; + border-style: solid; + border-width: 0px 15px 15px 0px; + border-color: transparent #FFF transparent transparent; +} + +.comments .comment > .comment-text { + border-radius: 0 5px 5px 5px; + border: 0; + min-height: 50px; + height: 50px; + flex-grow: 2; + padding: 5px; + font: 12px/20px "SegoeUI", "Segoe UI", sans-serif; + background: #FFF; +} + +.comments .comment > .comment-submit { + flex-shrink: 0; + font-family: FontAwesome; + height: 60px; + width: 60px; + border-radius: 4px; + margin-left: 2px; + border: 0; + background: #9475B2; + color: #FFF; + font-size: 2em; +} + +.comments ul { + list-style: none; +} + +.comments ul > li > ul { + margin-left: 40px; +} + +.comments ul > li > ul .comment > .comment-avatar { + height: 48px; + width: 48px; +} + +.comments ul > li > ul .comment > .comment-text { + min-height: 40px; + height: 40px; +}