Log In · Register

 
 
Closed TopicStart new topic
Umm i dont know how to explain this..., something to do with changing "comment"
computershateme
post Oct 2 2004, 11:29 AM
Post #1


Senior Member
***

Group: Member
Posts: 69
Joined: Aug 2004
Member No: 40,538



alrighty lets see, now im using this code to change the words "eprops" and "comments" into whatever i like, its a pretty common code and i dont know if i need to post it but i am just going to anyway :
CODE
<!-- begin code provided by createblog.com -->
<script language="javascript">
<!--
var links = document.getElementsByTagName ('a');
for (var l = 0; l < links.length; l++) {
str = links[l].innerHTML;
if (str.match (/\d+:\d+ (am|pm)/i)) links[l]
else if (str.match (/eprops/i)) links[l].innerHTML = str.replace (/eprops/i, "Bleeding Roses");
else if (str.match (/eprop/i)) links[l].innerHTML = str.replace (/eprop/i, "Bleeding Rose");
else if (str.match (/comments/i)) links[l].innerHTML = str.replace (/comments/i, "Sweet Nothings");
else if (str.match (/comment/i)) links[l].innerHTML = str.replace (/comment/i, "Sweet Nothing");
else if (str.match (/subscribe!/i)) links[l].innerHTML = str.replace (/subscribe!/i, "Lose yourself in the darkness..");
else if (str.match (/sign out/i)) links[l].innerHTML = str.replace (/sign out/i, "Don't leave me here, by myself. I can't breathe..");
}//-->
</script>
<!-- end code provided by createblog.com -->

now, at the bottom of each entry where it says "add eprops" and "add comments" this code is working for me just fine. it replaces both the words "eprops" and "comments" with what i have in the code. now, when you actually CLICK on the comments link and it takes you to the page where theres is just that entry and the comments only, right under the entry is a link that says "Give eprops or post a comment". this code i've notived only changes the word "eprops" in this link to what i have in my code, BUT it doesnt change the "comments" word. so, it reads "Give bleeding roses or post a comment" my question is, why doesnt is say "Give bleeding roses or post a sweet nothing" like i have in my code? is there any way to fix that so it does? i've noticed almost every xanga has this problem.... i'd appreciate it much! happy.gif
 
sammi rules you
post Oct 2 2004, 01:14 PM
Post #2


WWMD?! - i am from the age of BM 2
*******

Group: Member
Posts: 5,308
Joined: Mar 2004
Member No: 8,848



hmm..that is odd. try putting "comment." in your code and changing it to "sweet nothing."
 
lilphoenix
post Oct 2 2004, 01:37 PM
Post #3


I'm just a little bit crazy...
******

Group: Member
Posts: 1,119
Joined: Jun 2004
Member No: 19,760



ahh... yes.

i'd use this instead, it has the same results and all but i think this will work for your situation... since it replaces more.

it's all done for you already... (aren't i nice?)
and if some [regular] words still show, like Comments, eProps, etc...

add some more words with caps, since this script is cAsE-sEnSiTiVe!!!

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

<script type="text/javascript">
//
// ©EasterEgg, http://www.xanga.com/easteregg
//
// For use at Xanga only.
//
// This script replaces any given word or text fragment with
// whatever you want: new words and fragments, or even HTML!
//
// Actually it's pretty simple: add the words or fragments you
// wish to replace to the array "oldWords" (each word placed
// between double quotation marks, and separated by colons as you
// can see below) and add their replacements to the array "newWords",
// at the same position as the original words in "oldWords".
// The example is pretty self-explaining.
//
// The script is case sensitive, meaning that if you add "something"
// to "oldWords" array it will not recognize "SOMETHING", or "SoMetHInG".
//
// You can adjust the existing arrays in this code as you see fit,
// as long as both arrays keep the same size (same amount of words
// in both arrays), otherwise a script error will occur.
//
// Copy this entire code and paste in the webstats box at your
// Look and Feel page.
//
// You're free to use this script as long as this comment remains intact,
// and as long you won't use it to cripple the comments of your visitors;
// after all, no one likes his/her words getting twisted...
//
function replaceWords()
{
   // ***add the words or fragments you wish to replace below
   var oldWords = new Array(

"eprops",
"eprop",
"comments",
"comment",
"subscribe!",
"sign out"

    );

   // replacers
   var newWords = new Array(

"Bleeding Roses",
"Bleeding Rose",
"Sweet Nothings",
"Sweet Nothing",
"Lose yourself in the darkness..",
"Don't leave me here, by myself. I can't breathe.."

    );

   allTableData = document.getElementsByTagName('td');
   allTableHeaders = document.getElementsByTagName('th');
       
   var collections = new Array(allTableData,allTableHeaders);
   
   for (var k = 0; k < collections.length; ++k )
   {
       for (var i = 0; i < collections[k].length; ++i )
       {  
           if (collections[k][i].innerHTML.indexOf('TABLE') == -1)
           {
               for ( var n = 0; n < oldWords.length; ++n )
               {
                   var indx = collections[k][i].innerHTML.indexOf(oldWords[n])
                   while (indx != -1)
                   {  
                       var replacement = '';
                       indx = collections[k][i].innerHTML.indexOf(oldWords[n]);
                       replacement = collections[k][i].innerHTML.replace(oldWords[n], newWords[n]);
                       collections[k][i].innerHTML = replacement;
                       break;                    
                   }
               }
           }
       }
   }
}
replaceWords();
</script>

<!-- end code provided by createblog.com -->
 
computershateme
post Oct 3 2004, 12:04 AM
Post #4


Senior Member
***

Group: Member
Posts: 69
Joined: Aug 2004
Member No: 40,538



oh em gee. *sighs* well i used your code and stuff...thanks for putting all the crap in for me! XD but sadly....it just did the same thing. i dont know what to do! wacko.gif
 
C.Lime.Jello.
post Oct 3 2004, 12:34 AM
Post #5


The voices talk too much... -.-u
******

Group: Member
Posts: 2,099
Joined: Aug 2004
Member No: 39,078



CODEBOX: -> right click -> copy/paste


I'm sleepy, don't kill me if it doesn't work.
 

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