Log In · Register

 
 
Closed TopicStart new topic
change smilies
snowymoon06
post Feb 7 2004, 03:58 PM
Post #1


Senior Member
****

Group: Member
Posts: 192
Joined: Feb 2004
Member No: 3,204



i'm sorry if this has been posted already, but how do you change the smilies on xanga? is it the same thing as the "change text" code?
 
drewster
post Feb 19 2004, 11:54 AM
Post #2


Member
**

Group: Member
Posts: 21
Joined: Feb 2004
Member No: 4,553



no... its

QUOTE
<!-- begin code provided by createblog.com -->
<script type="text/javascript">
//
// ** Smiley Script +NEW YEAR+ Version **
//
// ©2003 by SeGae, http://www.xanga.com/SeGae3
//
// You can use this code freely, as long as the entire script remains intact.
//
// WHAT'S NEW?
// - WHOLE *44*NEW SMILEY
// - ADDED *36*more SMILEY
// - IMPORTANT TIP FOR USING THESE SMILEYS. YOU NEED TO PUT SPACE IN BETWEEN EACH SMILEYS TO MAKE THEM WORK.
// - cross browser: it runs in IE, Netscape, Mozilla and Opera
// - ready for the upcoming (beta tested) changes at Xanga
// - clickable smileys, even for non-IE users, displayed in buttons
// - customizable number of smileys displayed in three row
// - customizable smiley button size
// - easily adjustable: only two arrays to maintain
// - preloading images for faster performance
// - necessary adjustments made because of recent changes at Xanga
// - made suitable for Mac users!
// - runs only at the comment page for increased performance
// HOW TO USE:
// For use at Xanga only. Copy this entire code (including the script tags)
// and paste in the Website Stats box at your Look and Feel page. Make sure
// the previous version of this script (if any) is completely removed first.
//
// The script contains two arrays: "textSmileys" and "realSmileys". The items
// present in the array "textSmileys" will be automatically replaced with the
// corresponding images in the array "realSmileys". You can modify the arrays
// as you see fit, as long as both arrays keep the exact same number of items.
//
// For example, suppose you want to add some smiley to the script... that would mean
// in "textSmileys" you would add a shorthand like ":some_smiley:" or {somesmiley},
// and in "realSmileys" you would add it's url: "http://www.dude.com/some_smiley.gif".
//
// SETTINGS:
// - "maxNumberOfSmileysPerRow": number of smileys that will be displayed in one row.
// Smileys above that number will automatically be added to a new line. 10 by default.
// - "buttonSize": size of the smiley buttons in pixels. 30 px by default.
//
// AVAILABILITY:
// The script has been tested in the latest versions of IE, Netscape,
// Mozilla and Opera (Windows 98).
//
function typeSmiley(sSmiley)
{
  if (document.getElementsByTagName('textarea')[0].getAttribute('name') == 'bdescr')
      var editor = document.getElementsByTagName('textarea')[0];
  else
  {
      var allTextAreas = document.getElementsByTagName('textarea');
      for (i = 0; i < allTextAreas.length; ++i)
      {
          if (allTextAreas[i].getAttribute('name') == 'bdescr')
          {
              var editor = allTextAreas[i];
              break;
          }
      }
  }
  editor.value = editor.value + sSmiley;
}
function replaceTextSmileys()
{
  // ***add textual emoticons to the array below
  var textSmileys = new Array(
      " +PALE+",
      " +PALE2+",
      " +SMILE1+",
      " +( - -)+",
      " +BARF+",
      " +SMILE2+",
      " +ANGRY+",
      " +SMILE3+",
      " +-_-+",
      " +o_O+",
      " +SMILE4+",
      " +WINK+",
      " +T_T+",
      " +=*(+",
      " +-0-;+",
      " +-o-+",
      " +SMILE5+",
      " +MERONG+",
      " +ZzZ+",
      " +ANGRY+",
      " +(-_-)+",
      " +SMILE3+",
      " +PoO+",
      " +KiSS+",
      " +KiSS-2+",
      " +Juice+",
      " +COFFEE+",
      " +PIZZA+",
      " +Burger+",
      " +KIMBOB+",
      " +BEER+",
      " +CANDY+",
      " +MILK+",
      " +RICE+",
      " +ICECREAM+",
      " +FLOWER+",
      " +HI-1+",
      " +HI-2+",
      " +HI-3+",
      " +HI-4+",
      " +BYE-1+",
      " +BYE-2+",
      " +WOMAN+",
      " +FLOWER+",
      " +SKI+",
      " +BASKETBALL+",
      " +SOCCER+",
      " +BASEBALL+",
      " +VOLLEYBALL+",
      " +TAEKWONDO+",
      " +GUN+",
      " +HIKE+",
      " +BOXING+",
      " +TENNIS+",
      " +SWIM+",
      " +CRUISE+",
      " +BIKINI+",
      " +SNOW+",
      " +RAIN+",
      " +THUNDER+",
      " +SUN+",
      " +ANGEL+",
      " +AXE+",
      " +AXE-2+",
      " +PUNCH+",
      " +KNIFE+",
      " +BOMB+",
      " +BOMB-2+",
      " +BigPOO+",
      " +PooStick+",
      " +FART+",
      " +POOP+",
      " +UMBRELLA+",
      " +UMBRELLA-2+",
      " +MONEY+",
      " +CELLPHONE+",
      " +NO SMOKING+",
      " +HEART-1+",
      " +HEARTSTICK+",
      " +HEART-2+");

  // *** add the url's from the corresponding images below
  var realSmileys = new Array(
"http://image.hanmail.net/hanmail/s_img/messenger2/web/emot/face_s1.gif",
"http://image.hanmail.net/hanmail/s_img/messenger2/web/emot/face_s2.gif",
"http://image.hanmail.net/hanmail/s_img/messenger2/web/emot/face_s3.gif",
"http://image.hanmail.net/hanmail/s_img/messenger2/web/emot/face_s4.gif",
"http://image.hanmail.net/hanmail/s_img/messenger2/web/emot/face_s5.gif",
"http://image.hanmail.net/hanmail/s_img/messenger2/web/emot/face_s6.gif",
"http://image.hanmail.net/hanmail/s_img/messenger2/web/emot/face_s7.gif",
"http://image.hanmail.net/hanmail/s_img/messenger2/web/emot/face_s8.gif",
"http://image.hanmail.net/hanmail/s_img/messenger2/web/emot/face_s9.gif",
"http://image.hanmail.net/hanmail/s_img/messenger2/web/emot/face_s10.gif",
"http://image.hanmail.net/hanmail/s_img/messenger2/web/emot/face_s11.gif",
"http://image.hanmail.net/hanmail/s_img/messenger2/web/emot/face_s12.gif",
"http://image.hanmail.net/hanmail/s_img/messenger2/web/emot/face_s13.gif",
"http://image.hanmail.net/hanmail/s_img/messenger2/web/emot/face_s14.gif",
"http://image.hanmail.net/hanmail/s_img/messenger2/web/emot/face_s15.gif",
"http://image.hanmail.net/hanmail/s_img/messenger2/web/emot/face_s16.gif",
"http://image.hanmail.net/hanmail/s_img/messenger2/web/emot/face_s17.gif",
"http://image.hanmail.net/hanmail/s_img/messenger2/web/emot/face_s18.gif",
"http://image.hanmail.net/hanmail/s_img/messenger2/web/emot/face_s19.gif",
"http://image.hanmail.net/hanmail/s_img/messenger2/web/emot/face_s20.gif",
"http://image.hanmail.net/hanmail/s_img/messenger2/web/emot/face_s21.gif",
"http://image.hanmail.net/hanmail/s_img/messenger2/web/emot/say_s10.gif",
"http://image.hanmail.net/hanmail/s_img/messenger2/web/emot/jim_s1.gif",
"http://image.hanmail.net/hanmail/s_img/messenger2/web/emot/jim_s4.gif",
"http://image.hanmail.net/hanmail/s_img/myd/web_mes/f_17.gif",
"http://image.hanmail.net/hanmail/s_img/messenger2/web/emot/food_s1.gif",
"http://image.hanmail.net/hanmail/s_img/messenger2/web/emot/food_s2.gif",
"http://image.hanmail.net/hanmail/s_img/messenger2/web/emot/food_s3.gif",
"http://image.hanmail.net/hanmail/s_img/messenger2/web/emot/food_s4.gif",
"http://image.hanmail.net/hanmail/s_img/messenger2/web/emot/food_s5.gif",
"http://image.hanmail.net/hanmail/s_img/messenger2/web/emot/food_s6.gif",
"http://image.hanmail.net/hanmail/s_img/messenger2/web/emot/food_s7.gif",
"http://image.hanmail.net/hanmail/s_img/messenger2/web/emot/food_s8.gif",
"http://image.hanmail.net/hanmail/s_img/messenger2/web/emot/food_s9.gif",
"http://image.hanmail.net/hanmail/s_img/messenger2/web/emot/food_s10.gif",
"http://image.hanmail.net/hanmail/s_img/messenger2/web/emot/say_s1.gif",
"http://image.hanmail.net/hanmail/s_img/messenger2/web/emot/say_s2.gif",
"http://image.hanmail.net/hanmail/s_img/messenger2/web/emot/say_s3.gif",
"http://image.hanmail.net/hanmail/s_img/messenger2/web/emot/say_s4.gif",
"http://image.hanmail.net/hanmail/s_img/messenger2/web/emot/say_s5.gif",
"http://image.hanmail.net/hanmail/s_img/messenger2/web/emot/say_s6.gif",
"http://image.hanmail.net/hanmail/s_img/messenger2/web/emot/say_s7.gif",
"http://image.hanmail.net/hanmail/s_img/messenger2/web/emot/say_s9.gif",
"http://image.hanmail.net/hanmail/s_img/myd/web_mes/f_15.gif",
"http://image.hanmail.net/hanmail/s_img/myd/web_mes/e_1.gif",
"http://image.hanmail.net/hanmail/s_img/myd/web_mes/e_5.gif",
"http://image.hanmail.net/hanmail/s_img/myd/web_mes/e_6.gif",
"http://image.hanmail.net/hanmail/s_img/myd/web_mes/e_7.gif",
"http://image.hanmail.net/hanmail/s_img/myd/web_mes/e_8.gif",
"http://image.hanmail.net/hanmail/s_img/myd/web_mes/e_9.gif",
"http://image.hanmail.net/hanmail/s_img/myd/web_mes/e_10.gif",
"http://image.hanmail.net/hanmail/s_img/myd/web_mes/e_11.gif",
"http://image.hanmail.net/hanmail/s_img/myd/web_mes/e_12.gif",
"http://image.hanmail.net/hanmail/s_img/myd/web_mes/e_13.gif",
"http://image.hanmail.net/hanmail/s_img/myd/web_mes/e_14.gif",
"http://image.hanmail.net/hanmail/s_img/myd/web_mes/e_15.gif",
"http://image.hanmail.net/hanmail/s_img/myd/web_mes/e_16.gif",
"http://image.hanmail.net/hanmail/s_img/myd/web_mes/e_17.gif",
"http://image.hanmail.net/hanmail/s_img/myd/web_mes/e_18.gif",
"http://image.hanmail.net/hanmail/s_img/myd/web_mes/e_19.gif",
"http://image.hanmail.net/hanmail/s_img/myd/web_mes/e_20.gif",
"http://image.hanmail.net/hanmail/s_img/myd/web_mes/f_1.gif",
"http://image.hanmail.net/hanmail/s_img/myd/web_mes/f_2.gif",
"http://image.hanmail.net/hanmail/s_img/myd/web_mes/f_6.gif",
"http://image.hanmail.net/hanmail/s_img/myd/web_mes/f_13.gif",
"http://image.hanmail.net/hanmail/s_img/myd/web_mes/f_3.gif",
"http://image.hanmail.net/hanmail/s_img/myd/web_mes/f_18.gif",
"http://image.hanmail.net/hanmail/s_img/messenger2/web/emot/jim_s3.gif",
"http://image.hanmail.net/hanmail/s_img/myd/web_mes/f_4.gif",
"http://image.hanmail.net/hanmail/s_img/myd/web_mes/f_5.gif",
"http://image.hanmail.net/hanmail/s_img/myd/web_mes/f_14.gif",
"http://image.hanmail.net/hanmail/s_img/myd/web_mes/f_19.gif",
"http://image.hanmail.net/hanmail/s_img/myd/web_mes/f_8.gif",
"http://image.hanmail.net/hanmail/s_img/messenger2/web/emot/jim_s10.gif",
"http://image.hanmail.net/hanmail/s_img/myd/web_mes/f_9.gif",
"http://image.hanmail.net/hanmail/s_img/myd/web_mes/f_10.gif",
"http://image.hanmail.net/hanmail/s_img/myd/web_mes/f_12.gif",
"http://image.hanmail.net/hanmail/s_img/messenger2/web/emot/say_s8.gif",
"http://image.hanmail.net/hanmail/s_img/messenger2/web/emot/jim_s5.gif",
"http://image.hanmail.net/hanmail/s_img/myd/web_mes/f_20.gif");
 
  // *** number of smileys that will be displayed per row
  var maxNumberOfSmileysPerRow = 16;
  // *** button size in pixels
  var buttonSize = 30;
  // preloading images
  var preloadedImages = new Array(realSmileys.length);
  for (i = 0; i < preloadedImages.length; ++i)
  {
      preloadedImages[i] = new Image();
      preloadedImages[i].src = realSmileys[i];
  }
 
  var allTableData = document.getElementsByTagName('td');
  var indx;
  var smiley;
  var replacement;
 
  for (var i = 0; i < allTableData.length; ++i )
  { 
      for ( var n = 0; n < textSmileys.length; ++n )
      {
          if ((allTableData[i].innerHTML.toUpperCase().indexOf('TABLE') == -1) &&
              (allTableData[i].innerHTML.indexOf('previewHTML()') == -1))
          {
              indx = allTableData[i].innerHTML.indexOf(textSmileys[n]);
              if (indx != -1)
              {
                  while (indx != -1)
                  { 
                      replacement = '';
                      indx = allTableData[i].innerHTML.indexOf(textSmileys[n]);
                      smiley = '<img src=\"' + realSmileys[n] + '">'
                      replacement = allTableData[i].innerHTML.replace(textSmileys[n],smiley);
                      allTableData[i].innerHTML = replacement;                 
                  }                 
              }
          }
     
      }
  }
 
  if (document.URL.indexOf('weblogs') != -1)
  {
      var smileyCollection = new Array(realSmileys.length);
      var smileyBar = '';
     
      if (document.getElementById('htmleditor'))
      {
          for (i = 0; i < smileyCollection.length; ++i)
          {
              smileyCollection[i] = '<button type="button" value="" ' +
                  'style="width:' + buttonSize + 'px; height:' +
                  buttonSize + 'px;" onclick="java script:insertHTML(\'&nbsp;' +
                  textSmileys[i] + '\'); return false;">' +
                  '<img src=\"' + realSmileys[i] + '" alt="' + textSmileys[i] +
                  '"></button>';
          }
      }
      else
      {
          for (i = 0; i < smileyCollection.length; ++i)
          {
              smileyCollection[i] = '<button type="button" value="" ' +
                  'style="width:' + buttonSize + 'px; height:' +
                  buttonSize + 'px;" onclick="java script:typeSmiley(\'&nbsp;' +
                  textSmileys[i] + '\'); return false;">' +
                  '<img src=\"' + realSmileys[i] + '" alt="' + textSmileys[i] +
                  '"></button>';
          }
      }
     
 
      for (i = 0; i < smileyCollection.length; ++i)
      { 
          if (i != 0)
              if ( (i/maxNumberOfSmileysPerRow).toString().indexOf('.') == -1)
                  smileyBar = smileyBar + '<BR>';
          smileyBar = smileyBar + smileyCollection[i];
      }
     
      // add SmileyBar
      infoLink = '<a href="http://my.netian.com/~world15/world15_page1.html"' +
          'target=blank><font style="font-size: xx-small; font-weight: normal;">' +
          'Smiley Script</font><a/><br><br>';
      smileyBarHtml = '<br><b>USE EMOTICONS</b><br><font style="font-size: xx-small">' +
          'USE THEM WID COMMENT!! =D</font> ' +
          infoLink + smileyBar + '<br><br>';
      if (navigator.userAgent.indexOf('Mac') == -1)
      {
          if (document.getElementById('htmleditor'))
              var obj1 = document.getElementById('htmleditor').parentNode;
          else
          {
              if (document.getElementsByTagName('textarea')[0].getAttribute('name') == 'bdescr')
                  var obj1 = document.getElementsByTagName('textarea')[0].parentNode;
              else
              {
                  var allTextAreas = document.getElementsByTagName('textarea');
                  for (i = 0; i < allTextAreas.length; ++i)
                  {
                      if (allTextAreas[i].getAttribute('name') == 'bdescr')
                      {
                          var obj1 = allTextAreas[i].parentNode;
                          break;
                      }
                  }
              }
          }
          var obj2 = document.createElement('span');
          obj2.setAttribute('ID','idSmileyBar');
          obj2.innerHTML = smileyBarHtml;
          obj1.insertBefore(obj2,obj1.firstChild);
      }
      else
      {
          // alternative solution for the Mac
          for (var i = 0; i < allTableData.length; ++i )
          {
              if ((allTableData[i].innerHTML.toUpperCase().indexOf('TABLE') == -1) &&
              (allTableData[i].innerHTML.indexOf('previewHTML()') == -1))
              { 
                  if (allTableData[i].innerHTML.toUpperCase().indexOf('(OPTIONAL)') != -1)
                  {
                      var temp = allTableData[i].innerHTML;
                      allTableData[i].innerHTML = temp + '<br>' + smileyBarHtml;
                      break;
                  }
              }
          }
      }
  }
 
}
if (document.URL.indexOf('weblogs') != -1)
  replaceTextSmileys();
