|
Post by Wormopolis on Feb 11, 2009 23:20:02 GMT -8
Browser tested: IE and FF placement: Main Footer You will need some DIV with ids like: <div id="BOX1div"></div> where you want the parts to end up. <script type="text/javascript"> <!-- // Clone Info Center pieces into placeable DIVs v2.0 // By Wormopolis // wormocodes.proboards.com
var hideOriginalInfoCenter=true; // set to true to hide, false to leave there var storeInfoInCookies=true; //set true only if you want to have info on pages other then main // note: this will store the last read. it wont be 100% accurate
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=""; if (pb_action=='home') { 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; extract2=tds[n].parentNode.nextSibling.firstChild.nextSibling.getElementsByTagName('td')[1].innerHTML; // 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 (document.getElementById("ICDTable")) document.getElementById("ICDTable").style.display=""; var exp=new Date(); exp.setFullYear(exp.getFullYear()+1); document.cookie='ICRextract1=' + escape(extract1) + '; expires='+exp; document.cookie='ICRextract2=' + escape(extract2) + '; expires='+exp; document.cookie='ICRextract3=' + escape(extract3) + '; expires='+exp; document.cookie='ICRextract4=' + escape(extract4) + '; expires='+exp; document.cookie='ICRextract5=' + escape(extract5) + '; expires='+exp; document.cookie='ICRextract6=' + escape(extract6) + '; expires='+exp; break; } } } else { if (document.cookie.match(/ICRextract1=(.*?)(;|$)/)) { extract1=unescape(RegExp.$1); } if (document.cookie.match(/ICRextract2=(.*?)(;|$)/)) { extract2=unescape(RegExp.$1); } if (document.cookie.match(/ICRextract3=(.*?)(;|$)/)) { extract3=unescape(RegExp.$1); } if (document.cookie.match(/ICRextract4=(.*?)(;|$)/)) { extract4=unescape(RegExp.$1); } if (document.cookie.match(/ICRextract5=(.*?)(;|$)/)) { extract5=unescape(RegExp.$1); } if (document.cookie.match(/ICRextract6=(.*?)(;|$)/)) { extract6=unescape(RegExp.$1); } } 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; //--> </script>
SEE PREVIEW
|
|
headborg
Not New Member
Posts: 5
headborg said 0 great things
|
Post by headborg on Mar 22, 2009 20:30:26 GMT -8
hey dude, I'm trying to move my info center to a side table... this code works great.. I'm just wondering if there's a way to mod it slightly like:
can the total topics and total posts be broken into separate DIV lines/boxes:
I'd like to have:
Total topics: xxx Total Posts: xxx
on different lines.
Thanks
|
|
|
Post by Wormopolis on Mar 22, 2009 21:28:48 GMT -8
you want the rest of what is in that section, or just those 2 things?
|
|
headborg
Not New Member
Posts: 5
headborg said 0 great things
|
Post by headborg on Mar 22, 2009 21:39:31 GMT -8
you want the rest of what is in that section, or just those 2 things? yes sir, I want it all. I guess 'box1div' was simply 'wrapping' into 2 lines of info already. I'd still like all the data- I think it would just look better with the topics on one line, posts on new line. can u break that up into 4 elements
|
|
|
Post by Wormopolis on Mar 22, 2009 22:01:47 GMT -8
yes I can.. gimme a few minutes
|
|
|
Post by Wormopolis on Mar 22, 2009 22:30:13 GMT -8
find this line:
if (dest1) dest1.innerHTML=extract1;
replace with these 3:
rgxp=new RegExp(" &nb"+"sp; - &nb" + "sp; ",'i'); extract1=extract1.replace(rgxp,"<br>"); if (dest1) dest1.innerHTML=extract1;
|
|
headborg
Not New Member
Posts: 5
headborg said 0 great things
|
Post by headborg on Mar 24, 2009 14:55:25 GMT -8
thanks.. that did 'er
|
|
dynastygal
Not New Member
[Sj1:0]
Posts: 23
dynastygal said 0 great things
|
Post by dynastygal on May 3, 2009 14:07:30 GMT -8
Is it possible to remove the ten recent posts link and the pm info from this moving of infocentre stats?
|
|
|
Post by Wormopolis on May 3, 2009 14:40:24 GMT -8
completely remove them? sure.
gimme a sec...
|
|
|
Post by Wormopolis on May 3, 2009 14:55:57 GMT -8
find this line: extract1=tds[n].parentNode.nextSibling.firstChild.nextSibling.getElementsByTagName('td')[0].innerHTML;
replace with: extract1=tds[n].parentNode.nextSibling.firstChild.nextSibling.getElementsByTagName('td')[0].innerHTML; tmp=extract1.split('<br>'); tmp[2]=""; extract1=tmp.join('<br>');
next find this line: extract2=tds[n].parentNode.nextSibling.firstChild.nextSibling.getElementsByTagName('td')[1].innerHTML;
and replace with: 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>');
|
|
dynastygal
Not New Member
[Sj1:0]
Posts: 23
dynastygal said 0 great things
|
Post by dynastygal on May 5, 2009 7:13:07 GMT -8
Thanks, that did it. Just one last thing, how do I change font size of the displayed info to size 2? I tried <font size="2></font> around the div id's but it didn't work.
|
|
|
Post by Wormopolis on May 5, 2009 7:42:17 GMT -8
change the div style to include "font-size:10"
so like:
<div id="box1div" style="font-size:10"></div>
|
|
dynastygal
Not New Member
[Sj1:0]
Posts: 23
dynastygal said 0 great things
|
Post by dynastygal on May 5, 2009 8:32:05 GMT -8
Hmm, doesn't work :S
|
|
|
Post by Wormopolis on May 5, 2009 8:42:02 GMT -8
try this:
<div><font size="2" id="box1div"></font></div>
edit: scratch that. the HTML inside is what is setting the size.
after this line: extract1=tmp.join('<br>');
add this one: extract1=extract1.replace(/size=\"1\"/i,"size='2' ");
|
|
dynastygal
Not New Member
[Sj1:0]
Posts: 23
dynastygal said 0 great things
|
Post by dynastygal on May 5, 2009 9:05:33 GMT -8
Thanks
|
|