footer.less, added stats cards (ala soundsz) and replaced old footer

v1.18.x
psychobunny 12 years ago
parent ff4b35d6f1
commit 3b75734672

@ -1,4 +1,3 @@
.category {
.span9 {
margin-bottom: 50px;

@ -0,0 +1,18 @@
.footer-stats {
.stats-card {
text-align: center;
h2 {
font-size: 40px;
line-height: 25px;
}
.pointer;
}
padding-top: 15px;
}
.footer {
padding-bottom: 10px;
}

@ -1,5 +1,6 @@
.categories {
padding-top: 10px;
h4 {
font-weight: 700;
text-align: left;

@ -9,4 +9,5 @@
@import "search";
@import "unread";
@import "admin";
@import "users";
@import "users";
@import "footer";

@ -1,47 +1,28 @@
(function() {
var num_users = document.getElementById('number_of_users'),
post_stats = document.getElementById('post_stats'),
latest_user = document.getElementById('latest_user'),
active_users = document.getElementById('active_users'),
var stats_users = document.getElementById('stats_users'),
stats_topics = document.getElementById('stats_topics'),
stats_posts = document.getElementById('stats_posts'),
stats_online = document.getElementById('stats_online'),
user_label = document.getElementById('user_label'),
active_record = document.getElementById('active_record'),
right_menu = document.getElementById('right-menu');
socket.emit('user.count', {});
socket.on('user.count', function(data) {
num_users.innerHTML = "We currently have <b>" + data.count + "</b> registered users.";
stats_users.innerHTML = data.count;
});
socket.emit('post.stats');
socket.on('post.stats', function(data) {
post_stats.innerHTML = "Our users have created <b>" + data.topics + "</b> topics and made <b>" + data.posts + "</b> posts.";
});
socket.emit('user.latest', {});
socket.on('user.latest', function(data) {
if (data.username == '') {
latest_user.innerHTML = '';
} else {
latest_user.innerHTML = "The most recent user to register is <b><a href='/users/"+data.userslug+"'>" + data.username + "</a></b>.";
}
stats_topics.innerHTML = data.topics;
stats_posts.innerHTML = data.posts;
});
socket.emit('api:user.active.get');
socket.on('api:user.active.get', function(data) {
var plural_users = parseInt(data.users) !== 1,
plural_anon = parseInt(data.anon) !== 1;
active_users.innerHTML = 'There ' + (plural_users ? 'are' : 'is') + ' <strong>' + data.users + '</strong> user' + (plural_users ? 's' : '') + ' and <strong>' + data.anon + '</strong> guest' + (plural_anon ? 's' : '') + ' online';
});
socket.emit('api:user.active.get_record');
socket.on('api:user.active.get_record', function(data) {
active_record.innerHTML = "most users ever online was <strong>" + data.record + "</strong> on <strong>" + (new Date(parseInt(data.timestamp,10))).toUTCString() + "</strong>";
stats_online.innerHTML = data.users + data.anon;
});
socket.emit('api:updateHeader', { fields: ['username', 'picture', 'userslug'] });
socket.on('api:updateHeader', function(data) {
jQuery('#search-button').on('click', function() {

@ -40,17 +40,34 @@
<div id="alert_window"></div>
<!-- START Forum Info -->
<div id="footer" class="container" style="padding-top: 50px; display: none">
<div class="alert alert-info">
<span id="active_users"></span>; <span id="active_record"></span><br />
<span id="number_of_users"></span> <span id="post_stats"></span><br />
<span id="latest_user"></span>
<div class="container footer-stats">
<div class="row">
<div class="col-md-3 col-xs-6">
<div class="stats-card well">
<h2><span id="stats_online"></span><br /><small>Online</small></h2>
</div>
</div>
<div class="col-md-3 col-xs-6">
<div class="stats-card well">
<h2><span id="stats_users"></span><br /><small>Users</small></h2>
</div>
</div>
<div class="col-md-3 col-xs-6">
<div class="stats-card well">
<h2><span id="stats_topics"></span><br /><small>Topics</small></h2>
</div>
</div>
<div class="col-md-3 col-xs-6">
<div class="stats-card well">
<h2><span id="stats_posts"></span><br /><small>Posts</small></h2>
</div>
</div>
</div>
<footer class="footer">Copyright &copy; 2013 <a target="_blank" href="http://www.nodebb.org">NodeBB</a> by <a target="_blank" href="https://github.com/psychobunny">psychobunny</a>, <a href="https://github.com/julianlam" target="_blank">julianlam</a>, <a href="https://github.com/barisusakli" target="_blank">barisusakli</a> from <a target="_blank" href="http://www.designcreateplay.com">designcreateplay</a></footer>
</div>
<!-- END Forum Info -->
<footer class="footer">Copyright &copy; 2013 <a target="_blank" href="http://www.nodebb.org">NodeBB</a> by <a target="_blank" href="https://github.com/psychobunny">psychobunny</a>, <a href="https://github.com/julianlam" target="_blank">julianlam</a>, <a href="https://github.com/barisusakli" target="_blank">barisusakli</a> from <a target="_blank" href="http://www.designcreateplay.com">designcreateplay</a></footer>
<script>
$.getScript(RELATIVE_PATH + '/src/forum/footer.js');
</script>

Loading…
Cancel
Save