Saila Wei
Not New Member
What would you attempt to do if you knew you could not fail?[Sj1:0] [FB:anniemaeart][YT:anniemaeart]
Posts: 7
Saila Wei said 0 great things
|
Post by Saila Wei on Dec 8, 2009 3:45:51 GMT -8
Hey I wanted to put my info center stats on a side table, but for some reason it only works on the left side table. I've included some test links here so you can see what I mean... chbatesi3.proboards.com <-- IC on left side-table, works chbatesi4.proboards.com <-- IC on right side-table, doesn't work Any particular reason why?
|
|
|
Post by Wormopolis on Dec 8, 2009 10:03:13 GMT -8
the divs for the right side table appear AFTER the code runs. in other words, the spots where you want the info center pieces to go dont exist when the code runs. solution: move the code from the main footer to the global footer. make sure the code is AFTER the closing side tables tag. moving to the global footer will still let the left side table work.
|
|
Saila Wei
Not New Member
What would you attempt to do if you knew you could not fail?[Sj1:0] [FB:anniemaeart][YT:anniemaeart]
Posts: 7
Saila Wei said 0 great things
|
Post by Saila Wei on Dec 8, 2009 11:33:15 GMT -8
Ah, yea it works now. Thanks a ton!! *offers cakes as thanks*
|
|
Saila Wei
Not New Member
What would you attempt to do if you knew you could not fail?[Sj1:0] [FB:anniemaeart][YT:anniemaeart]
Posts: 7
Saila Wei said 0 great things
|
Post by Saila Wei on Jan 9, 2010 21:56:21 GMT -8
Yea, umm, hi... again... just wondering, is there any way to put in the birthday's events section, if there was no information displayed in that area, it could say like "none today" or something of the like?
|
|
|
Post by Wormopolis on Jan 10, 2010 2:32:20 GMT -8
in this line:
extract1=extract2=extract3=extract4=extract5=extract6="";
the birthdays will go into extract5, events go into extract6.
so basically, you can set a default HTML for those variables for when the code doesnt see something new to replace them. after that line, just add something like:
extract5="<b>No Birthdays Today</b>"
and have the destination divs as you would normaly.
|
|
Saila Wei
Not New Member
What would you attempt to do if you knew you could not fail?[Sj1:0] [FB:anniemaeart][YT:anniemaeart]
Posts: 7
Saila Wei said 0 great things
|
Post by Saila Wei on Jan 10, 2010 2:50:15 GMT -8
Sweet!! Thanks again! You never fail to impress *offers another cake*
|
|
|
Post by tunescool on Feb 4, 2010 19:53:11 GMT -8
are any of the things i have left in forum statistics or events one of the things that wouldnt be accurate if i wanted it in the post page
|
|
|
Post by Wormopolis on Feb 4, 2010 22:57:04 GMT -8
all forum statistics information is only visible on the main page. you could use cookies to carry things over to other pages, but the cookies would only update with new and accurate information if the main page was visited. It is against the TOS to poll the server for information with a code. similar to using a code to retrieve the contents of a post when not actually in that thread.
|
|
acornlauren
Not New Member
Posts: 3
acornlauren said 0 great things
|
Post by acornlauren on May 14, 2010 13:53:30 GMT -8
So I get that the content will only show up on the main page, but is there a way that I could make the content go in the footer? Like, if the table I want the content to show up in is in the footer, and I put the <div> tags in there, it won't show up; it only appears when I enter the div in the header. I'd like to be able to move info center content into a table in the main footer of my forum, if possible. As an example, here is a test forum I just made: udsjnsdnijds.proboards.com/index.cgiThe table in the footer there has info center content divs in both the "staff" tab of the dynamic table and in the right-hand part of the table below "section header", but they do not show. When this same table is in the main header, both appear normally, but in the footer they do not. Hope that makes sense :)
|
|
|
Post by Wormopolis on May 14, 2010 19:07:36 GMT -8
as long as the footer portion of the code is BELOW the DIVs. If you have any other code modifying the info center it might conflict as well.
looking at your test site, you have the DIVs AFTER the code, so the code doesnt have anywhere to put things because they dont exist yet.
|
|
|
Post by Wormopolis on May 14, 2010 19:11:51 GMT -8
you might also want to grab a new copy of the main footer portion... PB changed the class that the info center title was under.
|
|
acornlauren
Not New Member
Posts: 3
acornlauren said 0 great things
|
Post by acornlauren on May 14, 2010 21:02:12 GMT -8
I tried moving it below the divs but now it isn't working at all, like the normal info center isn't disappearing any more and such.
|
|
|
Post by Wormopolis on May 15, 2010 2:30:49 GMT -8
I got confused on something.. so when I made that last edit, I really shouldnt have.
v 1.4 is posted and has been tested in IE and FF
make sure the footer part of the code, appears AFTER you have placed your DIVs
|
|
acornlauren
Not New Member
Posts: 3
acornlauren said 0 great things
|
Post by acornlauren on May 16, 2010 8:24:15 GMT -8
Thanks, it worked!
I was wondering if there was a way to remove two bits in the content; I'd like it if there was no date after "Last Updated Topic", just the topic title and the username. I'd also like to not have "Most users online was x, DATE" either, so that line would just cut off right after listing how many staff members, members, and guests are currently online.
Here's the code I'm currently using (I added in one of the modifications you used earlier in this thread to remove the recent posts and private messages thing.)
<script type="text/javascript"> <!-- // Clone Info Center pieces into placeable DIVs v1.4 // By Wormopolis // [url]wormocodes.proboards.com[/url]
var hideOriginalInfoCenter=true; // set to true to hide, false to leave there
tds=document.getElementsByTagName('td'); dest1=document.getElementById("BOX1div"); //topics/posts/last topic/10 recent posts dest2=document.getElementById("BOX2div"); //members/newest member/personal messages dest3=document.getElementById("BOX3div"); //users online dest4=document.getElementById("BOX4div"); //users 24 hours dest5=document.getElementById("BOX5div"); //Events dest6=document.getElementById("BOX6div"); //Birthdays extract1=extract2=extract3=extract4=extract5=extract6=""; for (n=tds.length-1; n>0; n--) { if (tds[n].colSpan==2 && tds[n].className=="catbg" && tds[n].innerHTML.match(/forum statistics/i)) {
extract1=tds[n].parentNode.nextSibling.firstChild.nextSibling.getElementsByTagName('td')[0].innerHTML; tmp=extract1.split('<br>'); tmp[2]=""; extract1=tmp.join('<br>'); extract2=tds[n].parentNode.nextSibling.firstChild.nextSibling.getElementsByTagName('td')[1].innerHTML; tmp=extract2.split('<br>'); if (tmp.length>2) tmp[2]=""; extract2=tmp.join('<br>'); // those 2 are static. for (rws=tds[n].parentNode.parentNode.getElementsByTagName('tr'), i=0; i<rws.length; i++) { if (rws[i].firstChild.className.match(/catbg/) && rws[i].firstChild.innerHTML.match(/events this month/i)) { extract5=rws[i].nextSibling.firstChild.nextSibling.firstChild.firstChild.firstChild.innerHTML; } if (rws[i].firstChild.className.match(/catbg/) && rws[i].firstChild.innerHTML.match(/users online/i)) { extract3=rws[i].nextSibling.firstChild.nextSibling.innerHTML; } if (rws[i].firstChild.className.match(/catbg/) && rws[i].firstChild.innerHTML.match(/active users/i)) { extract4=rws[i].nextSibling.firstChild.nextSibling.innerHTML; } if (rws[i].firstChild.className.match(/catbg/) && rws[i].firstChild.innerHTML.match(/Today's Birthdays/i)) { extract6=rws[i].nextSibling.firstChild.nextSibling.firstChild.firstChild.firstChild.innerHTML; }
}
if (hideOriginalInfoCenter) tds[n].parentNode.parentNode.parentNode.parentNode.parentNode.style.display="none"; if (dest1) dest1.innerHTML=extract1; if (dest2) dest2.innerHTML=extract2; if (dest3) dest3.innerHTML=extract3; if (dest4) dest4.innerHTML=extract4; if (dest5) dest5.innerHTML=extract5; if (dest6) dest6.innerHTML=extract6; document.getElementById("ICDTable").style.display=""; break; } }
//--> </script>
|
|
|
Post by Wormopolis on May 16, 2010 14:54:55 GMT -8
after this line
extract3=rws.nextSibling.firstChild.nextSibling.innerHTML;
put this
extract3=extract3.split('.')[0]+'<br>'+extract3.split(/<br>/i)[1];
next, after this line
extract1=tmp.join('<br>');
add this
extract1=extract1.replace(/\((.*?)\)/,'');
|
|