How to change the background in user profiles?
3 posters
Page 1 of 1
How to change the background in user profiles?
Hello!
Please help me. I have a script that changes the design of categories on the forum, but I’m new to scripts and don’t understand how to change a user’s profile in the same way, that is, I want three or four users to have a different background in their profile, while the links in the script, i.e. indicate on which pages the script should work.
The script itself that I install in overal_footer_end before the </ body> tag. Although there is no difference. He also put scripts in the control panel for displaying on all pages. Does not work!
CSS settings:
I take this line
and change the address:
The problem is that when we allow a link to a profile instead of a category, then when I view this page it shows me that there are no changes!
why it happens ? please help me...
Here you just need to correctly put a link to use the script on the desired page. But I dont know how ...
Please help me. I have a script that changes the design of categories on the forum, but I’m new to scripts and don’t understand how to change a user’s profile in the same way, that is, I want three or four users to have a different background in their profile, while the links in the script, i.e. indicate on which pages the script should work.
The script itself that I install in overal_footer_end before the </ body> tag. Although there is no difference. He also put scripts in the control panel for displaying on all pages. Does not work!
- Code:
jQuery(document).ready(function(){
if (jQuery('.nav a').is("[href*='c1-category']")) {
jQuery("img#i_logo").attr('src', 'http://i15.servimg.com/u/f15/17/37/83/89/nddd3310.jpg'),
jQuery("body").addClass("darkbody")
}
else {jQuery("#i_logo").show()
}
});
CSS settings:
- Code:
.darkbody {
background: #35298B url("http://i15.servimg.com/u/f15/17/37/83/89/chbpol10.gif") top center !important;
}
.darkbody .bodyline {
background-color: #1D1D22 !important;
border: 1px solid #666 !important;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
-moz-box-shadow: 0px 0px 8px #000;
-webkit-box-shadow: 0px 0px 8px #000;
box-shadow: 0px 0px 8px #000;
}
.darkbody #i_logo {
border: 1px solid #666 !important;
}
I take this line
- Code:
if (jQuery('.nav a').is("[href*='c1-category']")) {
and change the address:
- Code:
if (jQuery('.nav a').is("[href*='u9']")) {
The problem is that when we allow a link to a profile instead of a category, then when I view this page it shows me that there are no changes!
why it happens ? please help me...
Here you just need to correctly put a link to use the script on the desired page. But I dont know how ...
Last edited by Storyteller of Wonderland on June 6th 2019, 6:38 pm; edited 1 time in total
Re: How to change the background in user profiles?
Hi there,
Are you looking for something that gives the user the power to change their own background or moderation have full control?
Are you looking for something that gives the user the power to change their own background or moderation have full control?
Re: How to change the background in user profiles?
Draxion wrote:Hi there,
Are you looking for something that gives the user the power to change their own background or moderation have full control?
Hello, Draxion!
Ideally, to look for a non-standard choice is almost unreal. or not ?
I want to personally change the profile design for some users. Avatar, background and other details in general. But this is not as important as the fact that I need the right link to the profile I need.
I own the design settings perfectly, but the scripts are something ... I understand them in part, but I showed an example above that nothing came of it.
In the last topic I asked for something funny. Ie the use of information about users in the list of users on another page. It turned out to be easy. I am writing a normal tutorial to share it.
However, I really do not understand why the link is not active? How to correctly explain the script that you need to work on the desired page?
no matter how I connect the script, it does not work
Re: How to change the background in user profiles?
Are you talking about this profile: https://help.forumotion.com/u109089 ?
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.
Re: How to change the background in user profiles?
Looking at your scripts, are you looking for something like this?
- Code:
if (top.location.pathname === "/u9") {
// execute code...
}
means the profile view page of that user."/u9"
Re: How to change the background in user profiles?
SLGray wrote:Are you talking about this profile: https://help.forumotion.com/u109089 ?
Hello, SLGray,
Yes Yes.
Draxion wrote:Looking at your scripts, are you looking for something like this?
- Code:
if (top.location.pathname === "/u9") {
// execute code...
}means the profile view page of that user."/u9"
So, but it does not work and destroys other scripts ...
I used your string and combined it with the code, but it did not work ...
Re: How to change the background in user profiles?
Hmm... it should work just the same, even if you used that by itself. I do have a script that I use on my site you can use that gives the user the power to change the background of their profiles. It simply takes the link out of the profile field and puts that as a background. Do you want it?
If you want full control, you can simply allow moderators to edit the field.
If you want full control, you can simply allow moderators to edit the field.
Re: How to change the background in user profiles?
Draxion wrote: Hmm... it should work just the same, even if you used that by itself. I do have a script that I use on my site you can use that gives the user the power to change the background of their profiles. It simply takes the link out of the profile field and puts that as a background. Do you want it?
If you want full control, you can simply allow moderators to edit the field.
Oooooh! Of course!
If possible, please give me such a script! That's cool!
Re: How to change the background in user profiles?
Here's the script.
ACP(Admin Control Panel) > Modules > HTML & JAVASCRIPT > Javascript codes management > Javascript codes management
Title: Whatever you like
Placement: All pages
In the code, you change the value field_id9 with whatever field you have chosen to use for the background URL. If you don't want users to have control, simply hide the field via CSS or Java but do not remove the element as that will not allow the script to work. If you still need assistance with this, please ask.
ACP(Admin Control Panel) > Modules > HTML & JAVASCRIPT > Javascript codes management > Javascript codes management
Title: Whatever you like
Placement: All pages
- Code:
/\/u\d+/.test(window.location.href) && $(function() {
var field = document.getElementById('field_id9'), bg;
if (field) {
bg = $('.field_uneditable', field)[0];
if (bg) document.body.style.backgroundImage = 'url(' + bg.innerHTML + ')';
}
});
In the code, you change the value field_id9 with whatever field you have chosen to use for the background URL. If you don't want users to have control, simply hide the field via CSS or Java but do not remove the element as that will not allow the script to work. If you still need assistance with this, please ask.
Re: How to change the background in user profiles?
Draxion wrote:Here's the script.
ACP(Admin Control Panel) > Modules > HTML & JAVASCRIPT > Javascript codes management > Javascript codes management
Title: Whatever you like
Placement: All pages
- Code:
/\/u\d+/.test(window.location.href) && $(function() {
var field = document.getElementById('field_id9'), bg;
if (field) {
bg = $('.field_uneditable', field)[0];
if (bg) document.body.style.backgroundImage = 'url(' + bg.innerHTML + ')';
}
});
In the code, you change the value field_id9 with whatever field you have chosen to use for the background URL. If you don't want users to have control, simply hide the field via CSS or Java but do not remove the element as that will not allow the script to work. If you still need assistance with this, please ask.
Oh my God! It is working! Thank you buddy!
Wait! But now how to add CSS properties to this class?
I want it to be background-attachment: fixed; and background-size: cover;
Re: How to change the background in user profiles?
You can simply add more to the script in terms of CSS with this part.
Just add another line with this.
So you the script would like this...
- Code:
document.body.style.backgroundImage = 'url(' + bg.innerHTML + ')';
Just add another line with this.
- Code:
document.body.style.backgroundAttachement = 'fixed';
So you the script would like this...
- Code:
/\/u\d+/.test(window.location.href) &&
$(function() {
var field = document.getElementById("field_id9"),
bg;
if (field) {
bg = $(".field_uneditable", field)[0];
if (bg) document.body.style.backgroundImage = "url(" + bg.innerHTML + ")";
document.body.style.backgroundAttachment = "fixed";
document.body.style.backgroundSize = "cover";
}
});
Re: How to change the background in user profiles?
Draxion, does it seem to me or are you a wizard? Thank you very much!
The issue is resolved!
The issue is resolved!
Re: How to change the background in user profiles?
You're very welcome!
Problem solved & topic archived.
|
Similar topics
» Change the background of the chatbox only in the section were the user list is
» Background to individual profiles
» Add a profile field for music to user profiles
» how to delete user profiles
» user profile background image help
» Background to individual profiles
» Add a profile field for music to user profiles
» how to delete user profiles
» user profile background image help
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum