inherit
117438
0
Aug 27, 2023 22:05:59 GMT -8
Hot Topic Butterfly
TIME TO REAP, TIME TO SLEEP
5
January 2008
shadowclaw
|
Post by Hot Topic Butterfly on Jun 27, 2005 0:03:34 GMT -8
On my forum shadowclaw.proboards24.comwe have a detailed self-created information box at the top of our homepage. One of my fellow co-admin's in currently having to change the " A warm welcome to our newest member (insert latest member's name here)" part of this box every day, and I was wondering if someone could supply us with whatever piece of coding does this down in the information box at the bottom of the home page. Then we could have the top part change automatically to show the newest member and save her from masses of retyping and editing when we end up with 5 new members coming along in a short space of time. Any takers?
|
|
inherit
Beware the ever changing head
33588
0
Nov 18, 2023 0:32:44 GMT -8
Ross
19,039
November 2004
elindir
|
Post by Ross on Jun 27, 2005 2:36:51 GMT -8
Stick this in your Main Header. It will give the same table you have now but it will update the newest member:
<script type="text/javascript"> var td=document.getElementsByTagName("td"); for(e=0;e<td.length;e++) if(td[e].innerHTML.match(/Total Members/) && td[e].width=="40%"){ if(td[e].innerHTML.match("<br>")){var b="br";}else{var b="BR";} var inew=td[e].innerHTML.split(/Newest Member: /)[1];}
// Box title var title='<b><u><i>RPG Updates\/Roleplay Central<\/i><\/u><\/b>';
// Contents of the Left Box var left=' New RPGs in SignUp<hr size="1" class"hr">World of the Dead<hr size="1" class"hr">See the new Epic, The Lost Slayer. Check the Board for more information<hr size="1" class"hr"> <b>Congrats to DR, our Member of the Month!<hr size="1" class"hr"><\/b>A warm welcome to our newest member, <font>'+inew+'<hr size="1" class"hr">';
// Contents of the Right Box var right='<hr size="1" class"hr">Slayerette Survivor I: Paging all remaining characters for the last few weeks of SS1<hr size="1" class"hr">To Page someone, pm an admin <hr size="1" class"hr"><b>Please see the Members Lounge: Top 15 posters for our new Top 15<\/b><hr size="1" class"hr">';
// Contents of the middle box var center="<hr>Welcome to Roleplay Central-your center for all things roleplay<hr> Take a look around and you'll see we have all sorts of roleplays-Angel and Buffy, to Charmed and Resident Evil RPGs<b> Please have a look in SignUp for a roleplay you might enjoy<\/b><hr>You will have to register before you can post here at RPC. If you do not intend to post regularly, please do not register.<hr><b>If you do join up please note that you must have at least 1 post on RPC before the end of a month if you don't want to be caught in the member wipe, and then at least one post every two months so that we don't assume your account is inactive. NO EXCEPTIONS. Thank you.<\/b><hr>Thankyou for visiting Roleplay Central. Hope you enjoy your stay<hr>";
// No need to edit below if(!document.location.href.match(/action=/)){ document.write('<table align="center" border="0" width="92%" cellspacing="0" cellpadding="0" class="bordercolor"><tr><td><table cellpadding="4" cellspacing="1" border="0" width="100%"><tr><td class="titlebg" align="center" colspan="3"><font color="000000" size="2">'+title+'<\/font></\td><\/tr><tr><td width="20%" valign="top" class="windowbg">'+left+'<\/td><td width="60%" class="windowbg2" valign="top">'+center+'<\/td><td width="20%" valign="top" class="windowbg">'+right+'<\/font><\/td><\/tr><\/table><\/td><\/tr><\/table>');} </script>
|
|
inherit
28779
0
Dec 28, 2011 17:06:56 GMT -8
Seryna
1,466
August 2004
seryna
|
Post by Seryna on Jun 27, 2005 11:25:39 GMT -8
Thankyou Elindir! As the co-admin, I aprreciate this. I have, however-a question-it now says: A warm welcome to our newest member, undefined The newest member is named gray. Will it take a moment or so for the code to figure in the memebr names and so on?
|
|
inherit
Beware the ever changing head
33588
0
Nov 18, 2023 0:32:44 GMT -8
Ross
19,039
November 2004
elindir
|
Post by Ross on Jun 27, 2005 14:18:51 GMT -8
Can you make it so guests can see the main page please?
|
|
inherit
28779
0
Dec 28, 2011 17:06:56 GMT -8
Seryna
1,466
August 2004
seryna
|
Post by Seryna on Jun 27, 2005 14:22:33 GMT -8
Of course. Doing so now. Thankyou.
|
|
inherit
Beware the ever changing head
33588
0
Nov 18, 2023 0:32:44 GMT -8
Ross
19,039
November 2004
elindir
|
Post by Ross on Jun 27, 2005 14:32:26 GMT -8
Try replacing this line (near the top)
var inew=td[e].innerHTML.split(/Newest Member: /)[1].split('<'+b+'>')[0];}
With this one:
var inew=td[e].innerHTML.split(/Newest Member: /)[1];}
And then replace this part (In the bit labelled as the left box):
newest member, '+inew+'<hr
with
newest member, <font>'+inew+'<hr
|
|
inherit
28779
0
Dec 28, 2011 17:06:56 GMT -8
Seryna
1,466
August 2004
seryna
|
Post by Seryna on Jun 27, 2005 18:16:16 GMT -8
I replaced it, and now the welcome newest member undefeined is font size 3. Is there a place I'm supposed to define the code?
|
|
#00AF33
Official Code Helper
19529
0
1
Nov 19, 2012 14:18:28 GMT -8
Todge
**
17,324
January 2004
todge
|
Post by Todge on Jun 27, 2005 19:22:34 GMT -8
Elindir, your code will not find the newest member's name because the Info Center isn't there when your code is executed.
You need a code in the footer to grab the info and give it to the code in the header.
|
|
inherit
Beware the ever changing head
33588
0
Nov 18, 2023 0:32:44 GMT -8
Ross
19,039
November 2004
elindir
|
Post by Ross on Jun 28, 2005 4:45:06 GMT -8
Elindir, your code will not find the newest member's name because the Info Center isn't there when your code is executed. You need a code in the footer to grab the info and give it to the code in the header. I didn't think of that Main Header: <div id='welcometable'></div> Main Footer: <script type="text/javascript"> var td=document.getElementsByTagName("td"); for(e=0;e<td.length;e++) if(td[e].innerHTML.match(/Total Members/) && td[e].width=="40%"){ if(td[e].innerHTML.match("<br>")){var b="br";}else{var b="BR";} var inew=td[e].innerHTML.split(/Newest Member: /)[1].split('<'+b+'>')[0];}
// Box title var title='<b><u><i>RPG Updates\/Roleplay Central<\/i><\/u><\/b>';
// Contents of the Left Box var left=' New RPGs in SignUp<hr size="1" class"hr">World of the Dead<hr size="1" class"hr">See the new Epic, The Lost Slayer. Check the Board for more information<hr size="1" class"hr"> <b>Congrats to DR, our Member of the Month!<hr size="1" class"hr"><\/b>A warm welcome to our newest member, '+inew+'<hr size="1" class"hr">';
// Contents of the Right Box var right='<hr size="1" class"hr">Slayerette Survivor I: Paging all remaining characters for the last few weeks of SS1<hr size="1" class"hr">To Page someone, pm an admin <hr size="1" class"hr"><b>Please see the Members Lounge: Top 15 posters for our new Top 15<\/b><hr size="1" class"hr">';
// Contents of the middle box var center="<hr>Welcome to Roleplay Central-your center for all things roleplay<hr> Take a look around and you'll see we have all sorts of roleplays-Angel and Buffy, to Charmed and Resident Evil RPGs<b> Please have a look in SignUp for a roleplay you might enjoy<\/b><hr>You will have to register before you can post here at RPC. If you do not intend to post regularly, please do not register.<hr><b>If you do join up please note that you must have at least 1 post on RPC before the end of a month if you don't want to be caught in the member wipe, and then at least one post every two months so that we don't assume your account is inactive. NO EXCEPTIONS. Thank you.<\/b><hr>Thankyou for visiting Roleplay Central. Hope you enjoy your stay<hr>";
// No need to edit below if(!document.location.href.match(/action=/)){ var itable='<table align="center" border="0" width="92%" cellspacing="0" cellpadding="0" class="bordercolor"><tr><td><table cellpadding="4" cellspacing="1" border="0" width="100%"><tr><td class="titlebg" align="center" colspan="3"><font color="000000" size="2">'+title+'<\/font></\td><\/tr><tr><td width="20%" valign="top" class="windowbg">'+left+'<\/td><td width="60%" class="windowbg2" valign="top">'+center+'<\/td><td width="20%" valign="top" class="windowbg">'+right+'<\/font><\/td><\/tr><\/table><\/td><\/tr><\/table>'; document.getElementById('welcometable').innerHTML=itable; } </script>
|
|
inherit
28779
0
Dec 28, 2011 17:06:56 GMT -8
Seryna
1,466
August 2004
seryna
|
Post by Seryna on Jun 28, 2005 8:28:13 GMT -8
Uhhh...I've done something stupid and now our headers don't show.
Top of our Header area:
<script type="text/javascript">
// Box title var title='<b><u><i>RPG Updates\/Roleplay Central<\/i><\/u><\/b>'; <div id='welcometable'></div> // Contents of the Left Box var left=' New RPGs in SignUp<hr size="1" class"hr">World of the Dead<hr size="1" class"hr">See the new Epic, The Lost Slayer. Check the Board for more information<hr size="1" class"hr"> <b>Congrats to DR, our Member of the Month!<hr size="1" class"hr"><\/b>A warm welcome to our newest member, <hr size="1" class"hr">
// Contents of the Right Box var right='<hr size="1" class"hr">Slayerette Survivor I: Paging all remaining characters for the last few weeks of SS1<hr size="1" class"hr">To Page someone, pm an admin <hr size="1" class"hr"><b>Please see the Members Lounge: Top 15 posters for our new Top 15<\/b><hr size="1" class"hr">';
// Contents of the middle box var center="<hr>Welcome to Roleplay Central-your center for all things roleplay<hr> Take a look around and you'll see we have all sorts of roleplays-Angel and Buffy, to Charmed and Resident Evil RPGs<b> Please have a look in SignUp for a roleplay you might enjoy<\/b><hr>You will have to register before you can post here at RPC. If you do not intend to post regularly, please do not register.<hr><b>If you do join up please note that you must have at least 1 post on RPC before the end of a month if you don't want to be caught in the member wipe, and then at least one post every two months so that we don't assume your account is inactive. NO EXCEPTIONS. Thank you.<\/b><hr>Thankyou for visiting Roleplay Central. Hope you enjoy your stay<hr>";
// No need to edit below if(!document.location.href.match(/action=/)){ document.write('<table align="center" border="0" width="92%" cellspacing="0" cellpadding="0" class="bordercolor"><tr><td><table cellpadding="4" cellspacing="1" border="0" width="100%"><tr><td class="titlebg" align="center" colspan="3"><font color="000000" size="2">'+title+'<\/font></\td><\/tr><tr><td width="20%" valign="top" class="windowbg">'+left+'<\/td><td width="60%" class="windowbg2" valign="top">'+center+'<\/td><td width="20%" valign="top" class="windowbg">'+right+'<\/font><\/td><\/tr><\/table><\/td><\/tr><\/table>');} </script>
Footer:
<script type="text/javascript"> var td=document.getElementsByTagName("td"); for(e=0;e<td.length;e++) if(td[e].innerHTML.match(/Total Members/) && td[e].width=="40%"){ if(td[e].innerHTML.match("<br>")){var b="br";}else{var b="BR";} var inew=td[e].innerHTML.split(/Newest Member: /)[1].split('<'+b+'>')[0];}
// Box title var title='<b><u><i>RPG Updates\/Roleplay Central<\/i><\/u><\/b>';
// Contents of the Left Box var left=' New RPGs in SignUp<hr size="1" class"hr">World of the Dead<hr size="1" class"hr">See the new Epic, The Lost Slayer. Check the Board for more information<hr size="1" class"hr"> <b>Congrats to DR, our Member of the Month!<hr size="1" class"hr"><\/b>A warm welcome to our newest member, '+inew+'<hr size="1" class"hr">';
// Contents of the Right Box var right='<hr size="1" class"hr">Slayerette Survivor I: Paging all remaining characters for the last few weeks of SS1<hr size="1" class"hr">To Page someone, pm an admin <hr size="1" class"hr"><b>Please see the Members Lounge: Top 15 posters for our new Top 15<\/b><hr size="1" class"hr">';
// Contents of the middle box var center="<hr>Welcome to Roleplay Central-your center for all things roleplay<hr> Take a look around and you'll see we have all sorts of roleplays-Angel and Buffy, to Charmed and Resident Evil RPGs<b> Please have a look in SignUp for a roleplay you might enjoy<\/b><hr>You will have to register before you can post here at RPC. If you do not intend to post regularly, please do not register.<hr><b>If you do join up please note that you must have at least 1 post on RPC before the end of a month if you don't want to be caught in the member wipe, and then at least one post every two months so that we don't assume your account is inactive. NO EXCEPTIONS. Thank you.<\/b><hr>Thankyou for visiting Roleplay Central. Hope you enjoy your stay<hr>";
// No need to edit below if(!document.location.href.match(/action=/)){ var itable='<table align="center" border="0" width="92%" cellspacing="0" cellpadding="0" class="bordercolor"><tr><td><table cellpadding="4" cellspacing="1" border="0" width="100%"><tr><td class="titlebg" align="center" colspan="3"><font color="000000" size="2">'+title+'<\/font></\td><\/tr><tr><td width="20%" valign="top" class="windowbg">'+left+'<\/td><td width="60%" class="windowbg2" valign="top">'+center+'<\/td><td width="20%" valign="top" class="windowbg">'+right+'<\/font><\/td><\/tr><\/table><\/td><\/tr><\/table>'; document.getElementById('welcometable').innerHTML=itable; } </script>
Theres more below that but tehres the pertinent data. If someone could tell me where I screwed up, that'd be great.
|
|
inherit
Beware the ever changing head
33588
0
Nov 18, 2023 0:32:44 GMT -8
Ross
19,039
November 2004
elindir
|
Post by Ross on Jun 28, 2005 9:47:10 GMT -8
Replace all that stuff you just posted in your Header with:
<div id='welcometable'></div>
|
|
inherit
28779
0
Dec 28, 2011 17:06:56 GMT -8
Seryna
1,466
August 2004
seryna
|
Post by Seryna on Jun 28, 2005 16:01:20 GMT -8
Worked perfectly!
Thankyou so much for your time and effort Elindir! Thanks for the tip Todge! *hugs* Its perfect now. Thankyou.
|
|
inherit
Beware the ever changing head
33588
0
Nov 18, 2023 0:32:44 GMT -8
Ross
19,039
November 2004
elindir
|
Post by Ross on Jun 28, 2005 16:03:33 GMT -8
You're welcome. I'm glad you got it working
|
|