Help - Search - Members - Calendar
Full Version: replacing eprops and comments code not working
Forums > Resource Center > Webmasters' Corner > Resolved Topics
neato625
i have been having ttrouble with this code. i cant get it to work. and ive been looking at it for hours trying to see if something will jump out at me.. but nothing has yet!

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 (/xanga/i)) links[l].innerHTML = str.replace (/xanga/i, "I cannot leave here×");
else if (str.match (/eprops/i)) links[l].innerHTML = str.replace (/eprops/i, "faded words×");
else if (str.match (/eprop/i)) links[l].innerHTML = str.replace (/eprop/i, "faded word×");
else if (str.match (/comments/i)) links[l].innerHTML = str.replace (/comments/i, "shaking hands×");
else if (str.match (/comment/i)) links[l].innerHTML = str.replace (/comment/i, "shaking hand×");
else if (str.match (/email it/i)) links[l].innerHTML = str.replace (/email it/i, "wasting time×");
else if (str.match (/subscribe!/i)) links[l].innerHTML = str.replace (/subscribe!/i, "All will turn to grey");
else if (str.match (/sign out/i)) links[l].innerHTML = str.replace (/sign out/i, "I cannot stay×");
else if (str.match (/Subscribe to NeAtO625/i)) links[l].innerHTML = str.replace (/Subscribe to NeAtO625/i, "Subscribe to me");
else if (str.match (/XTwisted_FlawX/i)) links[l].innerHTML = str.replace (/XTwisted_FlawX/i, "Kate");
else if (str.match (/xsoft34ballx/i)) links[l].innerHTML = str.replace (/xsoft34ballx/i, "Mrs Depp");
else if (str.match (/xshortyx14x/i)) links[l].innerHTML = str.replace (/xshortyx14x/i, "Samm");
else if (str.match (/skittles18/i)) links[l].innerHTML = str.replace (/skittles18/i, "Angela");
else if (str.match (/nunzia/i)) links[l].innerHTML = str.replace (/nunzia/i, "Nunza");
else if (str.match (/mnilax11/i)) links[l].innerHTML = str.replace (/mnilax11/i, "Non Pita");
else if (str.match (/MissChris117/i)) links[l].innerHTML = str.replace (/MissChris117/i, "Christie");
else if (str.match (/LiMpTaCoBoY/i)) links[l].innerHTML = str.replace (/LiMpTaCoBoY/i, "Tony");
else if (str.match (/KayTeeZee/i)) links[l].innerHTML = str.replace (/KayTeeZee/i, "Kate Z");
else if (str.match (/CapeSideRock00/i)) links[l].innerHTML = str.replace (/CapeSideRock00/i, "Christian");
else if (str.match (/events/i)) links[l].innerHTML = str.replace (/events/i, "Upon leaving");
else if (str.match (/reviews/i)) links[l].innerHTML = str.replace (/reviews/i, "All the colors");
else if (str.match (/view entire profile/i)) links[l].innerHTML = str.replace (/view entire profile/i, "Just like romantic verses");
else if (str.match (/sign my guestbook/i)) links[l].innerHTML = str.replace (/sign my guestbook/i, "Just like a joyous end");
}//-->
</script>
<!-- end code provided by createblog.com -->


if any one sees where im missing any characters or whatever is wrong with this, that would be great biggrin.gif thanks a bunch!
Jordan Inc.
it should work, u prolly messed up sumwhere
neato625
i kinda figured i messed up somewhere. i was just wondering if anyone could point out where
Kathleen
<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 (/smileys/i)) links[l].innerHTML = str.replace (/smileys/i, "smileys");
else if (str.match (/reviews/i)) links[l].innerHTML = str.replace (/reviews/i, "Whoa");
else if (str.match (/events/i)) links[l].innerHTML = str.replace (/events/i, "Huh?");
else if (str.match (/subscribe!/i)) links[l].innerHTML = str.replace (/subscribe!/i, "Become a human slave");
else if (str.match (/add comments/i)) links[l].innerHTML = str.replace (/add comments/i, "add merps");
else if (str.match (/add eProps/i)) links[l].innerHTML = str.replace (/add eProps/i, "add staplers");
else if (str.match (/email it/i)) links[l].innerHTML = str.replace (/email it/i, "send it away");
else if (str.match (/Subscribe to [philoph0biac]/i)) links[l].innerHTML = str.replace (/Subscribe to philoph0biac/i, "Become a human slave to Kathleen");
else if (str.match (/previous/i)) links[l].innerHTML = str.replace (/previous/i, "what came before");
else if (str.match (/random/i)) links[l].innerHTML = str.replace (/random/i, "insane randomness");
else if (str.match (/Get trial subscription/i)) links[l].innerHTML = str.replace (/Get trial subscription/i, "become a human slave for a few days");
else if (str.match (/xanga/i)) links[l].innerHTML = str.replace (/xanga/i, "the mothership");
else if (str.match (/join/i)) links[l].innerHTML = str.replace (/join/i, "become part of this wretched xanga community");
else if (str.match (/sign out/i)) links[l].innerHTML = str.replace (/sign out/i, "fine...LEAVE...I DON'T NEED YOU");
else if (str.match (/signin/i)) links[l].innerHTML = str.replace (/signin/i, "you know you want to");
else if (str.match (/view entire profile/i)) links[l].innerHTML = str.replace (/view entire profile/i, "lookie lookie");
else if (str.match (/sign my guestbook/i)) links[l].innerHTML = str.replace (/sign my guestbook/i, "SIGN IT NOW, DAMNIT!");
else if (str.match (/next 5/i)) links[l].innerHTML = str.replace (/next 5/i, "shall we take a look into the past?");
else if (str.match (/Previous 5/i)) links[l].innerHTML = str.replace (/Previous 5/i, "shall we jump back to the present?");
else if (str.match (/click here/i)) links[l].innerHTML = str.replace (/click here/i, "curious?");
else if (str.match (/Suggest a link/i)) links[l].innerHTML = str.replace (/Suggest a link/i, "suggest a link...c'mon...you know one");
else if (str.match (/Create a site/i)) links[l].innerHTML = str.replace (/Create a site/i, "start your own little xanga child");
}
var paras = document.getElementsByTagName ('p');
for (var p = 0; p < paras.length; p++) {
str = paras[p].innerHTML;
if (str.match (/smileys/gi)) paras[p].innerHTML = str.replace (/smileys/gi, "smileys");
}
//-->
</script>

This is mine...if you want, you can just change it...I was sort of too lazy to look through your whole thing, but I know this works. Yours looks just about right; did you put it in Website Stats?
AlweizN4evah
that happened to me once, uhh i just put too much so i put sum in this:

<script type="text/javascript">
function replaceWords()
{
// ***add the words or fragments you wish to replace below
var oldWords = new Array(
"Sites I Read",
"Real Name:",
"Gender:",
"Female",
"Location:",
"California",
"Expertise:",
"My Blogrings",
"Posting Calendar",
"Email:",
"Stats",
"Member since:",
"3/29/2003",
"About this Entry",
"Who gave the eProps?",
"Posted by:",
"Original:",
"Comments:",
"eProps:",
"2 eProps from:",
"Birthday:",
"2/16/1991",
"Hobbies:",
"Occupation:",
"Student",
"Get Involved!");

// *** add the replacing words or fragments below
var newWords = new Array(
"more and more people",
"Once upon a time there were these two girls named",
"there aim sn's are",
"StUp1Dp1nAy203 and DiSbEzYn777",
"there are both",
"FLiPZ",
"they are very good at",
"BLoGRiNGS",
"Today is",
"HoLLA ",
"STATUS ",
"X MARKS THE SPOT!",
"o6 . 15 . o3--",
"ENTRY iNFo",
"ePRoPS CAME FRoM",
"FRoM",
"iT iS... ",
"cOoKies",
"mIlk",
"mIlK frOm",
"D . o . B . ",
"hmmm",
"they are very good at ",
"they currently attend ",
"St.Victor School",
"JoiN!");



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>

yeh, just change the words or add stuff. good luck
neato625
thanks alot. i used Kathleen's code, and now it works. biggrin.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.