Please login or register. Welcome to the Studio, guest!


Quick Links:


newBookmarkLockedFalling

hpmad

hpmad Avatar



858


September 2005
This code can be useful for making info center hacks. Each one of these loops grab a certain info from the info center. You can use innerHTML to replace this info in the info center.

<script type="text/javascript">
var td = document.getElementsByTagName('td');

//Total Topics
for(t=0;t<td.length;t++){
if(td[t].className.match(/catbg/i) && td[t].innerHTML.match(/Forum Statistics/i)){
var totalTopics = (td[t+2].innerHTML.match(/Total Topics: (\d+)(,\d+)? &/i)) ? RegExp.$1+RegExp.$2: '';
}}

//Total Posts
for(t=0;t<td.length;t++){
if(td[t].className.match(/catbg/i) && td[t].innerHTML.match(/Forum Statistics/i)){
var totalPosts = (td[t+2].innerHTML.match(/Total Posts: (\d+)(,\d+)?<br/i)) ? RegExp.$1+RegExp.$2: '';
}}

//Last Post
for(h=0;h<td.length;h++){
if(td[h].align=="left" && td[h].vAlign=="top" && td[h].width=="60%" && td[h].innerHTML.match(/Total Topics:/)){
var splitLPost = td[h].innerHTML.split("Last Updated Topic: ")[1];
var splitLPost2 = splitLPost.split("<br>")[0];
var lastPost = splitLPost2.split("\(")[0];
}}

//Total Members
for(t=0;t<td.length;t++){
if(td[t].className.match(/catbg/i) && td[t].innerHTML.match(/Forum Statistics/i)){
var totalMembers = (td[t+2].innerHTML.match(/Total Members: (.+?)<br/i)) ? RegExp.$1:'';
var newMember = (td[t+2].innerHTML.match(/Newest Member: (.+?)<\/a>/i)) ? RegExp.$1:'';
}}

//Newest Member
for(t=0;t<td.length;t++){
if(td[t].className.match(/catbg/i) && td[t].innerHTML.match(/Forum Statistics/i)){
var newMember = (td[t+2].innerHTML.match(/Newest Member: (.+?)<\/a>/i)) ? RegExp.$1: '';
}}

//Users Online
for(t=0;t<td.length;t++){
if(td[t].className.match(/catbg/i) && td[t].innerHTML.match(/Users Online/i)){
var SusersOn = td[t+2].innerHTML.split(/<br>/i)[1];
var usersOn = SusersOn.split(/<\/td>/i)[0];
var membersOn = (td[t+2].innerHTML.match(/(\d+) Member/i)) ? RegExp.$1: '';
var guestsOn = (td[t+2].innerHTML.match(/(\d+) Guest/i)) ? RegExp.$1: '';
var staffOn = (td[t+2].innerHTML.match(/(\d+) Staff/i)) ? RegExp.$1: '';
}}
</script>


Well I was making an info center code for nooki and I had some problems so hey helped out quite a bit.

Variables
totalTopics - total topics
totalPosts - total posts
totalMembers - total members
newMember - newest member
lastPost - last post
membersOn - # of members online
guestsOn - # of guests online
StaffOn - # of staff online
usersOn - list of users online



Last Edit: Mar 12, 2006 23:52:59 GMT by hpmad

crazynarutard

crazynarutard Avatar

*****
Senior Studio Member

1,470


August 2005
good job hp_mad :P

hpmad

hpmad Avatar



858


September 2005
crazyj said:
good job hp_mad :P



:P I never thought you would say that.

Chris

Chris Avatar

******
Head Coder

19,519


June 2005
Could be a lot simpler, but good job. :P

hey

hey Avatar
j00 n00b. =P

**
Official Member

50


October 2005
Well, don't those variables look familiar? I gave you and nooki those for an info center. There technically not yours. :P


Last Edit: Nov 6, 2005 4:19:50 GMT by hey
forums.talesrpg.com

hpmad

hpmad Avatar



858


September 2005
:P I said that you helped me

:-/ but if you really want to, I can take it out.


Last Edit: Nov 6, 2005 4:30:52 GMT by hpmad

crazynarutard

crazynarutard Avatar

*****
Senior Studio Member

1,470


August 2005
hey said:
Well, don't those variables look familiar? I gave you and nooki those for an info center. There technically not yours. :P

They're*

hey

hey Avatar
j00 n00b. =P

**
Official Member

50


October 2005
hpmad said:
:P I said that you helped me

:-/ but if you really want to, I can take it out.


Oops, didn't read that line. Never mind then. :P
forums.talesrpg.com

hpmad

hpmad Avatar



858


September 2005
hey said:
hpmad said:
:P I said that you helped me

:-/ but if you really want to, I can take it out.


Oops, didn't read that line. Never mind then. :P


lol That's okay :D

hey

hey Avatar
j00 n00b. =P

**
Official Member

50


October 2005
I have some updated variables:

var lastPost = (innerHTML.match(/Last Updated Topic: (.+?)<br\s?\/?>/i)) ? RegExp.$1: 'n/a';
lastPost = lastPost.replace('\(','\(').replace('\)','\)').replace('\'','\'');

This will grab the last post line and will allow paranthesis and apostrophes in topic names.



var usersOn = innerHTML.split(/<br\s?\/?>/i)[1].replace('\'','\'');

Those will make it so users with apostrophes in their names are still able to show up in the info center.


Last Edit: Nov 12, 2005 21:03:00 GMT by hey
forums.talesrpg.com

Team Studio

Team Studio Avatar

******
Administrator

120


June 2005
Just what I needed! :o
To code the Apollo Information Centre!

I'll use those variables indefinately...but I won't start the coding until the test is over...or even so, I might not code at all..:(

newBookmarkLockedFalling