change the unknown avatar picture
3 posters
Page 1 of 1
change the unknown avatar picture
i'm trying to change the unknown avatar picture to an image of my own for some reason it's not changing
PunBB
- Code:
$(function(){
if(!window.localStorage) return;
// Avatar by default
var default_avatar= 'http://2img.net/i/fa/invision/pp-blank-thumb.png';
// Time of cache, here : 24hrs * 60m * 60s * 1000ms so one day
var caching_time= 24*60*60*1000;
// Time of cache in case of error, here : 60s * 1000ms so one minute
var caching_error= 60*1000;
var set_avatar= function(id) {
$('.mini_ava.member'+id).html('<img src="'+get_avatar(id)+'" />');
};
var get_avatar= function(id) {
if(localStorage.getItem('t_ava'+id) < +new Date - caching_time || (localStorage.getItem('d_ava'+id)==default_avatar && localStorage.getItem('t_ava'+id) < +new Date - caching_error))
{
localStorage.setItem('d_ava'+id, default_avatar);
$.get('/u'+id, function (d){
localStorage.setItem('t_ava'+id,+new Date);
localStorage.setItem('d_ava'+id, $('#profile-advanced-right .module:first div img:first,.forumline td.row1.gensmall:first > img, .frm-set.profile-view.left dd img,dl.left-box.details:first dd img, .row1 b .gen:first img, .real_avatar img',d).first().attr('src')||default_avatar);
set_avatar(id);
});
}
return localStorage.getItem('d_ava'+id);
};
var to_replace= {};
$('dd.lastpost strong a.gensmall, .ipbtable tr td:last-child span strong a.gensmall, .table td.tcr strong a.gensmall, .forumline .row3.over strong a.gensmall').each(function(){
to_replace[$(this).attr('href').substr(2)]= 1;
$(this).closest('td,dd').prepend('<div class="mini_ava member'+$(this).attr('href').substr(2)+'"></div>');
});
for(i in to_replace)
{
set_avatar(i);
};
});
PunBB
Re: change the unknown avatar picture
Hi
Why don't you try this instead?
ACP < Display < Avatar Management < Avatars Management < Copy the links and upload the photo for unknown < Make sure you clicked "Define as default avatar"
It would be easier.
Regards,
Pizza Boi
Why don't you try this instead?
ACP < Display < Avatar Management < Avatars Management < Copy the links and upload the photo for unknown < Make sure you clicked "Define as default avatar"
It would be easier.
Regards,
Pizza Boi
Pizza Boi- Hyperactive
- Posts : 2016
Reputation : 160
Language : French
Location : Pizza Hut!
Re: change the unknown avatar picture
Hi
The pizza's here! That'd be 2.99$ .
No problem~
Regards,
Pizza Boi
The pizza's here! That'd be 2.99$ .
No problem~
Regards,
Pizza Boi
Pizza Boi- Hyperactive
- Posts : 2016
Reputation : 160
Language : French
Location : Pizza Hut!
Re: change the unknown avatar picture
Problem solved & topic archived.
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Similar topics
» Picture below Avatar
» Picture-avatar request
» online picture over avatar
» widget and avatar picture
» How can I manage the rank picture above the avatar, when the name remain below that?
» Picture-avatar request
» online picture over avatar
» widget and avatar picture
» How can I manage the rank picture above the avatar, when the name remain below that?
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum