Support Request SupportDifferent avatar on refresh?

Support Section
Previous topicNext topic
User avatar

Topic Author
Magic user status: Offline
Posts: 16
Joined: Nov 15th, '16, 13:03
    Mac OS X Safari

Different avatar on refresh?

Post by VikViku »

Your phpBB Version: phpBB3.2
Your phpBB Type: Standard phpBB
Extensions installed: Yes
Your knowledge: Basic Knowledge

What have you done before the problem was there?
I added script in the beginning of viewtopic.html

var rand = Math.floor((Math.random()*3)+1);
var imgCache = new Image();
imgCache.src = 'styles/pbwow3/theme/avatars/pic' + rand + '.jpg';
$(window).load(function() {
$("a[href$='&u=97'] img.avatar").attr("src",imgCache);

What have you already tried to solve the problem?

Description and Message
In the end, no result. I don't know how to make it work. Maybe someone could help me. Thanks in advanced.
User avatar

Magic user status: Offline
Posts: 112
Joined: Aug 25th, '16, 10:50
    Windows 7 Firefox

Re: Different avatar on refresh?

Post by kaspir »

Not trying to spam, I wish I could help you with javascript, but PHP is still my love and JS is nemesis. However, I provide a dirt-cheap service for use with any forum or website that allows you to use hyperlinked avatars and signatures. It just may be what you're looking to do here. If this doesn't interest you, I am sorry and please request to remove this post, otherwise:

Learn more:

Or just google: matching avatar signature service ;)
World of Phaos RPG online is making it's come back! Play free now!
Check out phpBB contributions & extension downloads. :P
User avatar

Magic user status: Offline
Posts: 84
Joined: Oct 20th, '15, 09:43
    Windows 10 Chrome

Re: Different avatar on refresh?

Post by Posey »

It's hard to check, but do you even have avatars in that path?
Because I can not find any when changing the src attribute in my console.
And you need to have atleast 4 (1 .. 4) images in there, as those are the possibilities.

Not to mention a few errors..:
''I'm pretty sure there's a lot more to life than being really, really, ridiculously good looking.
And I plan on finding out what that is.''

Previous topicNext topic