actually using identicon default across the site

v1.18.x
Julian Lam 12 years ago
parent 3848115afe
commit 9af39622ed

@ -107,6 +107,7 @@ fs.readFile(path.join(__dirname, 'config.json'), function(err, data) {
base_url: base_url,
port: port,
use_port: use_port,
upload_path: '/public/uploads/',
redis: {
host: redis_host,
port: redis_port

@ -38,7 +38,7 @@
var userLabel = rightMenu.find('#user_label');
userLabel.attr('href','/users/'+data['username']);
userLabel.find('img').attr('src',data['picture']+"?s=24");
userLabel.find('img').attr('src',data['picture']+"?s=24&default=identicon");
userLabel.find('span').html(data['username']);
} else {

@ -2,8 +2,13 @@
// Alternate Logins
var altLoginEl = document.querySelector('.alt-logins');
altLoginEl.addEventListener('click', function(e) {
if (e.target.nodeName === 'LI') {
document.location.href = e.target.getAttribute('data-url');
var target;
switch(e.target.nodeName) {
case 'LI': target = e.target; break;
case 'I': target = e.target.parentNode; break;
}
if (target) {
document.location.href = target.getAttribute('data-url');
}
});
}());

@ -47,8 +47,13 @@
// Alternate Logins
var altLoginEl = document.querySelector('.alt-logins');
altLoginEl.addEventListener('click', function(e) {
if (e.target.nodeName === 'LI') {
document.location.href = e.target.getAttribute('data-url');
var target;
switch(e.target.nodeName) {
case 'LI': target = e.target; break;
case 'I': target = e.target.parentNode; break;
}
if (target) {
document.location.href = target.getAttribute('data-url');
}
});

@ -18,9 +18,9 @@
</div>
<div class="span11 topic-row-content">
<div class="top-posters">
<img src="http://www.gravatar.com/avatar/fd37ce111f863c6665045c2d72d199bf?s=60" class="img-polaroid" />
<img src="http://www.gravatar.com/avatar/07c9c7170c3ac676c2561e3eeaee063c?s=60" class="img-polaroid" />
<img src="http://www.gravatar.com/avatar/91050ce0072697b53380c6a03a1bc12a?s=60" class="img-polaroid" />
<img src="http://www.gravatar.com/avatar/fd37ce111f863c6665045c2d72d199bf?s=60&default=identicon" class="img-polaroid" />
<img src="http://www.gravatar.com/avatar/07c9c7170c3ac676c2561e3eeaee063c?s=60&default=identicon" class="img-polaroid" />
<img src="http://www.gravatar.com/avatar/91050ce0072697b53380c6a03a1bc12a?s=60&default=identicon" class="img-polaroid" />
</div>
<div>
<h3><span class="badge badge-important">3</span> {topics.title} <small>24<i class="icon-star"></i></small></h3>

@ -16,7 +16,7 @@
<div class="span12">
<div class="post-block">
<a class="main-avatar" href="/users/{main_posts.username}">
<img src="{main_posts.gravatar}?s=80" align="left" /><br />
<img src="{main_posts.gravatar}?s=80&default=identicon" align="left" /><br />
<div class="hover-overlay">
{main_posts.username}<br />
<i class="icon-star"></i><span class="user_rep_{main_posts.uid}">{main_posts.user_rep}</span>
@ -56,7 +56,7 @@
<div class="span1 profile-image-block visible-desktop">
<!--<i class="icon-spinner icon-spin icon-2x pull-left"></i>-->
<a href="/users/{posts.username}">
<img src="{posts.gravatar}?s=80" align="left" />
<img src="{posts.gravatar}?s=80&default=identicon" align="left" />
</a>
<i class="icon-star"></i><span class="user_rep_{posts.uid} formatted-number">{posts.user_rep}</span>
</div>
@ -73,7 +73,7 @@
<div id="favs_{posts.pid}_{posts.uid}" class="favourite hidden-phone"><span class="post_rep_{posts.pid}">{posts.post_rep}</span><i class="{posts.fav_star_class}"></i></div>
<div class="post_reply"><i class="icon-reply"></i></div>
</span>
<img class="hidden-desktop" src="{posts.gravatar}?s=10" align="left" /> posted by <strong><a class="username-field" href="/users/{posts.username}">{posts.username}</a></strong> {posts.relativeTime} ago
<img class="hidden-desktop" src="{posts.gravatar}?s=10&default=identicon" align="left" /> posted by <strong><a class="username-field" href="/users/{posts.username}">{posts.username}</a></strong> {posts.relativeTime} ago
<span class="{posts.edited-class} hidden-phone">| last edited by <strong><a href="/users/{posts.editor}">{posts.editor}</a></strong> {posts.relativeEditTime} ago</span>
<span class="{posts.edited-class}"><i class="icon-edit visible-phone" title="edited by {posts.editor} {posts.relativeEditTime} ago"></i></span>
</div>

@ -138,6 +138,7 @@ var user = require('./../user.js'),
filename = uid + '-' + filename;
var uploadPath = config.upload_path + filename;
console.log(config);
console.log('trying to upload to : '+ global.configuration['ROOT_DIRECTORY'] + uploadPath);

@ -332,8 +332,8 @@ var utils = require('./../public/src/utils.js'),
User.createGravatarURLFromEmail = function(email) {
if (!email) email = utils.generateUUID();
var md5sum = crypto.createHash('md5');
md5sum.update(email).toLowerCase().trim();
var gravatarURL = 'http://www.gravatar.com/avatar/' + md5sum.digest('hex');
md5sum.update(email.toLowerCase().trim());
var gravatarURL = 'http://www.gravatar.com/avatar/' + md5sum.digest('hex') + '?default=identicon';
return gravatarURL;
}

@ -244,7 +244,7 @@ var express = require('express'),
return;
}
user.getUserField(uid, 'picture', function(picture) {
if (picture == null) res.redirect('http://www.gravatar.com/avatar/a938b82215dfc96c4cabeb6906e5f953');
if (picture == null) res.redirect('http://www.gravatar.com/avatar/a938b82215dfc96c4cabeb6906e5f953&default=identicon');
res.redirect(picture);
});
});

Loading…
Cancel
Save