help with custom smilies in entries please!!, just cant get them to work |
help with custom smilies in entries please!!, just cant get them to work |
![]()
Post
#1
|
|
Newbie ![]() Group: Member Posts: 8 Joined: Jun 2005 Member No: 147,106 ![]() |
I checked out the scripts section and i followd everything that i was told, at least to my knowledge i did.. i put it in my website stats and when i wrote an entry and clicked on the smilies, i didnt see my custom ones! i still saw the old xanga ones.. is there some way that im not using in order to use my custom smilies? heres the code that i have in my webstats, pleasee can you tell me what to do to fix it
![]()
Attached File(s)
|
|
|
![]() |
![]()
Post
#2
|
|
Newbie ![]() Group: Member Posts: 8 Joined: Jun 2005 Member No: 147,106 ![]() |
<TEXTAREA><script type="text/javascript">
// *** Smiley Script V 2.2 *** // // ©2003 by EasterEgg, http://www.xanga.com/easteregg // // 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( ":smile:", ":geeked:", ":grin:", ":laughing:", ":pleased:", ":silly:", ":wink:", ":cool:", ":smooch:", ":shy:", ":blush:", ":bummed:", ":sad:", ":cry:", ":sick:", ":confused:", ":wtf:", ":bitter:", ":angry:", ":censored:", ":evil:", ":shocked:", ":stunned:", ":whatevah:", ":pray:", ":boogie:", ":dont:", ":sleepy:", ":exclaim:", ":question:", ":arrow:", ":heart:" ); // *** add the url's from the corresponding images below var realSmileys = new Array( "http://img.photobucket.com/albums/v253/MC10213/happy.gif", "http://home.comcast.net/~mc20191/geeked.gif", "http://home.comcast.net/~mc20191/grin.gif", "http://home.comcast.net/~mc20191/laughing.gif", "http://home.comcast.net/~mc20191/pleased.gif", "http://home.comcast.net/~mc20191/silly.gif", "http://home.comcast.net/~mc20191/winky.gif", "http://home.comcast.net/~mc20191/cool.gif", "http://home.comcast.net/~mc20191/smooch.gif", "http://home.comcast.net/~mc20191/shy.gif", "http://home.comcast.net/~mc20191/blush.gif", "http://home.comcast.net/~mc20191/bummed.gif", "http://img.photobucket.com/albums/v253/MC10213/sad.gif", "http://img.photobucket.com/albums/v253/MC10213/cry.gif", "http://home.comcast.net/~mc20191/sick.gif", "http://img.photobucket.com/albums/v253/MC10213/confused.gif", "http://home.comcast.net/~mc20191/wtf.gif", "http://home.comcast.net/~mc20191/bitter.gif", "http://home.comcast.net/~mc20191/angry.gif", "http://home.comcast.net/~mc20191/censored.gif", "http://home.comcast.net/~mc20191/evil.gif", "http://home.comcast.net/~mc20191/shocked.gif", "http://home.comcast.net/~mc20191/stunned.gif", "http://home.comcast.net/~mc20191/whatevah.gif", "http://home.comcast.net/~mc20191/pray.gif", "http://home.comcast.net/~mc20191/boogie.gif", "http://home.comcast.net/~mc20191/dont.gif", "http://home.comcast.net/~mc20191/cloud9.gif", "http://home.comcast.net/~mc20191/exclaim.gif", "http://home.comcast.net/~mc20191/question.gif", "http://home.comcast.net/~mc20191/arrow.gif", "http://home.comcast.net/~mc20191/heartt.gif" ); // *** number of smileys that will be displayed per row var maxNumberOfSmileysPerRow = 10; // *** 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(\' ' + 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(\' ' + 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.alicewoodrome.com/smileyscript.html"' + 'target=blank><font style="font-size: 8; font-weight: bold; font-color:purple;">' + 'Smiley Script From Createblog</font><a/><br><br>'; smileyBarHtml = '<br><b>Choose a Mood<br>' + 'Make your comments cooler by adding smilies!' + '<br>' + smileyBar + '</b><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 --> </TEXT> |
|
|
![]() ![]() |