</script>
<!-- end code provided by createblog.com -->
 
xSuperLazyBoix
post Feb 19 2004, 04:47 PM
Post #3


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

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



what place do u put this HTML code in??
 
drewster
post Feb 20 2004, 08:46 PM
Post #4


Member
**

Group: Member
Posts: 21
Joined: Feb 2004
Member No: 4,553



webstats
 
punkrawkluvr08
post Feb 25 2004, 10:52 PM
Post #5


punkrawkluvr08
*

Group: Member
Posts: 6
Joined: Feb 2004
Member No: 4,307



i cant get this to work either....rrrrr
 
iamyellow
post Feb 26 2004, 01:21 AM
Post #6


Newbie
*

Group: Member
Posts: 4
Joined: Feb 2004
Member No: 5,010



it doesnt work ='[
 
krazienilz
post Feb 26 2004, 05:04 AM
Post #7


krazienilz
*

Group: Member
Posts: 9
Joined: Feb 2004
Member No: 4,455



biggrin.gif biggrin.gif biggrin.gif biggrin.gif biggrin.gif biggrin.gif biggrin.gif biggrin.gif
 
drewster
post Feb 26 2004, 04:25 PM
Post #8


Member
**

Group: Member
Posts: 21
Joined: Feb 2004
Member No: 4,553



thats the comment smilies
 

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