Profile background
+2
Ange Tuteur
Tonight
6 posters
Page 1 of 1
Profile background
Hi, is it possible to give members ability to have their personal profile background? Something with similar script as this: https://help.forumotion.com/t137498-profile-song-javascript-help
Forum version: phpBB3
Forum version: phpBB3
Last edited by Tonight on 31/1/2015, 06:50; edited 1 time in total
Tonight- Forumember
- Posts : 312
Reputation : 80
Language : Estonian, English, Russian
Location : Estonia
Re: Profile background
Hello @Tonight,
Create a new profile field that has these options :
Type : Text field
Display : Profiles
The rest is up to you.
Next go to Administration Panel > Modules > JavaScript codes management > Create a new script
Title : Your choice
Placement : In all the pages
Paste the code below :
Go to your profile and click on the field that you just added. Copy the ID which shows up, and then you can remove this script.
Now create another script :
Title : Your choice
Placement : In all the pages
Paste the code below :
All you need to do is replace field_id-11 with the ID which you copied before, and you should be set.
Create a new profile field that has these options :
Type : Text field
Display : Profiles
The rest is up to you.
Next go to Administration Panel > Modules > JavaScript codes management > Create a new script
Title : Your choice
Placement : In all the pages
Paste the code below :
- Code:
window.location.pathname.match(/\/u\d+/) & $(function() { $('#profile-tab-field-profil dl').click(function() { alert(this.id) }) });
Go to your profile and click on the field that you just added. Copy the ID which shows up, and then you can remove this script.
Now create another script :
Title : Your choice
Placement : In all the pages
Paste the code below :
- Code:
window.location.pathname.match(/\/u\d+/) && $(function() {
var field = 'field_id-11';
document.body.style.backgroundImage = 'url(' + $('#'+field+' .field_uneditable').text() + ')';
});
All you need to do is replace field_id-11 with the ID which you copied before, and you should be set.
Re: Profile background
Hey, works great. But is there a way to have default background as well? So if member hasn't picked a custom background, then there will be default background chosen by me.
Tonight- Forumember
- Posts : 312
Reputation : 80
Language : Estonian, English, Russian
Location : Estonia
Re: Profile background
Try this :
You'll see a variable named default_bg place your image between the quotes.
- Code:
window.location.pathname.match(/\/u\d+/) && $(function() {
var field = 'field_id-11', default_bg = '', bg = $('#'+field+' .field_uneditable').text();
bg.length ? bg = bg : bg = default_bg;
document.body.style.backgroundImage = 'url(' + bg + ')';
});
You'll see a variable named default_bg place your image between the quotes.
Re: Profile background
Hello,
When I click on otheer tabs the background becomes black. Like on Profile it's fine but on Wall it's just black.
Also is there a way to hide the link from the public profile page?
Also, when I try to edit the picture link, I can't tripple click to highlight the whole link, which means I have to manually highlight the link.
Are there ways to fix this? Thanks
EDIT: Another problem is that if someone doesn't upload a pipcture, the background becomes black.
When I click on otheer tabs the background becomes black. Like on Profile it's fine but on Wall it's just black.
Also is there a way to hide the link from the public profile page?
Also, when I try to edit the picture link, I can't tripple click to highlight the whole link, which means I have to manually highlight the link.
Are there ways to fix this? Thanks
EDIT: Another problem is that if someone doesn't upload a pipcture, the background becomes black.
Re: Profile background
Yeah, there's a slight problem. It takes background-color as default, I'd like it to take background-image.
Tonight- Forumember
- Posts : 312
Reputation : 80
Language : Estonian, English, Russian
Location : Estonia
Re: Profile background
i havent used or tested this so im not 100% on this but
put a img url in
as for hiding the field this should work
as for everything else u have to wait on ange its his code
put a img url in
- Code:
default_bg = 'imageurl.gif'
as for hiding the field this should work
- Code:
window.location.pathname.match(/\/u\d+/) && $(function() {
var field = 'field_id-11', default_bg = '', bg = $('#'+field+' .field_uneditable').text();
$('#'+field).css('display','none');
bg.length ? bg = bg : bg = default_bg;
document.body.style.backgroundImage = 'url(' + bg + ')';
});
as for everything else u have to wait on ange its his code
Re: Profile background
If I put the default bg image the other one won't appear on the main profile tab.
I have yet to mess with the second code as it how you gave it removes the location, will have to change the id. And about the second code, is there a way to also remove the white line? Because then all it shows is one line after then next on the profile.
Thanks a ton!
I have yet to mess with the second code as it how you gave it removes the location, will have to change the id. And about the second code, is there a way to also remove the white line? Because then all it shows is one line after then next on the profile.
Thanks a ton!
Re: Profile background
hello
how about you do the 1st worked answer from Ange
https://help.forumotion.com/t138649-profile-background#939026
then do this
but while you creating the new field add the image link in the
Default content and save
or Edit the filed you did add the Default content save then use replace content
here images of what i say
i hope that help
how about you do the 1st worked answer from Ange
https://help.forumotion.com/t138649-profile-background#939026
then do this
but while you creating the new field add the image link in the
Default content and save
or Edit the filed you did add the Default content save then use replace content
here images of what i say
i hope that help
Michael_vx- Forumember
- Posts : 659
Reputation : 29
Language : Arabic and some English
Location : Egypt
Re: Profile background
Using default content feature doesn't solve problems with other tabs in profiles.
Tonight- Forumember
- Posts : 312
Reputation : 80
Language : Estonian, English, Russian
Location : Estonia
Re: Profile background
other taps ?
im a bit confused now
im a bit confused now
Michael_vx- Forumember
- Posts : 659
Reputation : 29
Language : Arabic and some English
Location : Egypt
Re: Profile background
he wants the bg image to display on the other profile tabs but it wont because it has no image url to grab on those pages .. you would have to use ajax to request the main profile page to get the image url or have the url saved to your local storage until the page no longer contains the user id ... idk its ange project ill let him do it
Re: Profile background
The code would work fine if the main image as displayed on the other tabs, but for it to go completely black is downer...
Re: Profile background
Problem is that Ange's script loses forum's original background. If anyone clicks on other tabs, then he sees just black (or whatever is your bg color) instead of original image._Twisted_Mods_ wrote:he wants the bg image to display on the other profile tabs but it wont because it has no image url to grab on those pages .. you would have to use ajax to request the main profile page to get the image url or have the url saved to your local storage until the page no longer contains the user id ... idk its ange project ill let him do it
Tonight- Forumember
- Posts : 312
Reputation : 80
Language : Estonian, English, Russian
Location : Estonia
Re: Profile background
@Tonight
i Remember i have tried that Script from Ange before and it was working cool on phpbb3
try to remove the original BG color
that could help
i Remember i have tried that Script from Ange before and it was working cool on phpbb3
try to remove the original BG color
that could help
Michael_vx- Forumember
- Posts : 659
Reputation : 29
Language : Arabic and some English
Location : Egypt
Re: Profile background
Here, try this :
Replace https://i.servimg.com/u/f38/18/45/41/65/red10.gif by the default BG you want to display.
- Code:
window.location.pathname.match(/\/u\d+/) && $(function() {
var field = 'field_id-11', default_bg = 'http://i38.servimg.com/u/f38/18/45/41/65/red10.gif', url = window.location.pathname.match(/(\/u\d+)/)[1],bg;
if (window.location.pathname != url) {
$.get(url,function(data){
bg = $('#'+field+' .field_uneditable',data).text().trim();
setBG();
});
} else {
bg = $('#'+field+' .field_uneditable').text().trim();
$('#'+field+',#'+field+'+div').hide();
setBG();
}
function setBG() { bg.length > 1 ? bg = bg : bg = default_bg; document.body.style.backgroundImage = 'url(' + bg + ')'; };
});
Replace https://i.servimg.com/u/f38/18/45/41/65/red10.gif by the default BG you want to display.
Re: Profile background
Thank you, solved.
Tonight- Forumember
- Posts : 312
Reputation : 80
Language : Estonian, English, Russian
Location : Estonia
Similar topics
» user profile background image help
» How come I can't add a background image to my profile plate?
» Background Color etc of Profile in posts
» Warning" message background color in your profile
» Adding a background onto a specific member's profile page.
» How come I can't add a background image to my profile plate?
» Background Color etc of Profile in posts
» Warning" message background color in your profile
» Adding a background onto a specific member's profile page.
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum