Big commit

This commit is contained in:
flash 2015-07-31 23:18:14 +02:00
parent 7ee70b3966
commit 31072687c8
19 changed files with 425 additions and 138 deletions

View file

@ -36,7 +36,8 @@
"20150707",
"20150725",
"20150728",
"20150730"
"20150730",
"20150731"
]
@ -1569,6 +1570,55 @@
"change": "Added draft for posting page."
}
],
"20150731": [
{
"type": "UPD",
"change": "Redid footer links and styling."
},
{
"type": "FIX",
"change": "Fixed an issue with linking to people's websites on the credits page."
},
{
"type": "ADD",
"change": "Added pagination to news page."
},
{
"type": "FIX",
"change": "Put pagination in own class."
},
{
"type": "UPD",
"change": "Implemented global pagination style on member list page."
},
{
"type": "REM",
"change": "Removed mention of Flashii in news page title."
},
{
"type": "FIX",
"change": "Fixed positioning bug on the notification history page."
},
{
"type": "ADD",
"change": "Added pagination to notification history page."
},
{
"type": "ADD",
"change": "Added friend management page."
},
{
"type": "FIX",
"change": "Fixed removing a friend not removing the request."
},
{
"type": "FIX",
"change": "Fixed pending friend requests function returning mutual friends instead of requests."
}
]
}

View file

@ -1297,7 +1297,7 @@ class Users {
}
// Get friends
public static function getFriends($uid = null, $timestamps = false) {
public static function getFriends($uid = null, $timestamps = false, $getData = false) {
// Assign $uid
if(!$uid)
@ -1315,7 +1315,12 @@ class Users {
foreach($getFriends as $key => $friend) {
// Add friend to array
$friends[($timestamps ? $friend['fid'] : $key)] = $friend[($timestamps ? 'timestamp' : 'fid')];
$friends[($timestamps ? $friend['fid'] : $key)] = $getData ? ([
'user' => ($_UDATA = self::getUser($friend['fid'])),
'rank' => self::getRank($_UDATA['rank_main'])
]) : $friend[($timestamps ? 'timestamp' : 'fid')];
}
@ -1325,7 +1330,7 @@ class Users {
}
// Get non-mutual friends
public static function getPendingFriends($uid = null) {
public static function getPendingFriends($uid = null, $getData = false) {
// Assign $of automatically if it's not set
if(!$uid)
@ -1343,8 +1348,16 @@ class Users {
foreach($friends as $friend) {
// Check if the friend is mutual
if(!self::checkFriend($friend, $uid))
$pending[] = $friend;
if(!self::checkFriend($friend['uid'], $uid)) {
$pending[] = $getData ? ([
'user' => ($_UDATA = self::getUser($friend['uid'])),
'rank' => self::getRank($_UDATA['rank_main'])
]) : $friend;
}
}
@ -1403,7 +1416,7 @@ class Users {
}
// Removing a friend
public static function removeFriend($uid) {
public static function removeFriend($uid, $deleteRequest = false) {
// Check if the user has this user a friend
if(!Database::fetch('friends', false, ['fid' => [$uid, '='], 'uid' => [Session::$userId, '=']]))
@ -1415,6 +1428,16 @@ class Users {
'fid' => [$uid, '=']
]);
// Attempt to remove the request
if($deleteRequest) {
Database::delete('friends', [
'fid' => [Session::$userId, '='],
'uid' => [$uid, '=']
]);
}
// Return true because yay
return [1, 'REMOVED'];

View file

@ -8,10 +8,10 @@
namespace Sakura;
// Define Sakura version
define('SAKURA_VERSION', '20150730');
define('SAKURA_VERSION', '20150731');
define('SAKURA_VLABEL', 'Eminence');
define('SAKURA_STABLE', false);
define('SAKURA_COLOUR', '#6C3082');
define('SAKURA_STABLE', false);
// Define Sakura Path
define('ROOT', str_replace(basename(__DIR__), '', dirname(__FILE__)));

View file

@ -1,4 +1,4 @@
{% if newsPosts|length > 1 %}<a href="/news/{{ newsPost.id }}" class="news-head" id="n{{ newsPost.id }}">{{ newsPost.title }}</a>{% endif %}
{% if not page.view_post %}<a href="/news/{{ newsPost.id }}" class="news-head" id="n{{ newsPost.id }}">{{ newsPost.title }}</a>{% endif %}
<div class="news-body">
<a class="no-underline" href="/u/{{ newsPost.uid }}">
<div class="news-poster">
@ -12,5 +12,5 @@
</div>
<div class="clear"></div>
<div class="news-post-time">
Posted on {{ newsPost.date|date(sakura.date_format) }}{% if newsPosts|length > 1 %} <a class="default" href="/news/{{ newsPost.id }}#disqus_thread">View comments</a>{% endif %}
Posted on {{ newsPost.date|date(sakura.date_format) }}{% if not page.view_post %} <a class="default" href="/news/{{ newsPost.id }}#disqus_thread">View comments</a>{% endif %}
</div>

View file

@ -5,8 +5,10 @@
<div>General</div>
<a href="/settings/">Home</a>
<a href="/settings/profile">Edit Profile</a>
<a href="/settings/friends">Friends</a>
<a href="/settings/groups">Groups</a>
<div>Friends</div>
<a href="/settings/friends">List</a>
<a href="/settings/friendrequests">Requests</a>
<div>Messages</div>
<a href="/messages/inbox">Inbox</a>
<a href="/messages/sent">Sent</a>

View file

@ -1,4 +1,4 @@
<div class="buttonRow">
<div class="buttonRow pagination">
<div class="leftSide">
<a href="/forum/{% if board.viewtopic %}{{ topic.forum_id }}/{% endif %}" class="forumbtn"><span class="fa fa-backward"></span> Back</a>
{% if board.viewtopic %}
@ -18,4 +18,4 @@
<a href="#" class="forumbtn"><span class="fa fa-step-forward"></span></a>
</div>
<div class="clear"></div>
</div>
</div>

View file

@ -18,7 +18,7 @@
<a class="fa fa-trash" title="Delete this post" href="/forum/post/{{ post.post_id }}/delete"></a>
{% else %}
{% if post.is_friend != 0 %}<a class="fa fa-{% if post.is_friend == 2 %}heart{% else %}star{% endif %}" title="You are friends"></a>{% endif %}
<a class="fa fa-user-{% if post.is_friend == 0 %}plus{% else %}times{% endif %}" title="{% if post.is_friend == 0 %}Add {{ post.user.username }} as a friend{% else %}Remove friend{% endif %}" href="//{{ sakura.urls.main }}/friends?{% if post.is_friend == 0 %}add{% else %}remove{% endif %}={{ post.user.id }}&amp;session={{ php.sessionid }}&amp;time={{ php.time }}&amp;redirect=/forum/post/{{ post.post_id }}%23p{{ post.post_id }}"></a>
<a class="fa fa-user-{% if post.is_friend == 0 %}plus{% else %}times{% endif %}" title="{% if post.is_friend == 0 %}Add {{ post.user.username }} as a friend{% else %}Remove friend{% endif %}" href="//{{ sakura.urls.main }}/friends?{% if post.is_friend == 0 %}add{% else %}remove{% endif %}={{ post.user.id }}&amp;session={{ php.sessionid }}&amp;time={{ php.time }}&amp;redirect=/forum/post/{{ post.post_id }}%23p{{ post.post_id }}&amp;direct=true"></a>
<a class="fa fa-flag" title="Report {{ post.user.username }}" href="//{{ sakura.urls.main }}/u/{{ post.user.id }}/report"></a>
{% endif %}
{% else %}

View file

@ -7,25 +7,26 @@
<li class="fthead">General</li>
<li><a href="//{{ sakura.urls.main }}/" title="Flashii Frontpage">Home</a></li>
<li><a href="//{{ sakura.urls.main }}/news" title="Flashii News &amp; Updates">News</a></li>
<li><a href="//{{ sakura.urls.main }}/contact" title="Contact Flashii Staff">Contact</a></li>
<li><a href="//{{ sakura.urls.main }}/r/terms" title="Our Terms of Service">Terms of Service</a></li>
<li><a href="//{{ sakura.urls.main }}/r/rules" title="Some Rules and Information kind of summing up the ToS">Rules and Information</a></li>
<li><a href="//{{ sakura.urls.main }}/faq" title="Questions that get Asked Frequently but not actually">Frequently Asked Questions</a></li>
<li><a href="//{{ sakura.urls.main }}/search" title="Do full-site search requests">Search</a></li>
<li><a href="//{{ sakura.urls.main }}/contact" title="Contact our Staff">Contact</a></li>
<li><a href="//{{ sakura.urls.main }}/changelog" title="All the changes made to Sakura are listed here">Changelog</a></li>
<li><a href="//{{ sakura.urls.main }}/feedback" target="_blank" title="Give us feedback on what to do">Feedback</a></li>
</ul>
<ul class="ftsection">
<li class="fthead">Search, Status &amp; Social</li>
<li><a href="//{{ sakura.urls.main }}/search" title="Do full-site search requests">Search</a></li>
<li><a href="http://status.flashii.net" target="_blank" title="Check the status on the Flashii Server and related services">Server Status</a></li>
<li class="fthead">Community</li>
<li><a href="//{{ sakura.urls.main }}/forum" title="Read and post on our forums">Forums</a></li>
<li><a href="https://twitter.com/_flashii" target="_blank" title="Follow us on Twitter for news messages that are too short for the news page">Twitter</a></li>
<li><a href="https://youtube.com/user/flashiinet" target="_blank" title="Our YouTube page where stuff barely ever gets uploaded, mainly used to archive community creations">YouTube</a></li>
<li><a href="//steamcommunity.com/groups/flashiinet" target="_blank" title="Our Steam group, play games with other members on the site">Steam</a></li>
<li><a href="https://github.com/circlestorm" target="_blank" title="Our Open Source repository thing">Github</a></li>
</ul>
<ul class="ftsection">
<li class="fthead">Contribution</li>
<li><a href="//{{ sakura.urls.main }}/changelog" title="All the changes made to Sakura are listed here">Changelog</a></li>
<li class="fthead">Information</li>
<li><a href="//{{ sakura.urls.main }}/faq" title="Questions that get Asked Frequently but not actually">FAQ</a></li>
<li><a href="//{{ sakura.urls.main }}/r/rules" title="Some Rules and Information kind of summing up the ToS">Rules</a></li>
<li><a href="//{{ sakura.urls.main }}/credits" title="Here everyone who's helped Flashii get to where it is now is listed">Credits</a></li>
<li><a href="//{{ sakura.urls.main }}/feedback" target="_blank" title="Give us feedback on what to do">Feedback &amp; Suggestions</a></li>
<li><a href="https://github.com/circlestorm" target="_blank" title="Our Open Source repository thing">Github</a></li>
<li><a href="http://status.flashii.net" target="_blank" title="Check the status on our Servers and related services">Server Status</a></li>
<li><a href="//{{ sakura.urls.main }}/r/terms" title="Our Terms of Service">Terms of Service</a></li>
</ul>
</div>
</div>

View file

@ -213,6 +213,7 @@
<a class="menu-item" href="//{{ sakura.urls.main }}/forum" title="Discuss things with other members but static">Forums</a>
<a class="menu-item" href="//{{ sakura.urls.main }}/search" title="Search on Flashii">Search</a>
{% if user.checklogin %}
<a class="menu-item" href="//{{ sakura.urls.main }}/members" title="View a list with all the activated user accounts">Members</a>
<a class="menu-item menu-donate" href="//{{ sakura.urls.main }}/support" title="Give us money to keep the site (and other services) up and running">Support us</a>
{% endif %}
</div>
@ -220,7 +221,6 @@
<!-- User menu, displayed on right side of the bar. -->
{% if user.checklogin %}
<a class="menu-item avatar" href="//{{ sakura.urls.main }}/u/{{ user.data.id }}" title="View and edit your own profile" style="background-image: url('//{{ sakura.urls.main }}/a/{{ user.data.id }}'); width: auto; color: {{ user.colour }}; font-weight: 700;">{{ user.data.username }}</a>
<a class="menu-item" href="//{{ sakura.urls.main }}/members" title="View a list with all the activated user accounts">Members</a>
<a class="menu-item" href="//{{ sakura.urls.main }}/messages" title="Read your private message">Messages</a>
<a class="menu-item" href="//{{ sakura.urls.main }}/manage" title="Manage the site">Manage</a>
<a class="menu-item" href="//{{ sakura.urls.main }}/settings" title="Change your settings">Settings</a>

View file

@ -13,7 +13,7 @@
<tbody>
{% for contribname, contributor in contributors %}
<tr>
<td><a href="{{ contributors[1] }}" target="_blank">{{ contribname }}</a></td>
<td><a href="{{ contributor[1] }}" target="_blank">{{ contribname }}</a></td>
<td>{{ contributor[0] }}</td>
</tr>
{% endfor %}

View file

@ -84,11 +84,17 @@
</div>
{% endif %}
{% if page.users|length > 1 %}
<h2 style="cursor: default;">[
<div class="pagination">
{% if page.page > 0 %}
<a href="/members/{% if page.sort != page.sorts[0] %}{{ page.sort }}/{% endif %}{% if page.active %}{{ page.active }}/{% endif %}p{{ page.page }}"><span class="fa fa-step-backward"></span></a>
{% endif %}
{% for count,navpage in page.users %}
<a href="/members/{% if page.sort != page.sorts[0] %}{{ page.sort }}/{% endif %}{% if page.active %}{{ page.active }}/{% endif %}p{{ count + 1 }}" class="default">{{ count + 1 }}</a>
<a href="/members/{% if page.sort != page.sorts[0] %}{{ page.sort }}/{% endif %}{% if page.active %}{{ page.active }}/{% endif %}p{{ count + 1 }}"{% if count == page.page %} class="current"{% endif %}>{{ count + 1 }}</a>
{% endfor %}
]</h2>
{% if page.page + 1 < page.users|length %}
<a href="/members/{% if page.sort != page.sorts[0] %}{{ page.sort }}/{% endif %}{% if page.active %}{{ page.active }}/{% endif %}p{{ page.page + 2 }}"><span class="fa fa-step-forward"></span></a>
{% endif %}
</div>
{% endif %}
</div>
{% else %}

View file

@ -1,11 +1,33 @@
{% include 'global/header.tpl' %}
<div class="content">
<div class="content-column news">
<div class="head">{% if newsPosts|length == 1 %}{{ newsPosts[0].title }}{% elseif newsPosts|length < 1 %}Post does not exist!{% else %}News <a href="/news.xml" class="fa fa-rss news-rss default"></a>{% endif %}</div>
<div class="head">{% if page.view_post %}{{ newsPosts[0].title }}{% elseif newsPosts|length < 1 %}Post does not exist!{% else %}News <a href="/news.xml" class="fa fa-rss news-rss default"></a>{% endif %}</div>
{% if newsPosts|length >= 1 %}
{% for newsPost in newsPosts %}
{% include 'elements/newsPost.tpl' %}
{% endfor %}
{% if page.view_post %}
{% for newsPost in newsPosts %}
{% include 'elements/newsPost.tpl' %}
{% endfor %}
{% else %}
{% for newsPost in newsPosts[page.currentPage] %}
{% include 'elements/newsPost.tpl' %}
{% endfor %}
{% endif %}
{% if not page.view_post and newsPosts|length > 1 %}
<div>
<div class="pagination" style="float: right;">
{% if page.currentPage > 0 %}
<a href="/news/p{{ page.currentPage }}"><span class="fa fa-step-backward"></span></a>
{% endif %}
{% for id,npage in newsPosts %}
<a href="/news/p{{ id + 1 }}"{% if id == page.currentPage %} class="current"{% endif %}>{{ id + 1 }}</a>
{% endfor %}
{% if page.currentPage + 1 < newsPosts|length %}
<a href="/news/p{{ page.currentPage + 2 }}"><span class="fa fa-step-forward"></span></a>
{% endif %}
</div>
<div class="clear"></div>
</div>
{% endif %}
{% else %}
<div style="padding: 20px;">
<h1>The requested news post does not exist!</h1>
@ -17,20 +39,7 @@
</div>
{% endif %}
</div>
{% if newsPosts|length > 1 %}
<script type="text/javascript">
var disqus_shortname = '{{ sakura.disqus_shortname }}';
(function () {
var s = document.createElement('script'); s.async = true;
s.type = 'text/javascript';
s.src = '//' + disqus_shortname + '.disqus.com/count.js';
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
}());
</script>
{% elseif newsPosts|length == 1 %}
{% if page.view_post %}
<div id="disqus_thread">
</div>
<script type="text/javascript">
@ -54,6 +63,19 @@
</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
<a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
{% else %}
<script type="text/javascript">
var disqus_shortname = '{{ sakura.disqus_shortname }}';
(function () {
var s = document.createElement('script'); s.async = true;
s.type = 'text/javascript';
s.src = '//' + disqus_shortname + '.disqus.com/count.js';
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
}());
</script>
{% endif %}
</div>

View file

@ -0,0 +1,52 @@
{% include 'global/header.tpl' %}
<div class="content settings">
<div class="content-right content-column">
{% include 'elements/settingsNav.tpl' %}
</div>
<div class="content-left content-column">
<div class="head">
{{ page.title }}
</div>
<div class="settings-explanation">
<div>Handle friend requests.</div>
</div>
{% if friends|length %}
<div class="friends-list">
{% for friend in friends[page.currentPage] %}
<div class="friend-container" id="friend-{{ friend.user.id }}">
<a class="friends-list-data clean" href="/u/{{ friend.user.id }}">
<img src="/a/{{ friend.user.id }}" alt="{{ friend.user.username }}" class="friends-list-avatar default-avatar-setting" style="width: 150px; height: 150px;" />
<div class="friends-list-name" style="color: {% if friend.user.name_colour %}{{ friend.user.name_colour }}{% else %}{{ friend.rank.colour }}{% endif %};">{{ friend.user.username }}</div>
</a>
<div class="friends-list-actions">
<a class="add fa fa-check" title="Add friend" href="//{{ sakura.urls.main }}/friends?add={{ friend.user.id }}&amp;session={{ php.sessionid }}&amp;time={{ php.time }}&amp;redirect=//{{ sakura.urls.main }}/settings/friendrequests&amp;direct=true"></a>
<a class="remove fa fa-remove" title="Remove friend" href="//{{ sakura.urls.main }}/friends?remove={{ friend.user.id }}&amp;session={{ php.sessionid }}&amp;time={{ php.time }}&amp;redirect=//{{ sakura.urls.main }}/settings/friendrequests&amp;direct=true"></a>
<div class="clear"></div>
</div>
</div>
{% endfor %}
<div class="clear"></div>
</div>
{% if friends|length > 1 %}
<div>
<div class="pagination" style="float: right;">
{% if page.currentPage > 0 %}
<a href="/settings/friends/p{{ page.currentPage }}"><span class="fa fa-step-backward"></span></a>
{% endif %}
{% for id,npage in friends %}
<a href="/settings/friends/p{{ id + 1 }}"{% if id == page.currentPage %} class="current"{% endif %}>{{ id + 1 }}</a>
{% endfor %}
{% if page.currentPage + 1 < friends|length %}
<a href="/settings/friends/p{{ page.currentPage + 2 }}"><span class="fa fa-step-forward"></span></a>
{% endif %}
</div>
<div class="clear"></div>
</div>
{% endif %}
{% else %}
<h1 class="stylised" style="margin: 2em auto; text-align: center;">You don't have any pending requests!</h1>
{% endif %}
</div>
<div class="clear"></div>
</div>
{% include 'global/footer.tpl' %}

View file

@ -1,5 +1,5 @@
{% include 'global/header.tpl' %}
<div class="content settings messages">
<div class="content settings">
<div class="content-right content-column">
{% include 'elements/settingsNav.tpl' %}
</div>
@ -10,7 +10,41 @@
<div class="settings-explanation">
<div>Manage your friends.</div>
</div>
{% if friends|length %}
<div class="friends-list">
{% for friend in friends[page.currentPage] %}
<div class="friend-container" id="friend-{{ friend.user.id }}">
<a class="friends-list-data clean" href="/u/{{ friend.user.id }}">
<img src="/a/{{ friend.user.id }}" alt="{{ friend.user.username }}" class="friends-list-avatar default-avatar-setting" style="width: 150px; height: 150px;" />
<div class="friends-list-name" style="color: {% if friend.user.name_colour %}{{ friend.user.name_colour }}{% else %}{{ friend.rank.colour }}{% endif %};">{{ friend.user.username }}</div>
</a>
<div class="friends-list-actions">
<a class="remove fill fa fa-remove" title="Remove friend" href="//{{ sakura.urls.main }}/friends?remove={{ friend.user.id }}&amp;session={{ php.sessionid }}&amp;time={{ php.time }}&amp;redirect=//{{ sakura.urls.main }}/settings/friends&amp;direct=true"></a>
<div class="clear"></div>
</div>
</div>
{% endfor %}
<div class="clear"></div>
</div>
{% if friends|length > 1 %}
<div>
<div class="pagination" style="float: right;">
{% if page.currentPage > 0 %}
<a href="/settings/friends/p{{ page.currentPage }}"><span class="fa fa-step-backward"></span></a>
{% endif %}
{% for id,npage in friends %}
<a href="/settings/friends/p{{ id + 1 }}"{% if id == page.currentPage %} class="current"{% endif %}>{{ id + 1 }}</a>
{% endfor %}
{% if page.currentPage + 1 < friends|length %}
<a href="/settings/friends/p{{ page.currentPage + 2 }}"><span class="fa fa-step-forward"></span></a>
{% endif %}
</div>
<div class="clear"></div>
</div>
{% endif %}
{% else %}
<h1 class="stylised" style="margin: 2em auto; text-align: center;">You don't have any friends yet!</h1>
{% endif %}
</div>
<div class="clear"></div>
</div>

View file

@ -11,8 +11,8 @@
This is the history of notifications that have been sent to you.
</div>
<div class="notification-history">
{% for notif in notifs %}
<div id="notif-hist-{{ notif.id }}" class="{% if notif.notif_read %}read{% endif %}">
{% for notif in notifs[page.currentPage] %}
<a id="notif-hist-{{ notif.id }}" class="clean {% if notif.notif_read %}read{% endif %}"{% if notif.notif_link %} href="{{ notif.notif_link }}"{% endif %}>
<div class="notif-hist-icon">
{% if 'FONT:' in notif.notif_img %}
<div class="font-icon fa {{ notif.notif_img|replace({'FONT:': ''}) }} fa-4x"></div>
@ -21,25 +21,38 @@
{% endif %}
</div>
<div class="notif-hist-content">
<div class="notif-hist-time">
{{ notif.timestamp|date("r") }}
</div>
<div class="notif-hist-inside">
<div class="notif-hist-title">
{{ notif.notif_title }}
</div>
<div class="notif-hist-text">
{{ notif.notif_text }}
{% if notif.notif_link %}
| <a href="{{ notif.notif_link }}" class="default">Go</a>
{% endif %}
</div>
</div>
<div class="notif-hist-time">
{{ notif.timestamp|date(sakura.date_format) }}
</div>
</div>
<div class="clear"></div>
</div>
</a>
{% endfor %}
</div>
{% if notifs|length > 1 %}
<div>
<div class="pagination" style="float: right;">
{% if page.currentPage > 0 %}
<a href="/settings/notifications/p{{ page.currentPage }}"><span class="fa fa-step-backward"></span></a>
{% endif %}
{% for id,npage in notifs %}
<a href="/settings/notifications/p{{ id + 1 }}"{% if id == page.currentPage %} class="current"{% endif %}>{{ id + 1 }}</a>
{% endfor %}
{% if page.currentPage + 1 < notifs|length %}
<a href="/settings/notifications/p{{ page.currentPage + 2 }}"><span class="fa fa-step-forward"></span></a>
{% endif %}
</div>
<div class="clear"></div>
</div>
{% endif %}
</div>
<div class="clear"></div>
</div>

View file

@ -120,30 +120,8 @@ body {
padding-bottom: 220px;
}
@media (max-width: 642px) {
#contentwrapper {
padding-bottom: 335px;
}
}
@media (max-width: 426px) {
#contentwrapper {
padding-bottom: 450px;
}
}
@media (max-width: 400px) {
#contentwrapper {
padding-bottom: 450px;
}
}
@media (max-width: 300px) {
/* Can't be bothered to figure this out since it'll spazz out anyway */
@media (max-width: 650px) {
.footer {
display: none;
@ -762,21 +740,24 @@ a.gotop.exit {
text-align: left;
display: inline-block;
width: 200px;
list-style-type: none;
list-style: square;
}
.footer .ftsections .ftsection li {
margin: 2px;
margin: 2px 2px 2px 16px;
}
.footer .ftsections .ftsection li.fthead {
margin-bottom: 5px;
margin: 2px 2px 5px;
font-weight: 700;
list-style: none;
}
.footer .sections .copycentre {
.footer .ftsections .copycentre {
text-align: center;
width: 100%;
font-size: .9em;
line-height: 1.8em;
}
/*
@ -973,7 +954,7 @@ a.gotop.exit {
text-align: right;
}
#notifications > div {
#notifications > div {
cursor: pointer;
text-align: left;
display: inline-block;
@ -1310,13 +1291,14 @@ a.gotop.exit {
overflow: auto;
}
.settings .notification-history > div {
.settings .notification-history > a {
border: 1px solid #507;
margin: 5px;
background: rgba(113, 74, 150, .3);
display: block;
}
.settings .notification-history > div > .notif-hist-icon {
.settings .notification-history > a > .notif-hist-icon {
float: left;
width: 80px;
height: 80px;
@ -1327,11 +1309,11 @@ a.gotop.exit {
color: #FFF;
}
.settings .notification-history > div > .notif-hist-icon > .font-icon {
.settings .notification-history > a > .notif-hist-icon > .font-icon {
margin: .34em 0;
}
.settings .notification-history > div > .notif-hist-content > .notif-hist-time {
.settings .notification-history > a > .notif-hist-content > .notif-hist-time {
font-style: italic;
text-align: right;
float: right;
@ -1339,19 +1321,87 @@ a.gotop.exit {
font-size: .8em;
}
.settings .notification-history > div > .notif-hist-content > .notif-hist-inside {
.settings .notification-history > a > .notif-hist-content > .notif-hist-inside {
float: left;
margin-left: 2px;
padding-left: 8px;
}
.settings .notification-history > div > .notif-hist-content > .notif-hist-inside > .notif-hist-title {
.settings .notification-history > a > .notif-hist-content > .notif-hist-inside > .notif-hist-title {
font-family: "SegoeUI", "Segoe UI", sans-serif;
font-weight: 300;
font-size: 1.7em;
margin-top: 1em;
}
.settings .friends-list > div:not(:last-child) {
display: block;
border: 1px solid #9475B2;
text-align: center;
width: 220px;
margin: 0 2px 40px;
float: left;
border-radius: 3px;
}
.settings .friends-list > div:not(:last-child):hover {
margin-bottom: 6px;
background: #C2AFFE;
}
.settings .friends-list > div > .friends-list-data {
display: block;
}
.settings .friends-list > div > .friends-list-data > .friends-list-name {
font-size: 1.2em;
line-height: 1.5em;
padding-bottom: 4px;
}
.settings .friends-list > div > .friends-list-actions {
display: none;
background: linear-gradient(0deg, #9475B2, #C2AFFE) #9475B2;
}
.settings .friends-list > div > .friends-list-actions > a {
color: #222;
font-size: 2em;
line-height: 1em;
text-decoration: none;
transition: .2s;
padding: 5px 0;
float: left;
}
.settings .friends-list > div:hover > .friends-list-actions {
display: block;
}
.settings .friends-list > div > .friends-list-actions > .remove:hover {
color: #D00;
}
.settings .friends-list > div > .friends-list-actions > .remove:active {
color: #A00;
}
.settings .friends-list > div > .friends-list-actions > .add:hover {
color: #0D0;
}
.settings .friends-list > div > .friends-list-actions > .add:active {
color: #0A0;
}
.settings .friends-list > div > .friends-list-actions > a {
width: 50%;
}
.settings .friends-list > div > .friends-list-actions > .fill {
width: 100%;
}
/*
* Support page Styling
*/
@ -1658,26 +1708,6 @@ textarea.inputStyling {
text-align: center;
}
.forum .forumbtn {
background: linear-gradient(0deg, #9475B2 10%, #C2AFFE 90%);
color: #306;
padding: 4px 8px;
text-decoration: none;
border-radius: 2px;
margin: 4px 2px;
display: inline-block;
font-size: 1.3em;
border: 1px solid #9475B2;
}
.forum .forumbtn:hover {
background: linear-gradient(0deg, #9475B2 30%, #C2AFFE 70%);
}
.forum .forumbtn:active {
background: linear-gradient(180deg, #9475B2 30%, #C2AFFE 70%);
}
.forum.viewtopic .posts {
width: 100%;
border-spacing: 0;
@ -1827,6 +1857,33 @@ textarea.inputStyling {
float: right;
}
/*
* Pagination
*/
.pagination a {
background: linear-gradient(0deg, #9475B2 10%, #C2AFFE 90%);
color: #306;
padding: 4px 8px;
text-decoration: none;
border-radius: 2px;
margin: 4px 2px;
display: inline-block;
font-size: 1.3em;
border: 1px solid #9475B2;
}
.pagination a.current {
background: linear-gradient(0deg, #A586C3, #D3BFFF);
}
.pagination a:hover {
background: linear-gradient(0deg, #9475B2 30%, #C2AFFE 70%);
}
.pagination a:active {
background: linear-gradient(180deg, #9475B2 30%, #C2AFFE 70%);
}
/*
* Ban page styling
*/

View file

@ -29,12 +29,14 @@ RewriteRule ^r/([a-z]+)$ infopage.php?r=$1 [L,QSA]
# News
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.xml$ news.php?xml [L,QSA]
# Settings
RewriteRule ^settings/?$ settings.php [L,QSA]
RewriteRule ^settings/([a-z]+)/?$ settings.php?mode=$1 [L,QSA]
RewriteRule ^settings/([a-z]+)/p([0-9]+)/?$ settings.php?mode=$1&page=$2 [L,QSA]
RewriteRule ^friends/?$ settings.php?friend-action=true [L,QSA]
# Private Messages

View file

@ -27,8 +27,10 @@ $disqus_data = [
// Add page specific things
$renderData['newsPosts'] = Main::getNewsPosts((isset($_GET['id']) && !isset($_GET['xml']) && is_numeric($_GET['id'])) ? $_GET['id'] : null, (isset($_GET['id']) && !isset($_GET['xml']) && is_numeric($_GET['id'])));
$renderData['page'] = [
'title' => (isset($_GET['id']) ? (count($renderData['newsPosts']) ? $renderData['newsPosts'][0]['title'] : 'Post does not exist!') : 'Flashii News'),
'disqus_sso' => (($disqus_message = base64_encode(json_encode($disqus_data))) .' '. Main::dsqHmacSha1($disqus_message .' '. time(), Configuration::getConfig('disqus_api_secret')) .' '. time())
'title' => (isset($_GET['id']) ? (count($renderData['newsPosts']) ? $renderData['newsPosts'][0]['title'] : 'Post does not exist!') : 'News'),
'disqus_sso' => (($disqus_message = base64_encode(json_encode($disqus_data))) .' '. Main::dsqHmacSha1($disqus_message .' '. time(), Configuration::getConfig('disqus_api_secret')) .' '. time()),
'view_post' => isset($_GET['id']) && count($renderData['newsPosts']),
'currentPage' => 0
];
// News XML feed
@ -133,5 +135,14 @@ if(isset($_GET['xml'])) {
}
// If we're not using the XML feed and we're not viewing a single post create pages
if(!isset($_GET['id'])) {
// Create the current page
$renderData['newsPosts'] = array_chunk($renderData['newsPosts'], Configuration::getConfig('news_posts_per_page'), true);
$renderData['page']['currentPage'] = isset($_GET['page']) && ($_GET['page'] - 1) >= 0 ? $_GET['page'] - 1 : 0;
}
// Print page contents
print Templates::render('main/news.tpl', $renderData);

View file

@ -133,7 +133,7 @@ if(isset($_REQUEST['request-notifications']) && $_REQUEST['request-notifications
if($continue) {
// Execute the action
$action = (isset($_REQUEST['add']) ? Users::addFriend($_REQUEST['add']) : Users::removeFriend($_REQUEST['remove']));
$action = (isset($_REQUEST['add']) ? Users::addFriend($_REQUEST['add']) : Users::removeFriend($_REQUEST['remove'], true));
// Set the messages
$messages = [
@ -180,6 +180,13 @@ if(isset($_REQUEST['request-notifications']) && $_REQUEST['request-notifications
}
if(isset($_REQUEST['direct']) && $_REQUEST['direct'] && !isset($_REQUEST['ajax'])) {
header('Location: '. $renderData['page']['redirect']);
exit;
}
// Print page contents or if the AJAX request is set only display the render data
print isset($_REQUEST['ajax']) ?
(
@ -200,23 +207,24 @@ if(Users::checkLogin()) {
// Settings page list
$pages = [
'home' => ['General', 'Home'],
'profile' => ['General', 'Edit Profile'],
'friends' => ['General', 'Friends'],
'groups' => ['General', 'Groups'],
'notifications' => ['Notifications', 'History'],
'avatar' => ['Aesthetics', 'Avatar'],
'background' => ['Aesthetics', 'Background'],
'page' => ['Aesthetics', 'Profile Page'],
'email' => ['Account', 'E-mail Address'],
'username' => ['Account', 'Username'],
'usertitle' => ['Account', 'User Title'],
'password' => ['Account', 'Password'],
'ranks' => ['Account', 'Ranks'],
'sessions' => ['Danger zone', 'Sessions'],
'regkeys' => ['Danger zone', 'Registration Keys'],
'deactivate' => ['Danger zone', 'Deactivate Account'],
'notfound' => ['Settings', '404']
'home' => ['General', 'Home'],
'profile' => ['General', 'Edit Profile'],
'groups' => ['General', 'Groups'],
'friends' => ['Friends', 'List'],
'friendrequests' => ['Friends', 'Requests'],
'notifications' => ['Notifications', 'History'],
'avatar' => ['Aesthetics', 'Avatar'],
'background' => ['Aesthetics', 'Background'],
'page' => ['Aesthetics', 'Profile Page'],
'email' => ['Account', 'E-mail Address'],
'username' => ['Account', 'Username'],
'usertitle' => ['Account', 'User Title'],
'password' => ['Account', 'Password'],
'ranks' => ['Account', 'Ranks'],
'sessions' => ['Danger zone', 'Sessions'],
'regkeys' => ['Danger zone', 'Registration Keys'],
'deactivate' => ['Danger zone', 'Deactivate Account'],
'notfound' => ['Settings', '404']
];
// Current settings page
@ -224,7 +232,8 @@ if(Users::checkLogin()) {
// Render data
$renderData['page'] = [
'title' => $pages[$currentPage][0] .' / '. $pages[$currentPage][1]
'title' => $pages[$currentPage][0] .' / '. $pages[$currentPage][1],
'currentPage' => isset($_GET['page']) && ($_GET['page'] - 1) >= 0 ? $_GET['page'] - 1 : 0
];
// Section specific
@ -240,12 +249,17 @@ if(Users::checkLogin()) {
// Friends
case 'friends':
$renderData['friends'] = Users::getFriends();
$renderData['friends'] = array_chunk(array_reverse(Users::getFriends(null, true, true)), 12, true);
break;
// Pending Friend Requests
case 'friendrequests':
$renderData['friends'] = array_chunk(array_reverse(Users::getPendingFriends(null, true)), 12, true);
break;
// Notification history
case 'notifications':
$renderData['notifs'] = array_reverse(Users::getNotifications(null, 0, false, true));
$renderData['notifs'] = array_chunk(array_reverse(Users::getNotifications(null, 0, false, true)), 10, true);
break;
}