Log In · Register

 
smilies in comments
cherryish
post Jan 29 2004, 06:56 PM
Post #1


Newbie
*

Group: Member
Posts: 2
Joined: Jan 2004
Member No: 1,900



how can you use your own smilies in the comments section? i've seen xangas using their own smilies for the person to comment with. does that make sense? _unsure.gif
 
 
Start new topic
Replies
lemmonii
post Feb 1 2004, 06:35 PM
Post #2


whoa...lol
**

Group: Member
Posts: 17
Joined: Jan 2004
Member No: 1,974



lido lep: u put the script under webstats in ur claf aka "look and feel"

so as i promised here are the smilies that are identical to the ones on this site...however...this script is missing some ie. yawn.gif xmas.gif worthy.gif thumbsup.gif throb.gif sick.gif showoff.gif pooh.gif hammer.gif group.gif flowers.gif fallen.gif console.gif boxing.gif and wub.gif ...i might have missed some... but to make up for it there are other faces besides the one on this site...you might want to check the original sites that the smilies came from (embedded in script). please respect the person who arranged these smilies by keeping the entire script intact. btw i didnt create this script so be extra careful, or else i wouldnt care that much...so keep those hands busy and dont delete the unessary. thank you

CODE
<!-- begin code provided by createblog.com -->

