Log In · Register

 
'any size' profile pic code question...
unrequited
post Dec 23 2004, 07:54 PM
Post #1


DANG forgot to add a border XD
*****

Group: Member
Posts: 324
Joined: Nov 2004
Member No: 66,973



So I'm trying to use CreateBlog's profile pic: any size code but for some reason its not working when I put it in my webstats and stuff...pic doesnt show up at all =\

Does anyone know why?

Here's the exact code I'm using:

CODE
<!-- begin code provided by createblog.com -->
<script type="text/javascript">
  //
  // Copyright ?004 by EasterEgg.
  //
  // For use at Xanga only.
  //
  // This script allows you to use any online image as a profile pic,
  // regardless of it's size. You're no longer confined to 160 x 160 pixels
  // or the maximum width that the left sidebar allows, since this script
  // will also adjust the width of the left sidebar as you see fit.
  // Random pics will be chosen if you have added more than one profile pic
  // to the array "newProfileImages" below.
  //
  // This script is freeware and can be freely used as long as the copyright
  // notice and the comments in this script remains intact. It is provided
  // 'as is' without guarantees of any kind.
  //
  // The script doesn't work for Mac users...
  //

  // ****************** BEGINNING OF WHAT YOU CAN EDIT ********************

  // ***** Set the width of the image(s). Note that this has no effect in Netscape.
  maxWidth = 100;

  // ***** add as many images as you like to the array below.
  var newProfileImages = new Array(
      "http://img152.exs.cx/img152/3522/avatar8by.gif" // <-- !!! no comma after last img!
  );


  // ********************* END OF WHAT YOU CAN EDIT ************************
 
  indexNr = Math.round(Math.random() * (newProfileImages.length));
  if (indexNr == newProfileImages.length)
      indexNr = newProfileImages.length - 1;
     
  newProfilePicURL = newProfileImages[indexNr];
 
  newImage = new Image(maxWidth,0);
  newImage.src = newProfilePicURL;

  var allImages = document.images;

  // rule out Mac users
  if (navigator.userAgent.indexOf('Mac') == -1)
  {
      for ( i = 0; i < allImages.length; ++i )
      {
          if (allImages[i].src.indexOf('profile') != -1)
          {
              allImages[i].src = newProfilePicURL;
              // Netscape doesn't allow adjusting the image width
              if (navigator.userAgent.indexOf('Netscape') == -1)
              {
                  allImages[i].width = newImage.width;
                  newStyle = '<style>table.left { width:' + (newImage.width + 40) + 'px;}</style>';
                  document.write(newStyle);
              }
              break;
          }
      }
  }
</script>
<!-- end code provided by createblog.com -->
 
 
Start new topic
Replies (1 - 4)
xSuperLazyBoix
post Dec 23 2004, 08:08 PM
Post #2


-'<-:-.//Outkast\\.-:->'-
****

Group: Member
Posts: 138
Joined: Feb 2004
Member No: 4,215



i tried the code wit on eof my pics too, it dont work for meh either ermm.gif
 
pynk_laday
post Dec 23 2004, 11:10 PM
Post #3


Senior Member
***

Group: Member
Posts: 51
Joined: Dec 2004
Member No: 68,810



i am currently using that code and it does work for me.... im not sure why its not working...i know when i first tried it i only wanted one picture but it wouldnt work so i then added a lot of different pictures and it worked :D heres my code maybe u can compare

QUOTE
<!-- begin code provided by createblog.com -->
<!-- begin code provided by createblog.com -->
<script type="text/javascript">
    //
    // Copyright ©2004 by EasterEgg.
    //
    // version 2.0, June 2004
    //
    // For use at Xanga only.
    //
    // This script allows you to use any online image as a profile pic,
    // regardless of it's size. You're no longer confined to 160 x 160 pixels
    // or the maximum width that the left sidebar allows, since this script
    // will also adjust the width of the left sidebar as you see fit.
    // Random pics will be chosen if you have added more than one profile pic
    // to the array "newProfileImages" below.
    //
    // This script is freeware and can be freely used as long as the copyright
    // notice and the comments in this script remains intact. It is provided
    // 'as is' without guarantees of any kind.
    //

    // ****************** BEGINNING OF WHAT YOU CAN EDIT ********************

    // ***** Set the width of the image(s). Note that this has no effect in Netscape.
    maxWidth = 230;

    // ***** add as many images as you like to the array below.
    // ***** add as many images as you like to the array below.
    var newProfileImages = new Array(
        "http://img.photobucket.com/albums/v320/pynk_laday1/EnesGraduation001.jpg",
        "http://img.photobucket.com/albums/v320/pynk_laday1/EnesGraduation005.jpg",
        "http://img.photobucket.com/albums/v320/pynk_laday1/max002.jpg",
        " http://img.photobucket.com/albums/v320/pyn...edithsxv039.jpg ",
        " http://img.photobucket.com/albums/v320/pyn...y/sandras02.jpg ",
        " http://img.photobucket.com/albums/v320/pyn...aduation023.jpg " // <-- !!! no comma after last img!
    );

    // ********************* END OF WHAT YOU CAN EDIT ************************
    // ***** retrieve username
    allLinks = document.getElementsByTagName('a');
    for ( i = 0; i < allLinks.length; ++i )
    {
        if (allLinks[i].href.indexOf('reviews') != -1)
        {
            var userName = allLinks[i].href.substr(allLinks[i].href.indexOf('user=') + 5, allLinks[i].href.length);
            break;
        }   
    }
   
    indexNr = Math.round(Math.random() * (newProfileImages.length));
    if (indexNr == newProfileImages.length)
        indexNr = newProfileImages.length - 1;

    newProfilePicURL = newProfileImages[indexNr];
    newImage = new Image(maxWidth,0);
    newImage.src = newProfilePicURL;
    var allImages = document.images;
    for ( i = 0; i < allImages.length; ++i )
    {
        if ((allImages[i].alt.indexOf('Site!') != -1) || (allImages[i].alt.indexOf(userName) != -1))
        {
            allImages[i].src = newProfilePicURL;
            // Netscape doesn't allow adjusting the image width
            if (navigator.userAgent.indexOf('Netscape') == -1)
            {
                allImages[i].width = newImage.width;
                newStyle = '<style>table.left { width:' + (newImage.width + 40) + 'px;}</style>';
                document.write(newStyle);
            }
            break;
        }
    }
</script>
<!-- end code provided by createblog.com -->
<!-- end code provided by createblog.com -->
 
kellirawks08
post Dec 23 2004, 11:11 PM
Post #4


Newbie
*

Group: Member
Posts: 1
Joined: Dec 2004
Member No: 74,172



don't worry about the code..it doesnt really help..just save ur pic as a jpeg image and it can be as big as u want. biggrin.gif
 
pynk_laday
post Dec 23 2004, 11:17 PM
Post #5


Senior Member
***

Group: Member
Posts: 51
Joined: Dec 2004
Member No: 68,810



i dont think thats true bc all of my pictures are jpeg and they are all still small and until i used the code then they got bigger
 

Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members: