SoCal
« Add Extra Info Center Section »

Welcome Guest. Please Login or Register.
Sept 2, 2010, 4:53pm




SoCal :: SoCal Codes :: ProBoards Codes :: Add Extra Info Center Section
Page 1 of 5 » Jump to page   Go    [Search This Thread][Send Topic To Friend] [Print]
 AuthorTopic: Add Extra Info Center Section (Read 7,488 times)
california
[image]
I'm not here...
member is offline

[avatar]



Joined: Nov 2004
Gender: Male
Posts: 6,425
 Add Extra Info Center Section
« Thread Started on Aug 2, 2005, 10:09pm »

Updated 10/29/07 for v4.5 compatibility.

This code will allow you to add your own info center section after the users online section, complete with customizable title and icon.

Code:
<div id="iccontent" style="display: none;">

SECTION HTML CONTENT HERE

</div>

<script type="text/javascript">
<!--
/* extra info center section by california */

var sectionTitle = "SECTION TITLE TEXT";
var iconURL = "SECTION ICON URL";

var content = document.getElementById("iccontent").innerHTML;
var tr = document.getElementsByTagName("tr");
if(location.href.match(/com\/?((index\.cgi)?\??(action=(logout|home|change.+?))?(#.+)?)?$/)){
&nbsp; &nbsp; for(i=tr.length-1;i>0;i--){
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; if(tr[i].cells[0].innerHTML.match("Users Online") && tr[i].cells[0].className=="catbg"){
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;with(tr[i].parentNode.insertRow(tr[i].parentNode.rows.length).insertCell(0)){
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; className="catbg";
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; align="left";
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; colSpan="2";
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; style.fontWeight="bold";
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; style.fontSize="12px";
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; appendChild(document.createTextNode(sectionTitle));
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;}
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;var iconImg=document.createElement("img");
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;iconImg.src=iconURL;
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;var row2=tr[i].parentNode.insertRow(tr[i].parentNode.rows.length);
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;with(row2.insertCell(0)){
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; className="windowbg";
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; align="center";
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; vAlign="middle";
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; width="20";
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; appendChild(iconImg);
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;}
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;with(row2.insertCell(1)){
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; className="windowbg2";
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; style.fontSize="11px";
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; innerHTML=content;
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;}
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;break;
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; }
&nbsp; &nbsp; }
}

// -->
</script>


Main Footer
« Last Edit: Oct 29, 2007, 7:03pm by Chris »Link to Post - Back to Top  IP: Logged

[image]
Zephix
[image]
member is offline

[avatar]

I really do!

[aim]

Joined: Jul 2005
Gender: Male
Posts: 28
Location: Australia
 Re: Add Extra Info Center Section
« Reply #1 on Aug 5, 2005, 1:29am »

is there anyway...you can change this code up so it can be an affilirate bar...and change it so it goes with ZD's infocenter?

Code:
<script>
var guestTxt = ['Guest','Guests'];
var memberTxt = ['Member','Members']
var modTxt = ['Director','Directors']
var gmodTxt = ['Bureaucrat','Bureaucrats']
var adminTxt = ['Commissioner','Commissioners']
</script>

<script src="http://webpost.net/zd/zdtom/icenter2.js">
/*
Zanmato Info Center version 2
[url]http://zdesign.proboards3.com[/url]
*/
</script>
« Last Edit: Aug 5, 2005, 1:30am by Zephix »Link to Post - Back to Top  IP: Logged

[image]

[image]
california
[image]
I'm not here...
member is offline

[avatar]



Joined: Nov 2004
Gender: Male
Posts: 6,425
 Re: Add Extra Info Center Section
« Reply #2 on Aug 5, 2005, 2:23am »

Well, no. I make my codes to work with the default configuration and, whenever possible, my other codes. The code can already be used for an affiliate bar by editting the variables, but it's just not worth my time to get this to work with someone else's info center.
Link to Post - Back to Top  IP: Logged

[image]
animefanguy
[image]
member is offline

[avatar]



Joined: Jul 2005
Posts: 153
 Re: Add Extra Info Center Section
« Reply #3 on Aug 5, 2005, 8:44pm »

The code doesnt work cal, when i added it...nothing happens

Click here
Link to Post - Back to Top  IP: Logged

[image]
california
[image]
I'm not here...
member is offline

[avatar]



Joined: Nov 2004
Gender: Male
Posts: 6,425
 Re: Add Extra Info Center Section
« Reply #4 on Aug 5, 2005, 11:48pm »

You can't have any line breaks in the content variable. Make it all one line. Use notepad with wordwrap disabled to make sure.
Link to Post - Back to Top  IP: Logged

[image]
gcag
[image]
member is offline





Joined: Aug 2005
Posts: 8
 Re: Add Extra Info Center Section
« Reply #5 on Aug 6, 2005, 9:51am »

how can I change the color of the section title text?
Link to Post - Back to Top  IP: Logged
california
[image]
I'm not here...
member is offline

[avatar]



Joined: Nov 2004
Gender: Male
Posts: 6,425
 Re: Add Extra Info Center Section
« Reply #6 on Aug 6, 2005, 11:09pm »

In the same with() section as this line:

appendChild(document.createTextNode(sectionTitle));

add this:

style.color="#HEX";

You can add/modify any property you like.
Link to Post - Back to Top  IP: Logged

[image]
Rbailey
[image]
member is offline

[avatar]

Redford's Biggest Fan

[yim]
[homepage]

Joined: Mar 2005
Gender: Female
Posts: 21
Location: Bakersfield, CA
 Re: Add Extra Info Center Section
« Reply #7 on Aug 9, 2005, 1:50pm »

So by putting in this code, how do we customize/update it?
Link to Post - Back to Top  IP: Logged

[image]
detectiveunknown
[image]
member is offline





Joined: Dec 2004
Gender: Male
Posts: 326
 Re: Add Extra Info Center Section
« Reply #8 on Aug 9, 2005, 1:56pm »

By using HTML, or anything else, right here

var sectionTitle="SECTION TITLE TEXT";
var iconURL="SECTION ICON URL";
var content="SECTION CONTENT HERE"; //HTML allowed
Link to Post - Back to Top  IP: Logged
hp.mad_
[image]
member is offline



Just because I'm paranoid doesn't mean they're not after me...

[aim]
[homepage]

Joined: Aug 2005
Gender: Male
Posts: 8
Location: USA
 Re: Add Extra Info Center Section
« Reply #9 on Aug 10, 2005, 8:35pm »

To think... I attempted the same code and couldn't get it and cali just took one minute to code it... weird. Well that means I'm still a n00b :(

great job!
Link to Post - Back to Top  IP: Logged

[image]
hurtfulsplash
Guest
 Re: Add Extra Info Center Section
« Reply #10 on Aug 14, 2005, 3:20pm »

Can someone check this for errors please, it's not working for me. I am trying to put my affiliate codes in the extra section in the info center.

Code:
<script type="text/javascript">
<!--
/* extra info center section by california */

var sectionTitle="Affiliates";
var iconURL="SECTION ICON URL";
var content="<a href="http://isolates.proboards40.com/" Target="_blank"><img src="http://img208.imageshack.us/img208/3087/misanthrope8kq.gif" width=88 height=31 border=0 alt="BANNER NAME"></a> "; //HTML allowed

var tr=document.getElementsByTagName("tr");
if(location.href.match(/com\/?((index\.cgi)?\??(action=(logout|home))?(#.+)?)?$/)){
&nbsp; &nbsp; for(i=tr.length-1;i>0;i--){
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; if(tr[i].cells[0].innerHTML.match("Users Online") && tr[i].cells[0].className=="catbg"){
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;with(tr[i].parentNode.insertRow(tr[i].parentNode.rows.length).insertCell(0)){
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; className="catbg";
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; align="left";
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; colSpan="2";
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; style.fontWeight="bold";
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; style.fontSize="12px";
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; appendChild(document.createTextNode(sectionTitle));
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;}
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;var iconImg=new Image();
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;iconImg.src=iconURL;
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;var row2=tr[i].parentNode.insertRow(tr[i].parentNode.rows.length);
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;with(row2.insertCell(0)){
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; className="windowbg";
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; align="center";
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; vAlign="middle";
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; width="20";
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; appendChild(iconImg);
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;}
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;with(row2.insertCell(1)){
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; className="windowbg2";
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; style.fontSize="11px";
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; innerHTML=content;
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;}
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;break;
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; }
&nbsp; &nbsp; }
}
// -->
</script>


edit: sorry to bother, but it's been fixed for me
« Last Edit: Aug 14, 2005, 7:58pm by hurtfulsplash »Link to Post - Back to Top  IP: Logged
california
[image]
I'm not here...
member is offline

[avatar]



Joined: Nov 2004
Gender: Male
Posts: 6,425
 Re: Add Extra Info Center Section
« Reply #11 on Aug 15, 2005, 10:18pm »

Yeah, you need to enclose the HTML in single quotes if you're going to use double quotes inside.
Link to Post - Back to Top  IP: Logged

[image]
Rbailey
[image]
member is offline

[avatar]

Redford's Biggest Fan

[yim]
[homepage]

Joined: Mar 2005
Gender: Female
Posts: 21
Location: Bakersfield, CA
 Re: Add Extra Info Center Section
« Reply #12 on Aug 23, 2005, 11:22am »

is there an example of this extra info center that I can look at before I use it on my forum?
Link to Post - Back to Top  IP: Logged

[image]
california
[image]
I'm not here...
member is offline

[avatar]



Joined: Nov 2004
Gender: Male
Posts: 6,425
 Re: Add Extra Info Center Section
« Reply #13 on Aug 23, 2005, 8:43pm »

If you look at the normal info center, it's divided into sections like 'Forum Statistics', 'Today's Birthdays' (when there are any) and 'Users Online'. This creates another one of those sections. It looks exactly the same, but you can pick the section title and the icon on the left.

Edit: Okay, I found a good example:

http://magiccarrot.proboards36.com/index.cgi

See in the info center where it says "MC Gold Members"? They're using this code. Hope they don't mind...
« Last Edit: Aug 25, 2005, 12:53am by california »Link to Post - Back to Top  IP: Logged

[image]
igi.ex
[image]
member is offline

[avatar]

[aim]

Joined: Aug 2005
Posts: 6
Location: Houston
 Re: Add Extra Info Center Section
« Reply #14 on Aug 24, 2005, 11:03pm »

Thats sweet. I will be using this.  :P
Link to Post - Back to Top  IP: Logged
Page 1 of 5 » Jump to page   Go    [Search This Thread][Send Topic To Friend] [Print]

Click Here To Make This Board Ad-Free


This Board Hosted For FREE By ProBoards
Get Your Own Free Message Boards & Free Forums!
Terms of Service | Privacy Policy | Report Abuse | Mobile