template example for user

v1.18.x
psychobunny 12 years ago
parent bff02a7f2e
commit 9e7654fa9a

@ -3,7 +3,7 @@
<!-- BEGIN topics -->
<a href="topic/{topics.slug}"><li class="topic-row">
<h4>{topics.title}</h4>
<p>Posted {topics.relativeTime} by user <span id="username"></span>. {topics.post_count} posts.</p>
<p>Posted {topics.relativeTime} by user <span class="username">{topics.uid}</span>. {topics.post_count} posts.</p>
</li></a>
<!-- END topics -->
</ul>
@ -14,7 +14,8 @@ new_post.onclick = function() {
}
jQuery('document').ready(function() {
var userId = {topics.uid};
jQuery('.username').each(function() {
var userId = this.innerHTML;
socket.on('api:user.get', function(userObj) {
console.log("derp");
@ -24,6 +25,11 @@ jQuery('document').ready(function() {
socket.emit('api:user.get', { fields: [ 'uid' ], 'uid': userId });
})
});

Loading…
Cancel
Save