Post by SubDevo on Feb 28, 2011 19:05:07 GMT -8
Add New Section(s) to Info Center by SubDevo
Tested in IE, FF, Opera, Safari and Chrome.
This code will add one or more new sections to the bottom of your Info Center.
You choose the icon and title for the section and the HTML for inside the new section.
You may also have the new section "members only", so guests can not see.
Enjoy!!!
SubDevo
Instructions:
Put this HTML above the code (already included in the code).
<span id="newICsection1" style="display:none;">
HTML FOR NEW SECTION
</span>
Replace the Maroon part with your HTML for the new section.
The HTML used (in the Maroon part) can be just about anything. Images, links, Widgets, scripts, CSS, chat box etc...
The ID will be used in the script.
In the Script:
var nSec=[
[0, "newICsection1", "My New Section", "images.proboards.com/new/online.png"]
]; // DO NOT TOUCH
There are four (4) parts to this line. From left to right:
[Members only? 1=Yes or 0=No, "ID of HTML content", "Section Title", "URL to Icon Image"]
You may also use HTML for the Section Title instead of plain text.
EXAMPLE: Use an image for the title. <img src='URL TO IMAGE' />
Mutiple Sections Example:
<span id="newICsection1" style="display:none;">
HTML FOR NEW SECTION
</span>
<span id="newICsection2" style="display:none;">
HTML FOR NEW SECTION
</span>
<span id="newICsection3" style="display:none;">
HTML FOR NEW SECTION
</span>
var nSec=[
[0, "newICsection1", "My New Section", "http://images.proboards.com/new/online.png"],
[1, "newICsection2", "What's Happening", "http://images.proboards.com/new/online.png"],
[0, "newICsection3", "Latest News", "http://images.proboards.com/new/online.png"] <---- NO COMMA
]; // DO NOT TOUCH
Copy/paste a line to add more sections (make sure the "spans" exist first).
Make sure the ID's match the ID's in your spans. They do not have to have a number at the end. They just need to match the exact ID you have given the span.
Make sure there is a comma after each line and there is NO comma at the end of the last line in the list.
NOTE: Notice that the second line in the example above is for Members Only.
Location: Main Footer
<span id="newICsection1" style="display:none;">
HTML FOR NEW SECTION
</span>
<script type="text/javascript">
/* Add New Section(s) to Info Center by SubDevo */
/* Main Footer - Please leave this header intact. Do not repost. */
/* interoceandesigns.com or lsdp.proboards.com */
// Format=[Members only? 1=Yes or 0=No, "ID of HTML content", "Section Title", "URL to Icon Image"]
var nSec=[
[0, "newICsection1", "My New Section", "http://images.proboards.com/new/online.png"]
]; // DO NOT TOUCH
function gTn(a,b){return ((b)?b:document).getElementsByTagName(a);}
if(pb_action=="home"){ var tb=gTn("td"),x=tb.length,n,b,i,f,nX,nR1,nR2;
while(tb[--x]){ n=tb[x];
if(n.className=="catbg"&&n.innerHTML.indexOf(">Forum Stat")!=-1){i=-1;
while(nSec[++i]){ tb=n.parentNode; nX=document.getElementById(nSec[1]);
if(nX&&(!nSec[0]||(pb_username!="Guest"&&nSec[0]))){
nR1=tb.cloneNode(true); nR2=tb.nextSibling.cloneNode(true);
gTn("b",nR1)[0].innerHTML=nSec[2]; gTn("img",nR2)[0].src=nSec[3];
f=gTn("td",nR2); f[2].width="100%"; f[2].innerHTML="";nX.style.display="";
f[3].parentNode.removeChild(f[3]); f[2].appendChild(nX);
b=tb.parentNode; b.appendChild(nR1); b.appendChild(nR2);}} break;
}}}
</script>
Tested in IE, FF, Opera, Safari and Chrome.
This code will add one or more new sections to the bottom of your Info Center.
You choose the icon and title for the section and the HTML for inside the new section.
You may also have the new section "members only", so guests can not see.
Enjoy!!!
SubDevo
Instructions:
Put this HTML above the code (already included in the code).
<span id="newICsection1" style="display:none;">
HTML FOR NEW SECTION
</span>
Replace the Maroon part with your HTML for the new section.
The HTML used (in the Maroon part) can be just about anything. Images, links, Widgets, scripts, CSS, chat box etc...
The ID will be used in the script.
In the Script:
var nSec=[
[0, "newICsection1", "My New Section", "images.proboards.com/new/online.png"]
]; // DO NOT TOUCH
There are four (4) parts to this line. From left to right:
[Members only? 1=Yes or 0=No, "ID of HTML content", "Section Title", "URL to Icon Image"]
You may also use HTML for the Section Title instead of plain text.
EXAMPLE: Use an image for the title. <img src='URL TO IMAGE' />
Mutiple Sections Example:
<span id="newICsection1" style="display:none;">
HTML FOR NEW SECTION
</span>
<span id="newICsection2" style="display:none;">
HTML FOR NEW SECTION
</span>
<span id="newICsection3" style="display:none;">
HTML FOR NEW SECTION
</span>
var nSec=[
[0, "newICsection1", "My New Section", "http://images.proboards.com/new/online.png"],
[1, "newICsection2", "What's Happening", "http://images.proboards.com/new/online.png"],
[0, "newICsection3", "Latest News", "http://images.proboards.com/new/online.png"] <---- NO COMMA
]; // DO NOT TOUCH
Copy/paste a line to add more sections (make sure the "spans" exist first).
Make sure the ID's match the ID's in your spans. They do not have to have a number at the end. They just need to match the exact ID you have given the span.
Make sure there is a comma after each line and there is NO comma at the end of the last line in the list.
NOTE: Notice that the second line in the example above is for Members Only.
Location: Main Footer
<span id="newICsection1" style="display:none;">
HTML FOR NEW SECTION
</span>
<script type="text/javascript">
/* Add New Section(s) to Info Center by SubDevo */
/* Main Footer - Please leave this header intact. Do not repost. */
/* interoceandesigns.com or lsdp.proboards.com */
// Format=[Members only? 1=Yes or 0=No, "ID of HTML content", "Section Title", "URL to Icon Image"]
var nSec=[
[0, "newICsection1", "My New Section", "http://images.proboards.com/new/online.png"]
]; // DO NOT TOUCH
function gTn(a,b){return ((b)?b:document).getElementsByTagName(a);}
if(pb_action=="home"){ var tb=gTn("td"),x=tb.length,n,b,i,f,nX,nR1,nR2;
while(tb[--x]){ n=tb[x];
if(n.className=="catbg"&&n.innerHTML.indexOf(">Forum Stat")!=-1){i=-1;
while(nSec[++i]){ tb=n.parentNode; nX=document.getElementById(nSec[1]);
if(nX&&(!nSec[0]||(pb_username!="Guest"&&nSec[0]))){
nR1=tb.cloneNode(true); nR2=tb.nextSibling.cloneNode(true);
gTn("b",nR1)[0].innerHTML=nSec[2]; gTn("img",nR2)[0].src=nSec[3];
f=gTn("td",nR2); f[2].width="100%"; f[2].innerHTML="";nX.style.display="";
f[3].parentNode.removeChild(f[3]); f[2].appendChild(nX);
b=tb.parentNode; b.appendChild(nR1); b.appendChild(nR2);}} break;
}}}
</script>