Skip to content

Node.js based forum software built for the modern web

some profile changes, added post count to users and account and some css to account

Baris Soner Usakli48d5100dfe0b
diff --git a/public/css/style.less b/public/css/style.less
index 13c2f43c56..1e6a81775d 100644
--- a/public/css/style.less
+++ b/public/css/style.less
@@ -272,4 +272,18 @@ footer.footer {
color: rgb(100,100,100);
font-weight: 600;
cursor: pointer;
+}
+
+.account-username{
+ font-size:20px;
+ font-weight:bold;
+}
+
+.account-bio-block{
+ display:inline-block;
+}
+
+.account-bio-label{
+ display:inline-block;
+ width:100px;
}
\ No newline at end of file
diff --git a/public/templates/account.tpl b/public/templates/account.tpl
index 2b1ce5b327..af8a5715d8 100644
--- a/public/templates/account.tpl
+++ b/public/templates/account.tpl
@@ -7,21 +7,36 @@
</div>
<!-- BEGIN user -->
+
+ <span class="account-username">{user.username}</span>
+ <br/>
+
+ <div class="account-bio-block">
+ <img src="{user.picture}?s=128" />
+ </div>
+
+ <div class="account-bio-block">
+ <span class="account-bio-label">Member for </span>
+ <span>{user.joindate}</span>
+ <br/>
+
+ <span class="account-bio-label">Reputation </span>
+ <span>{user.reputation}</span>
+ <br/>
- <img src="{user.picture}" />
+ <span class="account-bio-label">Posts</span>
+ <span>{user.postcount}</span>
+ </div>
+
<br/>
- <span>{user.username}</span>
- <br/>
+
+
+
+ <br/>
+
+
<label for="email">Email Address</label><input type="text" placeholder="Enter Email Address" id="email" /><br />
<button class="btn btn-primary" id="reset" type="submit">Reset Password</button>
- <br/>
- <span>Member for </span>
- <span id="membersince">{user.joindate}</span>
- <br/>
-
- <span>Reputation </span>
- <span id="membersince">{user.reputation}</span>
- <br/>
<!-- END user -->
diff --git a/src/posts.js b/src/posts.js
index 8a4bf8a4f5..e03badb1fd 100644
--- a/src/posts.js
+++ b/src/posts.js
@@ -202,7 +202,10 @@ var RDB = require('./redis.js'),
// User Details - move this out later
RDB.lpush('uid:' + uid + ':posts', pid);
- if (callback) callback(pid);
+ RDB.db.hincrby(uid, 'postcount', 1);
+
+ if (callback)
+ callback(pid);
});
}
diff --git a/src/user.js b/src/user.js
index 068327ebd2..718827e130 100644
--- a/src/user.js
+++ b/src/user.js
@@ -197,7 +197,8 @@ var config = require('../config.js'),
'joindate' : new Date().getTime(),
'password' : hash,
'picture' : User.createGravatarURLFromEmail(email),
- 'reputation': 0
+ 'reputation': 0,
+ 'postcount': 0
});
RDB.set('username:' + username + ':uid', uid);