matgb: (Webstuff)
Mat Bowles ([personal profile] matgb) wrote2009-05-04 06:25 pm

[LJ/DW] Making profile icons look cool in your layout

One of the things I like about journalling platforms based on the LJ codebase is the easy shortcut for usernames that'll link to both the blog itself and the profile, with that nice little logo for the profile link.

ETA: At the top, unfortunately. The site where some of my icons was hosted, dammitja.net appears to be down, I'll be contacting the site owner ASAP, but in the meantime, the code does work, but won't display properly here using the icons I liked :-(



LJ

DW

Mine

User

LJ User Icon

DW User Icon

Little Colin Baker

Community

LJ Comm Icon

DW Comm Icon

Little Tardis!

Feed

LJ Feed Icon

DW Feed Icon

Little Dalek!

Others
Little Peter! Little Mr Flibble! LJ userbloke
Thing is, the nice little logo doesn't always suit the style of the place it's appearing in, or the colour scheme of the layout. So, given I know how to replace them, I thought I'd update the code and add some new tweaks. As always, CSS hackery, playing with CSS is both fun and easy, I highly recommend it for people of a web-savvy nature.

I have, naturally, chosen a Doctor Who theme to my replacement images—feel free to replace them with something else if you wish. I forget where I got the original code for to do this, it's heavily updated now, but I'd like to credit the author, so if you know, gimme a link?

Anyway. Dreamwidth users should go to the DW Custom CSS page and paste the code into the big box.

Livejournal users should go to the LJ Custom CSS page and, go on, have a guess...

Yup, copy and paste the code into the box. One little caveat—it's replacing images taken from l-stat.livejournal.com, if LJ changes their CDN again, then the URL might change and the code'll stop working, I'll update it as soon as I know to, it's likely to be a simple change the letter hack (it used to be p-stat.*)

The Colin icon is taken from [livejournal.com profile] allah_sulu's Ten Doctor's. If you want to use different images, then replacing the image location is fairly easy, just make sure you also change the dimensions in the 'padding' area, the first two are effectively height and width.

I deliberately haven't done one for OpenID accounts, I might change my mind on that but I think the OpenID logo ought to be got used to. I'm considering a DW staff replacement, but not sure what I should go for (either Five or appeal a bit). Haven't bothered with sponsored Comms, probably ought to, not doing so means the image won't show up at all.

As always, feel free to link or comment with questions, etc.
mendi: (Default)

[personal profile] mendi 2009-05-04 07:18 pm (UTC)(link)
Thanks for the invite Mat - you didn't send me a code, does that mean you technically own my journal - or was the code in the Link? (I'm a complete techno simpleton I'm aftraid)
triadruid: Pseudocode for "If nothing else, remember this." (codemonkey)

[personal profile] triadruid 2009-05-04 10:02 pm (UTC)(link)
Snazzy post!
miss_s_b: River Song and The Eleventh Doctor have each other's back (Grammar Nazi)

[personal profile] miss_s_b 2009-05-05 12:11 am (UTC)(link)
Your spelling is AWFUL! :P

And your punctuation.
ext_28008: (Default)

[identity profile] mapp.livejournal.com 2009-05-05 06:53 am (UTC)(link)
Trouble is, while I like the Tardis and the Dalek icons, I don't really look at either of them and see "Community" and "RSS Feed" respectively...

[identity profile] paulatpingu.livejournal.com 2009-05-05 12:33 pm (UTC)(link)
(This is mostly to test Open ID posting)

They're nice, but I think now that the RSS logo is pretty much a Standard, changing it to something else is a bit confusing. I wouldn't have thought to look there if I was going to subscribe to your Journal/Blog/Width/Whatever.

But it's cool that you can do it, and that's worth praising.

[personal profile] ex_ardisia396 2009-07-15 12:59 am (UTC)(link)
I've tried adding this code to my css in my theme layer on my LJ but it wont compile.
I've put the message behind the cut:



S2 Compiler Output at Wed Jul 15 00:49:54 2009
Error compiling layer:

Compile error: line 216, column 32: Unexpected token found. Expecting: [TokenPunct] = ;
Got: [TokenIdent] = http
S2::Node, S2/Node.pm, 144
S2::NodeSet, S2/NodeSet.pm, 42
S2::Layer, S2/Layer.pm, 53
S2::Compiler, S2/Compiler.pm, 27


Context

212: /* so that IE users will still see an image */
213: background-image: url(http://i447.photobucket.com/albums/qq198/ardisia1/user_icons/user_green.png);
214: padding: 16px 16px 0 2px !important;
215: }
216: .ljuser img[src="http://l-stat.livejournal.com/img/userinfo.gif"] {
217: background-color:transparent;
218: background-image: url(http://i447.photobucket.com/albums/qq198/ardisia1/user_icons/user_green.png);
219: padding: 0px 0px 0 2px !important;
220: }



Hope you can give me a clue why it's not working. I really want to get this going. Ta!!!

Edited 2009-07-15 01:02 (UTC)

[personal profile] ex_ardisia396 2009-07-15 02:19 pm (UTC)(link)
Thanks Matgb. I've got it working that way and renamed my user layer.
Now I just need to get the user layer working with the theme layer.

Neat code though - many thanks.

PS. The wizard compile just added three back slashes before and after the attribute selectors URL, so once the code is there it can be cut and pasted into the theme layer and will compile fine.

example:
.ljuser img[src=\\\"http://l-stat.livejournal.com/img/userinfo.gif\\\"] {
background-color:transparent;
background-image: url(http://i447.photobucket.com/albums/qq198/ardisia1/user_icons/user_green.png);
padding: 16px 16px 0 0px !important;
}


 
Edited 2009-07-15 15:03 (UTC)
lunadelcorvo: (Default)

[personal profile] lunadelcorvo 2011-01-30 06:43 pm (UTC)(link)
This is awesome, thank you! I'm wondering though, if you know how to change the Edit/Tag/Memory/Share/Track icon images in posts as well?

In any case, thanks for sharing this!