<script type="text/javascript">
//
// *** Smiley Script Jiangsta21 Edition ***
// http://www.xanga.com/JiAnGsTa21
// http://www.freewebs.com/JiAnGsTa21
//
// You can use this code freely, as long as the entire script remains intact.
//
// WHAT'S NEW?
// - Reloaded on: 01.07.04
// - clickable smileys, even for non-IE users, displayed in buttons
// - customizable smiley button size
// - easily adjustable: only two arrays to maintain
// - preloading images for faster performance
// - made suitable for Mac users!
// - runs only at the comment page for increased performance
// - fixed problem which changed =) to a 2nd emoticon on the comment page of weblog. Now, it will only appear on the comment
// 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.
//
// 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(
       ":blink:",
       ":rolleyes:",
       ":sweatingbullets:",
       ":unsure:",
       ":wacko:",
       ":bookread:",
       ":bounce:",
       ":hypo:",
       ":hug:",
       ":kicking:",
       ":shifty:",
       ":shutup:",
       ":wave:",
       ":biggrin:",
       ":cooll:",
       ":crazy:",
       ":dry:",
       ":happyy:",
       ":huh:",
       ":kisss:",
       ":laugh:",
       ":mad:",
       ":mellow:",
       ":ohmy:",
       ":sadd:",
       ":sleep:",
       ":smile:",
       ":tongue:",
       ":tongue2:",
       ":wink:",
       ":w00t:",
       ":angryy:",
       ":blushing:",
       ":censoredd:",
       ":chicken:",
       ":cry:",
       ":devil:",
       ":disgust:",
       ":ermm:",
       ":flowers:",
       ":geek:",
       ":innocent:",
       ":king:",
       ":nugget:",
       ":nuke:",
       ":pease:",
       ":phone:",
       ":rasberry:",
       ":saddd:",
       ":sleeping:",
       ":surrender:",
       ":teehee:",
       ":thumbsup:",
       ":whistling:",
       ":pirate:",
       ":homestar:",
       ":strongbad:",
       ":ninja:",
       ":ph34r:",
       ":smurf:",
       ":zoro:",
       ":paperbag:",
       ":alien:",
       ":excl:",
       ":arrow:",
       ":qmark:");


   // *** add the url's from the corresponding images below
   var realSmileys = new Array(
       "http://soompi.com/forums/html/emoticons/blink.gif",
       "http://soompi.com/forums/html/emoticons/rolleyes.gif",
       "http://soompi.com/forums/html/emoticons/sweatingbullets.gif",
       "http://soompi.com/forums/html/emoticons/unsure.gif",
       "http://soompi.com/forums/html/emoticons/wacko.gif",
       "http://www.lpassociation.com/forums/html/emoticons/bookread.gif",
       "http://www.lpassociation.com/forums/html/emoticons/bounce.gif",
       "http://www.lpassociation.com/forums/html/emoticons/hypo.gif",
       "http://www.lpassociation.com/forums/html/emoticons/hug.gif",
       "http://www.lpassociation.com/forums/html/emoticons/kicking.gif",
       "http://www.lpassociation.com/forums/html/emoticons/shifty.gif",
       "http://www.lpassociation.com/forums/html/emoticons/shutup.gif",
       "http://www.lpassociation.com/forums/html/emoticons/wave.gif",
       "http://soompi.com/forums/html/emoticons/biggrin.gif",
       "http://soompi.com/forums/html/emoticons/cool.gif",
       "http://soompi.com/forums/html/emoticons/crazy.gif",
       "http://soompi.com/forums/html/emoticons/dry.gif",
       "http://soompi.com/forums/html/emoticons/happy.gif",
       "http://soompi.com/forums/html/emoticons/huh.gif",
       "http://soompi.com/forums/html/emoticons/kiss.gif",
       "http://soompi.com/forums/html/emoticons/laugh.gif",
       "http://soompi.com/forums/html/emoticons/mad.gif",
       "http://soompi.com/forums/html/emoticons/mellow.gif",
       "http://soompi.com/forums/html/emoticons/ohmy.gif",
       "http://soompi.com/forums/html/emoticons/sad.gif",
       "http://soompi.com/forums/html/emoticons/sleep.gif",
       "http://soompi.com/forums/html/emoticons/smile.gif",
       "http://soompi.com/forums/html/emoticons/tongue.gif",
       "http://soompi.com/forums/html/emoticons/tongue2.gif",
       "http://soompi.com/forums/html/emoticons/wink.gif",
       "http://soompi.com/forums/html/emoticons/w00t.gif",
       "http://www.lpassociation.com/forums/html/emoticons/angry.gif",
       "http://www.lpassociation.com/forums/html/emoticons/blushing.gif",
       "http://www.lpassociation.com/forums/html/emoticons/censored.gif",
       "http://www.lpassociation.com/forums/html/emoticons/chicken.gif",
       "http://www.lpassociation.com/forums/html/emoticons/cry.gif",
       "http://www.lpassociation.com/forums/html/emoticons/devil.gif",
       "http://www.lpassociation.com/forums/html/emoticons/disgust.GIF",
       "http://www.lpassociation.com/forums/html/emoticons/ermm.gif",
       "http://www.lpassociation.com/forums/html/emoticons/flowers.gif",
       "http://www.lpassociation.com/forums/html/emoticons/geek.gif",
       "http://www.lpassociation.com/forums/html/emoticons/innocent.gif",
       "http://www.lpassociation.com/forums/html/emoticons/king.gif",
       "http://www.lpassociation.com/forums/html/emoticons/nugget.gif",
       "http://www.lpassociation.com/forums/html/emoticons/nuke.gif",
       "http://www.lpassociation.com/forums/html/emoticons/pease.gif",
       "http://www.lpassociation.com/forums/html/emoticons/phone.gif",
       "http://www.lpassociation.com/forums/html/emoticons/rasberry.GIF",
       "http://www.lpassociation.com/forums/html/emoticons/sad.gif",
       "http://www.lpassociation.com/forums/html/emoticons/sleeping.gif",
       "http://www.lpassociation.com/forums/html/emoticons/surrender.gif",
       "http://www.lpassociation.com/forums/html/emoticons/teehee.gif",
       "http://www.lpassociation.com/forums/html/emoticons/thumbsup.gif",
       "http://www.lpassociation.com/forums/html/emoticons/whistling.gif",
       "http://soompi.com/forums/html/emoticons/pirate.gif",
       "http://soompi.com/forums/html/emoticons/homestar.gif",
       "http://soompi.com/forums/html/emoticons/strongbad.gif",
       "http://soompi.com/forums/html/emoticons/ninja.gif",
       "http://soompi.com/forums/html/emoticons/ph34r.gif",
       "http://soompi.com/forums/html/emoticons/smurf.gif",
       "http://soompi.com/forums/html/emoticons/zoro.gif",
       "http://www.lpassociation.com/forums/html/emoticons/paperbag.gif",
       "http://www.lpassociation.com/forums/html/emoticons/alien.gif",
       "http://www.lpassociation.com/forums/html/emoticons/excl.gif",
       "http://www.lpassociation.com/forums/style_images/LPA-009/icon11.gif",
       "http://www.lpassociation.com/forums/style_images/LPA-009/icon14.gif");

   // *** number of smileys that will be displayed per row
   var maxNumberOfSmileysPerRow = 11;
   // *** 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="javascript: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="javascript: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://www.xanga.com/item.aspx?user=JiAnGsTa21&tab=weblogs&uid=43487158"' +
           'target=blank><font style="font-size: xx-small; font-weight: normal;">' +
           'HERE</font><a/><br><br>';
       smileyBarHtml = '<br><b>Smileys modified by Jiangsta21</b><br><font style="font-size: xx-small">' +
           'If you want to get these smileys too, click -----></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 -->
 

Posts in this topic


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