inherit
(?)?
188910
0
Jan 26, 2013 13:30:48 GMT -8
♥ ℒʊ√ ♥
Clouds float into my life no longer to carry rain or usher storm but to add color to my sunset sky.
10,458
January 2013
luv
|
Post by ♥ ℒʊ√ ♥ on Nov 7, 2014 17:07:35 GMT -8
I'll mention that this doesn't address any padding issues that will most likely exist, and we also need to make some small changes for guests too, but both of those issues are easily remedied after the brunt of the work I described above is done (that, and I'm just about out of the office for the day, so we'll have to pick it up tomorrow). No problem. Enjoy!
|
|
inherit
(?)?
188910
0
Jan 26, 2013 13:30:48 GMT -8
♥ ℒʊ√ ♥
Clouds float into my life no longer to carry rain or usher storm but to add color to my sunset sky.
10,458
January 2013
luv
|
Post by ♥ ℒʊ√ ♥ on Nov 8, 2014 12:11:16 GMT -8
Padding, David Clark?
This works, but it needs to be moved away from the Login/Logout just a tad.
|
|
inherit
The Great Cinnamon Roll
191518
0
Oct 19, 2016 22:17:44 GMT -8
David Clark
Care for some tai chi with your chai tea?
17,602
March 2013
davidlinc1
|
Post by David Clark on Nov 8, 2014 12:24:05 GMT -8
You can try this instead of the CSS I provided before, ♥ ℒʊ√ ♥:
|
|
inherit
(?)?
188910
0
Jan 26, 2013 13:30:48 GMT -8
♥ ℒʊ√ ♥
Clouds float into my life no longer to carry rain or usher storm but to add color to my sunset sky.
10,458
January 2013
luv
|
Post by ♥ ℒʊ√ ♥ on Nov 8, 2014 12:32:20 GMT -8
Perfect, David Clark. I tweaked size and padding, but it's what I wanted.
Is there a way I can do this for guests with the dafault avatar?
|
|
inherit
The Great Cinnamon Roll
191518
0
Oct 19, 2016 22:17:44 GMT -8
David Clark
Care for some tai chi with your chai tea?
17,602
March 2013
davidlinc1
|
Post by David Clark on Nov 8, 2014 12:33:45 GMT -8
Yeah, let me take another look and I'll get back to you with what we need to change so guests see the theme's default avatar.
|
|
inherit
(?)?
188910
0
Jan 26, 2013 13:30:48 GMT -8
♥ ℒʊ√ ♥
Clouds float into my life no longer to carry rain or usher storm but to add color to my sunset sky.
10,458
January 2013
luv
|
Post by ♥ ℒʊ√ ♥ on Nov 8, 2014 12:46:10 GMT -8
|
|
inherit
The Great Cinnamon Roll
191518
0
Oct 19, 2016 22:17:44 GMT -8
David Clark
Care for some tai chi with your chai tea?
17,602
March 2013
davidlinc1
|
Post by David Clark on Nov 8, 2014 13:49:42 GMT -8
Try replacing the code I gave you before with this for guests, ♥ ℒʊ√ ♥. <script>
$(document).ready(function() { if (proboards.data('user').is_logged_in == 1) {
var avatarHTML = proboards.data('user').avatar
$('#welcome a').before(avatarHTML) $('#welcome .avatar-wrapper img').unwrap().addClass("smallAvatarImg");
} else {
var guestAvatarSrcVariable = proboards.data('default_avatar') var html = $('#welcome').html();
thing = "<img class='smallAvatarImg' src="+guestAvatarSrcVariable+">" html = html.replace(/((\w+\W+){2})/, '$1'+thing+'');
$('#welcome').html(html);
} });
</script>
|
|
inherit
133146
0
Jan 7, 2024 2:07:03 GMT -8
Alanna 🥀🖤
3,564
November 2008
alannab
|
Post by Alanna 🥀🖤 on Nov 8, 2014 13:58:56 GMT -8
David Clark, I may be mistaken of what you are trying to do for ♥ ℒʊ√ ♥, but I have not had to use JavaScript to get the avatar to change for guests and to take the default avatar of different themes since the variable $[current.user_avatar] already does that.
|
|
Alisha
Junior Member
Cake, and grief counseling, will be available at the conclusion of the test.
Posts: 308
inherit
174267
0
May 13, 2021 18:22:45 GMT -8
Alisha
Cake, and grief counseling, will be available at the conclusion of the test.
308
December 2011
alishabussart
|
Post by Alisha on Nov 8, 2014 14:01:24 GMT -8
I just looked and it seems like you have the variable in the section that pertains to guests -- since they don't have an avatar, nothing will appear (we need to add the default avatar image manually). Sorry, I just wanted to post to day that using the $[current_user.avatar_small] variable will produce the default avatar for guests. I've used this method MANY times on my various themes - no script required. This can be shown here, here, and here(currently).
|
|
inherit
(?)?
188910
0
Jan 26, 2013 13:30:48 GMT -8
♥ ℒʊ√ ♥
Clouds float into my life no longer to carry rain or usher storm but to add color to my sunset sky.
10,458
January 2013
luv
|
Post by ♥ ℒʊ√ ♥ on Nov 8, 2014 14:09:37 GMT -8
Thank you, @khristian and Alisha for your input. It's very much appreciated.
Alisha, I'm glad to find someone who has used this and you're correct. I just checked out your boards you've listed, and indeed, I see an avatar next to guest.
As always, I just love how volunteers and staff all come together on ProBoards. It really is why it's the BEST.
Thank you, all ~ and you, David Clark, for the wonderful assistance in an idea I see is not unique to me!
|
|
inherit
The Great Cinnamon Roll
191518
0
Oct 19, 2016 22:17:44 GMT -8
David Clark
Care for some tai chi with your chai tea?
17,602
March 2013
davidlinc1
|
Post by David Clark on Nov 8, 2014 14:13:34 GMT -8
Thanks guys -- I am aware, but since Luv wants a specific, inline placement for the guest avatar, the code is necessary to generate it as an <img> element (instead of an img wrapped in a div). JavaScript would be required either way, so there's no real benefit in using the $[current_user.avatar_small] or _quote over the proboards.data('default_avatar') that's also loaded on every page. And ♥ ℒʊ√ ♥, no problem.
|
|
inherit
133146
0
Jan 7, 2024 2:07:03 GMT -8
Alanna 🥀🖤
3,564
November 2008
alannab
|
Post by Alanna 🥀🖤 on Nov 8, 2014 14:22:16 GMT -8
Couldn't you not just add display:inline to that specific avatar and wrapper using CSS to avoid the JavaScript? I do it often since me being JavaScript-tarded... I have to use CSS to get around things like that.
|
|
inherit
The Great Cinnamon Roll
191518
0
Oct 19, 2016 22:17:44 GMT -8
David Clark
Care for some tai chi with your chai tea?
17,602
March 2013
davidlinc1
|
Post by David Clark on Nov 8, 2014 14:34:24 GMT -8
That would definitely work if we were shooting to show the avatar on either the left or right side of the welcome header, but in this case Luv wanted the avatar between the "Welcome" text and the logout link where the member's name would be, which makes the JavaScript necessary to get the avatar stripped down to just an <img> element. I'm sure there are other solutions, maybe even simpler ones -- I just might not be aware of them.
|
|
inherit
133146
0
Jan 7, 2024 2:07:03 GMT -8
Alanna 🥀🖤
3,564
November 2008
alannab
|
Post by Alanna 🥀🖤 on Nov 8, 2014 14:45:17 GMT -8
Hrm. I've done the same exact thing before using the CSS to overwrite the wrapper div and the img styling of the avatar, but all well.
|
|
inherit
The Great Cinnamon Roll
191518
0
Oct 19, 2016 22:17:44 GMT -8
David Clark
Care for some tai chi with your chai tea?
17,602
March 2013
davidlinc1
|
Post by David Clark on Nov 8, 2014 14:50:20 GMT -8
I tried going that route first, but couldn't get it working on ♥ ℒʊ√ ♥'s forum, so it might be down to different template structure, not sure. I don't doubt that ♥ ℒʊ√ ♥ would be willing put the necessary variables in place for you if you wanted to check it out and see if you have any insight in terms of a non-JS solution, though. If not though, it shouldn't be a problem - the JS solution produces pretty much the same thing (just in a different way).
|
|