Greasemonkey script to add your own SDMB avatars

If you really care - this is the bit that handles the sizing -

Not so much a Greasemonkey thing as an HTML thing.

I’ll do you one better. The SDMB actually does allow avatars, they just don’t display them on the forums. For example (because I know she has one), here is OpalCat’s profile, here is her avatar all by itself. Everyone could just upload their avatar right to there. As much as I like the idea of having a picture of the user, this would probably be the easiest thing to implement. My guess is that someone would have have to manually link each person’s avatar to their username though. I assume that would either be done manually by the end user or whomever maintains the script would have to periodically release updates as people upload their avatars (and then let the script maintainer know that they know have one).

Awesome find!

If people upload an avatar to their SDMB profile, I can periodically update the script to use people’s avatars.

I had noticed that as well, but the ability to do so appears to be limited to charter members and mods/admins and SDSAB members.(perhaps ironically, **Bosda Di’Chi of Tricor **has one too), but I can’t seem to find any facility for uploading one in my User CP as a guest, and I have never seen a plain old ‘member’ that has one.

Yeah, I just noticed that as well. The only solution then that works for everyone is to simply add the url of their desired avatar in the text of their profile like I did.

When I first started writing the post I was hoping the image URL and the profile URL would somehow be related so the GM script wouldn’t have to be manually updated but that doesn’t seem to be the case. I suppose just putting the a URL in your profile would work as well. Perhaps preceded by some specific set of characters or a phrase (as you did, or something like “%”) would give the script something to look for to reduce errors and give people a way to Opt-In. If the script doesn’t see that phrase it doesn’t show an avatar. This way nothing would have to be updated or maintained.

I added mine. SDMB Avatar: http://img856.imageshack.us/img856/1665/akumal.jpg

It looks nice. Thank you Polerius.

That still has the disadvantage of requiring people to periodically reinstall your script. Can’t you just make the script dynamically fetch the avatar from the user’s profile? Then people can add, remove, and change their avatars as often as they want, and nobody has to reinstall your script.

That was the text-replace script, wasn’t it? So one could, say, replace the term “Regards,” with “AH SHIT MA PANTS!!!” (Just to pick a random example.)

[off-topic] Wanna know something funny? I have that script, and I use it to replace “Regards,” with “I poop in my pants”.

I’m not sure what this says about either of us.

I don’t think it’s bogus. I think people honest-to-god just don’t understand.

What if someones avatar commits a crime? Can the person be held liable?

What if I don’t like the avatars that people pick for themselves and want to substitute avatars for individual posters that fit with my personal view of them. Could I do that with the script the OP posted and have my own separate avatar file married up to specific usernames?

The script exists solely within your browser, so you have full control of what it does, and you can edit the script and make it show any images you want.

You just need to edit the part that currently says


 var avatars = {
         'Polerius'          : 'http://upload.wikimedia.org/wikipedia/commons/7/7a/1859-Martinique.web.jpg',
         'someotherusername' : 'http://url.of/avatar.jpg'
       };

That’s awesome!

So does anyone think that I would need permission from each individual user before I selected an image to associate with their username? I already do it in my head, so this would just be putting it electronically in place using my browser.

Why would you need anyone’s permission? It is just something going on in your own web browser.

The only time a question of having permission might come up would be if, for example, the webmaster of a site saw that you were linking to images on their server to use them for this purpose, or whatever purpose, and they didn’t want you to do so.

If they decided not to give you permission they could block your IP or just shut down their site completely if it were important enough to them to stop you. So you need the permission of the host in that sense - if they decide they don’t want you to load images from their site they can prevent it while still allowing visitors to their pages to see the images.

So eloquently beautiful in its simplicity.

Why thank you.

I hope you didn’t neglect to see the rest of that eloquent quote - if someone has dedicated a server and time to hosting images for one reason and others decide to volunteer that server for their own bandwidth needs for other projects, it could very well end badly for everyone who might have enjoyed that server for it’s original purpose. It would probably go away or wind up restricted access.

Saying something is a matter of courtesy seems to be pretty clear, but I’m surprised that for some, it’s such an elusive concept.

To anyone who may be using the script, I updated my list with URL’s to those SDMB mods and admins who have elected to have avatars in their profiles. (in order of appearance, based on the order of the Forums).

I think SDSAB and Charter Members all may have avatars as well if they chose to upload one.

Since these images were uploaded to the SDMB with the express purpose of being used as avatars I hope that this is OK with all concerned.




// ==UserScript==
// @name           SDMB Avatars
// @namespace      test
// @description    SDMB Avatars
// @include        http://boards.straightdope.com/sdmb/*
// ==/UserScript==
(function() 
 {
     var avatars = {
            'Polerius'       : 'http://upload.wikimedia.org/wikipedia/commons/7/7a/1859-Martinique.web.jpg',

        'Crazyhorse'  :  'http://img856.imageshack.us/img856/1665/akumal.jpg',

             'TubaDiva'     : 'http://boards.straightdope.com/sdmb/image.php?u=32&dateline=1270212833&type=profile',

        'Rico' : 'http://boards.straightdope.com/sdmb/image.php?u=207&dateline=1226640205&type=profile',

        'C K Dexter Haven' : 'http://boards.straightdope.com/sdmb/image.php?u=19&dateline=1226697341&type=profile',

        'Gary "Wombat" Robson' : 'http://boards.straightdope.com/sdmb/image.php?u=32947&dateline=1259169736&type=profile',

        'Ellen Cherry' : 'http://boards.straightdope.com/sdmb/image.php?u=1185&dateline=1305921166&type=profile',

        'fluiddruid' : 'http://boards.straightdope.com/sdmb/image.php?u=19467&dateline=1229804609&type=profile',

        'Czarcasm' : 'http://boards.straightdope.com/sdmb/image.php?u=774&dateline=1286278670&type=profile',

        'Cajun Man' : 'http://boards.straightdope.com/sdmb/image.php?u=4803&dateline=1259262759&type=profile',

        'Idle Thoughts' : 'http://boards.straightdope.com/sdmb/image.php?u=38203&dateline=1226708361&type=profile'
       };

     var allNameHeaders    = document.getElementsByClassName('bigusername');

     for (var i = 0; i < allNameHeaders.length; i++)
     {
        var username = allNameHeaders*.innerHTML;

        if (username in avatars)
        {
          var img_src  = avatars[username];
          var img_html = "<img src=\"" + img_src + "\" width=\"50px\" height=\"50px\" style=\"float: left; margin-right: 5px; border-width:0;\">";
          allNameHeaders*.innerHTML =  img_html + allNameHeaders*.innerHTML;
        }
     }

 })();

So this means you CAN use goatsec as an avatar, and the mods would be none the wiser?