|
Author | Topic: Add Extra Info Center Section (Read 7,488 times) |
california
![[image] [image]](http://iycatacombs.com/socal/neon/images/ranks/admin.gif) I'm not here... member is offline
![[avatar] [avatar]](http://img241.echo.cx/img241/6917/california7bk.gif)
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.+?))?(#.+)?)?$/)){ for(i=tr.length-1;i>0;i--){ if(tr[i].cells[0].innerHTML.match("Users Online") && tr[i].cells[0].className=="catbg"){ with(tr[i].parentNode.insertRow(tr[i].parentNode.rows.length).insertCell(0)){ className="catbg"; align="left"; colSpan="2"; style.fontWeight="bold"; style.fontSize="12px"; appendChild(document.createTextNode(sectionTitle)); } var iconImg=document.createElement("img"); iconImg.src=iconURL; var row2=tr[i].parentNode.insertRow(tr[i].parentNode.rows.length); with(row2.insertCell(0)){ className="windowbg"; align="center"; vAlign="middle"; width="20"; appendChild(iconImg); } with(row2.insertCell(1)){ className="windowbg2"; style.fontSize="11px"; innerHTML=content; } break; } } }
// --> </script> |
|
Main Footer
|
|
|
Zephix
![[image] [image]](http://www.iycatacombs.com/socal/neon/images/ranks/new_member.gif) member is offline
![[avatar] [avatar]](http://i7.photobucket.com/albums/y278/zephix/Avatars/av-22532.gif)
I really do!
![[aim] [aim]](http://www.sz-ex.com/socal/neon/images/icons/aim.gif)
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>
|
|
|
|
|
california
![[image] [image]](http://iycatacombs.com/socal/neon/images/ranks/admin.gif) I'm not here... member is offline
![[avatar] [avatar]](http://img241.echo.cx/img241/6917/california7bk.gif)
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.
|
|
|
animefanguy
![[image] [image]](http://www.iycatacombs.com/socal/neon/images/ranks/full_member.gif) member is offline
![[avatar] [avatar]](http://img.photobucket.com/albums/v719/yugiohmonsters/Avatar.gif)
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
|
|
|
california
![[image] [image]](http://iycatacombs.com/socal/neon/images/ranks/admin.gif) I'm not here... member is offline
![[avatar] [avatar]](http://img241.echo.cx/img241/6917/california7bk.gif)
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.
|
|
|
gcag
![[image] [image]](http://www.iycatacombs.com/socal/neon/images/ranks/new_member.gif) 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?
| |
|
california
![[image] [image]](http://iycatacombs.com/socal/neon/images/ranks/admin.gif) I'm not here... member is offline
![[avatar] [avatar]](http://img241.echo.cx/img241/6917/california7bk.gif)
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.
|
|
|
Rbailey
![[image] [image]](http://www.iycatacombs.com/socal/neon/images/ranks/new_member.gif) member is offline
![[avatar] [avatar]](http://img.photobucket.com/albums/v432/PIRATESMATE/avatarsizepic.jpg)
Redford's Biggest Fan
![[yim] [yim]](http://www.sz-ex.com/socal/neon/images/icons/yim.gif)
![[homepage] [homepage]](http://www.sz-ex.com/socal/neon/images/icons/www_sm.gif) 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?
|
|
|
detectiveunknown
![[image] [image]](http://www.iycatacombs.com/socal/neon/images/ranks/senior_member.gif) 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
| |
|
hp.mad_
![[image] [image]](http://www.iycatacombs.com/socal/neon/images/ranks/new_member.gif) member is offline
Just because I'm paranoid doesn't mean they're not after me...
![[aim] [aim]](http://www.sz-ex.com/socal/neon/images/icons/aim.gif)
![[homepage] [homepage]](http://www.sz-ex.com/socal/neon/images/icons/www_sm.gif) 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!
|
|
|
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))?(#.+)?)?$/)){ for(i=tr.length-1;i>0;i--){ if(tr[i].cells[0].innerHTML.match("Users Online") && tr[i].cells[0].className=="catbg"){ with(tr[i].parentNode.insertRow(tr[i].parentNode.rows.length).insertCell(0)){ className="catbg"; align="left"; colSpan="2"; style.fontWeight="bold"; style.fontSize="12px"; appendChild(document.createTextNode(sectionTitle)); } var iconImg=new Image(); iconImg.src=iconURL; var row2=tr[i].parentNode.insertRow(tr[i].parentNode.rows.length); with(row2.insertCell(0)){ className="windowbg"; align="center"; vAlign="middle"; width="20"; appendChild(iconImg); } with(row2.insertCell(1)){ className="windowbg2"; style.fontSize="11px"; innerHTML=content; } break; } } } // --> </script> |
|
edit: sorry to bother, but it's been fixed for me
| |
|
california
![[image] [image]](http://iycatacombs.com/socal/neon/images/ranks/admin.gif) I'm not here... member is offline
![[avatar] [avatar]](http://img241.echo.cx/img241/6917/california7bk.gif)
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.
|
|
|
Rbailey
![[image] [image]](http://www.iycatacombs.com/socal/neon/images/ranks/new_member.gif) member is offline
![[avatar] [avatar]](http://img.photobucket.com/albums/v432/PIRATESMATE/avatarsizepic.jpg)
Redford's Biggest Fan
![[yim] [yim]](http://www.sz-ex.com/socal/neon/images/icons/yim.gif)
![[homepage] [homepage]](http://www.sz-ex.com/socal/neon/images/icons/www_sm.gif) 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?
|
|
|
california
![[image] [image]](http://iycatacombs.com/socal/neon/images/ranks/admin.gif) I'm not here... member is offline
![[avatar] [avatar]](http://img241.echo.cx/img241/6917/california7bk.gif)
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...
|
|
|
igi.ex
![[image] [image]](http://www.iycatacombs.com/socal/neon/images/ranks/new_member.gif) member is offline
![[avatar] [avatar]](http://i1.tinypic.com/nci8o4.png)
![[aim] [aim]](http://www.sz-ex.com/socal/neon/images/icons/aim.gif)
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.
| |
|
|