URL: https://cozylife.forumotion.com/t3-test
When you scroll down this page (as logged user), you can see that Admin image is still the same as default one (selected from image upload) but it doesn't load the image set from edit field in user's profile.
It doesn't load for admin user. But when I am signed in as Admin, I can see for myself and for test user.
Script:
How can this work for admin normally but fails for user? It does load second avatar for himself, but not for admin, at all.
For testing purposes ask me in PM for user login credentials.
When you scroll down this page (as logged user), you can see that Admin image is still the same as default one (selected from image upload) but it doesn't load the image set from edit field in user's profile.
It doesn't load for admin user. But when I am signed in as Admin, I can see for myself and for test user.
Script:
- Code:
$(document).ready(function() {
let listOfUsers = document.querySelectorAll('.post-aside');
listOfUsers.forEach((item, index) => {
let listOfBackgroundUsers = document.querySelectorAll('.avatar-big img');
let address = item.querySelector('.post-author-name a').getAttribute('href');
$.ajax({
url: address,
method: "GET",
data: 'dl#field_id1',
dataType: "html",
success: function(data) {
let div = document.createElement('div');
div.innerHTML = data;
let secondAvatar = div.querySelector('dl#field_id1 dd div.field_editable.invisible input')?.getAttribute('value');
console.log(secondAvatar);
if (secondAvatar != "") {
$(listOfBackgroundUsers[index]).attr("src", secondAvatar);
}
}
});
});
});
How can this work for admin normally but fails for user? It does load second avatar for himself, but not for admin, at all.
For testing purposes ask me in PM for user login credentials.
Last edited by The Raven on August 31st 2023, 9:56 pm; edited 1 time in total